C&C Red Alert Dissection
Hi guys,
I'm wondering how parts of Command & Conquer Red Alert (original 1) are made.
1. How are the maps implemented?
I have used the level editor. There are template tiles to select and place. I
would implement the world as a 2-D array consisting of pointers to tile objects
including a bitmap of it's representation. Is there a better way? I feel this
would provide random access to the world tiles which would be very advantageous. Maybe this is a naive approach?
2. The models/units
I asked this before. Some1 suggested that the models were made in a CAD app
then screenshots taken for the animations. What format would I save the
images in? They would have to be able to have transparent pixels?
3. Unit Collision detection
Would I calculate what units were in the nearest blocks then perform a per
pixel colision detection? maybe there is a more efficient way?
4. Scripting
What kind of scripting do you think they used? Hardcoded, custom scripting
or existing language? I would just want to implement a very easily made AI,
eg avoid then shoot.
1. Don´t know exactly about the maps, but a 2D-array doesn´t sound that bad to me. But as far as I know the pieces that were used in the editor weren´t necessarily regularly sized. Still that could have been a simplification for building the maps and getting nice looking coast lines and things like that.
2. The models don´t have to be stored in a format that supports an alpha channel. If I remember correctly there weren´t any semi-transparent parts in the units, so a simple color key transparency would suffice. Every pixel that shouldn´t be visible is given a certain color (magenta is a good choice for that, since it´s normally not used for anything else). When displaying a sprite every pixel with that exact color is neglected.
3. First you can check only units that occupy the same tile, after that you could check their bounding boxes and if they do collide you can perform a per-pixel-check. I can´t think of a way to get around a per-pixel-check to get per-pixel-exact collision tests.
No idea for the scripting thingie, sry.
2. The models don´t have to be stored in a format that supports an alpha channel. If I remember correctly there weren´t any semi-transparent parts in the units, so a simple color key transparency would suffice. Every pixel that shouldn´t be visible is given a certain color (magenta is a good choice for that, since it´s normally not used for anything else). When displaying a sprite every pixel with that exact color is neglected.
3. First you can check only units that occupy the same tile, after that you could check their bounding boxes and if they do collide you can perform a per-pixel-check. I can´t think of a way to get around a per-pixel-check to get per-pixel-exact collision tests.
No idea for the scripting thingie, sry.
I think a 2-D array of Tile pointers will be ok.
Good idea for the redundant pixels, i will look into that.
Yeah the bounding box check before per pixel collision would be better.
Dunno about the scriting. Thinking of just hardcoding in a few stategies for
quickness.
Thanks for the help!
Good idea for the redundant pixels, i will look into that.
Yeah the bounding box check before per pixel collision would be better.
Dunno about the scriting. Thinking of just hardcoding in a few stategies for
quickness.
Thanks for the help!
1. Yes, what you're proposing should work fine. Specifically, pointers to "tile types", which contain information such as graphics, movement speeds, etc...
2. I believe that is how the units were created, yes. If I remember correctly, the original Red Alert used palleted PCX files. Certain pallete entries had special meanings, such as transparent or team colors.
3. Red Alert did not use per-pixel collision detection. It was purely tile based. But if you want to use pixel-perfect detection, then your way should work fine.
4. I was an avid RA modder back in the day, and I'm pretty sure that they did not use any kind of "scripting" fore the AI. There was a rules.ini file which had in it lots of variables which were fed to the AI, but AFAIK you could not change the actual AI code without hacking the EXE.
2. I believe that is how the units were created, yes. If I remember correctly, the original Red Alert used palleted PCX files. Certain pallete entries had special meanings, such as transparent or team colors.
3. Red Alert did not use per-pixel collision detection. It was purely tile based. But if you want to use pixel-perfect detection, then your way should work fine.
4. I was an avid RA modder back in the day, and I'm pretty sure that they did not use any kind of "scripting" fore the AI. There was a rules.ini file which had in it lots of variables which were fed to the AI, but AFAIK you could not change the actual AI code without hacking the EXE.
So were units also tiles?
You could have 5 soldiers per ground tile but only 1 large tank in that space.
How could I achieve this kind of grouping/collision detection?
Thanks for ur help!
You could have 5 soldiers per ground tile but only 1 large tank in that space.
How could I achieve this kind of grouping/collision detection?
Thanks for ur help!
Units are drawn as sprites after the tiles have been drawn. You could have each unit have a weight that it adds to the tile(s) it stands on. If it reaches a maximum, new units will not go there. In your case, something like large tank = 5, infantry = 1, jeep = 2. So there could be 2 jeeps and a soldier on a tile.
btw, you should use boundingrects instead of boxes as red alert is a 2d game.
btw, you should use boundingrects instead of boxes as red alert is a 2d game.
Using weights would be a good idea!
How do u think the tiles were created?
They are images but how were they painted? Maybe screen shots from CAD apps?
Or were they pain stankingly made per pixel?
How do u think the tiles were created?
They are images but how were they painted? Maybe screen shots from CAD apps?
Or were they pain stankingly made per pixel?
I was hoping that wasn't the case LOL. But I think its probably true.
I'll just have to draw the different units manually. I suppose I can flip
a lot of the images that are Symmetrical.
It will be interesting to see how good my art with pixels will be lol.
Suppose I can scan in images that I draw then place a layer over the top
and place pixels over the top of them.
How about say for tanks where their turrets face different directions?
Would I have to make 8 * 8 images for the different configurations of the
base & turret? Is their an easier way? Multilayered sprites perhaps?
I'll just have to draw the different units manually. I suppose I can flip
a lot of the images that are Symmetrical.
It will be interesting to see how good my art with pixels will be lol.
Suppose I can scan in images that I draw then place a layer over the top
and place pixels over the top of them.
How about say for tanks where their turrets face different directions?
Would I have to make 8 * 8 images for the different configurations of the
base & turret? Is their an easier way? Multilayered sprites perhaps?
You don't have to draw your sprites pixel by pixel, using a vector drawing application, or using renders from a 3D modelling application would be other options.
For the turrets on tanks using two sprites would be a good idea as it'll allow you to rotate the turret in any direction instead of having 8 preset directions.
For the turrets on tanks using two sprites would be a good idea as it'll allow you to rotate the turret in any direction instead of having 8 preset directions.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement