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

Use position for object delta messages #5174

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

ephphatha
Copy link
Contributor

@ephphatha ephphatha commented Aug 1, 2022

In the worst case this ends up increasing the size of the DLevel object by 127*2 bytes (since we now need to track object position in the delta) + map overhead. Having said that deltas are only really needed for objects which actually allow interaction. Decorations no longer get a delta since they never change. Actual network traffic is compressed so should end up about the same in practice.

Static memory usage increases by 127*2+1 bytes unfortunately due to the use of sgRecvBuf. Hard to tell if we even need this chunk of memory to be on the stack given the use in OnLevelData().

fixes #5172

@ephphatha ephphatha force-pushed the delta/object branch 4 times, most recently from b354634 to bd35a18 Compare August 2, 2022 08:37
@ephphatha ephphatha marked this pull request as ready for review August 2, 2022 08:37
@ephphatha ephphatha requested a review from StephenCWills August 2, 2022 08:38
Co-authored-by: Stephen C. Wills <[email protected]>
Co-authored-by: Anders Jenbo <[email protected]>
@AJenbo AJenbo merged commit 2121d8d into diasurgical:master Aug 2, 2022
@AJenbo
Copy link
Member

AJenbo commented Aug 2, 2022

Thanks for solving this :)

@ephphatha ephphatha deleted the delta/object branch August 2, 2022 22:08
@glebm
Copy link
Collaborator

glebm commented Aug 3, 2022

Getting a warning:

Source/msg.cpp:357:121: warning: operation on ‘src’ may be undefined [-Wsequence-point]
  357 |                 WorldTilePosition objectPosition { static_cast<WorldTileCoord>(*src++), static_cast<WorldTileCoord>(*src++) };
      |                                                                                                                      ~~~^~

@ephphatha
Copy link
Contributor Author

GCC warns on code that is valid in C++17 but was undefined before that standard, even if the language level is set to a modern version :/

Can use #5181 to avoid the warning

@glebm
Copy link
Collaborator

glebm commented Aug 3, 2022

This is actually useful for us because some platforms do not fully support C++17 (only Amiga by now actually)

@AJenbo
Copy link
Member

AJenbo commented Aug 3, 2022

and my PowePC :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Object state is not synced if you were not on the floor when the object was operated
4 participants