Difference between revisions of "Creating enemy routes of battle arenas with Wiimm's tools"

From Custom Mario Kart
Jump to navigation Jump to search
Line 54: Line 54:
  
 
== Standard routes and dispatch points ==
 
== Standard routes and dispatch points ==
 +
[[File:ENPT of GCN Cookie Land.png|250px|thumb|ENPT routes of GCN Cookie Land]]
  
 +
9 of 10 battle arenas by Nintendo use [[Dispatch Point]]s. Here we use '''GCN Cookie Land''' as example. You can find the full de-compiled enemy route definition [[Creating enemy routes of battle arenas with Wiimm's tools/code examples#a24|here]].
 +
 +
???
 +
 +
<pre>
 +
# zero based index: 0,  prev: 10,  next: 12
 +
$GROUP G1,  next: DP4
 +
$PREV: DP2
 +
.... some points
 +
</pre>
 +
???
 +
 +
<pre>
 +
# zero based index: 10,  prev:,  next: 0 3 7
 +
$GROUP DP2,  next: G1 G4 G8
 +
$PREV:
 +
$SETTINGS: 0 0x80 AUTO
 +
.... exact one point
 +
</pre>
 +
???
 +
 +
<pre>
 +
@AUTO-CONNECT = AC$DISPATCH
 +
 +
$GROUP G1
 +
.... some points
 +
 +
$GROUP DP2
 +
$SETTINGS: 0 0x80
 +
.... exact one point
 +
</pre>
 +
 +
???
 +
 +
=== Issues ===
 
???
 
???
  

Revision as of 15:10, 16 August 2018

Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

This tutorial explains the creation of enemy routes in battle arenas using Wiimms SZS Tools. Be sure to understood the concept of Standard Routes and Dispatch Points!

The battle support of Wiimms SZS Tools is in development. At the moment there exists no public release of the tools that can handle the technics of this article. You have to wait for the release of v1.60a.


Introduction

As of v1.60a, Wiimms SZS Tools support an automatic connection of Standard Routes and Dispatch Points. All you need is to setup up the routes and points, edit some settings to advise the KMP compiler, and run the compiler.

Wiimm implemented the auto connection of enemy routes already and started a final test phase. See the change log for progress.

There is a second page with full code examples, which are used as reference from this page.

KMP Compiler

KMP conversions by Wiimms SZS Tools

If a tool of Wiimms SZS Tools reads a file, is does always the same: The file is read into memory and analyzed to find out the data format. If the file has an acceptable file format, a scan function is selected and the file data is scanned and translated into the internal data structures, which can held more data than the files.

In case of KMP (see image on the right), native KMP files and text KMP files are accepted for input. For SZS archives, file course.kmp is searched and scanned. Native are scanned by a binary scanner and text files by a KMP compiler.

Wiimms SZS Tools use a 2-pass compiler to translate KMP text files into the internal data structure. On each pass the complete text file is scanned. In the first pass the file is scanned for name definitions. This allows to use a name before it is defined. Error messages are suppressed. The second pass is used to setup the internal data structure. Error messages about syntax errors or missing names are printed.

The concept aof the 2-pass compiler is important for this article, because route links are created by by names!

The internal data structure allows manipulations of the data on different ways independent of the external file format. Manipulations are for example transformations, but also automatic route connections.

At the end, the data is is stored as as binary (commands ENCODE, PATCH), as text (commands DECODE, PATCH, CAT), or dropped (command CHECK).

Standard routes only

ENPT routes of Luigi Circuit

All 32 original racing tracks, and all custom tracks too, uses standard routes. In this case, each end of the routes is linked to 1 to 6 beginnings of other routes. The NEXT links are used for this connections. To get bidirectional links, the PREV links of the destinations are set to the previous routes. The PREV links can be set automatically by analyzing all NEXT links. Wiimm's tools does it, if parameter @AUTO-CONNECT is set to AC$PREV.

Let's look the group headers of Luigi Circuit. You can find the full de-compiled enemy route definition here.

@AUTO-CONNECT = AC$PREV # == automatic calculation of PREV links

 # zero based index: 0,  prev: 1,  next: 4 5
 $GROUP G1,  next: G2A G2B
 ....
 # zero based index: 4,  prev: 0,  next: 2 3
 $GROUP G2A,  next: G3A G3B
 ....
 # zero based index: 5,  prev: 0,  next: 2 3
 $GROUP G2B,  next: G3A G3B

Lines beginning with »#« are comments. Here they show the numerical route index and the links in botth direction. For Wiimm's tool's, the »$GROUP« tells the compiler to start a new group. The group names are generic and the numbering of group names following the links. In this example, group G1 has 2 successors named G2A and G2B. The PREV links are not defined, because they are calculated automatically.

This concept works for battle arenas too. Nintendo used it for SNES Battle Course 4 (A21). Anyway, using dispatch points is the better concept for battle arenas.

Standard routes and dispatch points

ENPT routes of GCN Cookie Land

9 of 10 battle arenas by Nintendo use Dispatch Points. Here we use GCN Cookie Land as example. You can find the full de-compiled enemy route definition here.

???

 # zero based index: 0,  prev: 10,  next: 12
 $GROUP G1,  next: DP4
 $PREV: DP2
 .... some points

???

 # zero based index: 10,  prev:,  next: 0 3 7
 $GROUP DP2,  next: G1 G4 G8
 $PREV:
 $SETTINGS: 0 0x80 AUTO
 .... exact one point

???

@AUTO-CONNECT = AC$DISPATCH

 $GROUP G1
 .... some points

 $GROUP DP2
 $SETTINGS: 0 0x80
 .... exact one point

???

Issues

???

Links