Jump to content
  • Advertisement
Sign in to follow this  
Lode

OpenGL Idea for a new engine

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

I find this very annoying of myself: I always make some cool engine for a game, but never acutally finish the game itself, ending up with nothing. Usually I also find the code of the game quite bad after I've left it alone for a while. Luckily each engine contributed something more to my main "library", so that making the next game always goes easier and better. Anyway, I've been working on a 2D tile engine for an RPG game, but now I was thinking, if I'd give every 2D tile a 3D shape instead and make the character walk around it in first person, and make every monster a 2D sprite (so that it's easy to draw lots of monsters without doing 3D modeling), wouldn't that be cool? But if I'd make such an engine, then everything would still be tile based, each tile would have a certain height and shape. I already have a tile engine, which saves tile worlds in sectors of 32x32 tiles, and which uses runlength encoding, so that when saving the map and many tiles have the same picture, it gets compressed. I'd use that same engine for the 3D world. Tiles would get a 3D shape, like ground, wall, pillar, floor+ceiling, statue, ... and a few textures that would be placed on predefined places on these shapes. Entering a house would be like this: you step in front of the door and get "teleported" to the inside of the house, which is in fact somewhere totally else (that's exactly how it works in my 2D tile engine). Say that the world would exist out of 1024x1024 such tiles (32x32 sectors of 32x32 tiles each), each tile in 3D would have on average 24 triangles (a simple ground square would be 4 triangles to allow fluent height differences, some more comples shapes would have more), then I'd have a world consisting out of 24 million triangles, plus monsters and trees in it that'd be sprites. What would be a good way to render such a world in realtime? I know modern 3D cards can render millions of triangles a second, but I'm not sure if the world structure I described above supports that? Do you think it would be possible to be standing somewhere high in this landscape and see with the camera a far view of all these 1024x1024 tiles at once? :) I'd be using OpenGL without extensions.

Share this post


Link to post
Share on other sites
Advertisement
Rendering it all at once might be pushing it :D Though the real problem might not be the triangles but the textures for everything. But due to your convenient format you can easily do culling by rendering, say, only nine sectors, or only the six sectors in front of the player.

Incidentally, Might & Magic (and probably quite a few others, but not quite so late) used this kind of "3D world with sprites" setup for a long time. It didn't harm the gameplay, but it was ugly beyond help, especially considering that by the time of number eight, it was already the year 2000.

Share this post


Link to post
Share on other sites
Other games like this (although they use geometry instead of sprites and the viewpoint might be a bit different) are shadowgrounds, neverwinter nights and warcraft 3, i even made a FPMS (first person mine sweeper) once using a similar technique.
So it's definitely possible, just make sure you don't end up with tons of different textures, a big texture atlas is probably the best way.
Then put all those tiles in a single VBO one after each other.
At this point it's pretty easy to just render all visible tiles.

Share this post


Link to post
Share on other sites
The basic concept sounds like the original Wolfenstein 3D game. You should see about playing that and seeing if it gives any ideas. Keep in mind that Wolfenstein is Very old, and was shortly surpassed by better things like Doom, even before the advent of OpenGl and hardware rendering.


Quote:
Original post by Lode
Do you think it would be possible to be standing somewhere high in this landscape and see with the camera a far view of all these 1024x1024 tiles at once? :)

This last part sounds a little bit different though; Wolfenstein was an indoors dungeon style game. Where you have walls that pretty much keep you from seeing too much at once.
What you describe about seeing the landscape; sounds more suited to a heightfield type terrain; one of these would be a better use of triangles if you're going to be outdoors. And they have their own set of algorithms for managing them. So check those out as well, its a well covered topic.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!