DSHack

Archive Generated December 23rd, 2018
The Ultimate NKM Guide
Author Posted on 2017/01/03
#2773
Louiskovski THE ULTIMATE NKM GUIDE

(Note: The guide isn't finished, it needs some grammatically fixes and some other improvements!)



This guide will lead you though the creating of the NKM, that definies the starting point, the route, the objects and much more!
This is NOT focused on Battle tracks. A tutorial for making Battle tracks can you find Here.


Recommendend Tools:

-MKDS Course Modifier (Latest)
-Every File Explorer
-MKToolbox (has 3D view)
-A Tool, that let's you replace files from a .nds ( I recommend NSMBDSe or EFE)


Before we start with the entire guide, we will take a look at the Object Categories and how we create paths. A NKM file consist of these categories.


Object Categories

General:

OBJI: Objects
The objects for the course, such as Goombas, Pipes, Item Boxes...
An object is definied by it's ID and can have varios settings.
You can set, if the object appears in Time Trial or not, which is recommended for Item Boxes.

Some objects can (or has to be) connected with PATHs (blue). For example Goombas, Cars or Thwomps.
Check out the DShack Database for a documented list with Objects. Here's an older Database.

Objects needs a Model file and other files in the "MapObj"-folder of the Course.carc to work. You can also use your own models.
If the game still crashes, check if the object uses a shadow model or other files, such as animations!

KTPS: Starting Position
This is the starting position, where all the drivers starts.
You should place them like this:
http://i.imgur.com/wlwkWMU.png

In Time Trial and Missions, the kart is the starting position. In Battlemode, they exist 8 times and are the startingpoints of each driver.

Note, that this is NOT the line, where the lap counts! It's only the spawnpoint of the drivers!


KTPJ: Respawn Points
This are the respawn-points.
You must enter it's ID in the CPOIs, so that the game knows, at which area the game spawns you at this point.
You also have to enter two IDs from the nearest EPOI and IPOI, otherwise, enemies and items will go crazy ways, when they got respawn.

KTP2
UNKNOWN / NOT NEEDED
On original tracks, they exist before the starting line, but they do nothing. Probably planned to be a spawnpoint for Time Trial or to count the lap?

KTPC: Canon Destination Point
This is the point, the drivers will be shot at, when touching the specific collision for canons.


KTPM: Mission Point
They are used for Missions. The Player will be spawn there, when the mission got completed.
Not needed for a normal Track.


PATHS:

CPAT: Checkpoint Path
This is the route, the driver have to follow, to get the lap count.

It works like this:

CPAT are connected though CPOIs. A CPOI consist of two connected points. The drivers have to go though the CPOIs in order. CPOI with ID 0 is the line, where the lap counts! Some CPOI have a Key Point Value. These definies, in which order you have to go though these CPOIs. They also split some CPOIs in a group. If you go for example though Key Point 1, only the CPOIs from 1 to 2 are active. This is used for crossing ways and for avoiding brutal shortcuts.



Important to know:
The red point of a CPOI must be placed right, while the green has to be on the left side! Remember with this: "Red is Right, Left is Luigi, Luigi is Green"


EPAT: Enemy Path
This is the path, the CPU Driver are following.
They are connected though EPOIs.
You should place the first EPOI with ID 0 right after the starting line.

You can make the CPUs drifting, by giving a value in the EPOI, where they should drift:

0= No action, default value
1= Start a drift to the left, with a powerslide
2= Start a drift to the left, without a powerslide (usually used for small turns, so that the CPU's can easily take the turn)
3= Start a drift to the right, with a powerslide
4= Start a drift to the right, without a powerslide (usually used for small turns, so that the CPU's can easily take the turn)
5= End a drift

First give the point, where they should start to drift, the value. The next points should have a 0 and the ending point should then have a 5 to end the drift.
Thanks to Platinatic and SGC for the info :)

You can change the size of the CPOI to let the CPUs drive a little bit around the point and not only exact the line. ~ 80 is used on SNES Mario Circuit for example.


IPAT: Item Path
And this is the path, Items like Bullet Bills, red and blue shells are following.
They are connected though IPOIs.
Like EPOI, you can change the size of an IPOI. ~100 is used on SNES Mario Circuit for example.


PATH
And finally a path, that can be used for objects such as Goombas, Cars, Itemboxes, but also cameras uses Paths.
They are connected though POITs.
The Value "Duration" can be used for some objects for stopping them for a specific time. Pokeys and the Sun are using this


Other things:

AREA
These are Areas for Cameraviews after race or for other effects such as Boos. Instead of a normal scale, they uses "Lenght Vector" and a X,Y and Z - Vector.
Lenght Vector is the normal scale from the area, while the X,Y,Z Vectors can form the edges from the area.

To make an Area with normal edges, set the X,Y,Z Vectors to this:


To rotate an area, change for example in X Vector the X to a number and the Z the same like x, but with a - before it. Then give the Z Vector the SAME values like X Vector, but without a - before the numbers:



CAME: Cameras
The Cameras for your Course.
They are used for the intro or views after race.
A tutorial about cameras can you find Here

STAG: Track Information
In the STAG, you can change the number of Laps or the time of a battle, informations about Fog and some other configurations about the track.
It can't be edited with MKToolbox, so you have to use MKDSCM!



Connecting Paths

CPAT, EPAT, IPAT and PATH are routes, that consist of connected points. They can be split into two other paths. Here you will find the information you need, to create your paths:

A path has a Start Index for a point and a Lenght, how many points it uses. In order to create a path, you place points in order, like this:



Then you enter in the Path, in "Start Index" the Point's ID, that is the starting point of the Path.
Then you enter the amount of points, that the path should use, in "Lenght" or "Nr of Points"


Note, that the (blue) PATH does not have a Start Index. It just uses the next POIT!

The (blue) path has the option to loop the path.



In order to split the path, you use another paths, that can be connected. (Blue) paths can't be split.

First create two other paths.



Then look at the "Comes From" and the "Goes To" options. At the first look, it can look strange, but it's very easy:
You only have to think a bit logical, "from which path comes this path?", "To which path goes this path?".
So in my example, the two splitted paths gets a 0 in the COMES FROM, and a 3 in the GOES TO. The starting Path gets a 1 and a 2 in the GOES TO and the last Path gets a 1 and a 2 in the COMES FROM. Really easy, isn't it?



If you still don't understand it, just ask :)



Creating the NKM

Ok, if you understand that all, Let's Go!
The first thing we need is an empty NKM file. You can either use MKDSCM 3 to create a new empty NKM, or you can export a NKM from one of the MR_Stages, which are all empty.

(It's recommend to use MKDSCM first, to create the NKM, and later MKToolbox to improve the NKM)
(Another tipp is to export the NKM and the KCL first. If you make a mistake with MKDSCM, all your work is lost D: )
(Make OFTEN copies of your NKM!!)


NKM Editors

The best thing i recommend for you, is exporting the Cource.carc from the rom to a safe place, so you can open it easily with MKDSCM.

Mario Kart DS Course Modifier
To edit a NKM file with MKDSCM, open the .carc and make a doubleclick on the NKM. The editor will now appear. To get a view from your Modell in the editor, doubleclick on a KCL file. This will show your NKM with the Collision (Use an edited version of your KCL, if your KCL does not display some streets and such not exactly).

The editor itself is a little bit buggy, but we really need it, because it has some important options, that are only in this editor. That's why i recommend you to start making the NKM with this tool.

Main Controlls:
-Click on an object to select it. Hold the mouse button and move the mouse to move the object
-Click with the mousewheel on an object to place it exactly on the road (THIS IS IMPORTANT and is only available with MKDSCM!)


Mario Kart Toolbox
MKToolbox works like SM64DSe. That means, it only can edit courses in the ROM and not separate files. But it's really useful, it has a 3D View! This tool can you use, after you finished the routes and other things in the NKM, that you can only make with MKDSCM.
To open a course, start the tool and open the ROM. A window will appear with a list with all tracks. Doubleclick on your track and the editor will appear.

Main Controlls:
-Hold left mousebutton and move the mouse to move the view
-Hold right mousebutton and move the mouse to rotate the view
-Mousewheel to zoom in and out
-click on an object to select it and hold the mousebutton to move it. At the Top-Right corner on the window is an icon, that can enable to move the object only on the X and Z axis.


Wexo's Toolbox
This tool also can edit NKM files, but it's in a very early stage!


Every File Browser
EFE has an NKM editor as well. It's like MKDSCM, but it's bugfree and can view Areas. But there's a fatal problem: You can NOT place the objects on the road. So you can use it for improving the NKM, but you should use MKDSCM to create all the points first!



Let's Start!

Okay. Now you can start to create, whatever you want, but i suggest to start with the Starting Line and the routes of the course.


Making the KTPS (Starting Line):
Place the KTPS like this:

Don't forget to rotate it into the right direction!



Making the CPATs:
Create all the CPOIs, place the points and connect them with CPATs. Place the first CPOI at the starting line!
CPATs have no Y-Value (Height).
You have to enter CPOIs with a Key Point in order to let the lap count, that means for example, you have to go though 0,1,2 and 3. Going first though 1 doesn't work, you have to go first though 0, if you want to go though 1. So give one of the first (But not the very first) CPOIs a 0, a later CPOI a 1 and so on. Normal Value is -1.
The Key Point feature is also useful for crossing ways!
(You can't make CPATs and CPOIs with MKToolbox (or not really good), so you should make it with MKDSCM!)





Making the EPATs:
Make it, like i told you on the quick list! Create the EPOIs and connect them with EPATs.
Don't forget to place the first EPOI with ID 0 right after the finish line!



Tipp: You can create the EPATs with MKToolbox really easy, so you can make the EPOIs first with MKDSCM and place them easily on the road with the Y-Value feature, and connect them later with MKToolbox. You can also see the EPOIs in MKToolbox connected, unlike in MKDSCM!




Making the IPATs:
Make it, like i told you on the quick list! Create the IPOIs and connect them with IPATs.



Tipp: You can create the IPATs with MKToolbox really easy, so you can make the IPOIs first with MKDSCM and place them easily on the road with the Y-Value feature, and connect them later with MKToolbox. You can also see the IPOIs in MKToolbox connected, unlike in MKDSCM!


Making the KTPJ (Respawn points):
This is your choice, where you want to place the respawn points. Look at original tracks to have a little knowledge of the placement.
Rotate the KTPJ into the right direction!
Don't forget to enter the IDs from the nearest IPOI and EPOI!! And also don't forget to enter the KTPJs ID in the CPOIs!
Also note, that the KTPJ should be placed ON the road, not above. The spawn point is a little bit above the KTPJ!




Adding Objects:
Objects like Item Boxes are common on tracks. Another Objects like a Goomba or a pipe or whatever can make the track more interesting!
An Object is definied by it's ID and can have varios settings. You can set, if the Object appears in Time Trial or not, which is recommend for Item Boxes.
Some Object can (or have to be) connected with PATHs (blue). For example Goombas, Cars or Thwomps.
Don't forget to place the models for used objects into the "MapObj"-folder of the Course.carc! If the game still crashes, check if the object uses a shadow model!




Check out the DShack Database for a documented list with Objects. Here's an older Database.
Don't forget to place the models for used objects into the "MapObj"-folder of the Course.carc! If the game still crashes, check if the object uses a shadow model or other files, such as animations!

Adding AREAs:
Add Areas, if you want to give your track replay cameras or effects such as boos. Instead of a normal scale, they uses "Lenght Vector" and a X,Y and Z - Vector.
Lenght Vector is the normal scale from the area, while the X,Y,Z Vectors can form the edges from the area.

To make an Area with normal edges, set the X,Y,Z Vectors to this:


To rotate an area, change for example in X Vector the X to a number and the Z the same like x, but with a - before it. Then give the Z Vector the SAME values like X Vector, but without a - before the numbers:



Adding Cameras (CAME):
They are used for the intro or views after race and gives your track a cool and interesting view.
A tutorial about cameras can you find Here
You can play camera intros with MKToolbox:



Change Track settings in the STAG category:
In the STAG, you can change the number of Laps or the time of a battle, informations about Fog and some other configurations about the track.
It can't be edited with MKToolbox, so you have to use MKDSCM!


Adding Track Info:
Here you can enter your track's name, the version and the author of the track.
This can be only seen and edited with MKDSCM!



Making a Mission:
A mission consist of configurations in the mission.mr file inside /data/Scene/Menu.carc and a seperate .nkm file inside the .carc of your track.
Depending of which type your mission should be, the nkm must be set different. A Mission without a CPU-Driver should not contain EPATs! It can cause a Crash on an Area on your Track (At least on my track).
The name of the Mission (mr64 for example) tells you, which name the nkm file should have. If the mission is named mr64, your nkm should be named mr64_tool.nkm. You have to place it in the MissionRun folder of your Track's carc.
Don't forget to set your Course in the mission.mr file.
You can edit the mr-file with MKDSCM.

Tipp: If you want to edit the mission nkm with MKToolbox, you can make a copy of your track and replace another track in the ROM with the copy. If your nkm is ready, just export the nkm from the course into your original track into the MissionRun folder.



So, that's it! I hope it could help you!
If you have any question, ask me in this thread :)
If there are some mistakes, you can post them also here.
Author Posted on 2017/01/03
#2774
Platinatic Thanks you SOO MUCH for this, we really needed this tutorial!
Author Posted on 2017/01/03
#2775
SGC Yellow Very good, indeed.
Thread stickied.
Author Posted on 2017/01/04
#2777
Platinatic EFE can display AREA, i don't know if it is exact, though.


I also noticed that the EPOI will roughly follow the quickest route, like in real racing (check This wikipedia page)

Thanks to SGC i've been able to figure out the function of the drifting values, you could put this in the tutorial:

0= No action, default value
1= Start a drift to the left, with a powerslide
2= Start a drift to the left, without a powerslide (usually used for small turns, so that the CPU's can easely take the turn)
3= Start a drift to the right, with a powerslide
4= Start a drift to the right, without a powerslide (usually used for small turns, so that the CPU's can easely take the turn)
5= End a drift


(To make clear: a powerslide is when there are sparkles coming of the wheels)

In this video you can "easely" see how the cpu's drift.
For example, the first turn DK takes goes to the right and it doesn't have a powerslide, this means that the drift value used there is 4.

Also, sometimes Nintendo uses a value on two successive points. I'm guessing that the CPU's would pick a random place between the two points to start drifting, but i'm not too sure about that.
Here's a picture, i've put some text on it too:





Author Posted on 2017/01/04
#2778
SGC Yellow Certain values also make the CPU drift to the left, or the right.
You'll need to test them out to know which ones drift the the left, and the right.
Author Posted on 2017/01/04
#2780
Louiskovski Wow. That are nice informations!! Thank you all :)
I will add it to the guide!

EFE can display AREA, i don't know if it is exact, though.

EFE also can edit NKM? Nice! Maybe the AREAs works like the from MKWii, many things are very similar.
Author Posted on 2017/01/04
#2781
Clearwater
Certain values also make the CPU drift to the left, or the right.
You'll need to test them out to know which ones drift the the left, and the right.


I think positive values make the CPU drift to the left, and negative values make them drift to the right.
Author Posted on 2017/01/04
#2782
Platinatic
Certain values also make the CPU drift to the left, or the right.
You'll need to test them out to know which ones drift the the left, and the right.


I think positive values make the CPU drift to the left, and negative values make them drift to the right.


What do you mean? There are no negative turning values. 0-5 are the only ones.
Author Posted on 2017/01/04
#2783
Clearwater Oops. Sorry, I was going off of logic. :/
Author Posted on 2017/01/04
#2784
Platinatic Another thing that might be usefull for anyone making a Course intro:
Every intro is 660 long in Duration.
If you want to make it like it's supposed to (which will make it fit perfectly with the music), you'll have to follow this pattern:

1st angle: 210 Duration
2nd angle: 200 Duration
3rd angle: 250 Duration
Author Posted on 2017/01/06
#2808
User 385 I need help
Someone could give me a complete tutorial on how to do Music Hack
Please
At least someone speaks spanish
Author Posted on 2017/01/07
#2812
MKGirlism Richard, could you make a new Thread regarding that?
Next time, I will have to remove it for being off-topic.
Author Posted on 2017/02/16
#2973
SGC Yellow Oh, by the way I should mention, AREA is used for the CAME, for example, when the player enters another AREA during a Replay, it will change to the CAME, associated with that AREA, AREA might also be used for certain Objects, but I'm unsure about that.

An example of Area being used in a CT, can been seen with my port of GCN Dry Dry Desert for MKDS.
Author Posted on 2017/02/17
#2979
Louiskovski
Oh, by the way I should mention, AREA is used for the CAME, for example, when the player enters another AREA during a Replay, it will change to the CAME, associated with that AREA, AREA might also be used for certain Objects, but I'm unsure about that.

An example of Area being used in a CT, can been seen with my port of GCN Dry Dry Desert for MKDS.

Jep, i will add it to the guide :)
By the way, i made a track with fully working replay cameras. A video is uploading..
Author Posted on 2017/02/17
#2981
SGC Yellow Ah, that sounds very very nice.
By the way, do you think you could tell us how you edited the NKM in the Kiosk Beta?
I find your knowledge of these things to be highly interesting.
Author Posted on 2017/02/17
#2982
Louiskovski
Ah, that sounds very very nice.
By the way, do you think you could tell us how you edited the NKM in the Kiosk Beta?
I find your knowledge of these things to be highly interesting.

Thanks :)
For the NKM, editing the NKM from the Beta is horrible!! The nkm format is normally the same like the final, but every NKM editor i know, adds some "." and "y" and other things to the file. It's purpose is maybe to make it easier for the nkm editor to edit the file, but the beta crashes when doing this.
To get the NKM in the beta working, i edited it with MKCM and copypaste the new POITs and PATHs to the original NKM with a hex editor. Sometimes it works, sometimes it crashes. It's a 50/50 chance that it works.
Author Posted on 2018/04/21
#3814
Louiskovski For some strange reason, spoilers do not work proberly anymore in this guide. Has someone an idea?
Author Posted on 2018/04/21
#3815
Kitty Remilya Ambiance

For the NKM, editing the NKM from the Beta is horrible!! The nkm format is normally the same like the final, but every NKM editor i know, adds some "." and "y" and other things to the file. It's purpose is maybe to make it easier for the nkm editor to edit the file, but the beta crashes when doing this.
To get the NKM in the beta working, i edited it with MKCM and copypaste the new POITs and PATHs to the original NKM with a hex editor. Sometimes it works, sometimes it crashes. It's a 50/50 chance that it works.


You can try editing the pointers, which is placed after the "NKM" title and before the "OBJI" title.
Author Posted on 2018/05/18
#3850
Rover I've noticed on my morning beach track I've made. There's one CPU that doesn't ever slow down. However...The rest of the cpus go slow and never attempt to speed up. I honestly have no idea how to fix this. I've seen some cts that CPUs actually try (Yawshi circuit for example) but I honestly don't know how to fix this ;w;