Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: I got some very confusing sync report and need some helps #20469

Closed
dnqbob opened this issue Nov 20, 2022 · 7 comments
Closed

Question: I got some very confusing sync report and need some helps #20469

dnqbob opened this issue Nov 20, 2022 · 7 comments
Labels

Comments

@dnqbob
Copy link
Contributor

dnqbob commented Nov 20, 2022

All of the sync reports generated from two game program run on PC, with 2 player observe 2 AI players, with speed of "Timestep: 20 OrderLatency: 18".

Pair1:
sp2.zip
The only difference of those 2 reports is the "Orders Issued", but when I looked into World.cs(line 477) to find how the sync code was generated, I found that the sync code only related to: Actors, ISync, SyncedEffects, SharedRandom, UnlockedRenderPlayer, unrelated with orders. Did I mistake something here or accually it does happen this way?

Pair2:
sp6modi.zip
During tests, I always get one player with a normal sync report while the other give me "No sync report available!", so I output the syncReports in SyncReport.cs to see what is wrong. The result is strange: one player has already goes to tick 28418 while another player is still at tick 28411. Is this normal?

Pair3:
sp5modi.zip and
sp9modi.zip

Comparing those 2 reports, I found that one player (host) recieved and executed harvest order while the other did not. Was It caused by OrderLatency?

Add: I looked into the custom code in Server.cs on the engine I use, but only found the default value of OrderLatency is changed, for fixing the local gameplay speed problem and upon test I confirm this is not related to the sync issues above.

@dnqbob dnqbob added the Bug label Nov 20, 2022
@anvilvapre
Copy link
Contributor

anvilvapre commented Nov 20, 2022

Order is/are what has impact on game state and therefore the sync hash for a given moment. If client a caclulated the sync before/after an order - then it is likely they differ. No sync hash is calculated over an Order object itself - it seems.

Regarding your first example;

The order that you see in the report is OrderManager.ProcessOrders processClientOrders. This order has already been processed (UnitOrder.ProcessOrder) - so has had impact on the calculated hash.

But in your sync reports the hashes are equal? So there is no issue?

Only the SyncHash and DefeatState are considered in determening if the game is out of sync.

Does it happen when your run on localhost? With no or minimal latency issues?

Odd, the vim editor detects one file to be in a DOS format as it has '\r'. But doesn't for the other and shows the '\r' characters in my editor.

Also worth noting, the harvest order is for an actor that is not in world. (Yet the autocarryall is carrying it?) Perhaps a clue to the issue. Perhaps the order is dropped on the other side - as it's an order on an actor not in the world.

@anvilvapre
Copy link
Contributor

Regarding 2;
GameSpeed reads a (max?) OrderLatency field from yaml. So perhaps you were running at speed fastest?

mods/ra/mod.yaml
259-                    Name: slowest
260-                    Timestep: 80
261:                    OrderLatency: 2
--
263-                    Name: slower
264-                    Timestep: 50
265:                    OrderLatency: 3
--
267-                    Name: normal
268-                    Timestep: 40
269:                    OrderLatency: 3
--
271-                    Name: fast
272-                    Timestep: 35
273:                    OrderLatency: 4
--
275-                    Name: faster
276-                    Timestep: 30
277:                    OrderLatency: 4
--
279-                    Name: fastest
280-                    Timestep: 20
281:                    OrderLatency: 6

@dnqbob
Copy link
Contributor Author

dnqbob commented Nov 20, 2022

yes, at Fastest speed

@dnqbob
Copy link
Contributor Author

dnqbob commented Nov 21, 2022

As for 1.

Does it happen when your run on localhost? With no or minimal latency issues?

Yes and there is no latency issues about network. All run at localhost. But it lags sometime, after all I run 2 game at the same time.

But in your sync reports the hashes are equal? So there is no issue?
Only the SyncHash and DefeatState are considered in determening if the game is out of sync.

So what confuse me the most is that, order does not join the hash check, meanwhile all sync reports are equal, then why the game is desync?

Odd, the vim editor detects one file to be in a DOS format as it has '\r'. But doesn't for the other and shows the '\r' characters in my editor.

This is weird, as well.

Also worth noting, the harvest order is for an actor that is not in world. (Yet the autocarryall is carrying it?) Perhaps a clue to the issue. Perhaps the order is dropped on the other side - as it's an order on an actor not in the world.

This is what I am testing about. I think order should not be dropped in our design, it should at least recieve the order but do nothing to actor.

I filled the #20465 to fix it but in Pair3 and Pair4 with the fix applied it still happens. I think it may related with order latency?

As for 2.
I run at "Timestep: 20 OrderLatency: 18", fastest and with more tolerance on order latency.

@dnqbob
Copy link
Contributor Author

dnqbob commented Nov 21, 2022

Regarding 2.

Decrease OrderLatency can solve "No sync report available!" , and we need to reduce it to <5, then the sync report can record just cover the desync frame.

I think we need to come out with better idea for that, this will add significiant difficulty for sync debugging.

@dnqbob
Copy link
Contributor Author

dnqbob commented Nov 23, 2022

Perhaps the order is dropped on the other side - as it's an order on an actor not in the world.

Yes and this is a issue since we introduce 6421c17, after my debug

@dnqbob
Copy link
Contributor Author

dnqbob commented Nov 28, 2022

Closed, the related issues is all fixed

@dnqbob dnqbob closed this as completed Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants