Well I promised to write an update yesterday, so that's what I'll do. In this blog entry I'll primarily write about general software design process and the profits of scripting. It's more theoretical and there won't be much talk about Transcend itself, but I think it'll still be interesting.
Alright, first, the software design process isn't an easy one. You can't really schedule it well because you can't design the software in one go without any problems. To get an appropriate schedule, you need to divide up your work into cycles. These cycles usually include a planning phase, a coding phase and a testing phase.
The first trick now is to try to get as many cycles as possible, as fast as possible. With every cycle, you refine your product and get errors, mistakes and flaws out. If you do few cycles, you're going mostly by luck, because you can't test and fix a lot.
The second trick is to try to divide the project up into different smaller cycles, that each only consider a subset of the whole. That way you can make sure to concentrate on the individual aspects, instead of having to jump around all the time.
This becomes even more important when you not only have to deal with coding, but also art, music, design and so on. You need to balance everything out as well as possible to get a good chance at succeeding (in time),
Have a figure: [img]http://4.bp.blogspot.com/_orZlfcV2GjA/TPaJ5QkhiVI/AAAAAAAAACs/Sk3qL_vRSd0/s1600/sdlc2.jpg[/img] The only thing differing from this in the usual game development process is that the release step only comes after (hopefully) many cycle iterations.
Now, of course, if you have a deadline, you'll want to increase the development speed as much as possible. However, since game design is largely based on trial and error, planning things is difficult and it'll never work from the first try. Most likely you'll have to test hundreds of different settings until you get a good enough formula that's actually fun to play. Usually, every time you change something, you need to recompile the game, start it, go to the place to test, try it, close it again, change the code and begin the cycle anew. This is very slow, especially when the project is big. The solution to this problem is scripting. Meaning the game engine has some sort of scripting interface, with which the game mechanics are built. Script languages are of course, slower because they either need to be wrapped into another language entirely or be accessed through an interface and be executed at runtime. This shouldn't be a problem though, since this is hardly noticeable on modern computers. The advantage of this system is that you can change the mechanics/settings during runtime almost completely, saving you a lot of time.
Since I can't use any other libraries than LWJGL (and Slick-Util), I had to program my own scripting language. Here's a sample of what a script file looks like:
NexT/script
//statements are separated by line breaks //comments can be // for single line or /* */ for multi line //define global script variables int a=10 double b=0.5 string c=“test” boolean d = true
defun myFunction{ double temp = (+ 5 a (getRandom 0 100 ) (sin b ) ) //mathematical expressions are based on LISP syntax return temp //you can only return variables }
defun getRandom{ //arguments are not specified, can be accessed by $n int temp = (+ (floor (* (rand) $1 ) ) $0 ) return temp }
Of course, it's very limited and a syntactical nightmare, but it does the job (I wanted to get this done quickly). You can access variables and functions from the engine out or from the script functions themselves. The engine automatically looks for changes on the script files and reloads them. This makes it really easy to try out things that affect the gameplay. Combined with the in-game world editor, this creates a pretty sweet game creation suite.
Anyway, I guess that's it for now. Oh, before I forget it: The editor will be available in the final release, but you'll have to change a constant in the advanced dialogue of the settings window.
–>Nick over and out. [img=http://img.tymoon.eu/bronies/13144401444397.jpg]style=‘max-width:500px’[/img]
Written by shinmera