Page 1 of 1

Counting and tick relationship and decisions

Posted: 03 Mar 2019, 13:31
by Borogrove
I've looked through the wiki and I've read through these forums and I've done my own experiments but I'm still a bit stumped so would appreciate some certain answers.

Firstly at what point(s) in a tick does a counter adjust? Is this dependent on variables or do all count effects happen at the same time (beginning or end) of a tick.

Secondly at what point in the tick does a bot change/ read its commands.
For example;
If a bot is advancing and then decides to retreat after having moved across a critical distance threshold which changed its commands...
At what point in a tick does it realise its position?
At what point does the decision change?
At what point does the decision take effect and become actionable?

I know it is perhaps a bit silly to break down a tick but I'm perplexed whether these things happen at the begining or end of etc.

Re: Counting and tick relationship and decisions

Posted: 07 Mar 2019, 21:21
by masterplayer
Tags and counters are adjusted instantly. If a node in your AI says "tag myself x" every condition "if myself tagged x" executed after this node will be returned as true. I highly recommend you not to use "tag x" in a tree below "if myself tagged x" to prevent bugs.

Team tags and team counters also rely on the instantiation order of your bots: Bot B can read team tags at the same tick bot A made it. However, bot A has to wait to the next tick to read team tags made by bot B.

All other decisions rely on the state of the last tick. If an enemy attacks your bot, it will realise that at the beginning of the next tick.

The actions should be executed during the whole tick, but I am not sure about that. :?

Re: Counting and tick relationship and decisions

Posted: 24 Apr 2019, 20:29
by shadow trooper
Great explanation, thank you.

As for the attacking bot realisation, I find it a bit confusing. I've played with a dummy scenario where a bot starts the counter once attacked by a MG and tries to dodge on every 8th tick and for some reason every other cycle MG will stop aiming and begin from start once the bot is back in the range (which is the desired effect), but then every other cycle it will start firing (and hitting some) at the same time when the bot tries to flee.

Then again I'm new to this, perhaps I'm doing something wrong...