THIS desyncs: syncdebug logs

THIS desyncs: syncdebug logs

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

THIS desyncs: syncdebug logs

Post by KingRaptor »

Technically this belongs in Games and Mods Discussion or Help & Bugs, but I'm posting this here because that's where you engine dev boffins hang out.

The grav flak weapon in THIS is causing desyncs. I've run several tests with the 0.8.4.2 syncdebug build, and I need someone who can make sense of the logs. Mod is here if you need to watch the included replays or look at the game code.

Help much appreciated :-)
Attachments
traces.zip
syncdebug logs + replays
(455.34 KiB) Downloaded 24 times
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: THIS desyncs: syncdebug logs

Post by imbaczek »

well done on your first try, but it wasn't a complete success: you didn't get the debug symbols (or spring can't read them.) this severely limits the usefulness of provided logs. getting debug symbols should be easy; it's on buildserv in the debug directory (instead of installer.)

one thing that you can try is playing in a window against yourself on only one computer - if the desync is in lua, you should be able to find it this way with the help of the sync debugger.

what's immediately interesting is this:

Code: Select all

Server: bad flop# 1955698 instead of 1955696 for player 1
basically, this means that player 1 didn't calculate something player 2 (or 0) did. this may be (usually is) a result of doing synced calculations based on unsynced conditions.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: THIS desyncs: syncdebug logs

Post by hoijui »

doh!
totally forgot about that (that one needs the debug symbols separately). sorry KingRaptor (i was around when he asked for instructions about sync-debugging).
this is the Wiki page, in case you did not yet see it:
http://springrts.com/wiki/Debugging_sync_errors
you essentially did eveyrthing except 5. on that page.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: THIS desyncs: syncdebug logs

Post by Kloot »

Reproduced it with two local clients (compiled with L2 debug symbols) by issuing

Code: Select all

/cheat
/give carrier 0
/give carrier 1
as in the 1_2carriers demo, so hopefully we'll know soon enough.
Attachments
this_wip9kre_syncdbg_spring0.80.4.tar.gz
(63.28 KiB) Downloaded 18 times
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: THIS desyncs: syncdebug logs

Post by Kloot »

Traced the carrier vs. carrier torpedo desyncs to dronelaunchers.local.lua; after commenting out

Code: Select all

table.insert(spawnList, {
	drone=drone, target = target, rotation = math.pi*.5*rotation, pitch = pitch or 0, team = team,
	x=x,y=y,z=z,dx=dx,dy=dy,dz=dz,
})
they disappear. But this isn't sync-unsafe code (unless insert interprets the second argument as a position), so the real cause should be somewhere inside GameFrame.

e: the drone GameFrame logic wasn't responsible after all, it just added to the snowball effect.
Last edited by Kloot on 14 Oct 2009, 13:53, edited 1 time in total.
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: THIS desyncs: syncdebug logs

Post by imbaczek »

wonder if there's a way of dumping the whole lua state? we could checksum only synced lua state to provide feedback to mod developers that it's their fault. syncdebug could perhaps dump and transfer the whole state for easy diffing.

as an added bonus, the code could be reused for saving games.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: THIS desyncs: syncdebug logs

Post by Tobi »

A complication would be that entire LuaRules (both synced and unsynced) runs in the same lua_State. So you'd actually have to track down which objects belong to the synced part, or which belong to the unsynced part.

(Or better, do the LuaRules synced/unsynced split trepan still wanted to do before he left.)
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: THIS desyncs: syncdebug logs

Post by KingRaptor »

It turns out I made a pretty flagrant bug in perks.locals.lua (declaring the local variable teams for the whole gadget when I only wanted it in Initialize() x_x), which cleared up a lot of problems when it was fixed. Sync error with 2 carriers (and likely other stuff) remains however.

EDIT: Drone controller (dronelauncherm) unit desynced when struck with grav-flak. Daggers did not desync when hit by same weapon. Drone controller did not desync under normal conditions even when drones were intercepted by Wraiths.

Suspect desync may be connected to drones being killed on same frame as spawn or similar issue. Attempt to replicate by spamming Wraiths to kill drones on spawn failed - unable to kill fast enough.
Attachments
dronelauncherm_vs_carrier.7z
Drone bomber vs carrier traces
(59.75 KiB) Downloaded 15 times
syncdebug_wip10.zip
Mod, demo, and traces included.
(1.98 MiB) Downloaded 15 times
Last edited by KingRaptor on 14 Oct 2009, 20:11, edited 1 time in total.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: THIS desyncs: syncdebug logs

Post by Kloot »

Thanks, but those carrier vs. carrier and other desyncs should already be fixed upstream (there was a dormant engine bug that got triggered by the perk system). If you can, try the master build.
User avatar
KingRaptor
Zero-K Developer
Posts: 838
Joined: 14 Mar 2007, 03:44

Re: THIS desyncs: syncdebug logs

Post by KingRaptor »

All known desyncs not reproduced in 0.80.4-356-g27d791f committed 2009-10-15 :-)
Post Reply

Return to “Engine”