Editable Terrain Manager [v2.2 released]

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix »

But that is like half a million triangles? That sounds hard enough burden for the card already... (yeah, well, LOD would help though).
But you said ETM is not limited to a single mesh, right? Then, smaller manual "tiles" can be used for levels bigger than 1-2 sq.km.
Well, that also means that a powerful LOD needs to be put into physics as well.
The mistery of Yoda's speech uncovered is:
Just an old Forth programmer Yoda was. :)

Nulle rule sine exceptione (lat.)

User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

The OgreOpcode ETM code I created a while back breaks the ETM vertex/index data into Tiles. (a user defined number of Tiles 8) ) Assuming ODE can do general bounding box collisions to test if 2 objects collide, this would improve performance some.
Creator of QuickGUI!

User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix »

Yes it can, but not sure if it will be fast enough. well, I'll do some tests today, and if we can get it to run consuming like 5-20% of a 2.0 Ghrz Intel-Core (or similar) processor, than everything is perfect!

-EDIT- was looking for the ETM's code, and only found that link:
http://downloads.oddbeat.de/ETMv2.2_source.zip. So, I take it there's no CVS/SVN?
The mistery of Yoda's speech uncovered is:
Just an old Forth programmer Yoda was. :)

Nulle rule sine exceptione (lat.)

dbrock
Kobold
Posts: 30
Joined: Sat Oct 20, 2007 4:49 am

Post by dbrock »

So I'm using ETM for editing terrain in the level editor, would it be practical for single player mode to use TSM and import the data which ETM created (ie. heightmaps) or just keep using the same OctreeSceneManager, and steal the heightmap from TerrainInfo and pass that heightmap to the physics engine.

There won't be any terrain deformation in-game.

Also, for lighting in-game, would it be a good idea to not use lightmaps generated for the terrain, and just have the directional lighting take over?

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Post by CABAListic »

Up to you. You can use both TSM and ETM (the exception is that ETM supports more terrain sizes than TSM, so if you're using e. g. some non-square terrain, then TSM can't deal with it), if you're not doing any deformation, they're pretty much the same. Personally I still use ETM (go figure) because I don't like TSM's config files and because it allows for code sharing between editor and game if applicable.

As for the lighting: Lightmaps will definitely look nicer. In particular, dynamic lighting will NOT produce terrain shadows. And of course, lightmaps are less costly to render. If your directional light is static, then I would stick with the lightmap.

mikoro
Gnoblar
Posts: 2
Joined: Thu Nov 29, 2007 4:25 pm

Post by mikoro »

Is it possible to link etm statically? I'm having some problems with it... Here's the situation:

- I'm using vc++ express 2008
- compiled ogre and depencies with no problems
- successfully linked ois statically
- downloaded etm sources, upgraded the solution file and compiled with no warnings
- tested with the dll version, everything works fine
- changed etm project properties (configuration type -> static library)
- compiled fine
- replaced dll versions of the .libs with these static ones

And I get compile errors like these:

Code: Select all

1>PlayGameState.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ET::TerrainInfo::~TerrainInfo(void)" (__imp_??1TerrainInfo@ET@@QAE@XZ) referenced in function __unwindfunclet$??0PlayGameState@@QAE@PAVGameEngine@@@Z$1

1>PlayGameState.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall ET::TerrainInfo::TerrainInfo(void)" (__imp_??0TerrainInfo@ET@@QAE@XZ) referenced in function "public: __thiscall PlayGameState::PlayGameState(class GameEngine *)" (??0PlayGameState@@QAE@PAVGameEngine@@@Z)

1>PlayGameState.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall ET::TerrainManager::setMaterial(class Ogre::MaterialPtr)" (__imp_?setMaterial@TerrainManager@ET@@QAEXVMaterialPtr@Ogre@@@Z) referenced in function "public: virtual void __thiscall PlayGameState::initialize(void)" (?initialize@PlayGameState@@UAEXXZ)

etc...
I tried changing the ET_MANAGER_EXPORTS definition, but disabling it just produces lots of compile warnings (e.g. warning C4273: 'ET::loadHeightmapFromImage' : inconsistent dll linkage) and these new .libs don't fix the compile errors.

Any suggestions?

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Post by CABAListic »

You will have to completely disable the ET_MANAGER_EXPORT macro, i. e. in the header file, comment everything and just place a line

Code: Select all

#define ET_MANAGER_EXPORT
instead. Then you need to recompile both ETM and your project. This should get rid of that particular error.

mikoro
Gnoblar
Posts: 2
Joined: Thu Nov 29, 2007 4:25 pm

Post by mikoro »

Thanks CABAListic, I got it working now. My problem was that I had etm distribution in its own folder, where I made the changes and recompilations. Then I had another copy of the header file in my own project, which I didn't realize to change... :oops:

This header works for me:

Code: Select all

#ifndef __ETPREREQUISITES_H__
#define __ETPREREQUISITES_H__

#include <OgrePlatform.h>
#define _ETManagerExport

#endif
I had an another strange problem too. After compiling I noticed that the debug .lib was about 3 MB and the release .lib was 11 MB 8) Well I thought it was some windows quirks and continued working. Then after I got the etm linking properly, linker gave me odd warning about "Link time code generation". I was like wtf, and went back to etm build and I noticed that the "Whole program optimization flag" was turned on in the conversion. So I switched it off and got much more reasonable file sizes for the .libs...

MartinBean
Gnome
Posts: 331
Joined: Thu Oct 25, 2007 12:21 pm
Location: The Netherlands

Post by MartinBean »

Maybey I have overlooked the solution in this thread or ETM's wiki but:

When I try to compile ETM with the CVS version of Ogre(couple of days old) I get a compile error:

Code: Select all

c:\ogresdk\etm-2.2\src\etterrainmanager.cpp(141) : error C2259: 'ET::Impl::Tile' : cannot instantiate abstract class
        due to following members:
        'void Ogre::MovableObject::visitRenderables(Ogre::Renderable::Visitor *,bool)' : is abstract
        c:\ogrecvs\ogrenew\ogremain\include\ogremovableobject.h(470) : see declaration of 'Ogre::MovableObject::visitRenderables'
Visual Studio 2005

Anybody any idea how to solve this??
I have not failed... I've just found many ways that wont work

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Post by CABAListic »

Obviously Shoggoth defines a new pure virtual function which ETM isn't defining. You'll have to look at what that function is supposed to do and implement it. I won't provide support for Shoggoth until it hits release, sorry.

MartinBean
Gnome
Posts: 331
Joined: Thu Oct 25, 2007 12:21 pm
Location: The Netherlands

Post by MartinBean »

np, I sort of fixed it by just defining the function and leave it empty. However, when running I get a different error:

Code: Select all

The procedure entry point ?createManual@TextureManager@Ogre@@QAE?AVTexturePtr@2@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@0W4TextureType@2@IIHW4PixelFormat@2@HPAVManualResourceLoader@2@@Z could not be located in the dynamic link library OgreMain_d.dll.
I had to type it over, it might contain a typo

This error occurs when starting the program, while loading the DLL's(so before any user created code is started e.g. the main function).

I have looked at the createManual function in Ogre, but I dont see anything strange. I compared the parameters, and still I dont see anything strange. Is this still a Shoggoth thingy?? :?
I have not failed... I've just found many ways that wont work

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Post by CABAListic »

This is usually the kind of error you get when you have somehow mixed different versions of the Ogre DLL. Make sure that both ETM and your whole application is linked against the same version of Ogre and that it is this version of Ogre which gets loaded when your app starts.

MartinBean
Gnome
Posts: 331
Joined: Thu Oct 25, 2007 12:21 pm
Location: The Netherlands

Post by MartinBean »

CABAListic wrote:This is usually the kind of error you get when you have somehow mixed different versions of the Ogre DLL. Make sure that both ETM and your whole application is linked against the same version of Ogre and that it is this version of Ogre which gets loaded when your app starts.
I apologise... very stupid mistake of me. I've got it running now :D

For the people who want to run this with Shoggoth(current CVS version), do the following:

Open ETTile.h and in the public section of the class Tile add the following line:

Code: Select all

void visitRenderables( Renderable::Visitor*, bool debugRenderables = false ) {}
I have not failed... I've just found many ways that wont work

manxnakur
Gnoblar
Posts: 3
Joined: Wed Nov 14, 2007 2:33 am

From TSM to ETM :D

Post by manxnakur »

Hi,

let me start of by saying that this looks like a kick ass Terrain loader and editor!!!

I'm currently using TSM but it would be really cool if i could load multiple terrains/heightmaps and display them all on screen, when playing the actual game i'll be disabling terrains/sectors that are not in the view frustum. I've heard that ETM is capable of displaying multiple terrains. Is it possible for me to manually, or even better is there an automatic function, which disables the terrain sectors that are not in the viewing frustum? Also, how can i implement collisions with ETM terrains? I'm currently using OgreODE for the terrain collision, is it possible to use OgreODE with ETM?


Thanks in advance!

Ankur

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Post by CABAListic »

Well, as I said a couple of times, yes, in principle you can create multiple terrain managers and therefore display multiple terrains. However, you will not get them to align properly at the borders due to LOD mismatches. So for what you are trying to do (which sounds a lot like paging) ETM is most likely not suited. If you still wish to try, you'll have to manually manage your terrains.

As for collisions: I have no experience with physics engines so far, but you'll have to create a collision shape for the terrain somehow. ETM does not do this for you. Some physics engines have functions to create collision shapes from heightmaps, that would be what you need. Otherwise, you'll have to do that on your own. All in all, though, shouldn't be too different from what is necessary to get TSM terrain to OgreODE.

User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Post by tdev »

is there any way (i possibly overlooked) to load the TerrainManager Settings from a file (like the default TSM does)?

Like the included file "\media\ET\ETterrain.cfg" ?

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Post by CABAListic »

No, ETM doesn't provide a way to load them (one of the motivations of my design choices was specifically to get away from those config files). You could write your own function to do it, though.

User avatar
tdev
Silver Sponsor
Silver Sponsor
Posts: 244
Joined: Thu Apr 12, 2007 9:21 pm
Location: Germany
x 14

Post by tdev »

CABAListic wrote:No, ETM doesn't provide a way to load them (one of the motivations of my design choices was specifically to get away from those config files). You could write your own function to do it, though.
ok! (i really disliked the config file dependency of the default TSM)

i think your clean and KISS-style is really great to read and use :D
whats your project schedule? what features are planned?

CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 57
Contact:

Post by CABAListic »

I don't currently have any new features planned. Well, linking terrain managers together at the edges would be nice to have, but is not important for me, so low priority. Aside from that, I might implement the possibility to assign distinct materials to each terrain tile in order to allow for splatting performance optimisations, but that's pretty much it. I'm open to suggestions, otherwise it's just maintenance mainly. I'm currently concentrating on studies and our actual game project ;)

MartinBean
Gnome
Posts: 331
Joined: Thu Oct 25, 2007 12:21 pm
Location: The Netherlands

Post by MartinBean »

linking terrain managers together at the edges would be nice to have
That would be really nice to have!!
I have not failed... I've just found many ways that wont work

Chaster
OGRE Expert User
OGRE Expert User
Posts: 557
Joined: Wed May 05, 2004 3:19 pm
Location: Portland, OR, USA
Contact:

Post by Chaster »

CABAListic wrote:I don't currently have any new features planned. Well, linking terrain managers together at the edges would be nice to have, but is not important for me, so low priority. Aside from that, I might implement the possibility to assign distinct materials to each terrain tile in order to allow for splatting performance optimisations, but that's pretty much it. I'm open to suggestions, otherwise it's just maintenance mainly. I'm currently concentrating on studies and our actual game project ;)
How about this for a feature request - PCZSM Editable Terrain Zone version..? :wink:

User avatar
Aquatix
Goblin
Posts: 239
Joined: Sun Oct 14, 2007 8:10 pm
Contact:

Post by Aquatix »

PCZSM Editable Terrain Zone version..?
Actually, you can already do that. Just create a zone with the Octree Scene Manager, and create a piece of terrain in that zone. Works pretty well.
The mistery of Yoda's speech uncovered is:
Just an old Forth programmer Yoda was. :)

Nulle rule sine exceptione (lat.)

User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

CABAListic, sorry if I've asked before, but what Physics lib do you use in your project? I've decided to try out PhysX directly (no wrapper), but I'm having issues relating to creating the Terrain Actor based on the heightmap. I can execute my app fine, but I don't see anything displayed on screen. (I'm expecting to see a wireframe outline of the terrain, representing the actor)
Creator of QuickGUI!

jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Post by jjp »

CABAListic wrote:No, we are not using physics (well, except for the usual projectile trajectories which I'll do myself); reason being that we're using a network model which absolutely requires deterministic calculation on all clients. That rules out any floating-point calculations which rules out physics libraries.
Previous page ;)
Enough is never enough.

User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

I had this feeling in my mind that we had discussed it before. Sorry for my useless posts. :(
Creator of QuickGUI!

Post Reply