aresrpg / aresrpg-dapp

Aresrpg's decentralized web application
https://app.aresrpg.world
2 stars 4 forks source link

Fights board & base effects (rendering) #130

Open Sceat opened 2 weeks ago

Sceat commented 2 weeks ago

Here is an issue about what is needed to complete the basic fight system on the client side.

Fight board

Currently when a player click on a group of mob a packet is sent to the server, if everything is valid the server create and send back a fight, but it stops here so we need a way to show the fight board

type Fight = {
  id: string
  team1: Entity[]
  team1_positions: Position[]
  team2: Entity[]
  team2_positions: Position[]
  spectators: string[]
  top_left: Position
  bottom_right: Position
  started: boolean
  locked: boolean
  need_help: boolean
}

Here is a map from Dofus unity:

Image

And here is the same map when someone starts a fight on it, its basically turned into a board

image

Here is a simplified version of a board, as we can see there are 3 type of blocks,

image

Placement phase

Before the fights starts, players will be able to choose their positions, the Fight packet from the server will contain those as an array of position which will need to be rendered with blue and red colors, (blue for team 1, red for team 2)

image

Fight started phase

Example of a fight in dofus to better understand: https://youtu.be/r3f7116JHow?si=mQDao8albr7Jg8ay Example of a fight in waven to better understand: https://youtu.be/I8QX7GI5UHw?si=i3h74KmcqQDmMSxA&t=423

Once the fight is started (when everyone is ready or when 60s passed), those red and blue positions disappear and we will see a blue square or red hexagon under each entities like this. Note that both players and creatures can be in both teams, the represention of red team is always a red hexagon and blue team a blue square

image

When a spell is selected, we will render the cells where it can be launched with a blue zone. Here is a tool to check this line of sight system https://www.dofusroom.com/insightroom

A spell will have a min range and a max range

piellardj commented 2 weeks ago

Initial thoughts for the rendering:

For the rest:

Sceat commented 2 weeks ago

From some tests, here is