| Author |
Message |
EMebane
Joined: Apr 15, 2019 Posts: 108
|
Posted: Apr 15, 2019 7:54 AM Post subject: Interacitve player other than Flash |
|
What options are there for interactive players other than Flash?
Is there a way to send events to other applications, such as a game EXE playing outside of BioEra? Edit: I see there is XmlNetServer for this. |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Apr 15, 2019 2:48 PM Post subject: |
|
Yes, see the RacerGame.bpd example. It uses ApplicationPlayer element to start, stop and control a demo game which is a separate EXE program. Please note - not everything is possible this way. Only keyboard and mouse events, and the application executed that way must be in focus (to receive those events).
Another option is to use HtmlPlayer. See the HtmlGame example. |
|
 |
EMebane
Joined: Apr 15, 2019 Posts: 108
|
Posted: Apr 16, 2019 6:55 PM Post subject: |
|
Got it. Would you clarify some things about keyboard HCI in the racing game?
It seems like there are two ways the game receives keyboard input: a) Direct keyboard WASD input goes straight to the game window that is focused (however W is disregarded or overridden. See below.). b) Arrow key input gets mapped to ASD and is sent to the game via the AppPlayer element. (However there seems to be an error in the Input names strings on the AppPlayer. They are in the wrong order. I corrected it and restarted BioEra for the correct hover labels to appear then rewired the in/out connections).
Pressing the W key on the keyboard doesn't move the car forward, yet when I launch the game .EXE separately from BioEra, pressing the W key moves the car forward. When playing the game via BioEra, does it receive a persistent False from BioEra when the Design is outputting false? i.e., is the game receiving the Forward press from the keyboard and the Forward release from BioEra simultaneously, and handling the conflict? Is this conflict between keyboard input sources unavoidable when passing keyboard input to a game? If so, one solution would be a game with the keys used by BioEra mapped to keys less likely to be pressed by the user on the physical keyboard. What is the cleanest and most reliable architecture for sending HCI to games (XMLNetServer?)?
BTW: I can switch to a text editor after launching the game to see the keyboard output from BioEra. This is helpful for debugging. I was able to use this to determine that Arrow keys Left, Down, Right are mapped to A, S, D.
How is KeyAdvSelector2 different than KeyAdvSelector? |
|
 |
jarek
Joined: Oct 22, 2007 Posts: 1073
|
Posted: Apr 16, 2019 11:43 PM Post subject: |
|
I can press W and it works for me even when the game is started from BioEra. I see no way BioEra could block keystrokes in any way (it was implemented a long time ago, so I could forgot details). I guess it is possible that frequent "key up" event coming from BioEra could cancel "key down" events from keyboard, but it is not intentional.
Yes, looks like labels are incorrectly configured, will need to fix that.
I don't know about HCI, but yes, XmlNetServer is most commonly used to exchange data with external programs. If you can implement it in your program, then this is the best (most flexible) way to go. The other ways (like AppPlayer) can be useful when XmlNetServer communication can't be implemented. |
|