Results 1 to 10 of 32

Thread: Planet texture generation code

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    I just read your comment on my profile page, so I guess it's better to answer here than via private messaging :

    What you're planning to do is a huge undertaking, and even a skilled programmer may need several years to implement what you want to do. So prepare to learn a lot, especially when it comes to 3D realtime graphics, physics, path finding and optimizations.

    Zooming in from space to the "street level" of a planet is a very complex thing to implement. You need a smart (and performing) way of storing your data (even with a high-end GPU and much RAM you won't be able to keep all necessary data in memory all the time), some continuous level-of-detail algorithm with advanced visibility checks to actually only draw what's visible (again same as storing all data isn't possible, rendering everything, if not visible or too far away, would be too much for your hardware). And these are just the basic. Adding good physics is another thing and many physics engines won't be well-suited for such a continuous scaling from space to ground.

    A very good place to learn about the techniques necessary for what you're about to do is http://vterrain.org

    When it comes to rendering planets and all the stuff they contain this page is a treasure chest of knowledge. So maybe take a look at their articles, though most of them will be very hard to understand unless you're pretty good at programming and have done something in terms of terrain renderning.

    So as an advice you should just start at ground level, render a limited terrain (using maybe octrees for visibility checks, to learn about this important feature) with basic physics that allow the player to walk on the terrain. Then start adding objects like trees and roads, include a phyisics engine for the vehicles and then zoom out stept by step, always adding to your base.

  2. #2
    @whtemple1959
    Are you just trying to transform OpenTTD to work on globe or are you trying to make the game to work with real 3D graphics?
    If it is the first option than it can be done but you will have to lower the detail to only have roads and railroads between large cities. Reason for this is the fact that you will never manage to sucsesfully simulate everything if there would be too much detail.
    I'm not sure for OpenTTD but original Transport Tycoon Delpuxe had the limitation of how mny of each structures, roadrs, rails can be on any map. And it was quite low so when playing on largest maps you quicly got to that limit which prevented you to build further.
    This was all implemented so that game simulation kept running smothy even on bit weaker computers. I asume that OpenTTD has theese limits a lot higher since todays computers are much more powerfull. But still I don't think that they are enough powerfull of sucsessfully running simulation of the whole world with such detail as present in OpenTTD.
    But if you plan on making your game in full 3D graphics than you will have to scale down your simulation part even further becouse processing 3D graphics is quite demanding.

  3. #3
    Some things can be learned from minecraft. It's not world size that makes a difference, but how much you show it at the time. If you need a real Earth model, you need to stream it from existing data sources. I'm not sure if Google-maps contain height information. If it does, you can use splines to smoothen out the details in between. Then again i'm not sure if that also counts as "blurred". There simply isn't height data in 10 meter accuracy propably anywhere, and such database would be measured in terabytes.

    Could add that with Earth data we are working in 2D pretty much. So possible optimizations go propably for quadtree, not octtree. Any data can be indexed or arranged in such a way that you can look them up quickly. Especially for project like this, you can expect that "player" doesn't make any changes to the terrain, so it's possible all the data can be in static sized blocks. That simplifies things.

    Oh, also the Earth topic might go on another thread entirely? Not so related to texture generation at all now.
    Last edited by User137; 07-11-2012 at 10:28 AM.

  4. #4
    Quote Originally Posted by User137 View Post
    Some things can be learned from minecraft. It's not world size that makes a difference, but how much you show it at the time.
    Yes Minecraft can be good exampla of how to have huge maps with low memory consumption.
    But From what I understand whtemple1959 is trying to make real time strategy game similar to OpenTTD. For RTS you need to have whole map loaded at all times.

    Quote Originally Posted by User137 View Post
    I'm not sure if Google-maps contain height information.
    Google-Maps do contain height information but it is only available through Google Earth application and not Online Maps.

    Quote Originally Posted by User137 View Post
    There simply isn't height data in 10 meter accuracy propably anywhere, and such database would be measured in terabytes.
    I belive Google Maps do have such acuracy.

    Quote Originally Posted by User137 View Post
    Especially for project like this, you can expect that "player" doesn't make any changes to the terrain, so it's possible all the data can be in static sized blocks.
    If he is trying to make somekinda remake of OpenTTD he will probably alow player to modify terrain as it is posible in OpenTTD.

  5. #5
    Quote Originally Posted by SilverWarior View Post
    Yes Minecraft can be good exampla of how to have huge maps with low memory consumption.
    But From what I understand whtemple1959 is trying to make real time strategy game similar to OpenTTD. For RTS you need to have whole map loaded at all times.
    &
    If he is trying to make somekinda remake of OpenTTD he will probably alow player to modify terrain as it is posible in OpenTTD.
    Nope, only need to load parts where things are happening and even then just what is needed.

    Need bit more information maybe. From whtemple1959's message it sounded like RPG or adventure game. In any case, you can't have the whole world "living" at the same time. If you have key structures like airports or such, they can be separate objects from the terrain entirely. Can send aircraft to different airports and so on. Just when you load their area you would see them visually. Single cars in city streets, there's no reason to simulate that for whole world at all times.

    Slightly related on topic is 1 of my units in nxPascal. Capable of keeping a huge world loaded up in memory at the same time. Unused parts are compressed, and used parts are automatically recompressed after certain time of no use.
    Last edited by User137; 07-11-2012 at 02:08 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •