RPG battle system (ATB-style)

Started by Snarky, Sat 09/03/2013 15:36:50

Previous topic - Next topic

Icey

Hey snarky, on my part I say take your time dude, I don't if I ever posted this but my plan was to work on everything in my game like art,code, puzzles and such. I plan to leave spaces open for battles all I have to do is save that stuff for last cause it'll take most of my dev time away.

Snarky

#21
It's been a while without any progress on this, but in the last week or so I've had another go at the project. (It's certainly more complex and time-consuming than I initially expected.)

Status update:
-Refactored code to use pseudopointers and separate status objects more consistently, improved basic data structures
-ATB normal mode and wait mode both fully implemented
-Implemented FF6-based attack logic (to calculate attack hit/miss and damage)
-Implemented basic UI to issue combat commands to units
-Implemented basic spell functionality (but not the random element of spell effects)

A rough working demo of the current state of the system is available here: https://www.dropbox.com/s/oamsj4crame1hmt/BattleTest.rar

The battle is set to run in Wait mode. When one of your characters' yellow time bar is full and turns green, click on him to issue him a command. Select type of action (only attack and cast spell currently supported), choose the weapon/spell (only spells you have enough MP for will be listed) and the target (you can attack members of your own team or heal enemies if you like!). The time bar then turns blue to show that he's waiting to act. Time does not progress while any of your units are waiting for commands (even if it's in the middle of an attack!), so start out by issuing commands to both your characters.

Once the battle is over (BattleState 7 indicates victory, 8 indicates defeat, if it's stuck at 5 it's waiting for you to issue another command before finishing...), just close the game.

TODO:
-Implement actual spell effect logic
-Implement support for multiple targets (a lot of this is actually in the engine, it's mostly just a matter of adding it to the UI) Done!
-Implement using items, assault, and other special actions
-Implement temporary bonuses, penalties and spell effects
-Improve enemy AI so they'll have some degree of battle strategy (including a morale stat)
-Clean up code and improve API, so it will be easier to import into a game project and so it can be configured/modified without delving too deep into the internals of the code
-Improve support for graphics, animations, sound effects, etc. so the battles can be rendered more attractively

Icey

It's looking good Snarky ;)

I've come to noticed that working on a RPG system is more time consuming than I thought as I've been working on my Mythic Battle System for 3 months now and I've finally come to and end with it. I think it took that long because of School, games, beta testing FF14 + KHx, and the fact I wanted to do it by myself.

I noticed something small(bug) though and I don't know how I did it, but the enemy came over to attack me and just kept bouncing. I'm not sure if it'd hit me but I think it's stuck in attack mode cause it has it displayed over it's head. However I can still select my next move and when I attack the enemy goes back to it's place and waits again.

It seems to always be the 1st or 3rd monster who gets stuck and it happened after Dennis died.

Snarky

Quote from: icey games on Tue 16/07/2013 23:46:54
I noticed something small(bug) though and I don't know how I did it, but the enemy came over to attack me and just kept bouncing. I'm not sure if it'd hit me but I think it's stuck in attack mode cause it has it displayed over it's head. However I can still select my next move and when I attack the enemy goes back to it's place and waits again.

Yes, that's "normal" behavior. It's because one of your characters' time bar has reached full in the middle of the attack, and as soon as that happens, time freezes:

Quote from: Snarky on Tue 16/07/2013 23:15:56
Time does not progress while any of your units are waiting for commands (even if it's in the middle of an attack!)

Ideally the animations should stop when time is frozen, I suppose, but I haven't bothered to implement that, so the attacking unit just keeps bouncing.

Apart from that, if this (time freezing in the middle of an attack) is not the desired behavior, we have to decide how it should actually work. We could let time run until the attack is over, but that might mean losing your place in the attack queue. I'd have to study FF6 more closely to see how it deals with this case.

Icey

I see maybe if you want, would you like a FF6 rom + emu zip? The rom is modded a bit with one of my characters thrown in their but it still plays. Also I can send you the modding kit for the game because it shows a lot of stuff that happens behind screen, it's sorta like AGS for FF6 but I don't think it shows code. However it might tho.

SMF spam blocked by CleanTalk