River Nyxx

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

平成20年3月19日水曜日

Time to get this battle started~

Okay, so I've now gone thru and finished off my script manager, and I've created a screen processor for handling full screen shaders, "filters" if you will. I can now stack filters to have multiple effects at the same time, applied to either the 3d Scene, or the whole screen including the GUI. I've written up a simple "mosaic" shader in HLSL and it now gets applied to the screen (with varying strength) when you try to select a disabled menu item, or back out of a menu you're not allowed to back out of.

I've also created an audio manager for handling of all music/sound effects in game. Currently all it does is act as a music play control, and a means thru which my classes can acquire 2d sounds, that is, sounds that don't represent anything in 3-Dimensional space, such as GUI sound effects, etc... Once I start having something in a format I want to represent it in, in 3D, I'll be throwing in the functions for 3d audio as well. And that, my friends, should be coming soon enough.

I've got back and streamlined a bunch of my initialization functions, making them faster, and more importantly, I've implemented a means for the game to compile my custom scripts into a format that it can load MUCH faster. I ran a test on my long test script, and when left to parse/load the raw script, it took 183 milliseconds to load, but after compiling it, just loading the compiled version took under 2 milliseconds! Yesyes, much better. *nodnod* FFVI3D can also load both compiled and non-compiled HLSL shaders now as well.

The commands available to the scripting language have been extended a touch to include option value acquisition as well. And also scripts can now be attached to interface layouts, to be executed when the layout is opened/closed/paused/resumed as well, which is quite useful for self-adjusting layouts, such as an options/config screen.

So now, I'm looking at what to do next, and I think it's finally time to start dipping my toes into the battle-state lake that I have been eyeing for quite some time now. Tonite I'm going to start work on some of the frameworks required by the battle-state so that I can start coming up with something real to show off sometime in the hopefully-not-quite-so-horribly-distant future^^

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

平成20年3月1日土曜日

Script Manager down, who's next?

So, the 2nd iteration of my Script Manager is up and running now. Everything is working beautifully, it's fully recursive, which means I can have expressions with parentheses, and math in function parameters, etc.. It also looks a LOT like C++... the only really noticable difference is that I don't use curly braces ( "{" and "}" ) anywhere, and opted to instead go for a "if/endif" and "while/endwhile" route instead. Other than that, it looks quite a lot like C++, function definitions, etc.. Well, I guess more appropriately, it would be closer to C, since my scripting language doesn't support objects, but whatever.

So this is the final test script I was running to make sure everything was working fine (and it is!), just so you can have a taste of what the language is capable of. Take note, that this doesn't actually make any calls to functions in the game itself, but they are fully supported (I was testing those in a different script file...)

number testFunction5(number x, number y);
number i;
i = 2 * (2 * ((1 + 1)) + 2) / 3;
print("*****FINAL RESULT*****");
print(i);
number r;
r = 5 * x * y;
r = r + 50;
r = r - 23;
r = r / 10;
string tst = "part1:";
tst = tst + "part2";
print(tst);
return(r);

void testFunction2(number num);
print(num);
num = 45;
print(num);
return;

string testFunction(string str1, number numbah);
print("Output- displays nothing since it is only useful mid-operation");
output;
number num = numbah;
print(str1);
print(32);
print(num);
print("constant text called explicitly");
expose;
return("text returned from function to main");

void testFunction3();
print("Test function 3");
return;

number testFunction4();
return(1337);

entry;
number n1;
boolean boo = false;
string s;
print("Before loop scopes:");
expose;
print("Inside loop scopes:");
while (n1 == -1 && !boo);
print(s);
s = s + "a";
if (s == "_aaa");
boo = true;
endif;
expose;
endwhile;
print("After loop scopes:");
expose;
while (n1 < 20);
print(n1);
n1 = n1 + 1;
endwhile;
while (n1 <= 40);
print(n1);
n1 = n1 + 1;
if (n1 >= 34);
break;
endif;
endwhile;
string str1 = "yay!";
string str2;
number num1;
print("Before ifelse scopes:");
expose;
if (str1 == "yay!" && str2 != "" || num1 == 0);
print("Inside ifelse scopes:");
expose;
print("Before if scopes:");
expose;
if (str2 == "_");
print("Inside if scopes:");
expose;
print("true");
endif;
print("After if scopes:");
expose;
else;
print("false");
endif;
print("After ifelse scopes:");
expose;
number num2 = 100;
str2 = "text";
num1 = 50;
string str = testFunction("text passed to function and thus is stored in variable", 42);
testFunction2(3);
testFunction3();
number ret = testFunction4();
print(ret);
print(str);
number n = testFunction5(num1, 23);
print(n);
boolean b = true;
number nr = 1.5;
print(nr);
expose;
end;
Of course, all of the variable names, constant values, etc.. are all random and make no sense whatsoever, as they were only being put in to test specific constructs in the scripting language itself. As far as the scripting language itself goes, there's only 3 things I'm currently considering still putting into it: do/while loops (which we can do without, as we have a basic while loop...), and for loops (which we can also do without, but it would be less scripting for a simple type of loop, if it was implemented), and lastly, a means to have the script wait for something in-game to occur, and trigger the script back into action again to finish off. The main thing I'll need this for is to implement in-game cutscenes, so I can have a script (for example...) tell a character to walk north 10 meters, at which point the script will wait until the character arrives at that point, at which time the script could continue to tell that character to say something, or some such.

Now I'm quite firmly involved in finishing off all the little notes I left for myself in my code months ago. With all those little things done, I'll be working on the battle state.

ラベル: , , , , , ,