-
Notifications
You must be signed in to change notification settings - Fork 241
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
Landlbock/Concurrency/Core Functionality Restructure #390
Conversation
* Added setstats debug command. * Initial attempt at making creature's stats regen. Values are way bogus, implementation is super clunky, but it appears to work. * Cleaned up vital updates. Appears to work. Probably good to merge? * Cleaned up vital updates. Appears to work. Probably good to merge? * Terminology fix setstat -> setvital * Added CreatureVital. Took out Vital specific information from Creature Ability. Added "Tick" to WorldObject, made Creature/Player update stats via Tick. * Hopefully builds now.
…can occur dramatically. Adding action queues and work handlers.
…based Object races caused by refactoring. Action delays (non-busy waiting) appear to function. Kill implemented (untested), Positon changes now reflected in remote clients. Pickup/drop mostly working (Known bug: Item not seen by dropping client on drop, but seen by others). Teleport works. Mostly ported/working. There is a race transferring between landblocks (due to the use of the old TrackObject system), which can cause a Player to be dissosciated from a landblock. Will fix when I rewrite object transfer/tracking system. Updated tracking to be handled by WorldManager -- Still needs to be optimzied. Fixed issue with chained delays. Cleanup and restructuring.
…lity appears to work. Needs more testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the looks of it. I only spent a few minutes but here are a few observations from a fresh set of eyes.
- Initial load is very uneven. Things pop in. Second load is fine.
- I had to make a new character to get it to work. Not a big deal - just mentioning.
- Pulling the flags (weenie and physics data) out of the database makes a lot of stuff break. Spawning items works hit our miss and will throw null exceptions.
- I think that OptimShi has the code to pull actual animation delays out - just a comment about your comment on hard coded timing delays.
I will leave architectural review to others with more current skills than I have. I think if we can get the data driven methods to set weenie header flags and physics description flags I think this will be a good step.
2 & 3 of your comments are related to how our object loading is saving (and are actually related to pr #388, which is included in this code). We're currently very inconsistent in the way we construct/manage objects (manually pushing flags hard coded in c# much of the time). I tried to make this functionality more consistent (and my "player" name patch is whats actually causing this), is there some reason we should have those flags hardcoded, as opposed to pulling them from the DB? |
Feel free to review core structural changes -- should wait until merge of "Player" name fix PR and "CreatureVital" PR to actually merge. |
Came to review, saw merge conflicts and will wait on the rebase to review. |
* Added setstats debug command. * Initial attempt at making creature's stats regen. Values are way bogus, implementation is super clunky, but it appears to work. * Cleaned up vital updates. Appears to work. Probably good to merge? * Cleaned up vital updates. Appears to work. Probably good to merge? * Terminology fix setstat -> setvital * Added CreatureVital. Took out Vital specific information from Creature Ability. Added "Tick" to WorldObject, made Creature/Player update stats via Tick. * Hopefully builds now.
…can occur dramatically. Adding action queues and work handlers.
…based Object races caused by refactoring. Action delays (non-busy waiting) appear to function. Kill implemented (untested), Positon changes now reflected in remote clients. Pickup/drop mostly working (Known bug: Item not seen by dropping client on drop, but seen by others). Teleport works. Mostly ported/working. There is a race transferring between landblocks (due to the use of the old TrackObject system), which can cause a Player to be dissosciated from a landblock. Will fix when I rewrite object transfer/tracking system. Updated tracking to be handled by WorldManager -- Still needs to be optimzied. Fixed issue with chained delays. Cleanup and restructuring.
…lity appears to work. Needs more testing.
I did something horrible to the branch, and can't seem to reopen it. I'll have to make a new pull request. |
Note: This branch builds upon the "Player" name fix, and "CreatureVital" branches. If they're merged I'll rebase and recreate this pull.
Note: This branch also includes Og's "MoveTo" operations.
The overall goal of this branch is to restructure our main-game logic in a manner that safely allows parallelism, without complex locking schemes. The overall idea of this restructure can be summarized as follows:
-- WorldObjects can only read/modify their own state on their own turn to "Act"
-- Communication between WorldObjects is allowed by having the Landblock forward "Actions" between the WorldObjects.
To facilitate this design I've added several classes (IActions, IActors, ActionChains) that encapsulate this functionality. A more detailed list of the behaviors is below.
Overall summary:
All work happens from UpdateWorld() thread in WorldManager
Outline of framework for physics position updates.
Added work managing infrastructure: Actions -- Remove busy-waiting/polling
Parallelism handled as follows:
-- Landblocks are acted on in parallel
-- Objects within landblocks act sequentially
-- Exception - position information - guaranteed not to change by above points
-- Any cross-object interactions must be done by queueing an action on the other object with data passed (This is currently handled by delegate/lambda functions within the action infrastructure, but could be co-routines, or dedicated per-action classes)
Other improvements/notes:
This is a huge change, I tried to segment it, but the races caused by restructuring the parallelism broke the server until I restructured how incoming network events happened -- The end result was this branch.
As far as I know the current branch does everything master does, plus has some minor bugfixes, and supports broadcasts for more things (like coming out of portal space, updating position, dropping/picking up items).
I'm looking forward to hear what you think of this structure.
Notable things removed:
Landblock.GeWorldObjectById
Landblock.Broadcast (handled by players now)
Landblock.UseTime
Things that still need to be done:
More robust object tracking
Asynchronous Landblock loading/prefetching.