AI ticks aren't exactly 0.25s

liq3
Hello World
Hello World
Posts: 4

AI ticks aren't exactly 0.25s

Post#1 » 18 Aug 2018, 15:13

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.

User avatar
Hairy Phil
Automaton
Automaton
Posts: 124
Contact:

Re: AI ticks aren't exactly 0.25s

Post#2 » 18 Aug 2018, 15:53

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.

Mahrgell
Script
Script
Posts: 12

Re: AI ticks aren't exactly 0.25s

Post#3 » 18 Aug 2018, 16:59

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.

Mahrgell
Script
Script
Posts: 12

Re: AI ticks aren't exactly 0.25s

Post#4 » 18 Aug 2018, 18:50

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.

pier4r
Skynet
Skynet
Posts: 3266

Re: AI ticks aren't exactly 0.25s

Post#5 » 18 Aug 2018, 20:38

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.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
GFX47
Dev
Posts: 2747

Re: AI ticks aren't exactly 0.25s

Post#6 » 18 Aug 2018, 20:49

Ticks are everything 0.25s.
Game playback speed just depends on your device performance (frame rate) so it may not run at 100% speed.

ElvenMonk
Automaton
Automaton
Posts: 198

Re: AI ticks aren't exactly 0.25s

Post#7 » 18 Aug 2018, 21:03

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.

Mahrgell
Script
Script
Posts: 12

Re: AI ticks aren't exactly 0.25s

Post#8 » 18 Aug 2018, 22:26

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.

sollniss
Automaton
Automaton
Posts: 175

Re: AI ticks aren't exactly 0.25s

Post#9 » 20 Aug 2018, 23:51

Can confirm that the sniper is not shooting at the 12th tick every time.

User avatar
GFX47
Dev
Posts: 2747

Re: AI ticks aren't exactly 0.25s

Post#10 » 21 Aug 2018, 09:49

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

pier4r
Skynet
Skynet
Posts: 3266

Re: AI ticks aren't exactly 0.25s

Post#11 » 21 Aug 2018, 12:19

well done to the players and gfx.

If I lose is both your fault.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

DjSapsan
Script
Script
Posts: 25

Re: AI ticks aren't exactly 0.25s

Post#12 » 10 Sep 2018, 09:06

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

ElvenMonk
Automaton
Automaton
Posts: 198

Re: AI ticks aren't exactly 0.25s

Post#13 » 10 Sep 2018, 15:37

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.

DjSapsan
Script
Script
Posts: 25

Re: AI ticks aren't exactly 0.25s

Post#14 » 10 Sep 2018, 16:44

Вначале игры я определяю состояние игры (где и сколько баз, поведение врагов) и затем выбираю соответствующую стратегию - пуш/полузащита/сбор ресов. В первый тик невозможно определить поведение врагов.

ElvenMonk
Automaton
Automaton
Posts: 198

Re: AI ticks aren't exactly 0.25s

Post#15 » 10 Sep 2018, 17:19

I don't think any other tick is much better in detecting enemies behavior then first one.

User avatar
Revenge
Neural Network
Neural Network
Posts: 381
Contact:

Re: AI ticks aren't exactly 0.25s

Post#16 » 10 Sep 2018, 21:10

pier4r wrote:well done to the players and gfx.

If I lose is both your fault.

same. :S

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest