Unfortunately, looks like I've come across another huge problem with MMF2. MMF2 does not handle scripts very well at all. Something as simple as (A+B+C)/D becomes a long, tangled, buggy mess.
So, I'm going to rebuild the project from the ground up. This time, Lua is the brains and MMF2 is the body. Lua is a brilliant scripting engine, able to write and read scripts quickly, cleanly, and without much hassle. But, it has almost no game-making capability.. takes a hundred lines to make a simple thing that doesn't require a single line in KNP. MMF2 on the other hand.. has brilliant 2D power, but it's got almost no scripting power at all.
Changing to Lua solves almost all the tough objectives of this project so far:
1. A fully moddable system, so that people without the source code could even make their own weapons, creatures, and cities.
2. More efficient storage. Basically, what I wanted to do was put a Head on a Body, and Eyes on the Head. A flexible array took up 1MB to do this, and most of it is empty space. Lua lets me use tables, which is basically an array with empty spaces that don't go into the memory.
3. Self-calculating stored values. It takes 7 events and 120 fastloops to load a single weapon. It takes some more to load other things like armor, and calculating the values into age. Am I going to copy-paste all of this across every frame? That's a waste of time! I could pre-calculate and store, but that would introduce a lot of bugs. But this beautiful thing called Lua.. it lets me calculate everything neatly, especially because of functions.
So, it's pretty obvious.. if I want to finish this by the end of next year, I have no choice but to use a Lua-MMF2 combo.
But unfortunately, the MMF2-Lua isn't exactly the same as pure Lua. So, I'm going to make another script-heavy game, just for practice. Combatant is too big and heavy to use for practice, so I'll start off with something else that needed a lot of scripts - Trap Designer. Combatant will just have to wait another month.
The only reason Project Progress isn't back to 0% is because a lot of the design has already been finished.. just have to convert it to code.
|