impossible reinforcements for spain

Parsec

Chieftain
Joined
Dec 4, 2015
Messages
24
hi guys

i registered to post you a crashing savegame. loading works normal with this savegame but if you try to go to the next round the game will stuck....

reason for this is some spanish atlantist which is crying for reinforcement... again and again (at least regarding the BBAI-log). I deleted them to play on :)

maybe this will help you to improve this mod, which is realy awesome imho.
 
Cavemen2Cosmos V36 BtS 3.19

so should be latest version (download around 2 weeks ago)
 
I'm quite happy to take a look here tomorrow. I'm also hoping that it's already been solved on the latest SVN. It might be. But I'll take a look anyhow and let you know what I find.
 
I'm looking into this and it looks like I'll be stuck on this problem for a while here. It's still a valid problem on the current SVN version. Looks like a unit joins an attack stack, then the stack offloads the unit then when it checks if units need updating, the same unit comes up again, joins the stack again, causing the stack head unit to update again and it again offloads the unit. Rinse and repeat indefinitely.

What I'm struggling to find is where the unit gets offloaded. Once I find that I may be able to solve this.
 
UPDATE:
Ok, I've found the solution here. When a unit in the city attack stack was being offloaded to go defend the city because the city apparently needed the defense, it wasn't changing the AI type of the unit. The stack would later call for a loose city attack unit that may wish to join in their building stack effort and the unit just offloaded would answer the call when it came time to update it's decisionmaking after it had been offloaded.

Telling the unit it was supposed to be a city defense unit now was the primary trick involved in fixing the loop. It then hit another infinite loop I was able to resolve by giving a proper boolean response where it needed one.

Complex. Horrifying. The City Attack AI is... imo a mess. But it's a mess that's grown out of the hundreds of considerations that city attack AI needs to make. At some point it needs restructured but it's going to be either very tricky to do or would be best to do from the ground up. I'm thinking of chipping away at the latter option eventually.


At the moment I gotta go out for a bit but I'll commit with the fix as soon as I can. To get the repair, you'll need to start working with a current SVN version once committed.
 
okay.. i admit.. i cannot follow your thoughts.. :confused:
what i get is, that someone need to go to a mud-bath (called AttackAI) and need to clean up there :)

i will be excited to test the next mod-version :)
 
Hi guys

same situation again. the game stuck on the change to the next round again...

unfortunaly this time it seam nothing todo with the BBAI.. the log is "empty"... last action was from one of the ai.. but the time the last action was done is already past away...


edit: last svn
 
Hi guys

same situation again. the game stuck on the change to the next round again...

unfortunaly this time it seam nothing todo with the BBAI.. the log is "empty"... last action was from one of the ai.. but the time the last action was done is already past away...


edit: last svn

I'm on the case with this one. Looks like it'll be a little complex but I'm sure I'll be able to get to the bottom of it by the end of the week.
 
Resolved. Enjoy! (Actually... thanks for finding this. It wasn't easy to sort out but very rewarding in terms of improving turn times, not just for solving the infinite loop.)
 
i have to thank you...

btw is there a way i can find such a reason by myself?
btw what was the reason?
 
I had used a function I really didn't mean to use that was very similarly named to the one I was after. I never got fully to the bottom of it but the function I used shouldn't have been called in the way I was calling it and the loop was somehow caused there. Was deep in the AI code. I'd have to explain nearly everything I know to explain how to fix this and that's a few years of learning it took me to get this depth of a fix.

It helped that it was in my own programming and I could spot the problematic behavior and its culprit without having to dig all the way down to exactly what was causing the loop.
 
Top Bottom