Workboats no longer automated

isenchine

Empress
Joined
Oct 18, 2010
Messages
1,774
Location
Brussels, Belgium
I must have messed up a file when merging several mod components but my workboats can no longer be automated to find sea food. Well, they can but they simply ignore the orders and stay at the port! I have to direct them to the place myself.

More annoying is that it affects the AI because this bug prevents it to use fishing boats properly.

I'm not a coder myself so I don't even know which file to check and where. Could somebody point me to the place where to look for?

Thanks in advance.
 
UNITAI_WORKER_SEA. No change here.
 
No. (ah ah: message too short - should be 5 characters at least! :D)
 
mmhh...are all the debuging options enabled?
(not sure which I'm meaning...everything what looks like one in the .ini, besides the HAP debugger)

Because then you should be able to see with pressing...er...alt...shift...one of these what orders the units have (includes automated), and for the plots which improvement the AI considers to build on them.
 
I think so. But I'm pretty sure it's in the SDK.

The Blue Circles (hints) are showing plots with sea food and the AI builds workboats but they go nowhere.
 
Many. K-Mod, BtS On Speed, Super Forts, Captured City Art, Great Generals from Barbarian Combat, Multiple Research. There are more, but those are just the ones which I merged at a certain period.

I probably did not notice it immediately because I love to play huge games and in the meantime I accumulated changes without thorough testing.

Sometimes I had to take decisions when the codes where occurring at the same place but it never really concerned working boats.

I looked at UNITAI_WORKER_SEA in 12 different files but I can't find an error easily. So to compare with the original files, I wanted to know where exactly that automation was coded.
 
Thank you Asaf, but the only change was from BETTER_BTS_AI_MOD. I cancelled it nevertheless to restore the initial code but still it does not work.

Any other suggestion?
 
You should debug this code - see if it's called at all.
Look for all the places which call this function in the original BTS code - do they still exist?
 
Look for all the places which call this function in the original BTS code - do they still exist?

Hum... I'm not sure to get it but I did a search for AI_workerSeaMove() in the original CvGameCoreDLL folder and just found it in 3 places in CvUnitAI.cpp and in 1 place in CvUnitAI.h. Compared and code found identical.

You should debug this code - see if it's called at all.

I ran a debug dll. Not really sure how to play with it but it was fun! I managed to enter a breakpoint at the function AI_workerSeaMove() and apparently it was called. Thereafter, it dwelled in several various files but I could not find anything suspicious. All the codes it opened were left untouched from the original, or at least that's what I understood.

Thank you for your help, Asaf, even if you run out of suggestions! And thanks also to The_J for his help.
 
If the AI is building things with workboats, then its not an issue with AI_workerSeaMove()

More likely it has something to do with the automate commands. You can still manually build improvements with workboats, correct? And Worker automation is functioning correctly?
 
@ Asaf: yes, the AI builds workboats but they don't even try to go to a sea resource (or... see last sentence).

@ Tholal: yes, I can build workboats, direct them to a sea resource manually and transform them into fishing boats or offshore platforms.

I've seen no problem with automating workers, but I usually don't automate them. The AI workers are working allright.

I wonder if it hasn't something to do with danger. They don't go out because the place doesn't seem safe enough (although it is). I don't know but that is a place where changes might have occurred.
 
Then I suggest to continue developing your debugging skills (it is fun ;) ) and see at what point this function exits.
You can add breakpoints on various exit points to see what's going on, or just step through the function. If it's a danger issue, you'll see it.
 
Thanks, I'll do that within a week. I'll let you know :scan:!
 
Problem solved!

I realized that despite the fact that I altered the XML schemas for Units and Buildings, I could still use old DLLs. After testing my saved copies one after the other, I identified when the change occurred exactly and narrowed the search to 4 different files. It turned out that the problem was well in CvUnitAI.cpp but rather in CvUnitAI::AI_improveBonus.

It might have happened with Super Forts since I changed progressively every part of the code that looked suspicious to me and tested every change I made, one by one.

I have posted a message in the thread opened for the mod component to see if it is really linked with that.

Thanks again to all three who replied to my request for assistance.
 
Top Bottom