issues: 236675578
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
236675578 | MDExOlB1bGxSZXF1ZXN0MTI2MTYzMzEz | 390 | Landlbock/Concurrency/Core Functionality Restructure | 5246554 | closed | 0 | 4 | 2017-06-17T18:09:03Z | 2017-06-20T02:00:12Z | 2017-06-20T01:54:25Z | CONTRIBUTOR | 0 | ACEmulator/ACE/pulls/390 | 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: - Physics, Movement, and Game Logic updates are done in their own phases, each phase is executed to completion before the next begins. - Within the GameLogic phase, WorldObjects are updated in parallel, but updates lock-free operations with these mechanics: -- 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: - All motion (will be) calculated by the physics engine (based on requests done in the object update phase) - After calculated, all motion is updated sequentially in the UpdateWorld function - All landblocks update any objects within them through Actions on an ActionQueue -- Landblocks are acted on in parallel -- Objects within landblocks act sequentially - Any action on an object may only read/modify the object its acting on -- 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: - The "DelayManager" Handles waiting, removing the need for busy waiting. - All asyncrhonous inputs (e.g. network communication) must delegate their work to the action handlers of objects (Designated by functions prefixed with HandleAction). - There is an infrastructure for position-based broadcasting (although issues in our landblock adjacencies need to be fixed before this will actually work cross-landblocks) - Landblocks are also "Actors" as they must manage object pick-ups/etc. - The movement to the "Actor/Action" interface removes any need for polling -- If we have a world with 1 billion entries, but only 2 active, it will run as fast as a world with 2 entries 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. | {"url": "https://api.github.com/repos/ACEmulator/ACE/issues/390/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0} | 79078680 | pull |