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 / Cannot use Char or dbText not working

Author
Message
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 23rd Apr 2008 19:18
Whenever I try to use dbText in my program or I try and use Char's in any way my program does not respond to it. This just happened a few weeks ago and I cant figure out why...

Is there a header file or something that allows C++ to utilize Char data types??

thank you!
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 23rd Apr 2008 19:19
It will actually freeze my program the first time it hits a dbText.. just something simple too, like.. dbText(50,50 "hello);
Very strange problem.
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 23rd Apr 2008 20:02
Are you looping? Is it possible that it's not actually frozen but rather in a loop where the display isn't getting updated properly?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 23rd Apr 2008 20:04
If you post some code we might have some idea of what is going wrong.

TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 23rd Apr 2008 21:08
It freezes the instant it touches the dbText, I simply have
dbText(50,50, "hello"); If I comment out the dbText call the game will compile fine. I have been using the dbText calls fine for months up until a few weeks ago when something went haywire and I cant use them at all now..

I tried other darkGDK programs that I made and the dark invaders example and dbText works fine in there, so I know my GDK files arent corrupted..

Posting code won't do you any good, the program is over 1000 lines of code, and like I said, whenever I hit the dbText it kicks out immediately.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 23rd Apr 2008 21:10
Like I said up top.. It definitely has something to do with char data types, because even if I comment out all the dbText calls, the program is still not functioning correctly in spots where it uses chars..
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 23rd Apr 2008 21:11 Edited at: 23rd Apr 2008 21:13
Quote: "It freezes the instant it touches the dbText, I simply have
dbText(50,50, "hello"); If I comment out the dbText call the game will compile fine."

Wait, you're saying it freezes when it touches dbText, yet it only compiles when it's removed? That doesn't make sense. How can it freeze if it hasn't been compiled?

If you can write a small app that reproduces the problem, we may be able to help you further. Otherwise, it's rather hard to figure out what's going on.

TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 23rd Apr 2008 22:04
I misspoke.. It will compile fine with the dbText call in there, but AS SOON as the program touches the tbText it kicks me out no matter where the dbText is in the program... If I comment out the dbText call it runs fine. I cannot post sample code until I get home, but I will as soon as I do get home.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 23rd Apr 2008 23:07
Have you changed the character set used by the application? It should be MBCS (Multi Byte Character Set)

TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 01:59
I checked, it was set to "Not Set" I set it to "multi-byte character set" and I am still getting the error.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 05:29
So I have more info now.. And how strange it is.

In my game I create multiple terrain blocks.. If I initialize more than 6 terrains, I cannot use dbText.. It doesnt matter which 6 I use.


As you can see above.. I have 3 of the terrain creation statements commented out.

Do they use the same memory space or something? How do I get around this?

thanks again!
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th Apr 2008 06:47 Edited at: 24th Apr 2008 06:48
I'm not sure that you've got a handle on the whole terrain ID thing. Where is this array terrain_block_reference[]? You do understand that you are wasting over 400,000 bytes of memory if you are not using the array elements below 101101, right? (Assuming it is an integer array, that is.)

I would recommend that you post up the command line used by the compiler and linker because I think that your project settings might be incorrect, and I'm also not sure what libs you are linking with. I see that you are using Sparky's...how are you accomplishing that? (LoadLibrary, perhaps?)

Anyway, that array is not good design in any event...What is the value at array_block_reference[101101], for instance...1, 2, 3...what? Large terrain IDs will waste memory in GDK, too.

That's also alot of terrains to be building at the same time. They take an enormous amount of memory each, and I'm sure they are also quite large, to boot.

In short, your project is probably not handling what are fairly unrealistic memory requirements, and also you may not have all of the project settings correct.

You should post up the command line for the compiler and linker. You can find them in the project properties pages, where the Character Set was located.

I think you can get it going, but you have some design issues that are not being addressed properly right now, and you will need to get it all sorted before proceeding, obviously.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 07:56
I had two arrays formatted as shown above, I now reformatted those as multidimensional arrays to conserve memory usage.



This did not help the problem at all. I am still stuck at using 6 terrains only.
There must be some sort of conflict somehwere between the terrain stuff and char usage..

Below is the output from the compiler, is this what you were referring to when you said "command line"?

------ Rebuild All started: Project: RakNet_DarkGDK_Combined, Configuration: Debug Win32 ------
Deleting intermediate and output files for project 'RakNet_DarkGDK_Combined', configuration 'Debug|Win32'
Compiling...
Sounds.cpp
Main.cpp
Generating Code...
Compiling manifest to resources...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Linking...
Creating library Debug\RakNet_DarkGDK_Combined.lib and object Debug\RakNet_DarkGDK_Combined.exp
SC_Collision.lib(Box.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(CollisionBox.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(CollisionPolygon.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(CollisionResults.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(CollisionSphere.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(CollisionTree.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(dllmain.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(Face.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(hMatrix.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(Object.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(Point.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(TreeFace.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
SC_Collision.lib(Vector.obj) : warning LNK4099: PDB 'vc80.pdb' was not found with 'D:\Program Files\The Game Creators\Dark GDK\Sparkys collision detection\lib\VS8\SC_Collision.lib' or at 'd:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\vc80.pdb'; linking object as if no debug info
Embedding manifest...
Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
Copyright (C) Microsoft Corporation. All rights reserved.
Build log was saved at "file://d:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\BuildLog.htm"
RakNet_DarkGDK_Combined - 0 error(s), 13 warning(s)
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th Apr 2008 08:09 Edited at: 24th Apr 2008 08:28
I meant these, but that is helpful for starters.





However, you are building a debug build, and I don't think you can do that, since you are using 2 third party libraries, which are not debug libraries, and also...it looks like your project settings are inconsistent with your build type.

Could you get me those command line settings?

Something else that is quite puzzling, you seem to be trying to combine RakNET and GDK while at the same time building Sparky's DLL. That's not possible, and it won't ever work, anyway.

Please don't take this the wrong way, but...that's not how you do it...use libraries together, that is.

The best way to do that is to have static librarry versions...first of all. They have the extension .lib, and not .dll

Next, if you want to build RakNET, that's a separate project...all by itself. Same goes for Sparky's.

Now, you can do all three (build static versions of the two libraries) and make your end application...all in 1 Solution, but not in the same project. Clear as mud, I'm sure.

I can help you set it up, if you want.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 08:18
C++
/Od /I "D:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Dark GDK - 3D Game1\RakNet" /D "_MBCS" /FD /EHsc /MTd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /nologo /c /ZI /TP /errorReport:prompt

LINKER
/OUT:"Debug\RakNet_DarkGDK_Combined.exe" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\RakNet_DarkGDK_Combined.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /NODEFAULTLIB:"libcmtd" /NODEFAULTLIB:"msvcrt" /NODEFAULTLIB:"atls" /DEBUG /PDB:"d:\Documents and Settings\Mike.MIKES\My Documents\Visual Studio 2008\Projects\Raknet_DarkGDK_Combine_Client\Dark GDK - 3D Game1\Debug\RakNet_DarkGDK_Combined.pdb" /SUBSYSTEM:WINDOWS /DYNAMICBASE /NXCOMPAT /ERRORREPORTROMPT RakNetLibStaticDebug.lib ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib

thanks for all your help man!!
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th Apr 2008 08:32 Edited at: 24th Apr 2008 08:52
NVM, I am still studying this. I assume:
That you have static release and debug versions of Sparky's and RakNET. Is that true?

Here is the static debug version of RakNET, for example:
RakNetLibStaticDebug.lib

It still appears you are not bringing in Sparky's correctly, however. i am not sure how that works, I don't have Sparky's. I don't see it in the libraries, either.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 08:53
I do have both static release and debug versions of RakNet yes.. I only know this because I have added both RakNetLibStatic.lib and RakNetLibStaticDebug.lib to my project..

I am assuming I have both versions of Sparky's as well.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th Apr 2008 09:10 Edited at: 24th Apr 2008 09:14
Okay, then...I am still a little confused about how Sparky's is being inserted into the mix...this is how you'd usually do it, I assume you already know that, but here's a pic of where you'd do that:


Now, I have highlighted the button that opens the Additional Dependencies dialog, as well as the Configuration drop list. The reason is that you must add the appropriate library for each type of build. RakNET is okay, it says its a debug library, but...I don't see Sparky's in there at all.

Are you using a #pragma directive to include Sparky's? (That would be the same way that you are including GDK libs.) If that is the case, then maybe that needs to change a little.

EDIT: Could you put the post you made about the command lines in a code block? It would make this display work alot better.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 09:19
C++


LINKER


I had Sparky's added into the C++ Directories, not in the individual project. I now added it in under additional dependencies for good measure, though that did not change how the program compiles or anything.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th Apr 2008 09:29 Edited at: 24th Apr 2008 09:37
Sorry, I meant...could you edit the posts above, and put them into code blocks, (there's two of them) so that it doesn't make my display so wide. (My monitor is only 1024x768, and the lines are too long, so I have to side scroll to read it.

Okay, but what is the library name (for Sparky's) that you used in the Debug configuration?

Also, did you try to build a Release build? (You can change that using the same property page...using the Configuration Manager button on the right.)
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 09:43
The library name is SC_Collision.lib

I just attempted to build a release build and I got some linker errors.. Ill have to look into how to get rid of them. Unless you have know off hand.. Below are the two errors I recieved.


TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 09:48
Ok I was using the Mtd instead of just Multithreaded, I got it compiled.. However I still get the same problem when I run the release compiled exe.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th Apr 2008 10:03
Are you running the exe in the Release folder? The exe goes in the Debug folder only for debug builds. It goes in the Release folder for release builds.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 10:09
Yes it is running in the release folder.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 24th Apr 2008 10:19
Okay, then...would you mind rebooting your computer, and running it again?
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 18:11
sorry I had to get some sleep, I will do this when I get home. However, I have made many debug builds over the past couple weeks as I have been troubleshooting this. I have restarted multiple times so I am sure this is not the issue.

So while I am waiting to get home and restart, if anyone wants to proceed this discussion as if I have restarted I would appreciate it.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 24th Apr 2008 18:19
RECAP..

Here is a recap of the problem in case anyone else feels like chiming in with an idea or suggestion..

When I build more than 6 terrains (with all my code not commented) or 7 (with some of my code commented) I cannot use dbText and I cannot use any "char" data types in my game at all.
TheeLord
16
Years of Service
User Offline
Joined: 23rd Jan 2008
Location: Chicago
Posted: 25th Apr 2008 07:07
RESOLVED!!!

For anyone reference in the future.. There is some sort of memory conflict when using lots of db terrains and char variable types. They do not play well together.

The other guy in my project created simple terrain .x files to replace the db terrains and it works perfectly now!

thanks for all your help, especially Jinzai!!

Login to post a reply

Server time is: 2024-11-20 09:11:38
Your offset time is: 2024-11-20 09:11:38