Help with understanding what needs to be debugged.

Post Reply
DanS
Posts: 4
Joined: Sun Apr 29, 2018 4:01 pm
Flag: United States of America

Help with understanding what needs to be debugged.

Post by DanS »

I have an open world game I’m working on, but I’ve hit error I don’t know how to fix. I’m in the process of creating an AI that remembers everything it learns about the map. I’m using dimensions such as ail(z,x,y) to denote that the AI of clan z has found a lake at point x,y. I’m also using variables such as aics(x,y) to denote that the AI for clan x has a value for the clan size of clan y. I’ve created a DIM for each of the variables used.

At some point when these variables start getting accessed the game ends and it kicks me to the debug screen where I can see the values for all the variables. I don’t know what it’d like me to do to fix the situation. Any help is appreciated.

-Dan S

DanS
Posts: 4
Joined: Sun Apr 29, 2018 4:01 pm
Flag: United States of America

Re: Help with understanding what needs to be debugged.

Post by DanS »

Never mind. Figured it out.

Henko
Posts: 814
Joined: Tue Apr 09, 2013 12:23 pm
My devices: iPhone,iPad
Windows
Location: Groningen, Netherlands
Flag: Netherlands

Re: Help with understanding what needs to be debugged.

Post by Henko »

Hi Dan,
Run-time errors are nasty due to lack of indication where they occur.
You could localize the location for instance by the following method:

Add a little function to your code : "DEF done(n) ! n=n ! END DEF
Then spread a number of statements in your code like done(1), done(2), done(3), and so on.
When the program jumps to the debug screen, look for the value of n in the "done" function.
If n equals 3 (for instance), the error occurred somewhere between the done(3) and the done(4) statements. By adding some more "done" statements in that interval, you can precisely locate the error cause.

I am very interested in sumulation games and can't wait for a first version of your's.

If you want us to help in specific error situations, a piece of code containing the offending code is necessary most of the time.

Post Reply