# units on uneven terrain

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

## 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 on other sites
Quote:
 Original post by RastermanI 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 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 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 on other sites
Well, the sprites aren't really all that big, are they?

##### 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 on other sites
Didn't C&C:TS and C&C:RA2 use voxel technology for tanks, anyway?

EDIT: Yes they did.

##### Share on other sites
Quote:
 Original post by ToohrVykDidn'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 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 on other sites
I could swear I've seen catapults tilt as they went up hills. :/

• ### Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 16
• 31
• 9
• 16
• 22