Another connundrum, anyone can help? (Game for you if help!)

Post Reply
Daniel Baines
Posts: 25
Joined: Tue Jul 28, 2015 12:40 am

Another connundrum, anyone can help? (Game for you if help!)

Post by Daniel Baines » Mon Aug 17, 2015 10:32 pm

Hi guys. Thank you SO much for solving the roads issue. Its making the development of my Vulcan expansion pack go fantastically. Even the remaining small bugs can now by fixed.

However... there is another issue that has been really bugging me.

WHOEVER CAN SOLVE THIS WILL GET A DOWNLOAD LINK TO A NEW GAME - NO BUGS OF ANY KIND (even the ai plays ok!) nobody else has received this game.Its a recreation of the Italian invasion of Somalia.

I still can't make maps more than 60 squares wide.

This is because of the AI.

I can make the maps, and they'll work perfectly as a '2 player only bonus.' But that will kindof suck as most people don't have friends who play Spectrum games with them!

When you change the map to make it more than 60 squares wide, the AI will still only play within the first 60 squares accross. If you manually place a unit of troops out past the 60 square mark, the AI will then crash. The game is totally stuck.

I have uploaded a snapshot. The snapshot has all map graphics remoed, all roads removed, all spawn points placed within the first 60 squares, etc. All units of troops are zeroed out too...

Except for one test unit. This test unit sits on a map 133 by 45 quares (default is 60 by 100.)

I have made it so there are as few variables as possible, for testing. Could someone take a look at it for me? The test unit is placed at 58 map squares accross (the 60 squares go from x axis 0 to 59) so, placing the test unit a further 2 squares to the right will crash the game. To achieve this crash, press the right arrow key twice, press enter, and follow it through to 'forces moving.' You can then poke 54406 to 5 to switch control over to the AI. Press enter and the AI will have taken over, and crashed the game. So, you have the option to see the AI in a non crashed and a crashed state.

Could anyone say what is causing this crash, and how to solve it?

https://drive.google.com/file/d/0BxhNrn ... sp=sharing

Memory addresses of interest: 50973 and 50974 - the x and y coordinates of the test unit (currently at 58 0. Crash begins at 60 0.)
54270 and 54271 - sets the actual map size. Default 60 100, but currently at 133 45 (my desired 'mega map' proportion.)
49049 and 49050 - POSSIBLE area of AI, may be a limiter of AI map recognition. I have played with it, to no avail. Maybe it isn't what I think it is. (default 59 99, so left it at that as it wasn't helping.)
54273 and 54274 - setting of viewable map area when moving the cursor. Doesn't change the actual map, just sets limitations on cursor and AI boundaries. (currently at 132 44, default 59 99.)
50821 and 50822 - x and y coordinates of a map property. This is a spawn zone and supply controller in the game. Moving any map property x coordinate to greater than 59 (the 60th square accross) will crash the game too, just like if a unit is moved. However, to reduce variables, all spawn points in my snapshot are within allowable limits.

The snapshot:

https://drive.google.com/file/d/0BxhNrn ... sp=sharing

FINGERS CROSSSED! This is another problem I've been having for 8 years. Lets hope its as simple as the last one!

IanB
Posts: 59
Joined: Mon Jul 27, 2015 4:40 am
Location: Northampton UK

Re: Another connundrum, anyone can help? (Game for you if he

Post by IanB » Tue Aug 18, 2015 8:16 pm

Just guessing, I will probably be wrong again ;) but 64 is 6 bits of binary. So it may be that the AI coding can address 64 squares, with 2 on each border not in the map, but for "overflow" when using its algorithms. That would mean that giving it a larger number breaks the AI code. If that's the case, the code might need a major rewrite to accept larger maps. For instance, it may be using 6 bits of a byte for location, and the other two bits as flags of some kind.

Daniel Baines
Posts: 25
Joined: Tue Jul 28, 2015 12:40 am

Re: Another connundrum, anyone can help? (Game for you if he

Post by Daniel Baines » Wed Aug 19, 2015 1:09 am

Hmm... possibly. I'll look into it. But I'd be surprised if that was the answer. I know the other RT Smith wargames use maps more than 60 squares wide, and he uses similar coding techniques between games. Also, he made different versions of 'Desert Rats,' and changed the map size. So there must be a way without completely reprogramming. Unless he did. Can't rule out your explanation. But I'm at a total loss as to how to even begin looking into it.

Rishi
Posts: 107
Joined: Mon Jun 08, 2015 5:57 pm
Location: Amsterdam

Re: Another connundrum, anyone can help? (Game for you if he

Post by Rishi » Thu Aug 20, 2015 4:04 pm

I don't know the game, and how it is actually set up, but i suspect that the AI creates a virtual map in memory into which it plays possible scenarios, and that for this it has a dedicated memory allocation max size 60x100 and that the positioning is done by increasing jump in memory location by 100 bytes for every x line. creating something beyond the max normal limits will cause an incorrect area of the memory to be changed which would cause it to crash. you will have to decode the AI and go through it's workings, which extra memory resources does it use and how does the AI determine what it should do. either that or what Ian is saying that the variable for the coordinates is out of range but this seems to me not so like to cause a crash, also normally that would occur above 255x255. So look at the workings of the AI, what does it do with the info it has, how does it determine strategy ?
32K SRAM WRX compatible, 32Bit IO-Port, ROM Ghost, ZX-Printer.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest