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

Submitted by Wouter van Oortmerssen, posted on December 31, 2001

Image Description, by Wouter van Oortmerssen

Yes, this is yet another landscape engine IOTD, but quite a different one this time :)

Cube is my tiny fps game engine project using a very simple design, that does a lot completely differently from most fps engines, for the sake of simplicity. Some of its features:
  • automatic LOD on the whole map allowing for configurable fps / visual quality tradeoff on any hardware.
  • very high precision dynamic occlusion culling.
  • simplistic but effective lighting, that can do dynamic soft shadows & lights.
  • in-engine editing of the world in full 3D, even with multiple people (coop editing, a first!).
  • no map precompilation of any kind needed.
  • simplistic quad-tree world structure, with slopes (heightfields with caps) and slants.
  • collision detection & physics
  • client/server networking
  • multiplayer FPS game (weapons, items, game modes).
  • Feel free to have a run around the game/engine yourself, it is available at

    My goal with this engine, besides having fun programming, was to keep things simple (there is that word again) so that I would actually have the time to make a full game out of it, rather than be stuck with a renderer that looks impressive but takes me 3 years to finish. Other goals were to make it very friendly for map editing, and to implement the kind of gameplay which seems to have grown unpopular in most recent games :)

    If you have any questions, I'll be happy to answer them.

    Wouter van Oortmerssen

    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.

    December 31, 2001, 01:20 PM

    Looks kinda cool


    December 31, 2001, 01:21 PM

    Sounds even better

    Ben Hanson

    December 31, 2001, 01:22 PM

    Looks really cool.


    December 31, 2001, 01:25 PM

    And where's the landscape??

    David Olsson

    December 31, 2001, 01:26 PM

    I think you have put very smart goals for yourself. Simplicity is the keyword for a project like this.
    It looks very good and the feature set is excellent.
    Everything sounds really good to me.
    I'm aiming for something very similar but with voxels instead of a heightmap.

    I'd love to hear more about what algo you are using for occlusion culling.


    December 31, 2001, 01:34 PM

    Get soapy


    December 31, 2001, 02:11 PM

    The maps seem remarkably complex considering the limitations you mention. Actually I didn't notice the restrictions at all when wandering around in the maps. I think you definitely made a good decision in structuring your maps this way.



    December 31, 2001, 02:28 PM

    How are you doing the lighting?

    It looks like ray casting from the sources to a low resolution grid, effectively computing light maps at run-time. The ray tests don't seem to take objects into account, only world geometry. Do you do this every frame or only when a light moves?


    Brebion flavien

    December 31, 2001, 02:42 PM

    Dynamic soft shadows ? What do you mean by that ? I have seen dynamic lighting in the demo, but that's all..

    Btw it's pretty neat, but i find the skybox to be pretty ugly :)

    F. Brebion


    December 31, 2001, 03:00 PM

    Co-op editing rules. We worked briefly on integrating that into Prax War's engine's editor back at RBR. Rob kept a secret branch of the editor code and we played around with adding in networked multi-person editing. He designed a very elegant system for allowing locking and partitioning so you could specify what parts of a map you were in control of at any given time. We never really got it off the ground (silly things like "making milestones" and "getting paychecks" got in the way :) but it would really have been cool, since our levels were so big (7 miles of terrain! w00t!).



    December 31, 2001, 03:01 PM

    Go check out his webpage... he's rendering "inside" levels using a landscape-style engine. It's clever. ^_^



    December 31, 2001, 03:24 PM

    dmh: its a landscape engine in the sense that the world is organized on a 2d grid / quad tree like most landscape engines... but its focus is very different (look at the 3rd screenshot for some heighfields).

    olsson: thanks :) the occlusion culling works as follows: every frame, it builds a (2d) "occlusion map" from the camera viewpoint, which says for every ray out of 512 directions what the distance of the first occluder is (this can be done in real time because tracing a ray thru the scene is so cheap, don't try this with a 3d bsp :). Then for every cube in the quad tree it finds the degrees it spans, finds the conservative range of rays within the occlusion map, and if for all distances recorded there they are nearer than the cube, the cube is occluded and is culled in its entirety. It take a bit of cpu power, but the tradeoff is VERY good and always "free" (unless you are on a 486+gf3), since on almost all machines the cpu isn't the bottleneck (under cube).

    max: well, it is still a challenge to make them come accross not too cubic. But the extra features (slopes/slants etc) allow that.

    morgan: yes, imagine it as one big world-spanning lightmap sitting on floor & ceiling. This is then recomputed dynamically as needed (every frame for the areas a rocket travels thru, using simple ray tracing not unlike the occlusion culler) and rendered as vertex lighting on all polygons involved. The actuall lighting algorithm is really basic (as in quake): start with a light intensity and fade out linearly with a radius until you hit an occluder (wall).


    December 31, 2001, 03:26 PM

    Well, I'm impressed. The maps are a bit small, but it's very fast and has a relatively high amount of detail, even considering the world structure. I particularly liked aard2 (2nd row, 1st column for those of you who haven't downloaded the demo). Very nice blending of landscape features with some indoor structures.

    My only two complaints are that the maps are kind of small and there seem to be quite a few rendering artifacts between polygons no matter how I tweak things. Anyone else get the rendering artifacts? Some things for you to look into. ;)


    December 31, 2001, 03:38 PM

    that's cool, but wasn't it how duke nukem 3d was made?

    What I remember from the map editor you could cut sectors on the floor and ceiling and then using PgUp and PgDown you could lower the ceiling "block" or raise the floor "block". But your graphics sure looks a lot better ;)


    December 31, 2001, 04:38 PM

    I remember doing that, that was great making DN levels...

    David Olsson

    December 31, 2001, 04:41 PM

    I got the artifacts too.

    Hiro Protagonist

    December 31, 2001, 04:47 PM

    I really wanted to jump in and have a look around, but I was only getting 2 FPS on my GeForce2 GTS, Pentium3 1 GHz, with 1 Gig Ram.
    I went to tweak the settings in the menu, and turned the optimal FPS to 30, and then the floor gave out and I fell through it. But my FPS remained at a steady 2.

    David Olsson

    December 31, 2001, 04:50 PM

    Can't this method cull visible cubes ?

    Are the texture coordinates generated automaticly or by the level designer ?


    December 31, 2001, 05:03 PM

    it sounds like you are using opengl software drivers. Have you tested any of you other opengl programs?


    December 31, 2001, 05:04 PM

    Wow, this looks really good. Nice job.


    December 31, 2001, 05:40 PM

    Looks great and plays very smoothly. Held a consistent 60 FPS (l.o.d
    250) on my P4 1.7Ghz, 256MB, MX400 with very few artifacts. Tech
    aside, the game could use a few front-end menus, but LAN play is
    reliable and enjoyable. The maps and textures are nice too. Great

    Timothy Barnes

    December 31, 2001, 05:52 PM

    I'm not easily impressed.

    However, those screenshots impressed me indeed. I love the lighting and the textures. It's not overdone and very soft. I like that. Keep up the good work!


    December 31, 2001, 06:22 PM

    Brilliant... simply brilliant...

    I got a constant 200-300 fps on almost every map... (p4-1,6Ghz with a gf3-ti200) @ lod250

    This is how things should be done... simple and fast whilst still beautiful to look at...

    I for one would like to see some tutorials on how you did certain things in your engine... perhaps something for your website, to share your knowledge with the rest of us... :)

    Good luck in the future!


    December 31, 2001, 07:15 PM

    Me too. Tutorials would be nice :)


    December 31, 2001, 07:54 PM

    Thanks everyone for the kind words, its really cool you can all appreciate it. I guess I was expecting a lot more of "this sucks, it doesn't have checkmark feature X".

    brebion: cube does "dynamic soft shadows" because its dynamic lights are identical to static lights (just recomputed more often) and thus cast shadows. And they are soft because thats what all the lights are. Modern engines that do dynamic shadows often use shadow/stencil buffer whatnot tricks and are usually hard (pixel precise) which looks unnatural (IMHO). If you want to see them more clearly, go to a map with columns and a lot of darkness (for example "metl1"), shoot past the columns and watch the shadows move. If it goes too fast, try doing so with "gamespeed 30" (slowmotion).

    z66831: that's a shame, I would like to see this more often. Me and some testers have been doing coop editing for a while now, and for some it has proved addictive. Maps like "cellar" were done entirely in coop.

    chrysomite: well, there are no reasons why it couldn't do bigger map, esp given the occlusion culling & lod. One particular map that is currently being made is absolutely huge. I guess if and when I add SP gameplay bigger maps will become more in demand. What artifacts are you getting?

    WD40: Yup, the BUILD engine's editor was very visual / 3d too, and there's a lot of similarities in the engine too (though cube is simpler, it is more of a souped up wolf3d ;)

    hiro: on that kinda machine you should get 200 fps, not 2. I also have a gf2gts so I know it can't be any funny driver bottlenecks... I have no idea what the problem is other than you running in software opengl for some reason.

    mark: there are menus in the game (press escape)... what was wrong with them?

    DEVLiN: well, the secret technology behind cube is that... there is no secret technology! I am not sure what I would write in such a tutorial, as there isn't a single complicated algorithm in the whole engine (how else would renderer/networking/physics/game/leveleditor add up to a mere 67k exe? :) its all about simplicity and brute force. But if you have any specific interests in parts of the engine I'll gladly explain them.


    December 31, 2001, 08:06 PM

    Thanks everyone for the kind words, its really cool you can all appreciate it. I guess I was expecting a lot more of "this sucks, it doesn't have checkmark feature X".

    Well it is 'safer' to expect the worst, but honestly I can't imagine anyone saying a lot of negative things about this IOTD. It's the most impressive one I have seen yet. (IMHO of course :) The only minor bad things I can spot are:

    1. Typing "/bind " doesn't tell you what is bound to, but it unbinds . Now this is not necessarily a bad thing, but Cube's console is pretty similar to Quake3's and this particular thing breaks that similarity.

    2. The weapons fire doesn't look very nice. (I like the explosions though. ;)

    Other than that it is absolutely great! Great configurability (even the menu is a text file!). Did you read chapter 1.1.0 of Game Programming Gems by any chance?

    Great maps, great framerate (I have yet to find a spot which produces fps < 150, most of the time it is 250-400), great graphics. I haven't tried out network play but I'm sure it's great as well, judging from Cube's documentation.

    It proves once more that a simple and good design is the way to go. (Carmack be damned! :)

    PS I love the scarab wall/floor texture. ;)


    December 31, 2001, 08:24 PM

    I'd suggest preventing lod for polys within a certain distance of the player to prevent people from dropping through floors, or running through walls like was the case for Hiro Protagonist who got 2 fps, anyhow, looks nice, I'll have to try the demo.


    December 31, 2001, 09:20 PM

    Wow.. its nice to see a project that works this well and looks good.. I ran it at 1600x1200 and consistently got 50+ fps (many times higher than 70) at 250lod on my athlon 1ghz, 256mb, GF2 ultra, and win2k.. I also tried multiplayer which seemed to work fine (although I only tried it with 1 other computer). Keep up the great work!

    Jeff Quesnelle

    December 31, 2001, 09:40 PM

    Whoa! Great! I got about 50-60 FPS (AMD-K6 533, GeForce2 MX 200 PCI, 256 MB RAM)


    December 31, 2001, 09:44 PM

    Cool! Ultra-smooth! Nice! Yummie!

    It ran with more than 100 FPS in the default resolution on a P!!! 933 + 256 MB SDRAM + GeForce2 MX + Det 23.xx + WinXP

    This thread contains 70 messages.
    First Previous ( To view more messages, select a page: 0 1 2 ... out of 2) Next Last
    Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.