Framework Definition Files

The purpose
Ok, so I think it’s finally time to introduce something I’ve been working on for the past several weeks. This is actually one of the two “bigger” things that I referred to in my previous blog post. As I’ve been hinting a couple of times already, one of our strategies is to design our future coming game making tools in such a way that they’re as modular as possible. That is, we want the languages (such as CoolBasic Classic) to be separate from game engines (such as Cool VES) so that a language is merely a tool to write programs and the user can choose the target framework that best suits his/her needs. This also dictates that language compilers should not be directly dependent from the target execution system (read Virtual Machine). CoolBasic Classic, as a language, thus doesn’t really know about the functions and constants or any other type of symbols that are available in, say, Cool VES game engine. For example, unless explicitly specified, you couldn’t call LoadObject or PlaySound from CoolBasic Classic source, unless you wrote those functions yourself.

So you have to tell somehow to CoolBasic Classic compiler that these functions exist and how to invoke them. What happens under the hood, is that instead of executing CoolBasic source, a game engine (Cool VES) procedure shall be invoked. This is where the Framework Definition Files come in handy. As a part of Cool VES installation, this file is provided. The definition file is passed to the compiler during build operation. It contains a list of function and constant symbols that will get imported to the compiler’s symbol table to begin with. In this way, the compiler is able to recognize those services provided by the target framework, in our case Cool VES game engine.

There are two types of definition files: one is XML and the other is binary. They both host the exact same information about symbols. The XML format is intended for easy reading, and it can be consumed by 3rd party applications. Also, Cool Developer editor reads symbol listings from the XML file so it can highlight the code properly. However, parsing XML can be a bit slowish, and doing so every time we want to build and run our game will be an overkill, simply put. Luckily, the binary format is designed for fast reading and parsing, containing offsets for fast file seeking. The data is stored there as a structured tree so that full scope info is retained. We are planning to publish the binary format specifications (yes, a public document) at some point too, but this information is, of course, subject to change.

The editor application
Needless to say, we needed an editor to create and maintain these definition files. So I created a neat application for that. It’s an internal tool that the DevTeam uses, thus it’s not available to public. This hasn’t prevented it ending up being a quality piece of software, though, and I’ve actually put a bit more time on it than I originally planned. But that just makes a point, eh? We drive for quality! Quality takes time, but in the end, it’ll be worth it. This is how the editor looks:

Cool Framework Definition Editor 0.9

It’s been written in C# (.NET framework 4.0), and that cool dark appearance (something like that will be in Cool Developer’s theme collection, too) is the Expression Dark theme, from Microsoft (and it’s also available for free at codeplex.com).

The video
As a bonus, I decided to try something new, and managed to conjure up something I think can be considered a video. That’s right, I made my first video ever, and put it on YouTube! I have absolutely zero skill and experience in video recording, editing, encoding, and presentation in general. It’s narrated in english (which is not my primary language), and I found out the hard way just exactly how difficult making a video like this can be. Despite careful planning and preparation, I found it surprisingly hard to not begin to stutter midway or how to keep your speech fluent without any moments of disturbing silence. Before the actual presentation, I actually wrote a 2,300 word transcript, but as soon as I got started with the presentation, I noticed I actually had no time to read anything (despite I’d learned half of it by heart). So I ended up improvising it all to the end.

Making the video took me all evening, and I learned how to zoom the screen only after uploading it on YouTube. All in all, I’m pleased to the outcome, but now I know how to do it better next time. Enjoy this 15 minute long demonstration (I recommend watching it in 720p, and yes I know it’s still blurry):

There’s also another video coming, stay tuned!

Comments are closed.

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress