Skip to content
Tesserex edited this page Jan 21, 2012 · 2 revisions

The main file, usually called game.xml, is the entry point for your project. When you want to load your game in the engine, select this file. This page will explain how to write this file by hand.

Table of Contents

Opening Tag and Global Declarations

The highest level tag of the file is called "Game". It takes a few attributes, but they're all optional.

 <Game name="Engine Demo" author="Tesserex" version="1.2.0.0">

These three attributes are not used in the engine. Right now they're only accepted by the editor, and don't have any effect on the behavior of the either.

Size

Screen size is specified as a single short tag, and given in pixels.

 <Size x="256" y="224" />

The standard screen size on NES is this, 256 x 224 pixels. Using standard 16 x 16 pixel tiles, that's 16 x 14 tiles. Remember, this is only how many "game pixels" are on the screen. You can stretch the actual engine window to whatever size you want.

Music and FX

There are two ways to include audio into the engine: as NSF files (NES Sound Format); or as WAV audio files, also known as the stupid way. The two can be mixed in one project, but I wouldn't recommend it - you're likely to hear errors in playback.

WAV files

If you go this route, you don't need to do anything at this level of the main file, because these audio files are referenced where they are used.

You can actually use any audio format accepted by .NET, but some formats with higher compression also have buffers at the start and end of the file that prevent smooth looping. Obviously WAV comes at a huge file size cost.

NSF files

Because NSF are the native format used on the NES, they are recommended for use with the engine. They are much smaller in file size, and preserve an authentic sound.

You need to tell the engine where your NSF files are located, one for music and one for effects. They can be the same file if you like, but you still need both tags.

<NSF>
    <Music>music\music.nsf</music>
    <SFX>music\sounds.nsf</sfx>
</nsf>

Hopefully the above is self-explanatory.

Starting Point

To tell the game where to start, use a Next Tag. I know this seems weird - shouldn't it be called Start? The reason is that this tag is used elsewhere to connect separate game states together, so one state, such as a cutscene, will tell the engine what the Next state is, like a stage.

 <Next type="Scene" name="Title" />

This particular tag says that the game begins with a cutscene called Title.

Stage Select

Pause Screen