Commands, attacking and blocking

I have this week, four or five weeks since the start of the course, among other things been making the players attacks and blocks. I also made the player attacks and blocks we had in the prototype. We had all of them sort of working in the prototype except the fire attack. We have now just hade Alpha and have pretty much everything at least almost implemented. The attacks and blocks are:

  • A horizontal slash in front of the player character. This causes damage on the three tiles horizontally in front of the player character.
  • A forward stab in front of the player character. This causes damage on two tiles forward in front of the player character.
  • The bug zapper / chain lightning causes damage on a tile of the player’s choice. This choice will be restricted to a radius around the player, but can as of now be placed anywhere on the map. Any character near it will also be damaged, and will also damage anyone near those character, and will continue to do so until there are no longer any characters nearby.
  • The fire attack causes sustained damage on a tile of player’s choice. This attack can just as the bug zapper / chain lighting be placed anywhere, but will be restricted in the future. Fire will appear on the tile, and will at least as of now, stay there indefinitely.
  • The stun block nullifies any incoming attack until next turn and stuns any attacking enemy.
  • The directional block nullifies any incoming attack from a direction of player’s choice.

For the final game, each character class has their own specific attacks and blocks, but we as of now only have one player character, and all attack and blocks are always available to be able to always test them. Making the different character classes is up next to do.

We had in the prototype made the attacks, blocks, and moving both for the player characters and for the enemy characters be ‘action’ behavior tree nodes so they could both be used in the planning stage for the AI, and be used when executing them. We have in the post-prototype version divided it up in behavior tree nodes and  ‘commands’. The behavior tree nodes are used by the AI for planning, and the commands are used by all characters to do actions such as walking, attacking, and blocking. The commands are put in a list on the server specifying what they are to do that turn. The clients make the player’s commands and sends them to the server. The commands can be created and sent as command classes without any conversion, in difference to the prototype where we had instructions be sent to the server, and the server made ‘action’ nodes out of the instructions. I had begun making the command code last week, but hadn’t made almost all of the attacks and blocks.

Something else I made this week is the status effects, which strongly relates to the attacks and blocks. Each character has a ‘StatusEffector’ which keeps a list of the different ‘StatusEffects’ that character currently has. The status effects we currently have in the game are ‘Stunned’, ‘StunBlocking’, and ‘DirBlocking’. The reason ‘StunBlocking’ and ‘DirBlocking’ are status effects even though their not usually thought of as status effects is because they remain and stay on the character unlike actions such as e.g. walking or horizontal slash which are used up immediately. We also had status effects in the prototype, and was then implemented directly in the ‘Entity’ class , and was implemented as an enum. We now have a ‘Character’ class inheriting from an ‘Entity’ class, unlike in the prototype where we didn’t have the character class.

About Linus Bjernhagen

2015 Programming