Game Development Community

Megaterrains: more than five terrains??

by Antonio Serrano · in Torque Game Engine Advanced · 04/05/2008 (9:47 am) · 10 replies

I was just testing the mega-terrains doing a 10x10 mega-terrain and I'm not able to put more than five terrains in the game.

I've put them in "0 0 0", "0 1024 0"..."0 4096 0" world vectors,... but when I try to put in the test the sixth terrain the engine crashes.

Really I don't know if this is a bug or a engine limitation or maybe I'm doing something wrong...

Thanks.

About the author

Recent Threads

  • DSO files?

  • #1
    04/05/2008 (9:49 am)
    Sorry I forget to tell the engine crashes when I add the terrain...even editing the terrain file and adding it in the file the engine crashes...
    #2
    04/05/2008 (11:25 am)
    Are you trying to put in 6 Mega Terrain's or 6 Individal terrains? Cause there is a big different. A MegaTerrain is 4 Terrain Blocks stitched togeather to form one MegaTerrain. If its 6 MegaTerrains that would turn out to be 24 Terrain Blocks. Thats alot of terrain to be trying to load up.

    Also what type of error message is it giving you on the crash?
    #3
    04/05/2008 (2:51 pm)
    I'm trying 6 indiviudal terrains.
    If I use the torque compiled in debug mode this is the error.

    D3DERR_OUTOFVIDEOMEMORY

    GFXD3D9TextureManager::_createTexture - failed to create texture!
    #4
    04/05/2008 (3:01 pm)
    Hmm.. That is interesting.. I will have to give this a test on my card and see what happens. What type of video card are you using?
    #5
    04/05/2008 (3:16 pm)
    I wasn't about to get it to crash. Had upto 25 terrains loaded before I stopped testing.

    It is worth noteing that you are looking at around 26MB memory per terrain (with the default values).

    I used a Geforce 8600 GTS 512mb card for testing. No crash with 25 terrains loaded up.
    #6
    04/05/2008 (3:24 pm)
    I think I know what's going on:

    Torque allocates a separate clip map for each terrain block. For blended terrains (which legacy terrains all are), these clip maps will not be allocated in the managed D3D pool but rather in the default pool (the DX9 texture manager bases this decision on the fact that they are used as render targets). In plain english, they will directly add to video memory pay load. How many terrain blocks a given configuration supports thus entirely depends on available video memory. (Thus your result, Thomas).

    //Edit: I should have added that this cannot be fixed trivially because texture render targets require this allocation scheme (i.e. it is not a mistake of the texture manager).
    #7
    04/05/2008 (3:31 pm)
    On a sidenote, Torque's error handling is in dire need of improvement. For just about most deviations from conditions the engine expects, Torque knows only one response: crash and burn.
    #8
    04/06/2008 (12:17 am)
    I'm using a GeForce 6600 GT with 256Mb of memory.
    My computer is a P4 Hiperthreading 3.20Ghz with 2Gb of memory.
    #9
    04/06/2008 (12:33 am)
    I've tested the demo on my wife's laptop....I know it's better than mine :)

    It's a hp nx9420 with mobility radeon X1600 with 256Mb of dedicated memory.

    I was able to put 15 terrains without any crash... (I've no tried more...)
    #10
    04/06/2008 (1:32 am)
    Ok, that seems abundantly clear then: I was wrong. Clip map allocation does not seem to be the culprit.