HowToDo rather complex visualizations / GUI's?

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

Post Reply
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

HowToDo rather complex visualizations / GUI's?

Post by GGShinobi »

Hello community,

I've searched through the bulletin board, but didn't find an answer yet...

I would like to know whether or not it is possible to create rather complex visual menus for an OXP? I'm planning on making a Long Range Scanner (LRS) (see: http://bb.aegidian.org/viewtopic.php?f=6&t=13274), and for that I need both some visual representation of the scanning results and a way of controlling the LRS. This is because it is planned that the LRS is a pretty complex array of hardware which should require some skill to use.

For the visual representation, I've imagined something like this: Are there ways of implementing something like that with an oxp?

My second question is about how the player can "program" or configure the LRS. The oxp's that I've encountered so far only allow one of two method's for player input:
  • By selecting an equipment with shift-n and the using it with n (or now (since 1.77: b))
  • By selecting options from a menu with up-down-arrow keys and pressing enter.
Are there other ways? Can the player also navigate menus with the left-right-arrows? And / or is it, for example, possible to read input from the player's keyboard (for example a number)? Can the player select something with the mouse? (click on a LRS-contact to see it's details, for example)

Regarding the visual representation: I am also using (the awesome) Chupacabra-HUD.oxp http://wiki.alioth.net/index.php/ChupacabraHUD, and therefore I know that at least with HUD's it seems to be possible to do pretty complex visual effects and real-time-animations. So I thought about doing a "Long Range HUD", which would display the data.

So another question here: Is it possible to have several HUD's installed at one time and switch between them?

I'm sure the oxp is possible without those features (a textual representation would be the fallback if no visual representation is possible, and up-down + enter are sufficient as a user interface, too), but it would neither be as attractive nor comfortable, so I'm crossing my fingers that some way exists :)
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: HowToDo rather complex visualizations / GUI's?

Post by cim »

GGShinobi wrote:
Are there ways of implementing something like that with an oxp?
It's not impossible. Very difficult, and involving unprecedented use of OXP capabilities, yes ... but it is just about possible.

You can, either with HUD equipment-linked objects or with shader-based graphics overlays, display highly complex 2-D objects on screen. For a scanner, you probably want shader-based overlays, because otherwise you need to define a separate HUD object for every possible scanner blip. With a shader-based overlay, you can use shader uniforms for configuration. (On the other hand, you restrict use of the OXP to people with shader-capable graphics cards) Cabal Common Library has some helper functions for shader overlays, but even with those this will be difficult.

Your input methods are the two you listed ... officially. There are other possibilities - use a frame callback to keep the player ship orientation static while the scanner is in use, and then use attempts to turn to give a four-directional input over the scanner display and a virtual cursor. Use 'b' or 'n' to readout the object hovered to the console message or comm log. The restriction "You can't turn while the scanner is enabled" can be explained away, of course, as necessary for proper functioning.

You can switch HUDs in flight. Bear in mind that some other OXPs already change HUDs in flight (for example, to give different HUD settings at different alert levels) so you'd need to manage the interaction with them. That said, HUDs is probably the harder way to do this.

At any rate, you're probably best starting with a text representation and menu control, and bringing in the fancier stuff later...
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

Re: HowToDo rather complex visualizations / GUI's?

Post by GGShinobi »

Thank you, cim, for that excellent and detailed reply!
cim wrote:
The restriction "You can't turn while the scanner is enabled" can be explained away, of course, as necessary for proper functioning.
I really like that explanation :) Makes much sense!
At any rate, you're probably best starting with a text representation and menu control, and bringing in the fancier stuff later...
I will do as you propose and start with a textual interface, then.
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
GGShinobi
---- E L I T E ----
---- E L I T E ----
Posts: 291
Joined: Tue Dec 25, 2012 7:20 pm

switching between HUDs

Post by GGShinobi »

cim wrote:
You can switch HUDs in flight. Bear in mind that some other OXPs already change HUDs in flight (for example, to give different HUD settings at different alert levels) so you'd need to manage the interaction with them. That said, HUDs is probably the harder way to do this.
Sorry, but I have to ask again, since that particular point is not clear to me:
What I understand of your post is that one can make a HUD.oxp that contains several HUDs, and then switch between them ingame.

But would it also be possible to make a HUD (let's say, "LongRangeHud.oxp") that doesn't overwrite the default HUD or another HUD the player is using? What I want is to have the players keep their preferred HUD and only switch to the LongRangeHUD when using the Long Range Scanner (LRS). When the LRS is not used, the other HUD (or the default HUD, if no other HUD.oxp is installed) should be used.

I'm asking because thanks to some awesome new OXP I've tested, I've got a new idea (see: http://bb.aegidian.org/viewtopic.php?f= ... 95#p192095) for the visual representation. :mrgreen:
忍 knowing that enough is enough, you'll always have enough.

Running Oolite 1.77 on Ubuntu Linux 12.04 LTS
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: HowToDo rather complex visualizations / GUI's?

Post by cim »

That can be done (player.ship.hud), but you'd need to be careful - so, if the long range HUD is active, the other HUD OXP might go "Oh, we're now at yellow alert", and change the HUD to its own. You'd then need to notice this had happened and change it back - or better, work with the other HUD author so that they checked for the long range HUD being active first.
Post Reply