AmyE123 / TactiKit-Game

A Fire Emblem inspired project for my CT6GAMAI module at University
1 stars 0 forks source link

Units colliding #13

Open AmyE123 opened 3 months ago

AmyE123 commented 3 months ago

Pete: If I selected a unit and moved it to attack an enemy unit while another one of my units was next to that enemy unit, sometimes the pathfinding put my attacking unit on top of that other unit, meaning I couldn't then select the other unit afterwards.

AmyE123 commented 3 months ago

pathfindingplan drawio

Need to reimplement how pathfinding works.

  1. Use current calculations to calculate all nodes within range. This includes all nodes with units on too.
  2. Add all of these nodes to an 'interactive' node list.
  3. Add all tiles minus the tiles with units stood on them to the 'valid stand position' node list.
  4. Add every tile that is one away from a valid stand tile to the 'attack' node list.
  5. Maybe an additional list of all the 'attack' nodes with units on them.

When it comes to units: