Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Controlling the player bug! plz urgent

Started 1 month, 1 week ago by prchakal
Hi people, I have a problem that i dont understand why it happen. I set on my listener a player object and when i create the listener i pass the main player pointer to the attribute player from my listenner, and in the listener i check key press and change player position. But the bug is that when i try get player information or other information about objects that i pass after listener ...
Site: Ogre Forums  Ogre Forums - site profile
Forum: General Discussion  General Discussion - forum profile
Total authors: 8 authors
Total thread posts: 25 posts
Thread activity: no new posts during last week
Domain info for: ogre3d.org

Other posts in this thread:

jacmoe replied 1 month, 1 week ago
No way I am going to waste my time debugging your code. Do yourself a huge favour and learn how to debug . The way you do it, is to get real close to where it fails, by using Step in, Step over, etc. And by setting a breakpoint closer and closer to where it fails. Learn how to use your debugger. Make it your best programming friend.

prchakal replied 1 month, 1 week ago
Man im a programmer for 7 years. Im using visual studio a long time and know how to debug. The problem is not with debug, the problem is to debug OGRE APPLICATIONS. The problem on debug only happen on OGRE!!!! If i play the OGRE APP appear a message that i dont know to solve and dont know why it apper, but the application start normal if executed direct by EXE. You can read my message before...

reptor replied 1 month, 1 week ago
Take code out of your program, block by block, and see when it stops crashing. Then you can start adding code back, and see which line causes the crash.

nikki replied 1 month, 1 week ago
Haven't used VS in a while, but as far as I remember, you probably have to fix your working directory in the debugger settings to the directory where the .exe resides. Also, posting the message that you get can help.

jacmoe replied 1 month, 1 week ago
If you are running Ogre in fullscreen mode, don't. It makes it nigh impossible to debug, unless you're debugging it remotely.

prchakal replied 1 month, 1 week ago
Im already do it man!!! Im saying that i dont know what happen. To me its ok, only move a node!! The code only initialize the Ogre and put the 3 meshes on scene. After this the listener verifiy if W is pressed, and call player->update(evt.timeSinceLastFrame, mKeyboard). But the error happen in the class player, when i use this->node->setPosition or anything on this->node crash the program....

nullsquared replied 1 month, 1 week ago
It's trying to access 0xfeeeff63, which is probably a debugger-set memory address for an initialized pointer. Are you sure your "node" point is valid?

jacmoe replied 1 month, 1 week ago
You are lucky, because you know where it happens. Put a breakpoint right where you detect that key-press, and look at the stack. You may have to walk the stack a bit to reach your own code, but it will show you what's going on. You might need to add additional breakpoints, and use the debugging stepper to slowly move towards where it all fails.

prchakal replied 1 month, 1 week ago
I think yes, because if i change the code: Code: Select all if (input->isKeyDown(OIS::KC_W)) { Vector3 pos = node->getPosition(); //<- bug on try access node? but it create sucefully before pos.y += 1; node->setPosition(pos); } to Code: Select all if (input->isKeyDown(OIS::KC_W)) { exit(EXIT_SUCCESS); } It run OK and exit. The problem is when i try access the ...

wacom replied 1 month, 1 week ago
This code of yours is really really evil. Try to name your variables a little bit more ... variously. Code: Select all class EngineFrameListener : public FrameListener , public WindowEventListener { // ... void setPlayer(Player *player) { player = player; } // ... //player Player* player; }; BTW, I couldn't really debug your code (sorry!!), because ...

 

Top contributing authors

Name
Posts
prchakal
11
user's latest post:
Controlling the player bug! plz...
Published (2009-11-14 06:08:00)
Bug solved, the problem is the default option of config screen: RTT Prefered Mode of OpenGL. If i change from FBO to other, it run normal and now i can debug. Thanks ppl.
jacmoe
6
user's latest post:
Controlling the player bug! plz...
Published (2009-11-13 17:23:00)
I am curious about that 'node' variable.. Is it going out of scope? How is it declared and defined?
nikki
2
user's latest post:
Controlling the player bug! plz...
Published (2009-11-12 23:01:00)
prchakal wrote: Oh man...thanks very much! I forgot the 'this-&gt;' on method 'setPlayer'. The real solution is to name your member variables differently from local variables so that they don't get shadowed. A common idiom used is to prefix with 'm' or 'm_' or '_' to keep them seperate, like mPlayer. Doing 'this-&gt;' every time is not really a solution IMHO.
Kojack
2
user's latest post:
Controlling the player bug! plz...
Published (2009-11-13 15:32:00)
Here's a handy reference on magic debug values: http://en.wikipedia.org/wiki/Magic_debug_values All programmers (using visual studio) should memorise the meaning of at least cdcdcdcd, cccccccc and feeefeee, they are the most common ones. Your error message says &quot;Access violation reading location 0xfeeeff63&quot;. feeeff63 is an invalid memory location, so visual studio is stopping you from reading it. The fact that the bad...
wacom
1
user's latest post:
Controlling the player bug! plz...
Published (2009-11-11 23:00:00)
This code of yours is really really evil. Try to name your variables a little bit more ... variously. Code: Select all class EngineFrameListener : public FrameListener , public WindowEventListener { // ... &nbsp; &nbsp;&nbsp; &nbsp;void setPlayer(Player *player) { &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;player = player; &nbsp; &nbsp;&nbsp; &nbsp;} // ... &nbsp; &nbsp;&nbsp;...
nullsquared
1
user's latest post:
Controlling the player bug! plz...
Published (2009-11-11 22:26:00)
It's trying to access 0xfeeeff63, which is probably a debugger-set memory address for an initialized pointer. Are you sure your &quot;node&quot; point is valid?
reptor
1
user's latest post:
Controlling the player bug! plz...
Published (2009-11-11 21:50:00)
Take code out of your program, block by block, and see when it stops crashing. Then you can start adding code back, and see which line causes the crash.
DanielSefton
1
user's latest post:
Controlling the player bug! plz...
Published (2009-11-13 16:34:00)
What version of Ogre? If it's trunk, I also had a problem with random crashes at initialisation. If not, then you're doing something wrong. Instead of screenshots, how about you post your code in [code ][/code ] tags?

Related threads on "Ogre Forums":

Related threads on other sites:

Thread profile page for "Controlling the player bug! plz urgent" on http://www.ogre3d.org. This report page is a snippet summary view from a single thread "Controlling the player bug! plz urgent", located on the Message Board at http://www.ogre3d.org. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity