Hi all,
I am new here, but not all that new to game creation and object oriented and event driven programming. I am a hobbyist without much depth of understanding with the Unity engine as of yet.
I am creating an 8-bit style turn-based RPG of sorts targeting mobile devices and I have decided to start in unity with my battle engine state machine.
The concept behind the battle animations and state transitions is SUPER simplistic, but may be challenging to explain. With image editing software, I have pre-created all the animations frame-by-frame for each interaction/outcome in battle between each enemy and the player(excessive I know). The animations are complete and contain the player, enemy, and, effects. Player and enemy return to their ‘ready stance’ at the end of each interaction, which is just a short (2 frame) animation of the player and enemy in the ready stance. I have also created sound files that sync with each animation. I built a state machine in animator on the base layer of a game object that I have named ready stance, that has an animator, sprite renderer, and script which allows me to transition to a state based on a key-press (for testing basically) but will ultimately be used as the battle engine. Each possible interaction in battle is represented as its own state in the state machine, which I tie in the animation and sound script behaviors for the given interaction. Each state has a transition to and from the default ‘Ready Stance’ state. This all looks and sounds smooth just the way I was imagining it.
First Q: does anyone see any more simplistic way to create my battle engine? If more clarifying information is needed don’t hesitate to ask
Before I started researching into unity, I created a simple form in Visual basic that is essentially my Player and Enemy statistics calculator, and a battle simulator program. The form relies on user to first input the player and enemy level, and strength, speed, and insight stats. Using this input, the battle outcomes such as chance to hit, critical chance, attack damage, block, health, energy etc are calculated, and a simulated battle can take place between the player and enemy by selecting the attacks for the player and enemy one at a time. It’s simplistic but has helped me to fine tune my calculations and make battles interesting. My next hurdle is going to be creating a similar form in unity to define the variables and pass them to the battle script, the problem is I am not quite sure what I need to do next.
Second Q: Given that I have already established the calculations necessary for defining all of my variables, what would be the most efficient way to input them into my project? Do I need to have a single script that manages these variables and then use getcomponent to pull them into the battle script? Can I define these all within a single script? Any insight here would be appreciated, and as always feel free to ask any clarifying questions.
The long term goal of this project is that there will be a map which can be explored with points of interest and the player will find themselves in plenty of battles along the way. Players will level up as they progress through the map and win battles, find items, and power up their character.
Respectfully,
-T