Page 1 of 1

AI debug

Posted: Sat Mar 09, 2013 7:24 pm
by rf900
Hi,

I am debugging AI actions to improve their effectiveness. I am using this right now:

Log("VP0",GetScriptGlobal("Slith_VictoryPoints", "VP_Team#0"));

Took it from the wiki, btw there is typo: http://www.slitherinebravo.net/GameWiki ... ing_ui_hot VPTeam#0 missing the underscore.

The thing is that this return a 1 if some team is targeting the VP, but I would prefer if it returned the list of team numbers attacking it.

Is there any other way to easily check what are the current orders of each team? I am using also GetTeamDestinationX(side, team) but would like to have a faster way of checking it. Is there a translation from coordinates to VP number?

Edit: Not sure if I am doing correctly the VP_Team call. Also I noticed a strange thing, I am changing the orders in turn7 for example, and after I write the log, the AI target does not change until its next turn (turn9). Why is this? Even setting the orders at the prebattlesetup I get a -1 for GetTeamDestinationX on turn1, in the StartTurn function, on turn3 it is then returned correctly.

Re: AI debug

Posted: Mon Mar 11, 2013 3:12 pm
by pipfromslitherine
The AI generates its movement orders during the start of its turn - that is, when you set something like a VP target, the AI will not immediately begin going there, it has to wait until the start of its turn until it looks at these orders and tries to action them.

I'll fix the typo. Thanks for spotting it!

There are several systems in play on the AI in the case you seem to be looking at. E.g. the VP plugin is sending orders to the AI teams that are set to attack VPs. The key information is indeed the team destination and you can also look at team data [0] to see if there are any 'orders' for that AI team.

Cheers

Pip