Home
Screenshots
Downloads
Forums
Docs
Servers
Stats
IRC Chat
Mods
SpecialSpecial  SearchSearch  LoginLogin
Main Page -> Modding Basics

Contents

The Basics of Modding

Introduction

Welcome to the basics of modding. Here, you will learn how modding is implemented in Scorched 3D. Modding is term given to modifiying the game in some way.

In Scorched3D the game can be modified by making new levels, weapons, graphics and sounds and using them the change the ones supplied with the game. Although all of these aspects of the game can be changed, a single mod can choose to change only a subset of these things. For example a mod could just add one level, or change the original weapons slightly.

This gives the mod developer endless possibilites for new and exciting gameplay.

XML

Modding for Scorched 3D is fairly easy as there is no requirement for coding skills. It's simply a matter of editing XML files and/or replacing/adding your own media files. The XML files can be thought of as a map for Scorched to follow. They can define anything from colors of effects, to how certain weapons perform, to locations for media files such as textures, models or sounds. Knowing what lines of code to place in XML files is essential to how your mod operates. These lines of code are commonly referred to as the syntax.

With that in mind, if you are not already vaguely familiar with XML or HTML even, you might want to look over these simple concepts about XML in general.

Note to Windows users: By default, XML files may open in Internet Explorer (which will not allow you to edit them). To change this, right-click on the file, select "Open With" and select "Choose Program..." In the list of programs, select a text editor, and check the box that says, "Always use this program..." and press "OK." Something better than notepad is preferable. But, it will suffice. You can now open XML files with a text editor by default.

Modding Directory Structure

Overview

Scorched3D has full support for modding and allows mods to be loaded and unloaded seperately from the actual game engine. This seperation keeps the original game clean from modifications, and also allows different mods to live side by side. From a users (players) perspective this means that they can download and install many different mods without them affecting each other. Mods can even be downloaded automaticaly/seamlessly from online servers when a player connects to play a game.

To allow this seperation it is never a good idea to edit or replace the original files for modding. There are several reasons for this. For one, you may accidentally lose the original files if you forget to backup. Two, if you replace original files, you'll either get an error when entering an online server or your modded files will be replaced with the originals by download (depending on server settings) because all clients need identical files for the game to be played correctly. Lastly, it's just generally messy to do it this way and your mod will not be able to be given to any other users.

Mods Directory

For these reasons, Scorched3D provides a seperate area for all mods to be developed in. The globalmods directory is the root for all mod development. Each mod gets it's own directory under this location.

The location of the globalmods directory is <Scorched3D install>/Scorched3D/data/globalmods :

  • Windows the default location - C:\Program Files\Scorched3D\data\globalmods
  • Unix default location - /usr/share/scorched3d/data/globalmods

If you look under this mod you will see there is already a directory here. The apoc mod ships with Scorched3D and so is installed by default.

 data                   - Scorched3D data directory
   |
   +-> globalmods       - Mod root directory
          |
          +-> apoc      - Apocalypse mod
          |
          +-> yourmod1  - Your 1st mod
          |
          +-> yourmodn  - Your nth mod


Mod Directory Search Order

As previously stated all the files for your mod will be in your own mod directory under the globalmods root. This keeps your mod files seperated from all the other files. However it is still possible to reuse any of the existing Scorched3D files without copying them into your mod.

When Scorched3D is playing your mod it will first look in your mod directory for any files it wants to load. If it doesn't find a file there, it will then look for the file in the original game engine instead.

For example, if the game wants to load the landscapes/mylevel.xml file it will first look for it in as data/globalmods/yourmod/landscapes/mylevel.xml and if it doesn't find it then it will look for it in data/landscapes/mylevel.xml.

This has two advantages:

  1. You can reuse any existing game engine files by just referencing them from within your mod (no need to copy them)
  2. You can mod aspects of Scorched3D by overriding certain engine files.
    e.g. the engine tries to load tanks.xml to give it a list of tanks. Putting a tanks.xml file in your mod will make it load this file instead, thus changing the tanks available to the player when using your mod.

Mod Files

Lower Case Files

When creating any file for a Scorched3D mod it must be created with a lower case filename. Any upper case files are ignored by Scorched3D. This is to insure that your mod is supported on all architectures, including those that don't support mixed case file systems.

Image Files

Scorched3D supports many different image formats. Currently supported image formats are :-

  • 24 bit .bmp files (windows bitmap files)
  • .png files (Portable Network Graphics files)
  • .jpg files (JPEG/Joint Photographic Experts Group files)

These image types may be used interchangeably anywhere an image file can be specified in a mod. There are however a few notible exceptions where an exact image type must be used:

  • Any where the documentation is explicit about which format to use.
  • Files used to specify level heightmaps should avoid using jpg files as this may give slightly different heights on different systems.

Starting A Mod

You have now gained all of the concepts needed to start your own mod. See Starting a Mod to continue...



Edit this pagePage historyWhat links hereRelated changes
Northern Rock | Bad Credit Credit Card | Loans | Remortgages | Home Loan
Safe
OpenGL Supporter Available for Linux Available for Windows Available for Mac Available for Solaris Available for Gentoo Available for Debian Available for Slackware Available for FreeBSD
Donate to Scorched3D Visit Scorched3D at SourceForge.net Get it from CNET Download.com! 5 Stars
© Copyright 2008 Gavin Camp. All Rights reserved.