[Question/Request] Animated sprites and gauges

Talk among developers, and propose and discuss general development planning/tackling/etc... feature in this forum.
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

[Question/Request] Animated sprites and gauges

Post by pontiac »

Is it possible to use something like this in a HUD file?

Code: Select all

sprite_animation.ani
0.5 0.75
0.0 0.0
If not, how hard would it be to implement it?
"Of what use it this?" you may ask
To make e.g animated crosshairs, radar borders etc...

Additional a gauge implemention where you give an animation instead of a sprite file could use the single animation frames for the different stages of the gauge.
e.g 100% => use the last image in the ani file ... 0% use the first image.

My current source of information on this topic:
HowTo:Edit HUDs -> The ".spr" file format

Pontiac
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

It's never an issue of "can" it be done. The issue is "who is willing to do it". :)

I'm a programmer, so I know that the question is never "can it be done" it's always "how do I do it". Unforunately, my programming expertise is limited to VB. I took a class in C++ back in '97, but since it's faster to program in VB, I haven't used it since. I can read the code that has been written, but I can't write it at this time.
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

Actually when I ask a programmer 'Is it possible' i mean it with the undertone of 'is it even worth the effort' ;)

Just to clear that up,
Pontiac
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

I'm thinking that it is worth doing and probably not too much of an effort to do. I'm not sure about the different stages part, but since there is already code to do animations, it shouldn't be too hard to implement.
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

smbarbour wrote:I'm thinking that it is worth doing and probably not too much of an effort to do. I'm not sure about the different stages part, but since there is already code to do animations, it shouldn't be too hard to implement.
After thinking a bit about this i think that different images for different percentages would even be the cooler thing of the two.
Especially for the energy/fuel levels, where you would then be able to do alot more variations in style.
Now you are a bit limited with the "one side will be cut away from the images" approach.

Pontiac
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

Erm... Are you sure it isn't done already?
I think you can specify an .ani for the sprite and it'll work. Never tried, but I think it should... that's how static is done.

As for the frames to stages mapping, I've thought of that myself. It shouldn't be difficult either, but it's most surely not done.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

Animations: You may be right. I'll test that .... at least it isn't documented right now.
EDIT: Didn't get it to work. If it is possible with the current code i don't know how.

Pontiac
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

I'll take a look and get back to you with some answers. It may take a while: my development timeframe does not intersect my online timeframes (that is, I have no internet at home ;) )
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

klauss wrote:I'll take a look and get back to you with some answers.
Thanks, i'm looking forward to it :)
It may take a while: my development timeframe does not intersect my online timeframes (that is, I have no internet at home ;) )
.... ehm ... That''s funny, i just imagined you wrote that you do not have internet access at home ... the horror ;)

---------------------------------------

Actually one thing i thought of from the beginning was to add vector line support to the hud-files.
Something line

Code: Select all

<line r="0.0" g="1.0" b="0.0" a="0.0" x1="-1.0" y1="-1.0" x2="1.0" y2="1.0" />
(this draws a green line from bottom left to upper right of the screen)
to draw lines would surely help for some things :)
But i think this should be a seperate thread.

EDIT: And a rotation (and flipping?) parameter in the spr file would also help a bit i think.
How this 'flipping' in the current HUDs actually works is beyond me (see the shields/armors). Does anybody know why the graphics are flipped?

Pontiac
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

I believe that you can flip a sprite by specifying a negative scale factor. I believe this also reverses the gauge settings on the axis as well.

BTW, I don't have internet access at home either (not even a phone line). That would be how I am still on XP SP1, but hey, at least I don't have to worry about worms and viruses! :)
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

but hey, at least I don't have to worry about worms and viruses!
Amen to that.
And a rotation (and flipping?) parameter in the spr file would also help a bit i think.
How this 'flipping' in the current HUDs actually works is beyond me (see the shields/armors). Does anybody know why the graphics are flipped?
I think, and I'm speculating out of looking at the code, that when they coded the RenderAsVSSprite() thing that draws them, they got reversed the texture coordinates but didn't realize since all textures were symmetrical at that point. Later, they must have fixed things by just invering textures (as a quick fix that would not require recompiling). That was probably done by an artist, and not a coder (a coder would prefer fixing the code). And since by now, fixing the code would break the entire dataset, nobody fixes it. And yes, a negative scaling will automatically mirror the files. About rotation, that could be done. But more interesting would be dynamic rotation: like a rotational gauge.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

klauss wrote:
but hey, at least I don't have to worry about worms and viruses!
Amen to that.
Oh, that one again :D
There are no big things to worry about when you have a (real) firewall between your internet connection and your computer ... and OS/client programs that are not as easy to manipulate (knocking on wood right now).

Not to mention i'm using linux here (let the flames begin ;)) which is (at least last time i checked) not as vunarable as windows (default open ports under windows are a 'tiny winey bit' too many, not to mention some of the remote ports).
And a rotation (and flipping?) parameter in the spr file would also help a bit i think.
How this 'flipping' in the current HUDs actually works is beyond me (see the shields/armors). Does anybody know why the graphics are flipped?
I think, and I'm speculating out of looking at the code, that when they coded the RenderAsVSSprite() thing that draws them, they got reversed the texture coordinates but didn't realize since all textures were symmetrical at that point. Later, they must have fixed things by just invering textures (as a quick fix that would not require recompiling). That was probably done by an artist, and not a coder (a coder would prefer fixing the code). And since by now, fixing the code would break the entire dataset, nobody fixes it. And yes, a negative scaling will automatically mirror the files. About rotation, that could be done. But more interesting would be dynamic rotation: like a rotational gauge.
I don't know if i follow you.
This is an example of what is used right now:
say there is the left armor bitmap armorl.png
Image
Then there is the sprite file amorl.spr

Code: Select all

cockpit/armorl.png cockpit/armorl.png
.031 .1
-.375 -.835
and the lines in the cockpit files:

Code: Select all

...
<ArmorL file="armorl.spr"  xcent="-0.825" ycent="-0.75" GaugeLeft="1"/>
<ArmorR file="armorl.spr" xcent="-0.725 " ycent="-0.75" GaugeRight="1"/>
...
where the same file is used two times .. once on the left and once on the right side.
I suspect the ArmorL and ArmorR triggers that since ther is no difference elsewhere.
So no real artist work, but the work of the HUD designer and/or coder... i think.

"rotational gauge" in combination with "animations" is making me drool 8)

Pontiac
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

There are no big things to worry about when you have a (real) firewall between your internet connection and your computer ...
Hey... but even less to worry about if there is no internet connection 8)
where the same file is used two times .. once on the left and once on the right side.
I suspect the ArmorL and ArmorR triggers that since ther is no difference elsewhere.
So no real artist work, but the work of the HUD designer and/or coder... i think.
That's another thing... I was referring to normal sprites. Usually, you would use positive width and height, but if you do, you get a flipped texture. That's what I meant, and I was speculating about the genesis of that odd behavior. Now, what you mean is different. I didn't realize that was happening. I'll have to try things, but I see something suspicious already: could it be the GaugeRight/GaugeLeft thing what triggers it?
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

I'm going to guess that it is the tag that identifies whether to flip the sprite. Here's a way to test it: Swap ArmorL for ArmorR and vice-versa so that the settings defined for Left armor are the settings that were for Right Armor and see if the images still show properly. If they do, then it is handled by the Gauge properties. Otherwise, the tag is causing the flipping.

Of course, at the base of this is the question "Does it really matter since it is displaying properly anyway?" I guess this is more of an exercise in identifying the behavior.

This would be relevant if someone wanted to display shields (and armor) as a series of vertical bars since they would be top down gauges.

(BTW, I would love to have an Internet connection. My choice consists of "Food or Bandwidth" at the moment. My wife thinks "Food" is the better choice :))
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

smbarbour wrote:Of course, at the base of this is the question "Does it really matter since it is displaying properly anyway?" I guess this is more of an exercise in identifying the behavior.
You are right, it doesn't really matter, i just asked out of curiosity and so in is documented (this isn't mentioned anywhere i know)
(BTW, I would love to have an Internet connection. My choice consists of "Food or Bandwidth" at the moment. My wife thinks "Food" is the better choice :))
It's the healthier choice for sure ;)

Pontiac
klauss
Elite
Elite
Posts: 7243
Joined: Mon Apr 18, 2005 2:40 pm
Location: LS87, Buenos Aires, República Argentina

Post by klauss »

BTW, I would love to have an Internet connection. My choice consists of "Food or Bandwidth" at the moment. My wife thinks "Food" is the better choice
So would I. But I have to admit that it is much more easy to be safe without internet than with it.
Oíd mortales, el grito sagrado...
Call me "Menes, lord of Cats"
Wing Commander Universe
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

If I did have an internet connection, it would be going through a linux box. When I had dial-up it went through a linux box. It was a PITA and wouldn't auto-dial when I wanted to use it (I used putty to SSH in and issue the command to dial), but I could have multiple users on it.
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

smbarbour wrote:If I did have an internet connection, it would be going through a linux box. When I had dial-up it went through a linux box. It was a PITA and wouldn't auto-dial when I wanted to use it (I used putty to SSH in and issue the command to dial), but I could have multiple users on it.
@everybody who want's to set up such a firewall/router:
I can recommend fli4l the on(e)-disk-router [1]. It's what i used back then with moden, with isdn and now with brodband as well.
It's floppy based (in the default configuration that is, it's easily installed to hard disk as well) and has practically everything you need for a firewall/router and is expandable via modules (the fli4l distri is similar to slackware so it's just a matter of copy them together).
If you use dailup you even have a remote control program (win/lin) called imonc which is _really_ handy.

The only drawback is that some of the docu may not yet be translated to english.

Just try it if you have an old crappy comp to spare.

OK, back to the topic it is ;)

Pontiac.

[1] The original (german) site is http://fli4l.de/
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

When I get broadband, I will probably build a firewall from an old machine I have lying around running Suse. It's been a while since I've used Linux, so I don't know if IPTables is still in modern distros, but I've used it in the past without much trouble.
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

I think IPTables is still the way to go (kernel 2.6).
You may want to look at firestarter (the name is kinda funny ;) )

Pontiac
pifactorial
Bounty Hunter
Bounty Hunter
Posts: 170
Joined: Mon Feb 21, 2005 7:04 am
Location: Pomona College
Contact:

Post by pifactorial »

Seems like all the threads are getting off-topic today. Strange :roll:
smbarbour
Fearless Venturer
Fearless Venturer
Posts: 610
Joined: Wed Mar 23, 2005 6:42 pm
Location: Northern Illinois

Post by smbarbour »

Sorry, my fault. :oops:

On-topic though, data4.x in CVS has been updated to use new HUD images for lock, missile lock, ECM, Blaster power, and warp energy.
I've stopped playing. I'm waiting for a new release.

I've kicked the MMO habit for now, but if I maintain enough money for an EVE-Online subscription, I'll be gone again.
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

Ok, back to the topic.

I've compiled two sets of animation/stage images for weapon and jump energy.
They may be used in the future when 'animated'/'stages'-gauges are possible ... and for testing purpose of course.

weapon energy (red)
jump energy (blue)

EDIT: Forgot to mention that the steps between the precentages are rather big here, but they can easily made smaller for future usage.
The Gimp (.xcf) source file is here.
EDIT2: Just found out that i didn't mirror them (left/right) so they will be displayed the wrong way.... no biggy though ;)

Pontiac
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

Here the same for the fuel bar:

fuel bar

The Gimp (.xcf) source file is here.

Pontiac
pontiac
Elite
Elite
Posts: 1454
Joined: Sun Jan 12, 2003 6:24 pm
Location: Far out in the uncharted backwaters of the unfashionable end of the western spiral arm of the Galaxy
Contact:

Post by pontiac »

Ok, here's the rlaan energy bar (i tried to include the base 4 number scheme.. not perfect, but it's there) in action.

Image
http://vegastrike.sourceforge.net/album ... ir_mk2.png
The only thinbg i might try to change is the cyan color of the jump energy... it just looks to 'plain'.

The animations frames are here:
rlaan energy circle


The Gimp (.xcf) source file is here.

The aeran one is in the making.

Pontiac
Post Reply