-
Notifications
You must be signed in to change notification settings - Fork 1
Home
The Wolf-Gang Engine is a 2D, RPG-styled engine for creating extremely interactive scenes. The goal is to encourage expressiveness in storytelling and the flexibility to do things as you please.
This flexibility also means that this engine will not be simple. It is primarily designed for those with a good grasp on programming so it may not be suitable for beginners.
This document will describe most (if not all) thingys and things related to the engine. I'll try to provide details and examples of usage as well. Hopefully; it ain't too messy....
###Units With the current version, one unit in the engine is entirely dependent on the tile size. If you choose a tile size of 32x32, anything placed at unit (1, 1) will techinically be placed at pixel (32, 32).
Textures are the basis of most (pretty much all) graphics in this engine. I highly recommend PNG format. Wait, no... I require it. The PNG format uses lossless compression meaning your image is not downgraded or decreased in quality. It's under the zlib license which means you can use your game any way you want without any royalties or whatnot.
The engine checks for png files in the data/textures
folder and associates an xml file of the same name in the same directory to it to use as the atlas. For example; if you have texture data/textures/foo.png
, its atlas would be at data/textures/foo.xml
.
NOTE: Every texture will need a unique name even if they are in separate subdirectories.
Walk-cycles, for character entities, are defined entirely by the name of the atlas entry.
Nameofcycle:direction
All character entities default to the "default" walk-cycle (More specifically: Entry named "default:default") when they are created.
A scene is comprised of an "xml" file and an "as" file. The xml file contains the settings of the scene. You probably don't want to touch these as they are generated by the editors. The "as" file ( AngelScript) contains the script that will be executed. If you thought that was actionscript, you thought wrong.
Angelscript is the main scripting language in the Wolf-Gang engine. Here is a basic starting point:
[start]
void helloworld()
{
say("Hello World!"); // Say thing
narrative::end(); // When done with the narrative, close it.
}
All you need to do is refer the path of this script in the <script>
element in the scenes xml file and it will execute it.
Yay, you now have a scene! This is minimal you'll need for a working scene. I recommend placing both scene files in the "scenes" folder.
As you may have noticed in the script above, there is a thingy before the function: [start]
This tells the engine that this function should start when the scene starts. The great thing about this is that you can have several functions declared with this and each function will start at the exact same time. Which means that there can be several functions running at once:
[start]
void dothing()
{
...
}
[start]
void alsodothing() // At the same time
{
...
}
This is especially useful when having a function handling some logic or something and then another function does magical effects. Remember to keep their functionality as separate as possible, otherwise, you may be in a world of hurt.
Note: A trigger is called once at a time. So if your stand on one, it pretty much doubles a loop unless you use the "once_flag" function described later down below.
You can also add a "vec" parameter and the engine will give the position of the pointin which it was triggered at:
[trigger x=1 y=2 w=2 h=3]
void trigger_thing(vec pPosition)
{
// Do things
}
You can find documentation of script functions and their usage here.
Separate things into well-defined functions. A function name is more effective than a comment.
Naming/style consistency. Don't get confused over what is what!
Small scenes! Big scenes are hard to maintain. Keep things simple. Best idea is to allocate one scene per room.