Friday, July 16, 2010

SFPC - July Combat Test Preview Video #2



So, more updates, more often.  Check!

Finally something that actually resembles very basic but functional combat!  My numbers are still way off, I'm sure, but I now have:

- The basic Attack/Magic/Item/Stay menu is functional.  Magic and Item do nothing, a lot of work needs done before they come online, but Stay and Attack are up and running as you can see above.
- Units can attack each other, do damage, and are removed from the battlefield when they run out of hit points.
- The battle ends when there are no enemies left on the field, which you can see when the debug info goes away at the end of the video.

Other than all the stuff left to do, what I really need right now is more accurate formulas.  None of the FAQs I have sifted through so far have the kind of info I need, at least not at first glance.  For now, I'm essentially rolling 1d20 behind the curtain to see if an attack hits.  A 20 is a crit (5%), a 4-19 is a hit (80%) and a 1-3 is a miss (15%).  Damage right now is just attacking character's Atk minus defending characters Def, +/- 1.  I still need to work counterattacks and double attacks into the mix as well, implement gold and how much gold an enemy is worth, how to award EXP, leveling up... so much left to do, but at least it's coming along.

If anyone has the exact formulas any of the SF games use, or can point me to a good resource that would save me a lot of time and effort doing research replaying parts of the original games over and over and over, please, let me know! 

Friday, July 9, 2010

SFPC - July Combat Test Preview Video



I wouldn't call this the official July video, but I felt like seeing if I could do a quick video this morning and maybe try having smaller videos more often. I had to quickly reinstall VirtualDub and FRAPS first this morning since I forgot to reinstall them when I put together my new PC, and the video compression settings were a little off so the video quality is not where I usually like it.

Anyway, this primarily shows off the range checking code. I've tested it on ranges up through 5 and it works fine, but I just have it set to do a plain melee range check for the video. The game loops through the established initiative order, which is currently just all characters in the battle sorted based on agility. (Is this correct? I don't know! Feel free to chime in below in the comments!) The code looks for any potential targets within range and just lists them in the debug info. Note that the Dark Dwarves are not AI controlled at this point, that's still a ways off, I'm pulling all the strings here with the keyboard. They are, however, on the enemy team. You'll notice for instance when Sarah does a range check near the end of the video, it does not list Bowie or Chester as valid targets. Only units on the opposing team will show up on the target list.

I've been dragging my feet on doing the next post on the scripting system, I should work on that soon. As a hint for the question from last time: what happens to the chest when you leave the map and return later? Also on that note, from the comments, BNC was right about the chest-opening music, and I didn't even think of that part! I'll have to work that in eventually, too.