Skip to content
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

collision framework re-work #76

Open
plaza-in-a-heatwave opened this issue Sep 17, 2020 · 1 comment
Open

collision framework re-work #76

plaza-in-a-heatwave opened this issue Sep 17, 2020 · 1 comment
Labels
bug Something isn't working enhancement New feature or request Server Issues affecting cadesim Server
Milestone

Comments

@plaza-in-a-heatwave
Copy link
Owner

The collision mech needs some rewriting to account for chains of square "claims".

Miscellaneous notes / possible implementation:

  • each move has 3 parts to it - a forward, (in-place turn if turning), (forward if turning).
  • if a ship is not able to move into the claimed space in either of the two forwards, it stops and can only turn in place (if turning).
  • first collect together all of the claims (i.e. ships {a, b, c, ... } claim each square i,j).
  • Apply in reverse dependency order by starting with the squares with fewest claimants. move it there, and remove that entity from the list of all things it claims (apart from the square it sits on). Repeat on the squares with the fewest claimants, until all entities have resolved their claims (or collided).
  • When resolving claims, if there is exactly one of the largest ship, it moves into the space.
  • Rocks, stationary vessels, or blocked vessels, claim the square they are on.
  • Turn each turning vessel 90 degrees in-place
  • Repeat the claims mechanism above (collect together, apply for the only claimants & remove those claimants. if anything was blocked previously, it no longer has a claim.)
  • any time a collision occurs, apply the relevant damage (ram or rock).
@plaza-in-a-heatwave plaza-in-a-heatwave added bug Something isn't working enhancement New feature or request Server Issues affecting cadesim Server labels Sep 17, 2020
@plaza-in-a-heatwave plaza-in-a-heatwave added this to the 1.9.93 milestone Sep 17, 2020
@David52920
Copy link
Collaborator

David52920 commented Sep 19, 2020

Also, a scenario to test: when 3 or 4 players trying to take the same space either turning into it or facing nose to nose with other ships and trying to perform a move

Perhaps go through list of every player, get position of their next move ; if any of the players try to take the same position on same slot, then block all.

@plaza-in-a-heatwave plaza-in-a-heatwave modified the milestones: 1.9.93, 2.0.0 Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Server Issues affecting cadesim Server
Projects
None yet
Development

No branches or pull requests

2 participants