Not logged in, Join Here! or Log In Below:  
News Articles Search    

Submitted by TopcaT, posted on May 07, 2001

Image Description, by TopcaT

Well, this is the beginnings of a RTS game engine. It's in a bit of a mess at the moment I'm afraid, and the graphics are suffering badly from 'programmers art'. The transparency effects won't work properly on a lot of older graphics cards, don't blame me, blame their dodgy OpenGL support. Still, it's feature list is fairly long, if not that impressive:
  • LoD based on distance and terrain variation
  • Bodged "almost A* algorithm" for path finding
  • View frustum culling
  • Procedural landscape texture generation
  • Completely seamless texture tiling [a b*tch to do]
  • Shadow maps
  • Detail texturing [but only not if you've got a lame gfx card]
  • 3 kinds of units [only 2 are textured]
  • Some trees!
  • Lame particle effects
  • Rubbish sounds effects
  • etc
  • The code is fairly slow and unoptimised, it was more of a test of algorithms than an attempt to get a supa fly engine. You can download the source and executable from my website



    Image of the Day Gallery


    Message Center / Reader Comments: ( To Participate in the Discussion, Join the Community )
    Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.

    May 07, 2001, 11:11 AM



    May 07, 2001, 11:43 AM

    i suffer from programmers art too :/ the only cure is expensive.

    The Wolf

    May 07, 2001, 12:04 PM

    The landscape looks pretty good.. you say it has LOD capability? what method are you using to do the landscape?

    Keep up the great work.


    May 07, 2001, 12:23 PM

    Very, very nice. Kudos.


    May 07, 2001, 12:41 PM

    Very nice. Besides your smoke and fire effects, which I'd be like :):):) if I did something like that, I noticed how you had even your water animate:) I really like it when people take the time to make all of their enviroment come alive. The only thing that bugged me was that the camra was a little hard to move. Personally, what I would do would be to have movement of the mouse normally change the orientation of the eye, forward arrow move forwards, backward move backwards, right strafe left, left strafe left. If you wanted to select a unit without messing the camra, maybe have holding the right mouse button lock down the view and then use the left mouse button to manuver. Becuase it can be a pain right now to try and move a unit halfway across the map accurately.



    May 07, 2001, 03:21 PM

    Thanks for the support guys. I've got to demo the engine for part of my university degree, so I'm glad you like it :)

    The Wolf: The LoD is based on the GeoMipMaps paper by Willem de Boer. All the triangles produced by my algorithm are right angled, unlike the method described in the paper and so it looks a little nicer.

    Thunderbird: I'm not entirely sure what you mean, but I know the control system needs a little work. You kind of get used to a control system if you use it for hours on end developing a game. Hell, at least it's better than the control system in Black & White :D




    May 07, 2001, 03:52 PM

    Stupid question, why does right triangles make it nicer?
    How do you handle the cases when there are different geo levels next to each other?
    Keep up the good work!


    May 07, 2001, 04:32 PM

    Cool! It looks a lot like Black and white (if you are an evil God like me). Especially the detail texture on the ground. Seems like a fairly complete engine.. maybe you can lisence it :)


    May 07, 2001, 05:01 PM

    noglin: There's not really that much difference really, it's just that Willem de Boer's method produces more needle like triangles which can look a little dodgy using a low resolution map. Here's a link to a shot of the LoD in action



    Richard Szalay

    May 07, 2001, 06:48 PM

    Looks nice, reminds me alot of Black & White.

    Also, its good to see you've released the source, IOTD seems to have turned into an eyecandy-of-the-day (as someone mentioned before), but as I don't want to start any kind of flame war, I'll leave it there.

    Anyways, good work, I'll be reading through your source today (instead of working *grins*).

    Keep it up big man :)


    May 07, 2001, 07:27 PM

    I am impressed.
    Your terrain engine looks very good. There is almost no popping , the texture seems very detailed (what resolution do you use, and if you
    can give us some details) and the frame rate is great, 65000 polygons and 40 fps on PII450 with GEForce2 GTS . This seems almost
    incredible to me, 2'600'000 p/s.
    My engine is using the same (almost) geo mip map tech, but can only do 30fps with 30000 polygons.

    Good work.


    May 07, 2001, 08:20 PM

    TopcaT, nice, can you give some references on where you learnt the techniques used?


    May 07, 2001, 09:11 PM

    Wow, I'm glad so many people are interested in my program, I thought it'd be "oh no, not another landscape engine". A lot of the techniques, I've just picked up along the way [this is about the fourth landscape engine I've written].

    The texture is scalable in size, but actually fairly low res [I think in that shot, the texture size was only 512*512]. The trick is to apply another tiled texture over the top using alpha blending to give the illusion of detail. This is becoming an increasingly common effect in games nowadays, Black & White and Serious Sam [a game well worth getting] use it to great effect.

    As for information, try reading the ROAM paper [dunno where it is], I didn't understand a lot of it but it pointed me in the right direction for a lot of things. There's some good articles at Gamasutra on terrain rendering, including this one and this one.

    As for multitexturing and particles, there's some good stuff on the OpenGL tuts page at NeHe.

    As for pathfinding, try here or here.

    Hope this helped some.




    May 07, 2001, 09:52 PM

    Wow! I really like the terrain! Looks really good. Also, the particle effects look impressive (i still have to get around to downloading it). The textures look a little bright, that's all. How large are the textures on the models, and what format do they use? Does the engine suppor tanimated models (like little soldiers)?

    That's really cool! Keep up the great work!


    May 07, 2001, 11:32 PM

    This engine looks damn good. I couldn't stop playing with it. Of course I tried modifying some stuff, adding my own heightmaps. I especially like the path finding and the blazingly fast code. I was getting over 20fps on my crappy machine. Good work.

    Lion V

    May 08, 2001, 02:02 AM

    oh no, not another landscape engine !!!!
    looks _very_ nice !!!!!!


    May 08, 2001, 02:35 AM

    Looks cool.

    I just wanted to comment about the terrain, I think it looks amazing the way it is. I think that its the models that make it look a bit bright. No offense but the models suck but thats "programmers art" for ya :) I couldn't draw a good stick figure (if such thing exists) for the life of me!

    But it does look good and I like terrain engines, they are bringing a whole new breed of games forward.


    My friends call me Spanky, you can call me Bill.


    May 08, 2001, 04:37 AM

    Is sure looks cool!

    I've got the transparancy-problem with old cards as well but it's also present on the GeForce2 cards when running in 32bit color...not in 16bit.
    There's a "blackness" around them...
    Anyone know why? Driver or programmer problem? (OGL & GLUT)



    May 08, 2001, 05:02 AM

    I use a simmilar technique in my landscape engine but I haven't sorted out the seems of different levels of detail and I haven't done anything to reduce popping (the main things :) ) and it only runs at 100,000 tris a second. So I am re-doing it from scratch with nice clean code and I am also writing a tutorial anlong with it.


    May 08, 2001, 05:07 AM

    Ah! Very nice! I especially like the facts that:

    a) it's pretty much a complete engine - you've got support for mesh, stationary objects, movable objects, particles, object selection, pathfinding, item interaction and collision detection and

    b) you provided the source. So many IOTDs look very cool, but include no source so all you can do is say, "Gosh, I wonder how he did that?" Thanks.

    I would like to suggest that you make your water a little more transparent; that would go a long way towards making it look better. Slowing down the rippling motion would also help, real ponds just don't have that much motion outside of an earthquake. I couldn't see the LOD you were using (maybe it's just too subtle) but the mip-mapping looked very good. The terrain looks fine, it's just your units that could use dressing up. I wouldn't be surprised if someone from here offered to help in that regard.

    Ran fine on my Athlon Thunderbird 700/GeForce 2 GTS machine, by the way. But then, MOST THINGS DO!, sorry.

    Again, great work. It's a nearly complete engine. Don't stop now.



    May 08, 2001, 05:10 AM

    Damn, some people took the words right out of my mouth: it looks like Black & White! :)


    May 08, 2001, 08:11 AM

    nice work.
    I like those "fluffy" trees :)

    Kasper Fauerby

    May 08, 2001, 08:37 AM

    Looks very nice!

    Of course the first thing I tried (to see if the A* worked) was to
    move a unit through another which unfortunately I was able to do. You should look into some collision detection algorithms - I think you would be able to get by with just some simple bounding-box tests for
    this game.

    Another thing is that you should try to use a dome for the sky instead of a plane (which it looks like you are doing now). Not a
    full half-sphere but rather just what could be described as the top of an egg. I use that in my engine and it looks much better!

    Looking forward to the final game



    May 08, 2001, 10:59 AM

    Hi, great work really. i had a look in your source code, because i wanted to disable multitexturing since my crappy banshee does not like this nice feature but i couldn't sort that out. i am amazed not to find any glEnable(GL_LIGHTING) kind of thing, but i didn't look hard enough. anyway if i disable textures i get a totally white screen with a wavy blue mark which i guess is the water, and the white is snowy mountains on white winter sky. what should i do (besides buying a new video card) to make your program run without the detail texture on ?


    May 08, 2001, 01:11 PM

    Very nice IOTD. I played around with it for a while and found it very cool. I can't wait to see what you do with it. Nice work!


    May 08, 2001, 08:58 PM

    Hikey: there is not lighting in the game, other than precomputed stuff, which is probably one of the reasons the units look so pants.

    It should run fine on a banshee without having to change the source, it's just that the detail texutre won't be drawn. I know it can run on a Voodoo 3 without showing the detail texture, so I assume it'll run on a Banshee as well.

    Kasper: I know, I know :) I had to write this to a very tight deadline and I never got round to putting in unit avoidence (shame on me). As for the dome, the sky is actually curved a bit, it's just very subtle, but I know what you mean.

    Badman: The water was just me playing around with a few effects, I know it looks completely wrong in context with the rest of the landscape.

    Anyway, thanks for all the comments guys.




    May 09, 2001, 05:45 AM

    this is sad, some people have time to lose to write java scripts while we are fighting against sleep because we can't finish our code on time. they spend their time wasting ours, which we already don't have. sad really.

    as for the program working on my benshee, it doesn't. it says "Oh dear, error generating textures, etc..." and the last line in the log file is "Multitexturing not supported".

    when i trick the dll GetProcAddress stuff like this:
    glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)wglGetProcAddress("glMultiTexCoord2fvARB");
    //changed to (definitions)
    void glMultiTexCoord2fvARB_rubbish(GLenum target, const GLfloat *v) {}
    // and in the code
    glMultiTexCoord2fvARB = glMultiTexCoord2fvARB_rubbish;

    then it works, but no texture at all, not even the mouse, nothing.
    what should i make the glMultiTexCoord2fvARB_rubbish function do to display the normal texture ?

    Kurt Miller

    May 10, 2001, 07:24 PM

    My network connection (ISP) was down for about 3 days; otherwise that script post would've been nuked much sooner. No big deal. I'll clean up the thread later. That'd be nice if the other moderators were anywhere to be found >:]. I'm not going to remove html support unless it gets to be consistently annoying. Its a simple switch to turn off though, so I leave it to you guys.

    Dean Harding

    May 10, 2001, 09:35 PM

    after not looking at the source at all, I'll make one suggestion for you to try:

    if( target == GL_TEXTURE0_ARB )
    glTexCoord2fv( v );

    Which will pass the texture coords for the first texture on, but not for any other textures. Obviously, I don't know if it'll work, but it's worth a try, I guess...


    May 10, 2001, 11:21 PM

    Very nice, thread cleaned up. Thanks Kurt.

    I for one would not like HTML gone.

    But, I'm in favor of deleting <SCRIPT > tags if it gets out of hand. Unless some moderators can get rid of the messages? :)

    Perhaps I'll become a moderator :)


    This thread contains 30 messages.
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.