Jump to content
  • Advertisement
Sign in to follow this  
sheep19

[C++]Game rehaves differently when placed in a different folder

This topic is 2539 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I have a really strange logic error in my game.

The game uses SDL, box2D and irrklang and is done in Visual Studio 2010 Ultimate. I finished it today, so I copied the "release" folder to the desktop, to run inno setup and create an installer. Before I ran the installer, I tried the game (in the desktop). There was a problem.

Let me explain what's going on. The game uses box2D to create a joint between two objects, x and y, where X.y > Y.y. So I move X up, and Y goes up as well because of the joint I created. The problem is, when I put the release folder on the desktop, the game behaved like the joint didn't exist! X was moving up, but Y was not!

This has happened before in the default generated folder, but a quick "rebuild project" solved the problem. But now, even when the app is working correctly, when I move it in another folder, it behaves like that.

Has anyone had this issue as well? What might cause it?

Thank you.

Share this post


Link to post
Share on other sites
Advertisement
Do you have other copies of the Box2D library on your computer? Are they all the same versions?

Share this post


Link to post
Share on other sites
Hello.

I'm not familiar with Box2D, but it sounds like when you move your release folder you lose the "linkage" (lol making up words!), as in the Box2D library is no longer being linked in to your project.

Could this be the problem maybe?

Share this post


Link to post
Share on other sites
I don't think so, because I am statically linking with box2D, not with a dll (dynamically). All the dlls I'm using are inside the application's folder.

Share this post


Link to post
Share on other sites
What resource files are you loading?
What DLL files do you load? And that includes DLL files needed by any other libraries you are using.

Without copying the data from the original folder where it works, rename one of the parent folders to the project. Does it still happen? What if you Rebuild All from there?
What if you add a space to the path to the project?
D:/MyProjects/MyCoolGame/
-> D:/My Projects/MyCoolGame/


L. Spiro

Share this post


Link to post
Share on other sites
Try reproducing this by copying it back to the original folder. Most likely it's a bug in your game which didn't get caught until now.

The fact that you moved it to another folder may have nothing to do with it.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!