Hi friends.

A small update. I was having alot of trouble when it came to pathfinding and reading values from an array. When the level computes the paths in the beginning and fills the array, the AI's move normally laugh But when I saved out this same array to a txt file, thats where things got bad. (I wanted to save to TXT to save from having to compute the A* every time the level is loaded)

When my AI's were using the array that was filled from a TXT file, they glitched out and gave me a bunch of errors I've been wracking my brain trying to figure out. Tried alot of different things and still couldnt get it to work. Making sure it was filling the correct values, looking at huge notepads with too many numbers, seeing if the index was off etc etc frown

But then I tried game_save! with SV_INFO as the flag, and then renaming this big path array with an _i at the end, I was able to load the saved array into the level using memcpy, without having to reload the level.

I will do more testing, but here is pseudo code of what I plan to do:

main()

1.find the level_name of the level
2.see if there is a saved Node.sav that matches the level name
3.if there is a save file that exists, that means the paths were computed
4.Load the .sav game then memcpy the path array into the working path array
5.Run level
6.If there is no save file that matches the level name
7.Run path calculation and fill the array
8.Create a save file and save the _i arrays
9.Run level

The initial TXT file was also pretty big. I made a worse case scenario, with an array of 999999, with a 0 in every slot, and this txt file came out to be around 5 megs. But saving these arrays in a .sav, the .sav comes out to be only 461 kilobites! The manual says .savs are compressed laugh

Last edited by jumpman; 05/22/17 19:35.