Skip to content

ADR - Restructuring of proto messages #10

Closed
@thoraxe

Description

@thoraxe

ADR Context / Overview

The current proto structure was based on a previous dependency on Box2D. Almost the entirety of the space of Box2D physics is pulled in as part of the EntityGameEventBuffer. This is mostly unused at this point.

Decision

The additional object associated with the proto should probably be dramatically reduced in scope. Instead of a Box2D object, we should just have a "physics" or "body" object that has the minimum information required at this time.

Body

  • Position (x,y coords)
  • Angle
  • Velocity
  • uuid
  • owner uuid (where relevant)

Additionally, we should tell the clients a little bit more about the bodies than we already do:

  • maximum potential velocity (allows client to display speed as a percentage of max)
  • remaining hit points (allows client to display some more information about the health of a body)

Rationale

There are two primary reasons for the change:

  • Reducing the complexity of the body proto object
  • Reducing the size of the entire message sent, which may have a minimal performance improving impact

The secondary reason would be to improve some of the capabilities of the client to display additional information about what's going on in the game.

Status

<[Proposed | Accepted | Deprecated | Superseded]
If deprecated, indicate why. If superseded, include a link to the new ADR. >

Consequences

  • Reduced complexity
  • Improved client experience
  • Potential performance improvement

Authors

@thoraxe

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions