Game Engines......

Started by
18 comments, last by Khaos 23 years, 6 months ago
Hello, just me again.... I have been working on my engine since the beginning of the summer (6/00) and am still working on it all the time. I am at about 10% of the way through. Oh well, it is gonna be great. It is a direct cross between the engines of Command and Conquer and Roller Coaster Tycoon, two of my favorite games. It is isometric and in 3D. I am using DirectX, and VC++. Anyhoo.... my question is this: Does anyone know anything about the engines of C&C or RCT. My game (so far) looks kinda like the feel of them, but I want it more so like it. It might change, but the stats are as follows: 3D GFX for buildings Voxels for vehicles 2D sprites for infantry anims Isometric tiles, and basic terrain Trees, rocks, etc. all in 2D sprites Locked in a 45° straight, up, and through camera angle Sorry to babble, just telling, but subject to change. Anyway, is there anywhere with code from any of these games? I kinda wanna know: How RCT stores its AI for all the thousands of people w/o any real slow down? How C&C creates INI''s to store all outside logic, and make the tags for them (editable)? How they both store map data and in what format? How C&C does light calculations and particle systems so good? (using premade GFX) And some other stuff I will post when I think of it. Any help is appreciated in making my engine more what my aim is. It is really good so far for being on my own. Thanks a lot guys! Laterz ======= ~Khaos~ =======
Advertisement
Hey, I noticed that you had the following specs for the renderer:

3D GFX for buildings
Voxels for vehicles
2D sprites for infantry anims
Isometric tiles, and basic terrain
Trees, rocks, etc. all in 2D sprites
Locked in a 45° straight, up, and through camera angle

If you have the camera locked in at a certain view angle, why have the buildings 3D? They will most likely be the last objects you have to rotate, and should you need to do more rotation than would be applicable when hand drawing, you could make the building in 3D Studio Max and just export the necessary images of the buildings viewed at the correct angle. May cost more memory, but it will save you A LOT of computation cycles in the end. I don''t know anything about voxels so I won''t comment but I would think you might want them as 3d object because you can take advantage of 3d acceleration. For terrain you might consider the Big Bitmap Map style. It looks beter and might even be easier when doing the rendering. Once again, however, I am not sure on this.

I of course might be wrong, in which case you need all the flexibility in the world for rendering units and objects, ala RCTY. In this case you could render it all in 3d and just have 4 (or more) different view angles preset, and just give the player an option to switch between them.

If this is unclear, please tell me.
"The computer programmer is a creator of universes for which he alone is the lawgiver...No playwright, no stage director, no emperor, however powerful, has ever exercised such absolute athority to arrange a stage or a field of battle and to command such unswervingly dutiful actors or troops." - Joseph Weizenbaum-Brent Robinson
Lotta questions, are u sure that you finished it 10%? I think such questions have to be considered BEFORE the actual writing...
I''ll assume you''re talking about C&C2 with those lighting and particle effects, because no previous C&C game I played had either of these. You''ve probably noticed how the lighting on the ground (in Tiberian Sun) looks blocky - it''s in diamonds, it seems. That''s because the colour of light is calculated only once for each map tile, to save processing time. The tile is then coloured a certain amount, and blitted to the backbuffer (or however they chose to do it).

This is similar to how the original Quake engine (and consequently, the Half-Life engine ) does lighting. You can divide your map into small chunks (or tiles if you''re using them), and save time with lighting. For particles... well, particle systems are fairly easy to write, and you could do some nice lighting effects with them using this method.

If you''ve played another Westwood game, Nox, you would have noticed that their particle engine isn''t amazingly fast, and slows the game down dramatically in multiplayer. So I doubt C&C2''s particle engine is fast; it just doesn''t use many particles. But at least that''s roughly how C&C2 does its lighting, to my knowledge

-----------

C++ is the language of the not-so-ancients.
Learn to speak it well.

BeamMeUp
-----------C++ is the language of the not-so-ancients.Learn to speak it well.BeamMeUp
I''m working on a RCT-style game, and I did a little research earlier into the AI really early on in the project.

Thanks to a friend here who''s name I have since forgotten, I found the information for the AI is stored within a huge array (arround 500 entries). Each entry was made up of a struct, which was filled with all the relevant data (and the irrelevant data too!)

However, I have a problem! I can''t quite figure out the best way to render and store the terrain. Currently, I''m creating an array of Square classes, but from here, my ideas become a little bit unsure.

I was thinking that to render them, I should find the square in the middle of the screen, then calculate the number of squares which will fill the screen based upon the distance from the camera. Then I simply draw each square. Does this sound OK? Or are there better ways of doing things?
XEOS Digital Development - Supporting the independant and OpenSource game developers!
Ok, to answer some of your questions:

I am not using polys for my units, because if you have 50+ units dukeing it out on the screen in a big battle, the game would slow down a lot more than when using voxels. Voxels are great 3D-ish GFX files, that look really good when done right, and don''t slow down much.

I am about 10% of the way through. Doing AI, which was the main thing I wanted to know about, dosn''t really come in until 50% or so. I work in order. I don''t need to know about that BEFORE time, because my engine already looks sorta like C&C and RCT. I just wanted to know a little bit more on their engine specifics so I could make it even closer to them.

Yes, I am talking about C&C2-Tiberian Sun. I just said C&C, well, just because. C&C1 and RA1 DID had particle systems. Trust me, I ripped the engine a new ass in editing them. TS had a good particle system, except under A LOT of stress, but it used whole GFX as particles. In other words, it didn''t pixel plot them, it used a whole GFX as one particle, and did the animations that way. Anyhoo, just wanted to know how to go about coding that.

And I wanted to know more specific how RCT stores its AI for the people. I knew that much already, was going for specifics. Does anyone know if there is any code for them? I doubt it, just wondering though.

Any help, code, examples is appreciated. Thanks again!

=======
~Khaos~
=======
Oh sorry, forgot.....

The buildings are in 3D because we are also having a FPS view, and a rotating camera view. It will have a sort of "helmat camera" like in the old PSX game: Theme Park. You can switch to a units view in other words. And it will also have a rotating camera, to see behind rocks, trees, buildings, etc. Non-3D buildings, IMO, would kinda look stupid then.

We might take out the FPS view, but are definitally keeping the rotating camera. Sprites in units won''t matter then, and voxels will not either. I could make buildings sprites, but we want as much 3D(ish) as possible. Even if most is just 2.5, that is fine too.

Thanks.....

=======
~Khaos~
=======
how do you render the voxels?!
just a lot of RGBA-maps overeachother?! or how..

we wanna play, not watch the pictures

If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

Well, I have no code yet, and I do not want to just post to post, because I am in the process of optimizing the code, but I will post the rendering code part when I am finished with it.

But the basics behind it is not all that hard...

(Please note, these are NOT the exact same thing as voxel terrain. Many people think it is, but they are really quite different. At least, in the sense of how I use them.)

I am using a voxel editor/creator to make the voxels. It is really like painting an object in layers. Say you go into a paint program. You paint a triangle. You keep it 2D perspective, NOT 3d. Well, thats all well and good. That would be a STRANGE looking sprite. So how do you make it 3D? Give it depth or volume. A voxel is a pixel with volume (depth) to it. Volume, Voxel, V's, get it? Anyhoo, here is an idea to give you an idea of what it is like with the traingle: ( : = a pixel) (Ignore the - marks, need them for formatting)

---:
--:::
-:::::
:::::::

Now that is 2D. How do you make it 3D? Use a voxel creator... and add different layers to the side of that to give it width. Then add the layers on the top to give it height. Then add layers on the front to give it depth. This is REALLY hard to explain, sorry

Layers make up the top view of a 3D pyramid:

: (top)

::: (middle)
:::

::::: (bottom)
:::::
:::::

Add, or STACK those on top to get your height.
Now for width:

: (left,left)

:
: (left)

:
:
: (middle)

:
: (right)

: (right,right)

That makes up the width if you stack them together.
Now for the depth: ( _ = pixel using a different symbol than : )


_(bottom) __(lower) ___(middle) __(higher) _(top)

Stack or put those together, and you got depth. Add all three layers of x, y, and z, and you got a voxel. Sorry, quite hard to show those in an understandable way.

The voxel program I have, you "paint" a layer on the X axis, move up a layer, and do that, move up a layer, etc....
Then you switch to the Y axis, and then the Z. Add them all together, and you have what TS uses, which is a very good way IMO. You can make EXCELLENT looking, even better than polys, 2.5 (3D) units, that don't slow the engine down nearly as much, I really like them.

So you create a .VXL file (voxel). Then, you use a .HVA to handle the movement and special characteristics to support the .VXL file. These are the formats that Westwood uses for theirs. I will post the file format for .VXLs in another post in a little bit, same topic (if you want them).

Hope that answers your question, again, very hard to describe. Once you play with the proggy, you have a much better feel for how they work.



=======
~Khaos~
=======



Edited by - khaos on October 6, 2000 3:38:15 PM
Geeze, I had to edit the thing 6 times to get it right, took about an hour to post that it seems!!!
I had to erase my "Edited by....." things every time cause it would look horrible to see how many time it took to get that dang thing right, GEEZEY-PEEZY!!!
I hate formatting sometimes!

=======
~Khaos~
=======

This topic is closed to new replies.

Advertisement