Devlog 3: A (DONE BY ERNIE BURROWS)


New Features.

  • Implemented BattleCharacter base class
    • This is inherited by EnemyRobot and Player Robot
  • Implemented Effect Abstract Scriptable Object Class
    • This used to create multiple types of effects.
    • Ability Scriptable Object has been changed to work with effects. 
  • Added BattleSystem.cs
  • Added BattleState.cs
  • Health and player XP now updated at runtime in UI
  • Overall code refactoring.
    • I redid most of the code to work within these new systems.

Battle Character Class

This is just a blank parent class that holds inheritable variables and generic functions like TakeDamage().

Enemy and Player Robot Class

These are more specific classes, Enemy robot for now only holds a Die() function. While Player Robot tracks the players XP and deals with leveling up.

Effect Scriptable Objects

Using what Joss showed in class I implemented and abstract class EffectSO. This class will be inherited from to create multiple types of effects. For now I only have a Damage Effect, but this is easy enough to add more in the future.

Ability Scriptable Object

This object holds some variables then a list of EffectSO's. When calling the ability.Use() function it iterates the the list of EffectSO's and calls each of their .Use() functions.

BattleSystem.cs

I spent a good amount of time on this script. This will handle any and all battle logic. So far I have used it to apply the damage effects. As well as begin and end battle sequences (This calls initialization on the UI and other classes). However, another very useful aspect of this class are the events it calls. These events will prove useful in the future when listeners can subscribe to them to perform animation, sound and camera sequences logic.

BattleState.cs

This script is responsible for playing the battle. It swaps turns between AI and the player using a switch statment in the function HandleStates().

Health and XP in UI

The health and xp amount until next level are now updated for the player and the enemy robot.

Overall Refactoring

Since I switched from my old system to this new (Much cleaner) system. It required a lot of code refactoring. For example the enemies are now prefabs which hold data from scriptable objects ~ as opposed to being scriptable objects themselves. I spent some extra time on this DevLog to set up stuff for the future. 

For example the Enemy actually attacks the player from their List of abilities ~ All I need to do it program decision making and the AI will be complete. As well the way I set up enemy spawning in the encounter zones will work for the next DevLog. 

The battle system is very versatile now and will be able to handle any new abilities we add to it in the future.

Next Steps

By far the most important next step is adding modules to battle characters for their armor and weapons. However, this will require and inventory system on BattleCharacters that is level dependent and supports dropping of these items.

We also need to decide if the player will receive the item dropped by the enemy via UI after the battle, or if it will spawn on the ground post battle sequence. If we do the second option this will also require a system for item pickups in world (Which is also a future DevLog).

For a more in depth view of what I did this week here is the YouTube link.


GitHub Link -> https://github.com/GEIII-GearUp/GearUp/tree/9c6f92066400d13509bf0d585c85e8a42c98...

Get Gear Up

Leave a comment

Log in with itch.io to leave a comment.