HUD

Introduce your project and write about your work.

Moderator: PPS-Leaders

User avatar
superegg
Human Space Navy Major
Posts: 41
Joined: Mon Oct 08, 2007 2:41 pm

Post by superegg » Thu Mar 27, 2008 1:03 am

A simple class Bar and an inherited class SmartBar have been done.

The codes are ugly at several point of view, cause Bar is not an inherited class from Ogre::OverlayElement, but it has a public variable as OverlayElement and several functions to modify it.

Code: Select all

    Bar* newBar;
    newBar = new Bar(0,0,100,10,Bar::LEFT, Bar::RED,"hallo");
    newBar->reset(50);
    .........
    .........
    panel->addChild(newBar->element);
The first 4 parameters define the position and dimension of the bar object, "LEFT" defines in which direction the bar goes, "RED" is its colour, and "hallo" its unique name among all orxonox elements.
reset() can only change the length of the bar (I dont think that other things would be changed during the game)
With "addChild()" the new element can be added to a panel.

Class SmartBar actually does the same thing, but it changed colour depends on bar's length, it means, green if the bar is full, yellow semifull, and red nearly empty.

Now, some advices and suggestions are welcome, and new ideas about new modules are welcome as well.

I will commit all when the holidays are over :D
Image

User avatar
x3n
Baron Vladimir Harkonnen
Posts: 810
Joined: Mon Oct 30, 2006 5:40 pm
Contact:

Post by x3n » Thu Mar 27, 2008 3:02 am

Cool :D

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Post by beni » Thu Mar 27, 2008 3:48 pm

Yeah, cool thing.

What about a timer which does practically the same? It could also change color and starts to flash when there are only a few seconds left.
Same goes for ammo, rocket lock and warning system.
Also a hit indicator would be something really nice. Please ask if something is not clear.
"I'm Commander Shepard and this is my favorite forum on the internet."

User avatar
superegg
Human Space Navy Major
Posts: 41
Joined: Mon Oct 08, 2007 2:41 pm

Post by superegg » Thu Mar 27, 2008 5:30 pm

The idea with flash can be done within a single function. I am just thinking how to make it cuter, because I cannot change the alpha value of the color yet. Colors are defined as a material now which cannot be changed. Color changing is now only possible, cause I defined several basic colors as material and gave each of them a unique name.

But what is special with ammo, rocket lock and warning system? I understand these words, but dont understand what their jobs are. And what is a hit indicatior?
Image

User avatar
beni
Baron Vladimir Harkonnen
Posts: 949
Joined: Tue Oct 03, 2006 9:15 am
Location: Zurich
Contact:

Post by beni » Thu Mar 27, 2008 5:59 pm

Well ammo uses maybe a bar as well, but with ammo I would rather like numbers. Those numbers however behave different than the timer I would say.
The rocket lock is of course another element which is doing some behaviour to delay the launch of a rocket. There should also be a HUD-element which illustrates that target finding of the rocket.
Then the warning system can be a flashing symbol or something similar.
The hit indicator shows the player that he has been hit.

See half life for the hit indicator:
Image
that red thing left shows that the player has been hit from left.
"I'm Commander Shepard and this is my favorite forum on the internet."

User avatar
BadElvis
Human Space Navy Lord Commander
Posts: 83
Joined: Wed Nov 14, 2007 1:07 pm
Contact:

Post by BadElvis » Thu Mar 27, 2008 6:09 pm

Something which I find is very important is the radar. At some point, there should be a (global?) list of things that are shown on the radar.

Probably you could use different symbols for different types of objects. Also, if an object is on the screen (and not behind or beside you) the object could be marked with a tag, so that it is easy to navigate there. But this is probably something more advanced.

User avatar
superegg
Human Space Navy Major
Posts: 41
Joined: Mon Oct 08, 2007 2:41 pm

Post by superegg » Sun Mar 30, 2008 12:20 am

This hit indicator should not be a big problem. But I am still trying to show Strings on any element, but still without success. Anyway, I have to know few things to program the radar:

- Is the whole space a 3D room? and how big is it?

- Does every object have coordinates? in what kind of object are they saved? and are all objects saved in an array?

- For player's ship I have to know its coordinates and 2 angles

It's quite complicated to show a 3D thing in 2D. The best way in my opinion is that the "camera" for the radar is always above player's ship. In this case, the single disadvantage is that player only knows how far away an object is in front of it, but not how high it is above it. Perhaps the height can be shown as the point on radar goes smaller the farther the object is.
Image

User avatar
BadElvis
Human Space Navy Lord Commander
Posts: 83
Joined: Wed Nov 14, 2007 1:07 pm
Contact:

Post by BadElvis » Sun Mar 30, 2008 12:45 pm

about the radar:
i think it is the best solution to display it with two circles. i know this from some games and t is really useful it you know how it works.

Image

each point inside the outer circle will represent a specific direction relative to your direction of travel.

the center is the direction where the spaceship is flying, an object directly in front of you will show up there (blue)

all objects in front of you will be between the center and the inner circle.

objects that are in the plane orthogonal to the direction you are flying will show up on the inner circle (yellow). for example, an enemy straight above you will show up on the inner circle at 12 o'clock, an enemy below you at 6. an object directly to your left will be at 9, an object to your right at 3.

all objects behind you will be seen between the inner and the outer circle.

objects on the outer circle will be straight behind you (red). so all points on this circle will represent the same direction in space.

with this system you can see quickly in which direction a object is, which is probably the most important in close combat. however, the distance can not be told from the position on the radar, but i think it would be a good idea to modulate the transparency of an object on the radar to give information on the distance. near objects have low transparency, objects far away have high transparency.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests