• Advertisement
Sign in to follow this  

units on uneven terrain

This topic is 4246 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a question regarding isometric units on uneven terrain, like in AOE or C&C Red Alert 2. I have been studying Red Alert 2 specifically and am wondering how they did their graphics when units are on hillsides and transitioning to hillsides. It appears they use 32 rotations per unit on a flat surface, and then there are 8 slopes, which would be another 256 (8*32) frames, or 288 frames total for one unit! Do you think they prerendered all of the units this way? On top of that, when a unit is transitioning from flat to slope, it goes through 2 other transitions, which would be another 512 (2*8*32) frames, this seems like an aweful lot of frames which leads me to believe they are generating these on the fly somehow. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Rasterman
I have a question regarding isometric units on uneven terrain, like in AOE or C&C Red Alert 2. I have been studying Red Alert 2 specifically and am wondering how they did their graphics when units are on hillsides and transitioning to hillsides. It appears they use 32 rotations per unit on a flat surface, and then there are 8 slopes, which would be another 256 (8*32) frames, or 288 frames total for one unit! Do you think they prerendered all of the units this way?

On top of that, when a unit is transitioning from flat to slope, it goes through 2 other transitions, which would be another 512 (2*8*32) frames, this seems like an aweful lot of frames which leads me to believe they are generating these on the fly somehow. Any ideas?


wait, why do you need a different image for each hill height? You just have to offset the same image for each land level.

And also, are you sure they have 32 directions? I thought the first two AOEs used 16. 16 directions can be faked by using 9 frames. include 4 for walking + 2 extra for standing, 4 for attacks. 90 frames per unit + a few deaths. If you make high res 3D models, then set the angles to take screenshots and that should be fairly fast.

Share this post


Link to post
Share on other sites
If I remember the older AOE right, it used mirrored graphics. The left facing graphic was just a mirror image of the right, and vice versa. I'm not sure how many directions it used, but it wouldn't surprise me if it was only 8.

I think when he said 'slopes' he meant 'grades'. Unless all the slopes are the same grade, like AOE2 (I think it had a uniform grade...) you'd need different amounts of 'tilt' to line the graphic up with the hill. Some units could just use the same graphics as on flat ground, but vehicles at least would need tilted versions in all the facings.

It doesn't seem unreasonable that they were pre-rendered at all. They used 3d modelling programs to make them, and I'm sure they set them up to spit out all the sprites automatically.

Share this post


Link to post
Share on other sites
I was referring to Red Alert 2 when talking about 32 rotations. I would guess AOE uses 16, and AOE2 might use 16 or 32, I don't know.

Yes they very well might be using mirrored graphics, just looking at the screenshots it doesn't appear they have self shadowing on the units themselves, although the units would need to be symetrical.

I wasn't as concerned about making the sprites, but the fact that there are so many, it would use up a lot of memory I would think. (Red Alert 2 was a 2001 game and required 64MB of memory.)

Share this post


Link to post
Share on other sites
Well, the sprites aren't really all that big, are they?

Share this post


Link to post
Share on other sites
The sprites are what, 32x32?

32 x 32 x 8 x 32 = 262144 bytes. That is nothing really. 32 different "frames" is a lot too but possible. That's a quarter megabyte PER unit. That is for 8 bit sprites which I think all the above mentioned games were. That I could be wrong but won't bump it up much. You have what, 32 different units total say... That's 7.5 MB of memory used for those graphics. Not bad. You can likely make a game fit nicely into 32MB of memory (don't forget landscape, buildings and some random stuff).

Anyways, its late, night!

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
Didn't C&C:TS and C&C:RA2 use voxel technology for tanks, anyway?

EDIT: Yes they did.


Awesome, now this is what I was looking for, thanks :) BTW great job on Darklaga, it is great.


@Mike2343:

262k would be for only 1 flat plane, in RA2 they draw units on 9 different planes, which would be more like 2.4MB per unit. But as ToohrVyk so helpfully pointed out they don't even use prerendered frames, which I can clearly see in the graphics, prerendered units would look sharper and have better detail.

Share this post


Link to post
Share on other sites
Just some random historical info:

The first AOE used eight rotations, and had pre-rendered sprites for five of them (up, down, up-left, left and down-left). I assume that the right facing sprites were generated at run-time by mirroring the left facing ones.

I don't know how AOK (AOE II) handled sprites internally, but it also used just eight rotations.

Neither of them did anything for units on slopes, the normal sprites were used for any slope.

Share this post


Link to post
Share on other sites
I could swear I've seen catapults tilt as they went up hills. :/

Share this post


Link to post
Share on other sites
Quote:
Original post by Deyja
I could swear I've seen catapults tilt as they went up hills. :/
Which is exactly the sign of an immersive game experience :D

Share this post


Link to post
Share on other sites
Bleh, those games are all the same. In AOE, just rush to war elephants. In AOK/AOC, bombadiers or bombadier galleys. In star craft, depending on who your playing as, built Hydralisks, Goliaths, or Carriers.

Share this post


Link to post
Share on other sites
Quote:
Original post by Deyja
Bleh, those games are all the same. In AOE, just rush to war elephants. In AOK/AOC, bombadiers or bombadier galleys. In star craft, depending on who your playing as, built Hydralisks, Goliaths, or Carriers.


AOE, Rush to Horse Archers.

Starcraft? Full rush, with starting combat unit. Zealot/scout army often works well, nothing like taking down the base of someone as they're trying to build a carrier fleet with lowly swordmen and a few flying spotters. :P


but as far as tilting on hills goes, for most things it is somewhat unneeded, and if you are going to use tanks or something, you might want to look into a Mixed 2D/3D game engine. Where you still have a full 2D map for everything, but an extra 3D mini engine running in the background to make the sprites at different angles for you. This lets you use whatever 2D API you like (if you don't want to use a full 3D API, which isn't really too much harder for this) while using a very, very simple 3D program running semi realtime.

Or just prerender them and get them over, unless you're looking at very very ram limited hardware, it shouldn't be a problem at all.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement