Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / dbLoadObject broken?

Author
Message
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Aug 2009 13:15
Well, I'm using the May 2009 Update, and somehow I can't seem to load my world that works fine in DBP. I'm using this code:


Yes, I did define WorldID... But this just does nothing, it doesn't error, it doesn't load the object nothing. I tried a check in the loop wether it existed or not and it still said it didn't exist. I tried replacing the WorldID with simply 1 and no effect at all.

Am I just being stupid here, or is it really broken?

Oh, and while I'm posting here... Dark Physics gives me an error I don't get on this line:


The error is:



It's not the world that turns against you, it's you that turns against the world.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 16th Aug 2009 13:26
If you are using GDK7.4 then you need to download the second library that mike posted, and also the core/system update he posted a little bit further down to fix the 3D object problem.

Im sure they will put it all into a single update eventually, but 7.4 should be considered beta until you hear otherwise.

You DarkPhysics error is caused because you need to tell your linker where to find the library that contains the commands and you havent done that yet. Including the header is just the first step, you still need to make sure the static library is where it will be found by the linker, I put mine in the GDK folder, but you will still need to tell the compiler to include it. Right click your project, goto linker->input->additional dependancies and add DarkPhysics.lib to the list.

If it ain't broke.... DONT FIX IT !!!
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Aug 2009 13:41 Edited at: 16th Aug 2009 13:47
I think the May 2009 update is 7.3, not 7.4

And that makes sense I guess.(The Dark Physics thing) Though if I right click my project it doesn't give an Linker option :/

EDIT : OK, figured the linker thing out, but now it nags me with this:



It's not the world that turns against you, it's you that turns against the world.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 16th Aug 2009 14:27
looks like you have told your linker to look for something that doesnt exist.

For darkphysics, Rightclick the project name, then select options..
in the following window, select... Linker, then Input, then on the right, Additional Dependancies, click on that field and add "DarkPhysics.lib" (make sure the darkphysics.lib is somewhere in the linker search path, stik it in the GDK lib folder to be sure)

If it ain't broke.... DONT FIX IT !!!
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Aug 2009 14:38
Doing that gives these errors:





It's not the world that turns against you, it's you that turns against the world.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 16th Aug 2009 15:02
make sure you tell it to use the Multi-Threaded library... not Multi-Threaded debug(yes, even in debug mode)

Right click you project, select C++ -> Code Generation, then make sure "Runtime Library" reads "Multi-Threaded" .. rather than "Multi-Threaded Debug"

If it ain't broke.... DONT FIX IT !!!
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Aug 2009 15:09 Edited at: 16th Aug 2009 15:37
Ah! That worked, Thanks.

EDIT : I can't get dbLoadObject to work on any version of DGDK. Maybe it's just Windows 7 having issues with it, but any other 3D command works fine :S

It's not the world that turns against you, it's you that turns against the world.
_Pauli_
AGK Developer
15
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 16th Aug 2009 15:38
Hope this helps with your dbLoadObject issue:
do you know that you have to put a "\\" where there is a "\" in your objects path? ( c++ <> darkbasic ! )

you posted this:


what should be:
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 16th Aug 2009 15:50 Edited at: 16th Aug 2009 15:50
Doesn't your compiler complain about the single backslashes in the file name? (The usual error message is "unrecognized escape character" or something like that.) Exchange them for either double backslashes or (single or double) forward slashes.

Quote: "I tried a check in the loop wether it existed or not and it still said it didn't exist."


That means there is nothing wrong with dbLoadObject, the problem is that the file is not found. The characters after the single backslashes are practically removed from the file name.
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Aug 2009 15:52 Edited at: 16th Aug 2009 15:54
Still nothing, and no it never complained. It never even reaches the main loop because it keeps nagging me about the fact it's loading.

EDIT : My full code for reference



It's not the world that turns against you, it's you that turns against the world.
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 16th Aug 2009 16:16 Edited at: 16th Aug 2009 16:22
Change those backslashes:




Also, you can use the dbFileExist command to check whether the file is found or not. That at least will tell you if the problem is with the file location or with the loading.

If the file is found but loading takes forever, you can also try to compile in release mode and run the program outside Visual Studio to see if it manages loading like that. (Note that the working directory is different in that case, so you need to place your dbo file to be in the correct relative position to the exe.)
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Aug 2009 16:39 Edited at: 16th Aug 2009 17:22
Apparently it doesn't exist, while the exact same code and filestructure works fine in DBP... And running it outside the editor just locks it up.

EDIT : Seems like it was looking in a different directory then I assumed.
EDIT2 : It also seems DGDK is slow as HELL on loading objects I had it take a minute over something that loads in a few seconds in DBP, and some things it just locks up on even though it does exist.

It's not the world that turns against you, it's you that turns against the world.
Mista Wilson
16
Years of Service
User Offline
Joined: 27th Aug 2008
Location: Brisbane, Australia
Posted: 16th Aug 2009 18:01
Quote: "It also seems DGDK is slow as HELL on loading objects"


You must be doing something incorrectly. GDK is if anything at least the same, if not faster, than DarkBasic Pro. Perhaps there is some discrepancy in the file itself that GDK doesnt like but DBP lets slide...

I imagine if you removed the Physics build command aswell :

dbPhyMakeRigidBodyStaticMesh(WorldID);

you would notice a large speed increase in loading, im assuming world.dbo is a large "entire level" type file.. It may be an idea to load it up and generate the physics mesh and save it out again, so that you can just load the physics mesh rather than generate it each time.

Also, you need to call:

dbPhyStart();

before you call any other physics commands or they will fail, maybe that has something to do with it too.

If it ain't broke.... DONT FIX IT !!!
Red Eye
16
Years of Service
User Offline
Joined: 15th Oct 2008
Location:
Posted: 16th Aug 2009 20:39
Silvester what am I seeing?

Good Luck

Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 16th Aug 2009 21:07
Right, now everything works and whatever, but now I have the amusing issue that nothing gets repositioned... Everything stays at 0,0,0 even though I told it not to.



Any pointers as to where I went wrong? Or is this an issue with 7.4a?

It's not the world that turns against you, it's you that turns against the world.

Login to post a reply

Server time is: 2024-11-20 17:41:17
Your offset time is: 2024-11-20 17:41:17