Hey again.
I've been working on MnD's inner workings a bit, and I've got some new stuff to report:
First, error reporting has been vastly improved, since now it'll report the line number an error occurred on. This includes both syntax errors (detected when the script file is loaded) and runtime errors.
Secondly, I just got done coding up some major optimizations for collision detection. This has bumped up the game's performance considerably.
I have two collision performance test scripts, which each just create 100 objects that can all collide with each other. One script uses circular objects, the other uses laser objects. To give you an idea of the improvement, here's the FPS numbers for the old and new collision algorithms:
| Old Algorithm | New Algorithm |
Circles | 35-41 | 56-62 |
Lasers | 26-29 | 52-57 |
... before you start thinking that it's bad, since it's choking on "only 100 objects", keep in mind that each of those objects is being collision-checked with
every other one; this results in nearly 10,000 collision checks per frame. This is something that wouldn't come up in a normal script - a lot of object pairs have no reason to be collision-checked, since there's no scripts to run for such a collision.
Here's the latest look at the running "to do" list:
Checklist update:
Bullet definition files- Additional functions for:
Random numbers- Some more mathematical functions like the power function.
- The drawing functions.
- Improved audio control (loop points, pausing/resuming, possibly fadein/fadeout)
- Improved bullet shooting functions like CreateShotA to avoid having to script overtly simple patterns with objects
Default support for:Lives/respawningPoints/GrazeBombsPower system
Plural files, stage files, possibly game files?Lasers- User-defined functions/subroutines/tasks.
Message functions for objects.- Various bugfixing
- Code optimization to make the program run faster (major progress)
Better error handling (mostly done)- *Low priority* Dialogue events.
- *Low priority* Effect objects with vertices, 3D drawing.
- *Low priority* Replays.
One more thing - I had another niffy idea, and I figured I'd throw it out here:
To help scripters figure out issues in their scripts, I was thinking of implementing a runtime script debugger. I'd have it be a separate program that connects to MnD via a socket (meaning you could, if you wanted, run it on a different computer than MnD itself is running on), and allow you to set breakpoints, inspect variables, and other fun things. :3
It'll be a bit to implement, but I think it'll go a long way to help people figure out issues in their scripts. Also, based on how I plan to implement it, it'll force me to refactor some of the script engine, which also will help with other things (like implementing tasks).
I have a basic idea of how the communication protocol for the debugging interface will work - it'll be all-text, so it won't be a pain to implement another program to interface it (or, if you're a bit crazy, access it through
telnet :V )