River Nyxx

A development blog for FFVI3D, the fan-made Final Fantasy VI remake in 3D.

平成20年2月12日火曜日

Script Manager is live!

I've now got a working (albeit just barely) script manager implemented into FFVI3D. It's composed of a virtual machine that interprets opcodes that are all linked in sequence in a script object, for the most part. It also acts as (currently) a dumb interface to simply execute a script by name (as saved in the script file).

The scripts are saved in a pseudo-XML format, in that some script parameters are stored in XML, but the main part of the file, the script, is stored as plaintext inside an tag. The scripting language I've created for FFVI3D is currently pretty limited, as I still have yet to implement a lot of the major things in it. But the opcodes are there and accepted fully by the virtual machine, it's just that the parser doesn't yet convert script into opcodes for everything yet.

A simple exaple of a script that I have currently, which I was using for testing is this:



function test(string:text);
print:text;
print:"const text";
return:"arg";

entry;
test("var text");
print:"return text";
end;


So as you can see, it currently supports defining in-script functions, and some simple print-to-console commands. It also supports other commands such as one to show a gui layout by name, one to hide the current gui layout, etc.. but they aren't in that test script.

I'll be spending the next couple of days implementing the remainder of the major parser script-to-opcode conversions, and an automated means thru which an object in my code can contribute any number of it's own functions to the list of available functions, as well as automated means for the parser to know/use them.

With that outta the way, I'll be going back to my to-do list, knocking off the remainder of the small stuff that I had to touch up in my reworking of the code. This scripting thing was by far the largest thing on that list, so the rest of it should go pretty quickly.

On the horizon: I'm going to start seriously looking at managers required to start a battle game state. In the coming weeks/months, I think we can look forward to a battle state slowly starting to show it's ugly head in the works, which will be the first _REAL_ visual experience of FFVI3D- I'm all excited about that^^

ラベル: , , , , , , ,

平成20年2月4日月曜日

A setback, and starting with new things...

So I spent most of last week working out some way to effectively change the resolution of FFVI without having to quit and restart. You see the issue is that with the Irrlicht Engine, you cannot dynamically change the resolution and everything will be fine. You have to actually properly shut down the IrrlichtDevice and create a new one with a different resolution setting.

I spent about 3 or 4 days working some code in to make sure everything that needed to know the device was going to change, knew.. but it started getting to the point where I was writing a hack to make a hack work so it would hack another hack into making the whole thing work. Not even close to clean. I can deal with some hacks, as they tend to be temporary, but this was just getting rediculous, and I knew some of them just couldn't possibly be temporary.

So I scrapped everything I had done in that direction and looked at it from a different perspective after taking a small break. In a matter of 2 nights, I wrote up a new means thru which to not only effectively, but CLEANLY do what I wanted to, and I proceeded to work out all the memory leaks, and all now looks well^^ I'm quite happy with how my code turned out.

After that, I went thru my to-do list, cleaning up a buncha stuff that got dirty while I was doing all this, and got back down to the major points on the list again. The 2 things that really stuck out was to go back thru my code and fix everything that I had left notes to myself to fix, and to implement a means thru which the various menu items could actually DO something. (Technically, the latter is a member of the former, but ah well...) This menu item action thing is actually the last piece I need to implement to have 100% of my previous code working again, but it's actually going to take a bit before I get them working again, as I'm going to do it properly this time.

And the new thing! I am now writing a virtual machine to execute external scripts. These scripts will be specific to FFVI3D, but will be easy enough to figure out. They'll likely be in a similar style to BASIC, but I might go so far as to make them feel more like C/++.. Not that any of this will matter to the player, but it'll be a LOT easier for when I get around to putting some events/ingame cutscenes/etc.. in. I'll also be using scripts to define what each menu item will do when selected. But I really haven't gotten far into this yet, so I'll update later on it.

ラベル: , , , , , , , ,