Page 1 of 1

AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 15:13
by liq3
After a bunch of testing and looking at things with video frame by frame, I've determined that AI ticks are slightly larger than 0.25s, while things like shotgun firing is exactly 1 second.

Re: AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 15:53
by Hairy Phil
Where did you read that each tick is 0.25 seconds?

What problem would this cause if it were longer?

I may be wrong, but I think ticks control when a bot commences aiming, not when the shot is released, so the length of a tick is not related to the duration of firing. For the shotgun, it would always be 1 second from the first tick, regardless of how many ticks occurred in between.

Re: AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 16:59
by Mahrgell
Hairy Phil wrote:Where did you read that each tick is 0.25 seconds?

What problem would this cause if it were longer?

I may be wrong, but I think ticks control when a bot commences aiming, not when the shot is released, so the length of a tick is not related to the duration of firing. For the shotgun, it would always be 1 second from the first tick, regardless of how many ticks occurred in between.


Ticks must have a constant length, that is the same for everyone, to guarantee determinism. The wiki states and pretty much everyone on the Discord claimed a second to have 4 ticks.

So a SG aiming takes exactly 4 ticks. Everyone thought...


In fact you have to aim for 4/8/... ticks to fire once/twice/...
This works up to 32 ticks to fire 8 times in a row. If you want to fire 9 times, 35 ticks are enough. Following shots again require 4 ticks, we didn't test when the next 3 tick shot hapens, should be the 17th or 18th. (but this would fully kill an MG, so it is less relevant, lol)

For people who tick count this is actually kinda relevant. If a tick is ~0.2577 secs, as it seems like, this not only affects shooting but also some ranges when walking etc...

It wouldn't even be a big issue if it wasn't 0.25. (just annoying, lol) But it should be known how long a tick is.

Re: AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 18:50
by Mahrgell
ElvenMonk now stated on Discord that he had tested (and published) it earlier that ticks are indeed 0.26s exactly.

In that case it would be useful to have this officially confirmed as intended behavior. Stuff like the wiki could then be corrected.

Re: AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 20:38
by pier4r
On trello, in the old releases (like alpha 6) one can spot a "execution time, 250 ms" for every bot. Before it was 500 ms.

Re: AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 20:49
by GFX47
Ticks are everything 0.25s.
Game playback speed just depends on your device performance (frame rate) so it may not run at 100% speed.

Re: AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 21:03
by ElvenMonk
Hairy Phil wrote:Where did you read that each tick is 0.25 seconds?


It's clearly stated inside the game in stats page for each bot class. Last row.

And for GFX. No, actual ticks are definitely exactly 0.26s for each bot class now. I can provide bunch of tests proving it, and recently made a stream on twitch specifically dedicated to show results of those tests. For instance 100 ticks take exactly 26s of in-game time and sniper makes exactly 26 meters if moving 100 ticks.

It has nothing to do with subjective playback performance.

Re: AI ticks aren't exactly 0.25s

Posted: 18 Aug 2018, 22:26
by Mahrgell
Or simply aim for X ticks with a shotgun and count the number of shots fired:
0-3: no shot
4-7: 1 shot
...
28-31: 7 shots
32-34: 8 shots
35: 9 shots


So yeah this isnt about game playback speed or anything. Amusingly, using a screencapture, liq confirmed the shots to be exactly fired every 1 sec. But if we look how many ticks happened, it was about 3.88 and not 4.

And Elvenmonkeys tests independently perfectly align with ours.

@GFX I think you could just check how many ticks a match has, I'm pretty sure thats easy to log. It should be 1200 if it was 0.25s. It will be less.

Re: AI ticks aren't exactly 0.25s

Posted: 20 Aug 2018, 23:51
by sollniss
Can confirm that the sniper is not shooting at the 12th tick every time.

Re: AI ticks aren't exactly 0.25s

Posted: 21 Aug 2018, 09:49
by GFX47
Nice catch guys, here's why: the determinist game engine I use updates game state every 20ms. And AI checks are part of the update.
So basically, here's what happens:
t = 0: game starts
t = 20ms: first update, AIs are checked for the first time, next AI check should be at 20+250=270ms
t = 40ms: next game update, units mode, shot, etc
...
t = 260ms: not yet
t = 280ms: next AI check!

And here are the 10ms offset...
I've changed the game update period to 25ms in the next version.
Can't wait to see all the side effects of this!

Image

Re: AI ticks aren't exactly 0.25s

Posted: 21 Aug 2018, 12:19
by pier4r
well done to the players and gfx.

If I lose is both your fault.

Re: AI ticks aren't exactly 0.25s

Posted: 10 Sep 2018, 09:06
by DjSapsan
I noticed that at start of the match all bots are idling. Its was painful sometimes, so I created temporary tag just to ignore first tick

Re: AI ticks aren't exactly 0.25s

Posted: 10 Sep 2018, 15:37
by ElvenMonk
It's not painful, it's a best way to detect first tick and do initial setup. Unless you want something to be tagged during entire game.

Re: AI ticks aren't exactly 0.25s

Posted: 10 Sep 2018, 16:44
by DjSapsan
Вначале игры я определяю состояние игры (где и сколько баз, поведение врагов) и затем выбираю соответствующую стратегию - пуш/полузащита/сбор ресов. В первый тик невозможно определить поведение врагов.

Re: AI ticks aren't exactly 0.25s

Posted: 10 Sep 2018, 17:19
by ElvenMonk
I don't think any other tick is much better in detecting enemies behavior then first one.

Re: AI ticks aren't exactly 0.25s

Posted: 10 Sep 2018, 21:10
by Revenge
pier4r wrote:well done to the players and gfx.

If I lose is both your fault.

same. :S