About Store Forum Documentation Contact
Donations:
140$/mo



Post Reply 
Strange Break/Continue Error
Author Message
Harry Offline
Member

Post: #1
Strange Break/Continue Error
Sometimes on some places when I'm flying or moving suddenly I get this error:

Unhandled exception at 0x0068f0ac in Tutorials.exe: 0xC0000005: Access violation reading location 0x00000000.

and green arrow on
void update(Vec &pos){update(pos.xz());} // update, 'pos'= center of action

from World.h.

I add a screen from Visual. Why I have it?


Attached File(s) Image(s)
   
(This post was last modified: 03-23-2010 04:59 PM by Harry.)
03-23-2010 04:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Strange Break/Continue Error
thanks for the info, however it is possible that you have an error somewhere else in the codes.
1-are you sure you're using correct headers+lib file?
2-I could take a look at your codes (you can send them to my email)
03-23-2010 05:33 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #3
RE: Strange Break/Continue Error
1. Yes.
2. I sent it.
03-23-2010 09:50 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Strange Break/Continue Error
There are too many codes so I could check them all.

how frequently you have this error?

In your situation I'd check if you correctly save/load all objects (if << are matched with >> in save/load methods)
-try rebuild your world first (remove all previous save games if you were using them for testing)
-if you still have this problem, try disabling creation of some objects (for example don't load cars), maybe the problem will narrow down to a specific class
03-26-2010 01:07 AM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #5
RE: Strange Break/Continue Error
I have this error always when I fly some time outside the prison near parking (I don't check how situation looks in another places).

1. All << >> are set ok.
2. Rebuild doesn't help.
3. When I disable AI objects error disappear so I'll try to find the problem somewhere in AI.cpp.
03-26-2010 12:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #6
RE: Strange Break/Continue Error
you have one small error, but I doubt that this is causing the problem:

Chr::die
if(Players[0].level<20)Players[0].exp+=expAdd;

you dont check if the 0-th object exists in the container

first do if (Players.elms())



check AI.cpp and also all other codes which refer to the AI
03-26-2010 03:59 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #7
RE: Strange Break/Continue Error
I'm not sure in 100% but error is probably associated with waypoints in AI.cpp, but I don't know whats wrong. Should I save/load them? I save and load only waypoint name. I add a photo with strange direction values.

BTW: I have another error in game which is only when I'm flying. Sometimes all collisions with objects disappear and player is like a ghost. I had it before but forgot to write it.


Attached File(s) Image(s)
   
(This post was last modified: 03-26-2010 08:01 PM by Harry.)
03-26-2010 07:58 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #8
RE: Strange Break/Continue Error
I made more tests in different situations and I found that this problem is only when player is flying. I run about 5 minutes around area where I usually obtain error and nothing happens. But when I turned on flying and flew about 3 meters I got this error again.
03-28-2010 12:17 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #9
RE: Strange Break/Continue Error
all of the members have incorrect values, perhaps you've used c++ optimizations enabled in your project settings?

when you're flying, you're travelling faster, when you're travelling faster, the methods for unloading/loading world areas are called more often.

I've tested flying through the hole level in Bloody Massacre demo, but haven't encountered any error.

You could try to disable loading the Player object,

and then just move the camera through the whole world a little.
03-28-2010 12:28 AM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #10
RE: Strange Break/Continue Error
(03-28-2010 12:28 AM)Esenthel Wrote:  all of the members have incorrect values, perhaps you've used c++ optimizations enabled in your project settings?

when you're flying, you're travelling faster, when you're travelling faster, the methods for unloading/loading world areas are called more often.

I've tested flying through the hole level in Bloody Massacre demo, but haven't encountered any error.

You could try to disable loading the Player object,

and then just move the camera through the whole world a little.

No, I set it to disabled.

I disable Player and set camera like in Small Overlays tutorial. I moved camera through all prison and I got this error again still near the same place.
03-28-2010 11:32 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #11
RE: Strange Break/Continue Error
please try narrowing down the error - remove loading all objects / commenting out more codes step by step, so your project will get smaller, but the error still occurs

if you'd like I could test this by myself. but I would need your world data, (and updated codes since the last changes that you made - if any)
03-28-2010 03:17 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #12
RE: Strange Break/Continue Error
When I comment case AI_GUARD I have no error:

Code:
            switch(type)
            {
            case AI_PRISONER:
                if((time_to_random_move-=Time.d())<=0)
                {
                    if(!action)
                    {
                        actionMoveTo(pos()+Random.vec(-3,3));
                        time_to_random_move=RandomF(3,10);
                    }
                }
                break;

            case AI_GUARD:
                if(Game::Waypoint *waypoint=Game::World.findWaypoint(waypointName)) // if waypoint exists
                {
                    if(!action)
                    {
                        if(!move_walking)move_walking=true;
                        move_to=(move_to+1)%waypoint->points();
                        actionMoveTo(waypoint->point(move_to).pos);
                    }
                }
                break;
            }

Do I have something wrong in this code?
(This post was last modified: 03-29-2010 08:27 PM by Harry.)
03-29-2010 08:26 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #13
RE: Strange Break/Continue Error
it looks ok, please keep AI_GUARD uncommented, and try to comment more of other codes, to narrow down the problem
03-29-2010 08:39 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #14
RE: Strange Break/Continue Error
All save, load and draw functions etc. comment too? Or only this what is in update? If I comment setObjType should I comment codes for this objects or they are automatically not used?

I comment all setObjType except Player and AI. In Player.cpp I comment everything except player movement. In Ai I comment everything except this switch which I showed in last post. I comment also another codes in Game like weather, explosions, bullets, game saving, not used camera modes, inventory etc. and error still occurs.

I have no error only when I comment actionMoveTo(waypoint->point(move_to).pos); line.
(This post was last modified: 03-29-2010 09:37 PM by Harry.)
03-29-2010 09:14 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #15
RE: Strange Break/Continue Error
please comment as much as you can.
when you'll get to the point that you can't comment any more codes then let me know smile

I'll investigate the problem then, by checking your minimized version of the codes. (send me then the codes)
03-29-2010 11:08 PM
Find all posts by this user Quote this message in a reply
Post Reply