#Creeps 'teleporting' in replays

131 messages · Page 1 of 1 (latest)

bleak crescent
#

We have received several reports that there are visual glitches in replays when creep position is visually stuck and refreshed only when the next 100-tick chunk is loaded.

Here are a few questions that would help us to troubleshoot this:

  1. How often this issue is reproduced? Every replay?

  2. Does it happen only in your games when the console and Visuals are available, or in shared replays of other players too?

  3. If it happens in your replays only, does closing the console help?

  4. If it happens in other players replays, does it happen in the same replay again if you start it over? Please share a link to the replay.

  5. Are all objects stuck on this tick, or this affects only the state of one creep?

  6. Could you record a video with this behavior?

tardy bridge
#
  1. Almost every replay. Some very simple ones E.g. 1 creep vs System, I don't detect it.
  2. It happens with other players too.
  3. Closing the console makes no difference.
  4. Closing the replay and re-opening it reduces the frequency and severity, but closing Arena and reopening the same one has the same behaviour.
  5. All objects are frozen for somewhere between 0 and sometimes up to 10 seconds. As far as I can tell, always on 100-tick boundaries.
  6. I'll try.
onyx quest
#
  1. every replay
  2. yes, in shared replays of other players too
  3. no, it doesn't matter if console opened or minimized
  4. for my replays: it happens only on first playback of same opened replay; if I for example test 2x opponents, I can watch replay1, replay2, replay1. First playback lags every time, replay1 lagged when played first time, now i've opened replay2 and its first playback is lagging, and then I've opened replay1 again its first playback is lagging again

for shared replays: I've tested the border of tick 99-101, when I first encountered it I got the lag. Then when I scrolled back, and played again, got no lag. But when reaching 199-201 border i got lag again. Every first encounter or %100tick border lags.

switching shared replays back and forth appears to preserve old replay playback tick state. If I leave the state on lets say 150, then scroll it back to cross 100 again, this 100 will not lag. As it apparently preloaded. Yet if before switching back and forth I scroll it to lets say 50, upon return and continue playing 99-101 will lag again.

TLDR: every %100===0 on every unique replay open hangs. Test it with 20ticks/sec for better effect.

  1. if affects state of every creep on the map. Visuals are not stuck though.
  2. -; I don't actually believe you can not reproduce it, since even very low resolution no gpu/cpu-bound gameplay still lags; can you record a video of not reproducing it? since clicking "watch" up to watching it run? 20ticks/sec to make sure.
tardy bridge
#

I suspect it may depend upon network latency, and a low-latency connection to the server may not show the effect. (I'm in Australia)

bleak crescent
#

I'm watching replays of different players in different arenas right now, can't reproduce this behavior. Creeps are moving correctly around 100-tick boundaries.

Any links to shared replays where this is reproduced?

tardy bridge
#

(Which was pretty much the first shared replay I found)

onyx quest
#

I can not seem to be able to copy a link, just the first replay I've opened:

tardy bridge
#

I've captured a video, but it doesn't show the effect at its worst - just a second or so.

bleak crescent
#

Yeah, this has nothing to do with GPU, CPU and rendering, it's either a network client/server issue, or some bug in the ticks loading code that makes this 100-tick chunk corrupted.

tardy bridge
#

My suspicion is that the client keeps "ticking" at constant rate whether it has data from the network or not.

onyx quest
#

I must remind you, that if upon opening a new replay you grab the scroll-progress-bar and drag it through the duration, then move it back to the beginnig, there will be no lags. Encountering playback locations for first time properly loads it. Be it during real playback, or by dragging through it, for states to be loaded on the field statically.

tardy bridge
#

So when the network data does arrive, it "catches up" and teleports everything by up to 20-50 ticks.

onyx quest
bleak crescent
#

What if you manually advance by 1 tick and give it a few seconds every time, what happens around the 100-tick boundary?

tardy bridge
#

It definitely does load in 100-tick chunks. You can see them come in through the network.

onyx quest
#

controls react to my manual clicks, numbers update realtime, only by the time I have clicked ~107 does creep positions gets updated. Same lag.

bleak crescent
onyx quest
#

"loaded" as in "decoded some blob of json data that is already in local memory -- into an actionable objects state".
Or is pwk correct and it really queries remote server 20 times per 2000 tick replay every time?!

bleak crescent
#

Loaded as in loaded from the server, Pwk is correct

tardy bridge
#

It would probably resolve 99% of the issue if it prefetched the next chunk while playing the current one.

#

(If one is available to be prefetched)

bleak crescent
#

It tries to do that currently

tardy bridge
#

Really? I'm not seeing that happen.

onyx quest
#

I'm trying to send you a PM @bleak crescent add me as friend on discord

tardy bridge
#

If I'm at tick 600 and advance then I get a definite pause (currently about 1.5-2 seconds) before it shows tick 601.

#

If it was preloaded I would expect it to be effectively instant.

onyx quest
#

indeed, when reproducing it manually with 1tick steps, I can stop at tick99 for a minute, then start clicking and it will still lag when crossing %100

tardy bridge
#

(and it is effectively instant if I step tick backward then forward again)

bleak crescent
onyx quest
#

so it's not network speed or something, it's lack of intent to preload

#

I wanted to send you my network info, np if you don't want it. We figured it's lack of intent to preload.

bleak crescent
#

Ok just to confirm: if you are at tick x00, you advance by 1 tick, you wait some long enough time, it loads the tick x01 successfully without issues?

onyx quest
#

99->100 just checked, lags.

tardy bridge
#

If I single-step from x00 to x01, there's pause, but it eventually loads. If it's on "play" mode, the playback doesn't pause, it just teleports everything when it loads.

onyx quest
#

will see the 101st

#

no, it appears to lag 100->101

#

so it was not 99-100 :)

#

101->102 doesn't lag

bleak crescent
#

But 100-101 eventually loads if you wait?

onyx quest
tardy bridge
#

If my play rate is 5 tick/s then it will skip 5-15 ticks (depending upon load time) except that oddly visuals may update during that time, sometimes.

#

But yeah, if single-stepping then 101 loads. It just gets skipped in a continuous playback.

#

The more creeps and visual, the longer the skips/pauses appear to be.

bleak crescent
#

Something is wrong with the preload indeed

onyx quest
#

Lol by the way, if our assumption it's networking is correct, how the fuck my Visuals are being updated real time every time (have last time checked like a week ago; creeps froze; Visuals kept updating)

#

visuals are only-clientside?!

tardy bridge
#

Yes, it's weird that visuals often render during the "pauses" when creeps don't update.

onyx quest
#

nah, sounds like nonsense

bleak crescent
#

Visuals, console and game objects are 3 separate streams of websocket data

#

This is why I asked about other players' shared replays because they have only 1 stream

tardy bridge
#

It's just weird that I never see visuals paused with creeps updating. Just creeps paused with visuals updating.

onyx quest
#

console ticks never freeze
visuals never freeze
creeps freeze on %100

bleak crescent
#

Less data for visuals

#

We'll try to fix the preload and deploy to a debug branch on Steam

#

Keep in touch

#

Thanks for your help with troubleshooting

bleak crescent
#

Could you please install an update from the preview beta branch on Steam and check does it work better for you?

tardy bridge
#

Will give it a go!

onyx quest
#

I did. I can not click on Test or on shared replays or on Fame or on Rated play. Can not test. Both with my dpi compatibility on and off.
Can play tutorial, in tutorial it doesn't appear to be lagging. But I don't remember if it was lagging previously in tutorial.

tardy bridge
#

Oh, that's much smoother for me.

#

Playback went straight through the chunk boundary without pausing, and creeps were moving. I verified that when single-stepping backward into a chunk I hadn't seen, it did pause.

#

Single-stepping forward into a chunk I hadn't seen didn't pause.

onyx quest
#

"I verified that when single-stepping backward into a chunk I hadn't seen, it did pause."
lol

tardy bridge
#

Yeah, tested that to make sure that it was preload and not just some fluke network conditions.

onyx quest
bleak crescent
#

Do animations on the main screen work?

Do arena cards react on mouse hover?

Do Rating, Test, and Fame buttons react on mouse hover?

bleak crescent
onyx quest
#

yes I did restart game client and checked it's not ran as a process, before running it again

#

i did not restart windows
i did not restart steam

#

background animation doesn't happen. The only thing that moves is the big icon of the arena, its animation is played like usual. The rest doesn't react doesn't move.

#

whole top menu works like it should. Tutorial works like it should.

#

console output is as usual:

ScreepsArena>
(node:12345) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `screeps_arena --trace-deprecation ...` to show where the warning was created)
123.1 1 1280 719 {
  accelerometerSupport: 'unknown',
  bounds: { x: 0, y: 0, width: 1280, height: 800 },
  colorDepth: 24,
  colorSpace: '{primaries:BT709, transfer:SRGB, matrix:RGB, range:FULL}',
  depthPerComponent: 8,
  detected: true,
  displayFrequency: 60,
  id: 12345,
  internal: true,
  label: '',
  maximumCursorSize: { width: 0, height: 0 },
  monochrome: false,
  nativeOrigin: { x: 0, y: 0 },
  rotation: 0,
  size: { width: 1280, height: 800 },
  workArea: { x: 0, y: 0, width: 1280, height: 719 },
  touchSupport: 'unknown'
}
123.2 1 1
GET_STEAM_SESSION_TICKET
Setting breakpad minidump AppID = 12345
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  12345 [API loaded no]
bleak crescent
#

OK there was a bug with handling mouse events. Please install an update and try again

onyx quest
#

switched from main to preview and installed update
nothing changed, UI doesn't work

bleak crescent
#

Does it show version 1.0.8 in the bottom left corner of the game window?

onyx quest
#

restarted steam and repeated main->preview change. Now it works.

#

replay playback doesn't appear to be lagging as well

#

no, it shows 1.0.7 :)

#

yet my own replays, and shared replays as well don't lag

#

manually 1stepping backwards does lag like it used to, when crossing %100 for the segments never before loaded

bleak crescent
#

OK so the preload seems to be fixed now, very nice

onyx quest
#

this is asking for more than could have hoped before:

when I clicked and started watching not-yet-finished replay, it lags every %100 again: this time every time duration gets +100 added

bleak crescent
#

yeah because the preload can't work while there is nothing to preload yet

onyx quest
#

no, the current watch state is at let's say 340/1200, and it lags when it changes 340/1200 -> 340/1300

bleak crescent
#

it didn't happen before?

onyx quest
#

before it lagged even when it's totally loaded, so I never checked :)

#

i'll switch to main to see

bleak crescent
#

@tardy bridge do you have this behavior?

onyx quest
#

yes I'm on main. It gets teleported like this (the one you've fixed in Preview)

tardy bridge
#

Updating now...

onyx quest
#

by the way, since now I know it's websocket streams, separate for console and stuff...

when launching a match, and then prematurely stopping it, and then trying to watch a replay, nothing gets printed to that prematurely-stopped game console.

tardy bridge
#

Everything looks normal here, background animations are running etc.

onyx quest
bleak crescent
onyx quest
tardy bridge
#

Oh okay. I haven't been at my computer for the past hour or so.

#

Oh, is this about matches in progress?

bleak crescent
#

yes

tardy bridge
#

I'll fire one up

bleak crescent
#

Is this lag just a UI slowdown, or it teleports creeps as well?

onyx quest
#

this one is obviously not as important and urgent as the one you've fixed, Артём. Nice to have but it's ok.

tardy bridge
#

Oh hmm, I'll try one that doesn't reach the end in a couple of seconds 😉

bleak crescent
#

if it teleports creeps, it seems important. if it's simply a slowdown, then that's something else

tardy bridge
#

In a Construct and Control test game, it lags the UI for about 0.5-1 seconds when each new chunk becomes available, but everything pauses no teleports.

onyx quest
#

it's hard to distinguish on main with all this lags and teleports. Switching to preview..

tardy bridge
#

Yes, it's definitely just a slowdown (and the ticks available counter ticks up while it's loading).

onyx quest
#

getting +100 right bound teleports, about this much (two different teleport distances). It's less than the original preload distance teleport.

#

20 ticks/sec

tardy bridge
#

In my test games (with not a lot of creeps in the map) there is a bit of "catch-up" burst or movement that's faster than usual, almost a teleport, but not the huge teleports that the missing preload caused.

onyx quest
#

ticks ui continue to run smoothly while this hang happens. Just like in first fixed case.

bleak crescent
#

Very well then. We'll continue working on other performance-related stuff, but regarding this immediate issue with chunk preloading - I think we can consider it closed.

onyx quest
#

Trying to guess why would creeps-UI(not ticks UI) hang while server got increased right bound.. I can't come up with an idea.
You say client only preloads nearby frames, so 340/1200->340/1300 wouldn't make client load that new 1200-1300 chunk. Then, it's not ~399 where server lag may slow down getting new portion, client already has all the data to keep showing 340->350... What the fuck lags then?! :)

#

except... the right-bound +100 is increased not with a +100 step, it's increased gradually +1-2-3-4-5...-100. This interface operation takes time. Maybe this loop of visual increase of right bound is performed in main/creeps interface thread, stopping all creep drawing?!

bleak crescent
#

Yes, there is something else being triggered in that case, needs investigating

onyx quest
#

lol by the end of this bugfixes who knows maybe SC:A will not lag at all, even for 4k display :)

#

only way I know to make stuff lag on modern hardware is to make a while{} loop somewhere without clear boundaries like "only 60 times per second". Or to render some arcane 3d which is not the case.

bleak crescent
#

by the way, does preview branch work better for you with hidpi enabled?

onyx quest
#

I don't actually know. Please remind me, what should I expect?

  1. when I enable compatibility-thing, it keeps low app resolution, very-small close to unusable cursor. Nothing appear to have changed.

  2. when disable compatibility, running it stock default (win10, 4k, 300% scale), logo while game loads lags just as much as it used to. It's a fucking letters on a black background. Please don't lag!!

  3. yes, I did a fallback to main and see the difference: edges of letters for like "test" and its graphics not as crisp on preview. Feels non-retina, blurry. And it lags obviously not as much.
    Still not as good enabling my compatibility dpi.

You've improved it for me, and you've broken it for everyone with retina who has a better hardware :) And I intend to keep using my compatibility dpi to keep it more ugly / more fast.

#

only thing that I envy for the new version is big visible cursor. I don't have it with compatibility dpi.

bleak crescent
#

We don't care about the loading splash screen performance. It is lagging not because of any issues, but just because it is actually loading the app, and the main browser thread is busy. Just ignore this, we are not going to do anything related to the loading splash screen. And it's not an indicator of anything.

The optimization in preview had two parts: 1) limiting dpi ratio to 1.5 because 2 and 3 is maybe an overkill in this case without clear benefits, 1.5 looks crisp enough, 2) limiting the internal animation frame rate to save some CPU cycles. Thepreview branch should perform with better GPU and CPU usage and higher resulting game client FPS on both low-dpi and high-dpi setups, but most notable on high-dpi.

onyx quest
#

"it is actually loading the app, and the main browser thread is busy"
when in dpi compatibility (lower resolution) it beautifully bundles letters into a word, and C rotates smoothly, and __ blinking. First impression matters :)

#

your new dpi 1.5 doesn't seem to apply to loading screen, that screeps logo looks retina-crisp, like x3. That's what I'm reporting.

bleak crescent
#

that's correct, there were no changes on the loading screen

#

as well as in many other UI elements and texts. only animated graphical elements were updated

onyx quest
#

yeah, Preview looks good. I haven't actually noticed I was without my compatibility-dpi, it lags more than compatibility-dpi, but it's not uncomfortable in Preview. Great.

bleak crescent
#

glad to know!

onyx quest
#

stock main:

#

stock preview: