[]=================[]
||  Cas-Stunts II  ||
[]=================[]


1. Introduction
2. System requirements
3. The editor panel
4. The terrain editor
5. The track editor
6. Shortcut keys
7. The configuration file
8. Contacting the author


[ 1 ] INTRODUCTION

	Cas-Stunts is a track editor for the 1990 game Stunts. Stunts was developed in 1990 by DSI and has no network support at all, but even today, in 2015, an active community of Stunts racers exists and a number of tournaments are avaiable based on this incredible game.
	Although Stunts does include a built-in track editor, it is limited by several factors. This, and the fact that many users in the 90s didn't know that the built-in editor could also edit terrains, led to the creation of several terrain editors and a couple of track editors external to the game by different people. Yet, these programs are usually very old and some do not even support a mouse.
	Cas-Stunts is a brand-new, multi-platform editor, with many new featues. The interface is very user-friendly, yet simple and is now a live project, evolving in real-time and accepting suggestions.


[ 2 ] SYSTEM REQUIREMENTS

	The editor includes executable files for DOS, GNU/Linux and Windows. The DOS build is tested to run properly in DOSBox or under FreeDOS, with a DPMI (it is a 32bit FreeDOS program). The GNU/Linux build is a 64bit ELF file and will not work on 32bit distributions. The Windows build is a 64bit PE file and should run normally on all 64bit versions of Windows.
	Cas-Stunts can handle track files from both v1.0 and v1.1 (which are identical), but can also read and write the tracks contained in replays of these two versions, which have different formats. The editor will work even if Stunts is not installed and does not require any of the game files to run.


[ 3 ] THE EDITOR PANEL

	When the program starts, the track grid will be visible on the right side. On the left side, there's the editor panel. Clicking on the icons near the top of the panel allow for clearing the grid and loading and saving tracks.
	Near the bottom, there's a track element palette, along with a page selector. Twelve pages are available. The pages can be selected by clicking on the corresponding selector icon or by pressing the keys F1-F10, just like in the built-in editor. The last two pages are the terrain pages and they have shortcuts too: page 11 is the default terrain editor palette and works just like in the built-in editor. It is activated by pressing SHIFT+F1 or F11. The last page is the new brush-like terrain editor. It can be selected with SHIFT+F2 or F12. In GNU/Linux, a bug in the compiler prevents F11 and F12 keystrokes from working properly. By pressing the letter "T", you can switch between the two terrain modes.
	As you move the mouse cursor over a track, you will notice the grid coordinates will update near the centre of the panel. Below the coordinates, there will also be a description of the track element currently being pointed. In debugging mode, hexadecimal codes for the currently pointed terrain and track elements will be shown instead.
	In between the grid info and the palette, there's the background selector. By clicking on it, you can choose among the five available track background images.


[ 4 ] THE TERRAIN EDITOR

	Two terrain editing modes exist. Palette page 11, which is selected by clicking on the top-right corner of the page selector or by pressing SHIFT+F1 or F11, or "T" if any other page is currently selected, is the classic terrain editor. It works pretty much like the built-in terrain editor: you use the left mouse button to pick a terrain element from the palette and with the same button, you can place it on the grid. Keep pressing the button and draggin to continue painting. The right mouse button is hard-wired to grass. You can use it to delete terrain elements from the grid. While this mode allows you to set any terrain element anywhere in the grid, it is not the recommended terrain editing mode for most of the time. I suggest only using it for minor touches.
	The enhanced, brush-style terrain editor can be found at palette page 12, which can be selected by clicking on the bottom right selector icon or by pressing SHIFT+F2, F12, or also "T", if you are currently on page 11. While on this mode, you can click on the left or right side of the palette to choose either water or mountain. You can also press the spacebar to switch between the two. Instead of pointing to boxes on the grid, you now point to verteces. The left mouse button will raise the terrain (if mountain is selected) or flood it (if water is selected) and the right mouse button will respectively lower or dry the terrain. It is a lot faster to design a terrain this way.
	Because Stunts does not include terrain elements with only two opposite verteces risen, some shapes are not possible. This may come unnoticed in the regular terrain editor. While in brush-style, however, it may become apparent how rising or lowering a certain point sometimes can affect a number of other points as well. This is done to avoid unfinished terrain borders.


[ 5 ] THE TRACK EDITOR

	By selecting any of the palette pages 1 to 10, you enter track editing mode. The distribution of the track elements in the palettes is the same as in the built-in editor, except for two new elements: the player's car and the opponent's car. These elements were excluded from the original editor most likely because they were not meant to be used as track elements, but only as a place in memory to store the track models for easier rendering at game run-time. The player's car will always be identical to the car you select to run the race and will point North. The opponent's car will only appear if you select an opponent, will also point North and will be just like the car you choose for your opponent. Both cars are passable.
	You can freely select and paste any track element anywhere on the grid by using the left mouse button. Use the right mouse button to delete the track element from the grid. The middle button can be used to select an item from the grid (as opposed to from the palette). Items can be placed even where a conflict with the terrain could exist. In those cases, by default, a warning colour or icon will be shown on the terrain.
	There are three kinds of terrain warnings you can find in the editor. The first ir a red square. You will likely never see this one. It means that the element at that position is not known and is preventing the track from being run in Stunts. This is not an actual conflict with the track, but an error in the terrain itself. Cas-Stunts will never generate this by itself. Another, more common, warning, is a yellow square in the grid, underneath the track element. This means the track element is in conflict with the terrain and the result is unpredictable. Both the track element and the terrain will likely be invisible during the game, but the track might also just be rejected or may cause the game to crash. You can resolve these conflicts by removing the track element. That way, you will be able to see the terrain element again. The third conflict occurs when track elements bigger than 1x1 and not designed for water terrain are actually placed on the water. Only one of the element boxes will be in conflict and will show like green and blue lines. If this is left unchanged, the track will run, but at that place, the track will look like there is grass, yet, if the car drives on it, it will sink.
	Some track designers enjoy so-called "illusion tracks" and may actually try to create these effects. Others may prefer to avoid these "awkward inconsistencies" in their tracks. In either case, it is good to know when and where these things will happen. This is why, Cas-Stunts is careful to show these warnings. You might anyway want to disable them, for example, to take a snapshot of the track or to look at a terrain element currently hidden by a yellow box. You can enable/disable terrain warnings by pressing CTRL+D.
	In addition to track-terrain conflicts, Stunts track format allows for track-track conficts to exist. By default, Cas-Stunts works like the built-in editor in this respect, preventing the user from generating these conflicts, but this can be disabled by pressing CTRL+E. With track-track conflicts enabled, you are able to place a track element on another bigger track element, breaking it. The old track element will not be deleted and you can continue editing the track. The effects of this will often not be desired. The track will sometimes be accepted by Stunts, but when approaching the conflict zone, the player may find inconsistencies. The track object may flicker intermittently between the two elements in conflict. The collision engine may suddenly change from recognising one of them to responding for the other one, causing an unexpected car crash. If warnings are active, track-track conflicts will appear as a yellow hollow box bordering the offending sub-elements.
	While in debugging mode (CTRL+X), composite track elements will not display as such. Rather, only the parent sub-element will be shown normally, while the others will appear as arrows pointing to it. This can be useful when creating custom track elements or to detect the nature of track-track conflicts.
	The complemental sub-elements can be selected as the current brush, both with debugging mode enabled or disabled. This can be accomplished by pressing the keys X, Y and Z, for the East, South or South-East complement, respectively.


[ 6 ] SHORTCUT KEYS

	The following is a list of the shortcut keys you have access to while you are at the editing screen of Cas-Stunts.

	F1-F10		Change track palette page
	F11/SHIFT+F1	Select classic terrain editor palette
	F12/SHIFT+F2	Select brush-like terrain editor
	T		Switch between the two terrain editor modes
	SPACEBAR	Switch between water and mountain
	CTRL+D		Enable/disable grid graphical warnings
	CTRL+E		Enable/disable conflict generation
	CTRL+R		Redraw the track and terrain
	CTRL+X		Enable/disable debugging mode
	X, Y, Z		Select complemental sub-element for track brush
	ESC		Exit Cas-Stunts


[ 7 ] THE CONFIGURATION FILE

	The file cast.cfg, included with the program, is the configuration file. It is a simple text file that must always be present in the program's directory for it to run. Each line is composed of a parameter name, an equal sign, and a value for that parameter. If the paramenter is not known, it will be ignored. A colon will cause everything after it to be ignored in a line.
	So far, three parameters are recognised by Cas-Stunts for its configuration:

	tracks		- Specifies the directory where tracks are found
	superpositions	- Enables or disables conflict generation
	warnings	- Enables or disables terrain graphical warnings
	graphics	- Specifies the track graphics file to be used

	These parameters are read at program start and applied immediately. For each of them omitted (or commented) in the configuration file, there is a default. Following are the default for the configuration parameters:

	tracks		- Same as program's running directory
	superpositions	- Off
	warnings	- On
	graphics	- castgfx


[ 8 ] CONTACTING THE AUTHOR

	In case of any question, issue or suggestion, or if you would like to say "thank you" or send a donation... :P  ...you can contact the author at castunts@gmx.com. Please understand that, while I will do my best to help and to take your suggestions, this program is freeware and comes with no warranty.
