Skip to content

Enhancement/player #183

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

Merged
merged 30 commits into from
Feb 7, 2021
Merged

Enhancement/player #183

merged 30 commits into from
Feb 7, 2021

Conversation

MickVermeulen
Copy link
Member

This pull requests aims to refactor much of the player and character in such a way that APIs are easier to understand and performance is much improved. It does this by:

  • Eliminating all cases of database save-back for the player (e.g. when an item is added to the inventory or the player is hurt)
  • Reducing much of the complexity of the inventory and inventory manager components
  • Reducing much of the complexity of the item game objects and moving all of its logic in memory instead of in the database
  • Redoing missions such that, at runtime, everything is handled in-memory instead of in the database
  • Moving all the character information from the player into the character component
  • Implementing explicit player save on world leave and autosave during play time so that all database communication can happen in the background
  • Simplifying several character APIs like flags
  • Adding documentation to most of the existing and new code

I tested this quite thoroughly and also had a lot of community members help me test. A recent test run up until NS showed no oddities besides the regular bugs (e.g. block yard and stuff, currency desyncs for achievements).

@MickVermeulen MickVermeulen requested review from Jettford, Wincent01 and TheNexusAvenger and removed request for Jettford and Wincent01 February 5, 2021 11:47
@MickVermeulen MickVermeulen self-assigned this Feb 5, 2021
This was linked to issues Feb 5, 2021
Copy link
Member

@TheNexusAvenger TheNexusAvenger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Started to prepare for playtesting, and the world was very slow to load. A change I made as part of improving the world load times seems to have been reverted (incorrect merge?).

@TheNexusAvenger
Copy link
Member

I spent some time playtesting this refactor. The video contains observations about the refactor and general stuff.
https://www.youtube.com/watch?v=CVzdlQC0Hro

The highlight bugs that I think are related to the refactoring include:

  • 3:39: Universe Score compounds between transferring worlds, but only on the client. Re-logging in or switching characters fixes it.
  • 4:01, 26:56, 30:25, 1:16:02, 1:22:29: Server processing stopped for several seconds to several minutes.
    • I have a theory that the cause is related to adding items to the inventory. A case where this is amplified is if you try to take the loot of a Maelstrom dragon on Crux Prime. After doing so, it can take several minutes for packets to properly get accepted. Solving why this happens may solve processing stopping problem I noticed for free.
  • 41:40: The level up animation always plays when joining.
  • 1:06:34: A faction token pack opened but didn't award anything, unless there is a hard limit of 512 faction tokens.
  • 1:18:44: After swapping an item and switching characters, the other item didn't swap spots. The server also crashed after loading in (couldn't reproduce).
  • Faction tokens never appeared as drops.

@MickVermeulen
Copy link
Member Author

3:39: Universe Score compounds between transferring worlds, but only on the client. Re-logging in or switching characters fixes it.
41:40: The level up animation always plays when joining.

These have always been there but the other ones are valid points, I've also noticed that on occasion drops can be slow so I'll give that a look.

Faction tokens never appeared as drops.

Valid point I'll look into that as well, I changed the behavior so that's most probably due to this refactor.

After swapping an item and switching characters, the other item didn't swap spots.

Good point, I'll check that out.

@MickVermeulen
Copy link
Member Author

I looked into the drops from the maelstrom dragon and it caused no issues for me, maybe it has to do with your character specifically? @TheNexusAvenger . Anyway I managed to fix most of the other problems so at this point I'm going to merge and all subsequent problems can be marked as issues.

@MickVermeulen MickVermeulen merged commit fc79929 into dev Feb 7, 2021
@MickVermeulen MickVermeulen deleted the enhancement/player branch February 7, 2021 13:02
@TheNexusAvenger
Copy link
Member

These have always been there but the other ones are valid points, I've also noticed that on occasion drops can be slow so I'll give that a look.

I realized I had an old build (based on commit 5e27e8b4f01f62f7a0766aad99c094e229a06bd0 from late December 2020) of Uchu that I could test against. This bug is new and may be due to the refactor. Haven't investigated why this may be happening.

@TheNexusAvenger
Copy link
Member

TheNexusAvenger commented Feb 9, 2021

Following up on this a bit, I was able to confirm this bug on the 13th commit (c5914ae6165cb53217b2b4d7e9e20e6614e464b5), but was able to test on earlier commits due to either the world not loading or the /testmap not working. My guess is one of those commits is the reason why this bug appeared.

Edit: Found the cause. Line 36 of CharacterComponent invokes the setter that sends ModifyLegoScoreMessage with a delta of the loaded universe score minus 0, or just the entire universe score. Having that line initialize _universeScore instead of UniverseScore fixes it.

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.

refactor players optimize player updates
2 participants