Frogtoss Games
     
 
     
             

Featured Game

Verticube Logo Verticube Screenshots

Break Blocks to Bright Beats!


Modding Verticube

It's possible to create custom levels for Verticube.  If you know how to use a paint program or a sound editor, you can produce your own levels for the registered version of Verticube.

This guide will take you through the steps of creating a level for Verticube with new sounds, playing it, packaging it up, and sharing it with other people.

What You Need

In order to follow this tutorial, you should have the following:

  • A registered copy of Verticube
  • A paint program capable of saving 32-bit BMPs such as The GIMP.
  • A text editor.  Notepad will do fine.
  • Optional: A sound editor capable of creating wav files.

Getting Started

The first step is to locate your Verticube directory.  Once you've found where you told the installer to put the files, you'll need to create a folder for your mod.

Verticube in Explorer

In the pictured directory, create a new mod directory.  It can be anything, as long as there are no spaces, and it is in lowercase.  For example, "spud" will do nicely.

Next, click on verticube.exe, and select "Create Shortcut".  You are making a shortcut to Verticube because you want to run it with different parameters.

Verticube shortcut

In the "target" field, add "+set fs_game spud +set cheats 1" to the text that's already there.  This enables cheats, which helps development, and tells the game to look for files in "spud" before falling back to "resource". 

Your First Tweak

For example, if you have a file called "spud/cache/bugoff/block_one.bmp", it will load that instead of "resources/cache/bugoff/block_one.bmp".  Try it!  Create the necessary directories and a new file called block_one.bmp. 

In your image editor, save block_one.bmp as a 32-bit image.  Because it is a game block, it has to be 42 pixels wide by 42 pixels tall.

Run the game using the new shortcut you created.  In order to fast forward the game and see your changes, bring down the console by pressing the tilde key (~).  Now, type nextlevel.  Each time you do this, the game will advance by one level.  Hit up arrow and enter to repeat the command.

Modded Bugoff Theme

In the above image, block_one.bmp has been replaced by a yellow and red smiley block.  Whether you agree this is cool or not, you should now be ready to create your own mods for Verticube.

Read on to understand the specifics!

Definition Files

Definition files are the centerpiece of Verticube modding.  If you understand how they work, you can create anything within the puzzle game engine.

Definition files contain key/value pair combos.  For example, if you had a key called "cat", and its name was "Snowflake", you could add that info to the definition file like this:

<key name="cat">Snowflake</Key>

Astute readers will notice that these files are XML.  You must keep consistent formatting with what an XML reader expects, or the game will not run.

Inheritance

When creating a definition file, sometimes you see "inherit":

<Inherit name="Base"/>

This tells Verticube to include all of the definitions in "Base" in the current definition.  If a key exists multiple times, the last one is the actual key value.

Creating a Theme

Creating a new theme is done by creating a definition file, and setting certain keys to certain values.  The best way to get started is to copy an existing file to a new one, and to change the information in the file on an as-needed basis.

To start, copy "resources/cache/def/candy.def.xml" to "spud/cache/def/candy.xml", and open the new file in your text editor.

Types of Keys

There are a number of different key types in a theme definition.  Here is a description of the ones that may interest you:

  • Ones that end in ".Img".  These point to files on the disk.  You don't specify your mod, but instead the paths underneath.  In addition, you use $img instead of .jpg or .bmp.  So, spud/image.bmp becomes /image.$img.  The image section below explains why some images have the .xml extension.
  • NextTheme.  This is the theme that comes after this one.  If you create a new theme, use this to chain it.  This is very important!
  • Ones that end in ".Snd".  These are wav files that are played at different intervals.
  • Ones that end in ".X" or ".Y".  These contain screen coordinates for different images.  You'll find a lot of these in base.def.xml, though they can be overridden.
  • Music.  This should be a path to an ogg vorbis file.  You can download a free wav to ogg encoder, and use any tune you want with your Verticube mod.
  • TrailInterval and NumTrails.  These are graphical effects for the blocks.  Each theme can specify how much, if any at all, they want to use.

Creating Images

All images in Verticube are either jpeg or bmp.  You can make part of your image transparent by making pixels in the image cyan (red: 0 green:255 blue:255).  In order to see this, open "/resources/cache/sludgefactor/block_one.bmp".  You will notice that some of the edge pixels are bright blue.  They show up as transparent in-game.

XML Shaders

There is basic support for "shaders" in Verticube.  Shaders are special rendering rules for images.  If a definition file has an image listed with a ".xml" extension, that is a shader.  Shaders make possible the following:

  • Animation: The ability to have multiple frames that cycle through
  • Transparency: Use OpenGL's blending capability for transparency

I will make the details of the shader language available if modding becomes popular enough for me to document it.  For now, you can follow the available examples.

Distributing Your Mod

Although there are many ways to create installers, the best way to do it is to create a batch file that runs your mod.  Next to verticube.exe, create a file called run-spud.bat.  Inside, add:

@ECHO OFF
@verticube.exe +set fs_game spud

Zip up your spud directory, along with run-spud.bat.  Now, a user should be able to unzip your directory into their installed Verticube directory and click on run-spud.bat.

What you can't do

Please do not make mods for the shareware version of Verticube!  I would appreciate it if all mod authors created their mods in a way that made them only work with the full version.

In addition, you can't commercially exploit, sell your mod, or describe its contents as being an official Frogtoss Games creation.

Thanks for doing it by the rules.

Finally

If you create something worthwhile, post it to the forums!  We'll all take a look at it.