Game Development Community

ODEScript and TGEA 1.0.3 - linker errors

by Andy Hawkins · in Torque Game Engine Advanced · 05/12/2008 (8:28 am) · 32 replies

So I've been using this resource but not matter what lib I use I still get linker errors.

In this resource garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11767 the author says to generate my own ode.lib and use that - which I did.

I still get these errors...
ode.lib(convex.obj) : error LNK2005: "void * __cdecl operator new(unsigned int,void *)" (??2@YAPAXIPAX@Z) already defined in winMemory.obj
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _strstr already defined in LIBCMT.lib(strstr.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _strchr already defined in LIBCMT.lib(strchr.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
MSVCRT.lib(MSVCR90.dll) : error LNK2005: _realloc already defined in LIBCMT.lib(realloc.obj)
... etc
I've built ode.lib version 0.9 and added the include folder under 0.9. I've also added ode.lib to the Linker | Input | Additional Dependencies.

I'm using Visual C++ Express 2008 which might be the problem, but 0.9 is the latest version of ode I can find.

Any help would be GREATLY appreciated.
Page «Previous 1 2
#1
05/12/2008 (8:35 am)
Cool - fixed that one - added ode.dll to the same library folder as ode.lib and compiled... moving on...
#2
05/12/2008 (8:39 am)
Grrr... ran from Torsion - crashed... back to debugging... :(

I'm porting what I can from ODERocks into my game and try to get it running.
#3
05/12/2008 (9:26 am)
Well I've been stripping out the functionality of oderocks to put in my game, but while the boulder and cube import they don't fall to the floor or react to impulses... continuing on... sigh...

Anyone else had success getting ODEScript into TGEA 1.0.3 and getting ODERocks to work?
#4
05/12/2008 (11:29 am)
Quote:Well I've stripping out the functionality of oderocks to put in my game, but while the boulder and cube import they don't fall to the floor or react to impulses

Can you show the actual torquescript code you use to put it in your game?

I'd guess one of two things:
1) The ODEShape/tdBody relationship isn't set up
2) The physics is disabled [$pref::ODEPhysics::Server::EnableODE]

Just a thought.

Gary (-;
#5
05/12/2008 (11:55 am)
I made a tutorial for VS2005 that I completely forgot I made. It might be of some help.

ODE/Torque Install VS2005 Tutorial
#6
05/12/2008 (3:47 pm)
Thanks guys. @mb yes I found that rtf - thanks - that help me confirm that I was compiling the correct way.

@ Gary - I'm not sure how to set the prefs as there is no prefs file within oderocks, and I'm not sure how to test whether ODEShape/tdBody are setup.

I ran a debug session from VC++ Express 2008 and it crashed with this error...
Fatal: (c:\torque\tgea_1_0_3\engine\gui\core\guitypes.cpp @ 373) GuiControlProfile: unable to find specified profile (GuiDefaultProfile) and GuiDefaultProfile does not exist!
Seems to match the same point in the console.log...(also see the "Missing file: oderocks/physicsprefs.cs!" error)
--------- Initializing MOD: ODEScript ---------
Executing oderocks/physicsdefaults.cs.
Missing file: oderocks/physicsprefs.cs!
Executing oderocks/client/init.cs.
Executing oderocks/server/init.cs.

--------- Initializing MOD: ODEScript Server ---------
Executing oderocks/server/odescript/main.cs.
Executing oderocks/server/odescript/oderock.cs.
Executing oderocks/server/odescript/odesetup.cs.
Executing oderocks/server/odescript/servercmds.cs.
Executing oderocks/server/odescript/chain.cs.
Executing oderocks/server/scripts/game.cs.

--------- Initializing MOD: ODEScript Client ---------
Executing oderocks/client/ui/physicsopts.gui.
Warning: (c:\torque\tgea_1_0_3\engine\gui\core\guitypes.cpp @ 369) GuiControlProfile: requested gui profile (GuiDefaultProfile) does not exist.
Fatal: (c:\torque\tgea_1_0_3\engine\gui\core\guitypes.cpp @ 373) GuiControlProfile: unable to find specified profile (GuiDefaultProfile) and GuiDefaultProfile does not exist!
Warning: (c:\torque\tgea_1_0_3\engine\gui\core\guitypes.cpp @ 369) GuiControlProfile: requested gui profile (GuiWindowProfile) does not exist.
Fatal: (c:\torque\tgea_1_0_3\engine\gui\core\guitypes.cpp @ 373) GuiControlProfile: unable to find specified profile (GuiWindowProfile) and GuiDefaultProfile does not exist!
Error, a DecalManager (16e5ab0) isn't properly out of the bins!

Anyway, thanks guys - I'll keep trying to get this to work.
#7
05/12/2008 (3:53 pm)
Here's how I call ODE...

1. I copied odescript folder from client to client
2. I copied physicsui.cs into client/scripts
3. Then I copied the odeclient function out of client/init.cs and put into my client/init.cs
function initODEClient()
{
   echo("\n--------- Initializing MOD: ODEScript Client ---------");
   exec("./ui/physicsopts.gui");
   exec("./scripts/physicsui.cs");
   
   if(isObject(moveMap)) moveMap.bind( keyboard, c, togglePhysicsUI ); // ew


   // Setup ODE stuffs
   exec("./odescript/main.cs");
   setupODEClient();
}
4. I copied odescript folder from server to server
5. I copied the initODEServer from server/init.s into my server/init.cs but commented out the game.cs exec call as my initServer also calls it (guess I start to go off rails here)
function initODEServer()
{
   echo("\n--------- Initializing MOD: ODEScript Server ---------");
   exec("./odescript/main.cs");
   //exec("./scripts/game.cs");
}
6. In my server/scripts/games.cs in onServerCreated I add "setupODE();"
7. In my server/scripts/games.cs in onMissionEnded I add "shutdownODE();"
8. Put this code into server/main.cs in onStart (though this may cause problems - like is it not networked?)
// Default ode console values
    exec("./physicsdefaults.cs");
    exec("./physicsprefs.cs");
    
   // Load the scripts that start it all...
   exec("./client/init.cs");
   exec("./server/init.cs");


   // Server gets loaded for all sessions, since clients
   // can host in-game servers.
   initServer();

   // Start up in either client, or dedicated server mode
   if ($Server::Dedicated)
      initDedicated();
   else
      initClient();
   
   // Server gets loaded for all sessions, since clients
   // can host in-game servers.
   if (!$Server::Dedicated)
   {
      initODEClient();
	}
#8
05/12/2008 (5:44 pm)
Quote:Fatal: (c:\torque\tgea_1_0_3\engine\gui\core\guitypes.cpp @ 373) GuiControlProfile: unable to find specified profile (GuiDefaultProfile) and GuiDefaultProfile does not exist!

Sounds like you're using -game oderocks instead of -mod oderocks to start it. ODERocks is just a little mod to the default game using stronghold, not an entire game itself.

Regarding the entire moving stuff from oderocks about, I'd suggesting just trying to get oderocks running as a mod so you know all that is working correctly, before starting to change it.

Gary (-;
#9
05/12/2008 (8:04 pm)
Yes that would be correct, I am using game. I will do as you say and try again. Thanks for putting in the time to help me :)

I can't wait to get it working - there are buildings to blow up!!!!
#10
05/13/2008 (5:47 am)
So how does the mod work different to the game? What does it do to the game? I mean from a fundamental point of view, not specifically for the oderocks mod.
#11
05/13/2008 (6:09 am)
Hmm.. I loaded oderocks up with starter.fps found here... and got the errors (below) in the console.
www.garagegames.com/mg/forums/result.thread.php?qt=57563

I downloaded this version which works and has a space ork in it...
www.sentinelgames.com/download/Torque/starter.fps.rar

The ui comes up with the 'c' key, but when I try to add a boulder nothing appears. I suspect the errors below have something to do with it. Any help would be appreciated.

//-----------------------------------------------

Executing starter.fps/server/scripts/player.cs.
Executing starter.fps/data/shapes/spaceOrc/player.cs.
Validation required for shape: starter.fps/data/shapes/spaceOrc/player.dts
Executing starter.fps/server/scripts/aiPlayer.cs.
Validation required for shape: starter.fps/data/shapes/spaceOrc/player.dts
Executing oderocks/server/scripts/crossbow.cs.
Executing oderocks/data/shapes/boulder/boulder.cs.
Executing oderocks/data/shapes/simplecube/simplecube.cs.
Warning: shape oderocks/data/shapes/simplecube/SimpleCube.dts collision detail 0 (Collision-1) bounds exceed that of shape.
$odeworld: 1736
oderocks/server/odescript/odesetup.cs (15): Unable to find object: 'MissionCleanup' attempting to call function 'add'
oderocks/server/odescript/odesetup.cs (16): Unable to find object: 'MissionCleanup' attempting to call function 'add'
oderocks/server/odescript/odesetup.cs (19): Unable to find object: 'MissionCleanup' attempting to call function 'add'
*** LOADING MISSION: starter.fps/data/missions/simple.mis
*** Stage 1 load
*** Stage 2 load
#12
05/13/2008 (11:58 am)
Quote: So how does the mod work different to the game? What does it do to the game?

Look at it as a stack of things [each "thing" being a subdirectory off your top level]:

mod [whatever]
mod [oderocks]
game [starter.fps]
common

Each "mod" makes use of all the stuff below it. The "game" part uses stuff out of common, the first mod on the stack makes use of stuff from game and common, etc.

In my case, oderocks enjoys stuff in starter.fps, such as UI widgetry. Just trying to load oderocks as a game means that there's nothing in starter.fps currently in your stack of stuff. No stronghold mission, no textures, no main menu. Nada.


The other stuff there, I imagine that TGEA has a different work for "MissionCleanup". Honestly I can't actually use TGEA. Until two months ago I didn't have a windows box at all, and TGEA is way way way too high end [TGE only barely runs] for my pulled-off-a-trash-heap windows machine.

Ponders...

Hm. www.sentinelgames.com/download/Torque/starter.fps.rar. You know, perhaps the rocks are being created but not in the right place [like, under the terrain or something], originally oderocks was only really used with the original TGE stronghold. Try messing with the [hardcoded] spawn positions in oderocks/server/odescript/oderock.cs around lines 28 and 57.

Gary (-;
#13
05/13/2008 (4:22 pm)
Cool thanks for that description - I kinda get it. I'll have to make my own mod to full understand how it works.

When I moved the setupODE(); call to onClientEnterGame or after onMissionLoaded the MissionCleanup simgroup exists. I'll check out the spawning points next - thanks.
#14
05/13/2008 (4:55 pm)
Oh another thing - when I press the c key the UI appears for a second then disappears. Am I meant to hold the c key while I want access it? If so, how can I change it so it stays on.

I think I understand the mod thing now. So it means I can "mod" my game with ODERock (or any other mod I made) so I can build up a game starting from a base template and add "modules" to create the environment and features I need?

Can I ship a game this way?
#15
05/13/2008 (6:22 pm)
Quote:Am I meant to hold the c key while I want access it? If so, how can I change it so it stays on.
Yep. Probably by setting the keybinding to be a toggle instead of a simple on-off thing. Keep in mind that oderocks is my demo and experiment testbed, not a sincere effort at making a game :-)

Typically what you actually want to do is write your entire game in a single subdir. "mods" are used for things like... well, mods.

Gary (-;
#16
05/14/2008 (7:25 am)
Well the ODERocks works well in my game as a mod, only when I drop a rock it falls through the terrain. Do I need a terrain collider mesh or something? I figured not. Do you have any idea why it's falling through?

Do ODE objects collide of TGE/A objects natively or am I supposed to do something else?
#17
05/14/2008 (7:32 am)
This happens a lot too - just as the object falls through the terrain, an assertion is raised.

www.drewfx.com/BRAVE/ODERocks1.JPG
#18
05/14/2008 (11:21 am)
Quote: Do ODE objects collide of TGE/A objects natively or am I supposed to do something else?

TGE, definitely. ODEScript [specifcally ODEShape actually] chugs the torque collision kool-aid, in the function ODEShape::doCollisionStuff(). Perhaps TGEA doesn't do collisions the same way [check to see if the rigidshape code has needed to be changed].

If your collisions aren't even happening until that late, I suspect you need to do some variable tweaking, specifically $pref::ODEPhysics::Server::Tolerance [that you see in the screenshot you pasted above]. Ideally it should be set to zero so contact joints are only created when a body is directly in contact with another body, but in practice that doesn't work for various torque-related sniglet reasons. Set it to a bit higher [say, ten] and see if your collisions are working, albeit with the rock suspended ten units above the ground.

NormalMultiplier should be set to 1 most of the time. Less than one and you're gonna suffer stuff falling through the ground a lot.

If you read rigidshape's collision code, you'll see I borrowed from it "heavily". There may be all-round better ways to use torque collision information [polysoup, anyone?] but I never suffered any real problems with the stuff that's there. You'll specifically want to work a little more with polysoup if you want ragdolls to work the way ODEScript needs it.

For what it's worth, I eventually cheesed it with the cubes by making the collision mesh slighly smaller than the visible mesh, and increasing the tolerance a bit. Overall the effect looked the same but worked a lot better.

Gary (-;

PS Oh... perhaps you could try just enabling or disabling polysoup on the objects. I don't know what happens by default in TGEA
#19
05/14/2008 (3:59 pm)
Does polysoup do the same thing as ODE? Maybe I should just port to TGEA 1.7
#20
05/14/2008 (4:48 pm)
Polysoup is a substitute for other builtin torque collision stuff
Page «Previous 1 2