Categories
Game Development

Script system done. But useful?

So I spent the last 5 days week implementing and exposing all of Ogre 3D to AngelScript, and I’m starting to feel it was a mistake. All I’ve gained is the ability to run code in text files, and reload them at run time. But that benefit is very limited – slow, hard to debug, less capable than the compiler. And for what I’m using it for I could have programmed it in C++ directly in 15 minutes. As a long-term solution, like if I had a year to develop this, this is a good solution because these text files could serve as data files as well and be output and worked with from an editor, with the ability to debug the script itself. But as a short term solution I’m feeling I wasted 5 days. I have nothing visible to show for my work and it’s not like I have plenty of time to spare. And the worst part is I’m not sure it’s going to work. Angel Script is pretty hard to use and understand. The forum support is good, and what they are doing is a difficult task so understandable to an extent. However, me figuring out means stuff takes twice as long as it should. For example, how do I handle casting references to pointers, or vice-versa? Why does declaring a parameter list of (void) not work, but () does work? Why did they decide not to support pointers, but to require reference counted objects? This means not only do I have to declare script classes for all my game classes, but I have to do it duplicate again for the pointer to that class as well.

If I could do this week over again I should have just hardcoded everything.

2 replies on “Script system done. But useful?”

I think script is only meant for non-core programmer which is called ‘script programmers’. In the games development hierarchy, there should be at least one senior programmer who will code everything in C++ & expose only ‘selective’ functions for script. And the functions should not be low level aka the same level as Ogre’s. It should be higher level than that. For example:-
if (soldier.detectArmy) {
if (soldier.energy > 50)
sodier.runForCover;
else if (solider.energy > 30)
soldier.layOnGround;
}

Obviously, detectArmy function is a very high level function, and it all is implemented in C++.

Okay may I add that script programmers may be supervised by a level designer. So they could pretty much tweak numbers here and there so that the level is hard enough (depending on the level etc).

Leave a Reply

Your email address will not be published. Required fields are marked *