Jump to content
  • Advertisement
Sign in to follow this  
Relfos

OpenGL Tile based 3d engine, some ideas and questions

This topic is 3297 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'm currently planning the design of my next engine (I've coded and finished one before, over the time span of five years). The reason is, technology has changed, and the old one doesnt cut it anymore. Now, I can't really spend the next five years coding another engine. I've looked at the opensource options currently avaliable, like Ogre, Irricht, etc, and all suffer from the same problem as my older engine, they try to support everything, with a very generic design, and very bloated. I now plan to write a small and specialized engine (reusing as much code as the old engine as possible, to speed up production), with the objective to render a continuous RPG world. To simplify map building/edition as much as possible (and the code itself), the world is going to be made of 3d tiles (like tiles in 2d games, but using cubes instead, think Dwarf Fortress). Of course, instead of cubes I'll use small 3d meshes. The world will be made of various cells (each store 8x8 tiles), and stored as a gigant octree. Since the complete world would feature hundreds of cells, they're streamed from disk as required. This not problem, already implemented something similar in the past, using lightmaps for shading. Now the problem is, this time, some eyecandy with modern technology is required. 1. Global Ilumination I'm thinking of for each cell, generate a volume texture that will somewhat work as a 3d lightmap, and use it in the shader for calculating the ambient factor per vertex/pixel maybe? A volume texture of 32x32x32 gives a resolution of four samples per tile, and uses something like 128kb of memory, probably I can increase resolution, and still be feasible. This texture would be used for both static and dynamic objects, as vertices positions would be transformed to cell space and then to 0..1 range. I'm still unsure about possible lighting problems between adjacent cells. Any toughs? 2. Lighting There's going to be lots of lights in the world. Most of them static, yes. But I want to have dynamic shadows, almost everything should cast shadows, so lightmaps are out of question. I've looked into deferred shading, but it requires advanced hardware and my engine/game should run in most pcs (maybe with some limitations). How to have multiple lights cast shadows (with shadow mapping), one render pass per light? I tough about the possibility of only the sun could cast shadows, but then in a dungeon underground, the sun would not visible and everything would be very dark, even if there is some torch or something. I found very difficult to find a shadow mapping demo for OpenGL that works and doesnt produce very ugly shadows. What's the best take to implement a system with lots of lights(most static, some dynamic)? 3. Water simulation This is currently a big problem. How to integrate water bodies into this system? I was thinking of defining a water height per cell, and the simple way would to render a plane with some reflection/refraction shader. But what if I want a river going downside a hill, or a waterfall? And what about the ocean, the waves in a beach? I want to integrate the water with physics system, so when a big object falls in the water there's some waves, and other stuff like that. Any thoughs? Sorry for the long text, and thanks in advance for any help!

Share this post


Link to post
Share on other sites
Advertisement
Thats been done before, remember ages ago with the pc game "stuntz", it was a racing game and used tile based 3d graphics.

It works... how big are you planning on making your tiles?

Youd get some really cool indoor tunnels and doungeons with that, id make a single tile maybe 3x3 men across and in and up and go for it like that.

You should be able to make a city area, just make streets that are sorrounded by houses that maybe you cant go in and you could have missions in the cities too.

Im making a 3d world myself right now, but im only going for old school textured graphics. Mine packs 100% unique texelling :) its quite interesting... but for this project? go for it, cube worlds would be really cool! i hope you finish it!

You should get a prototype going right now and see if you can get the inside of a doungeon or something... it wouldnt take you more than a week id imagine.

Share this post


Link to post
Share on other sites
I'm working on pretty much the same thing myself but writing my engine from scratch to learn all the tricks. One thing I had to think about when starting this project was who I was targeting for support. I ended up deciding to go with DX10 as a requirement because I liked the API and figured by the time I got anything finished most people would have machines able to run a DX10 application. I mean DX10 compatible hardware is cheap these days, and if you're going to want to use your code in the future for another project why not base is off the latest technology so you don't have to spend so much time updating?

As for lighting another reason I went with DX10 was to do deferred shading/lighting and I can tell you already it's been much more fun than going the old routes. I mean you get to try some of the latest techniques if you want.

One reason I went with deferred lighting too was specifically for the reason of wanting to do hundreds of small lights per scene. Torches, windows, fires, all that spiff stuff. It seemed more robust for handling such that it really made the decision for me as far as what I wanted to do.

Just my 2 cents on the matter.

Share this post


Link to post
Share on other sites
rounCED, ehehe, thats cool, and yeah, I'll try to make a prototype soon. What about this "100% unique texelling", could you explain more about that?

BattleCollie, yes, I really liked the idea of having deferred shaded, until I found it didnt support transparencies. What you plan to do about that? Things like water could pose a problem in a defered shading engine, unless you render it with forward rendering, but then, I dont think thats a nice solution.

Good luck for both!

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!