Skip to content

ADR - Ship collision #5

Open
Open
@thoraxe

Description

@thoraxe

ADR Context / Overview

SRT is not using real Godot physics at present and is simply implementing KinematicBody2D. We are using only MoveAndCollide, with the result being simply that the ships kind of grind past one another.

Some form of actual collision mechanics needs to be implemented.

Currently all ships have the same maximum speed and max health and they always travel in the direction that the nose is pointing.

Decision

  • Ship collisions will cause damage to both ships
  • A head-on collision at full speed (the resulting vector is 2x the max speed) for both ships will destroy both ships (always does 100% damage)
  • The amount of damage is proportional to the collision vector. This means that whatever the percentage of 2x the max speed is calculates the resulting damage.
  • The collision vector is the calculated effective strength of the "head on" collision.
  • The effective damage points are calculated based on the starting max health

Examples:
A head-on collision where one ship is stopped and the other ship is traveling at max speed would do 50% damage to both ships.

A collision where one ship is moving "up" at max speed and one ship is moving "left" (t-bone) at max speed would do 50% damage to both ships, because the effective "head on" force is is 1x max -- only one of the ships hit the other at full-speed head-on.

A "glancing" collision where both ships are moving at max speed but they are 179deg oriented towards one another would cause a small fraction of damage to both ships because the effective "head on" velocity is very low.

When ships collide they should both be moved by the collision. Each ship should be immediately rotated in some way relative to their original directions of travel, and then they should be translated some distance in that new direction proportional to their original rate of travel.

Rationale

When things collide, they should take damage.

When non-perfectly-shaped objects collide, they move a bit.

Status

Accepted

Consequences

Implementing the damage without the "bounce"/movement will potentially have a weird effect because Godot tends to "grind" these objects against one another. So they would end up having tons of collisions which would probably have the wrong effect.

Also, if the ships aren't sufficiently rotated and moved away from one another, there is risk that the new travel path will re-collide the ships, which we probably don't want.

Authors

@RoddieKieley
@dudash
Luke Dary
Kaliq Ray
@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