Day 9

[I’m messing around with the wordpress theme at the moment, so you may need to refresh this page to get it to display correctly. If needs be, in Firefox you can hit CTRL-F5 to do a hard refresh and reload the stylesheet.]

Got load of code work done today, though I also ran into a lot more errors that I hadn’t been expecting. There was this one thing in particular where animations weren’t being processed in the battle mode, only in the field mode. That kept me back quite a bit.

I put together a testmap using old graphics from The Guardian:

click the image for a full size screenshot

In the screenshot, I was testing some new targeting code. I was hoping I’d have it finished today, but I ran into problems reversing enemy intentions for actions. It should be dead simple – I check the allegiance of a battle participant, if it’s set to ENEMY, then reverse all the target sets. For some reason though, it’s not working. As bugs go, it’s pretty annoying.

I managed to do a little more damage to that general to-do list:

from quite a few days ago:
Here’s what’s left to add to the “general” side of the engine:

– Battle animations
– Reading battlescripts and itemscripts from a file
– Full implementation of all the target sets
– Status effects

…on top of that, the target sets are basically finished. I just need to fix that bug that prevents enemies from properly understanding target sets, then I’ve got a little graphical thing, and that’s it.

I finished the code for the battle animations today too. I wish I could put together a little video or something – the glowing and the animation look really smooth in game!

I had a lot of the code for the battle animations already in place for the Hecate contest two years ago, but it had been so long since I’d seen it that I’d forgotten how it worked. Actually, it’s a total mess. It’s pretty obvious that I rushed it to have it ready for the contest (in the Hecate demo, the animation controls Nathan’s sword). I’ve basically got this one big method that has access to all the classes in the engine, and it’s a nightmare to even look at it. Along with that, bits and pieces of it are fragmented in the most random places in the code. There’s nothing seriously wrong with how I implemented it – it’s just a little messy, and probably not how I would do it now. If I ever go open source on this thing, I’ll have to remember to clean it up…

The one remaining thing left to do on the basic engine is to add status effects. I think it should be a pretty straightforward job, as I’ve got a very clear idea of how I’m going to implement them. Basically, I’m just going to take a really general approach. My idea is that I’ll just create a status class containing all the status effects, each one with a name, an initial script to run, a secondary script to run, a restore script, and a script interval. It’ll work like this: when the status is first cast, the initial script runs. Then, if the interval is a positive value, a timer counts down every interval*speed frames and runs the secondary script. If the hero dies, all status effects on the hero are cleared. If a suitable restore spell is cast, this runs the restore script, which basically just tells the engine what to fix to restore his stats.

So to take one example, poison say, the primary and secondary scripts are the same (a simple action which shows a poison animation and reduces the hero’s health). For another, say a paralyse status, the primary effect sets the character’s speed to zero, and the secondary and restore scripts both restore his speed after a set amount of time. You can also have other actions act as restore scripts without doing anything noticeable – regular attacks could trigger the sleep effect restore script, for example.

Anyway, I can worry about that tomorrow. I hate how long this is taking, but I don’t think it’s going to take much longer.

By the way, here are my Clean Asia finish times for the Thailand stage! This is the best game I’ve played all year, heh. I am so going to speed run this game before I go back to work.

* Post a Comment

No comments yet

Leave a reply