Difference between revisions of "Object/coin"

From Custom Mario Kart
Jump to navigation Jump to search
(16 intermediate revisions by 3 users not shown)
Line 5: Line 5:
  
 
== Settings ==
 
== Settings ==
 +
 +
Only settings 2 and 3 are used by Nintendo on battle arenas. Setting 1 is used on tournaments, and the rest (4 to 8) are always 0.
 +
 
=== Setting #2: Start or respawn place ===
 
=== Setting #2: Start or respawn place ===
  
Line 16: Line 19:
 
=== Setting #3: Spawning type ===
 
=== Setting #3: Spawning type ===
 
Nintendo uses types 0, 1 and 2. The tests of [[Wiimm]] additionally cover type 3:
 
Nintendo uses types 0, 1 and 2. The tests of [[Wiimm]] additionally cover type 3:
* No differences between types 2 and 3 found.
 
 
* '''Type 0 and 1:''' Coins are inserted at place.
 
* '''Type 0 and 1:''' Coins are inserted at place.
* '''Type 2 and 3:''' Coins fall down from the sky.
+
* '''Type 2:''' Coins fall down from the sky and keep their X and Z value.
 +
* '''Type 3:''' Coins fall down from the sky when they fall on a slope they ricochet.
 
* Coins from starting places of all types '''except type 1''' are moved to respawn places at the beginning of Phase 2 (see below).
 
* Coins from starting places of all types '''except type 1''' are moved to respawn places at the beginning of Phase 2 (see below).
  
 
== Phases ==
 
== Phases ==
It seems, that 3 phases exist for coins, but the details depend on the used slot.
+
 
* At the beginning, the game is in '''Phase 1''': coins are only available at start places. Only if <20 (value depends on slot), start places exist; respawn places are used as start places too.
+
There exist 3 coin phases:
* If a player is damaged (is respawned and maybe hit), '''Phase 2''' begins: coins from starting places of all types except type 1 are moved to respawn places.
+
* In '''Phase 1''', coins are only available at start places. The game starts usually in Phase 1.
* Phase 2 is also triggered, if about the half of the starting coins are caught. Some slots (e.g. A13 with less than 14 start places) start directly in Phase 2.
+
* In '''Phase 2''', coins of starting places (except type 1) moved to respawn places.
* In some situations (number of starting points, slot), Phase 2 is skipped.
+
* In '''Phase 3''', additional coins (not starting coins) become available and will be spawned time by time.
* If in Phase 2 and if a player is damaged and lost at least 1 coin, then '''Phase 3''' begins: coins, that were not inserted in Phase 1, become available and will be spawned time by time.
+
 
* Phase 3 is also triggered, if many coins from respawn places were caught.
+
The triggering of the phases are not really clear. It seems that there are different triggers for each phase.
* Some slots (e.g. A11 with less than 12 start places) start directly in Phase 3.
+
 
 +
Phase 2 is triggered:
 +
* when a player is damaged (is respawned and maybe hit).
 +
* when about the half of the starting coins are caught.
 +
* if to less starting places defined (slot dependent), the game starts directly in phase 2.
 +
 
 +
Phase 3 is triggered:
 +
* when in Phase 2 and if a player is damaged (is respawned and maybe hit) and lost at least 1 coin.
 +
* when many coins from respawn places were caught.
 +
* if there are not many starting places defined (slot dependent), the game starts directly in Phase 3 or skips Phase 2.
  
 
== Observations ==
 
== Observations ==
Line 45: Line 57:
 
== Slot dependency ==
 
== Slot dependency ==
  
The following limits were tested with 50 start places and 90 respawn places, overall with 140 coin objects.
+
The values of the following table are extracted from file [[minigame.kmg]] and from [[KMP]] section [[KMP#GOBJ|GOBJ]] of the arena files.
 +
 
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
|+ Slot dependent limits of coins
+
|+ Slot dependent limits of coins and usage of slot object
 
|-
 
|-
! Slot !! Arena name || max<br>coins<br>at<br>start ||max<br>total<br>coins
+
! rowspan=2 | Slot
 +
! rowspan=2 | Index
 +
! rowspan=2 | Arena name
 +
! rowspan=2 | Coins<br>at<br>start
 +
! rowspan=2 | Max<br>coins
 +
! colspan=3 | Number of<br>start places
 +
! colspan=3 | Number of<br>respawn places
 
|-
 
|-
| align=center | 1.1 || Block Plaza || align=center | 40 || align=center | 67
+
! align=center | Type<br>0
 +
! align=center | Type<br>1
 +
! align=center | Type<br>2
 +
! align=center | Type<br>0
 +
! align=center | Type<br>1
 +
! align=center | Type<br>2
 
|-
 
|-
| align=center | 1.2 || Delfino Pier || align=center | 40 || align=center |  71
+
| align=center | 1.1 || align=center | 1 || Block Plaza
 +
| align=center | 12–40 || align=center | 21–67
 +
| align=center | 40 || align=center |  — || align=center |  —
 +
| align=center |  — || align=center |  — || align=center | 53
 
|-
 
|-
| align=center | 1.3 || Funky Stadium || align=center | 42 || align=center |  71
+
| align=center | 1.2 || align=center | 0 || Delfino Pier
 +
| align=center | 12–40 || align=center |  21–71
 +
| align=center | 10 || align=center | 4 || align=center | 28
 +
| align=center |  8 || align=center |  2 || align=center | 82
 
|-
 
|-
| align=center | 1.4 || Chain Chomp Wheel || align=center | 28 || align=center |  55
+
| align=center | 1.3 || align=center | 3 || Funky Stadium
 +
| align=center | 10–42 || align=center |  21–71
 +
| align=center | 12 || align=center | 30 || align=center | 
 +
| align=center |  3 || align=center |  3 || align=center | 42
 
|-
 
|-
| align=center | 1.5 || Thwomp Desert || align=center | 30 || align=center |  55
+
| align=center | 1.4 || align=center | 2 || Chain Chomp Wheel
 +
| align=center | 10–28 || align=center |  21–55
 +
| align=center | 48 || align=center | 2 || align=center | 
 +
| align=center |  — || align=center | 18 || align=center | 39
 
|-
 
|-
| align=center | 2.1 || SNES Battle Course 4 || align=center | 30 || align=center |  57
+
| align=center | 1.5 || align=center | 4 || Thwomp Desert
 +
| align=center | 12–30 || align=center |  21–55
 +
| align=center | 28 || align=center |  — || align=center |  —
 +
| align=center |  — || align=center |  — || align=center | 52
 
|-
 
|-
| align=center | 2.2 || GBA Battle Course 3 || align=center | 30 || align=center |  63
+
| align=center | 2.1 || align=center | 7 || SNES Battle Course 4
 +
| align=center | 12–30 || align=center | 21–57
 +
| align=center | 32 || align=center |  — || align=center |  —
 +
| align=center | 60 || align=center |  — || align=center | 
 
|-
 
|-
| align=center | 2.3 || N64 Skyscraper || align=center | 28 || align=center |  55
+
| align=center | 2.2 || align=center | 8 || GBA Battle Course 3
 +
| align=center | 10–30 || align=center |  21–63
 +
| align=center | 50 || align=center |  — || align=center |  —
 +
| align=center |  — || align=center |  — || align=center | 54
 
|-
 
|-
| align=center | 2.4 || GCN Cookie Land || align=center | 21 || align=center |  53
+
| align=center | 2.3 || align=center | 9 || N64 Skyscraper
 +
| align=center | 10–28 || align=center | 21–55
 +
| align=center | 40 || align=center |  — || align=center |  —
 +
| align=center |  — || align=center |  — || align=center | 56
 
|-
 
|-
| align=center | 2.5 || DS Twilight House || align=center | 30 || align=center |  57
+
| align=center | 2.4 || align=center | 5 || GCN Cookie Land
 +
| align=center | 12–21 || align=center |  21–53
 +
| align=center | 27 || align=center |  — || align=center |  —
 +
| align=center |  — || align=center |  — || align=center | 45
 +
|-
 +
| align=center | 2.5 || align=center | 6 || DS Twilight House
 +
| align=center | 10–30 || align=center | 21–57
 +
| align=center | 40 || align=center |  — || align=center |  —
 +
| align=center | 11 || align=center |  — || align=center | 45
 
|}
 
|}
 +
 +
;Notes:
 +
* '''Index''' is the zero based internal index to address battle dependent tables (e.g. on file [[minigame.kmg]]).
 +
* '''Coins at start''' (number of coins at battle start) and '''Max coins''' (maximal number of available coins) depend on the arena slot and the number of players. The related tables are placed in [[minigame.kmg]] at offsets 0x394 and 0x470.
 +
 +
== More technical information ==
 +
The coin model is not fully loaded from coin.brres. Instead, there is raw model data which contains vertex, UV and normal information into [[StaticR.rel]]. The data is found at offset 0x3A2000 for the [[PAL]] version of the game, 0x3A1A40 for [[NTSC-US]] and 0x3A17E0 for [[NTSC-J]].
 +
 +
However, texture and animation data, as well as the coin's shadow and {{obj-ref|pile_coin}} are still used from coin.brres.
  
 
== Guidelines for good custom setups ==
 
== Guidelines for good custom setups ==
 +
 
These guideline are based on the observations above.
 
These guideline are based on the observations above.
* Use between 20 and 42 starting places. Additional places are simply ignored. If using less than 20 starting places, curios effects like starting in phase 2 or 3 will happen.
+
* Use between 20 and 42 starting places. Additional places are simply ignored. If using less than 20 starting places, curious effects like starting in phase 2 or 3 will happen (depends on slot).
* Use unique identifiers for setting #2 of starting places. Preferred is a zero based unique index. Most likely these identifiers are irrelevant, but only most likely. Anyway, uses always values &lt;50, because larger values will disable respawning at all.
+
* Use unique identifiers for setting #2 of starting places. Preferred is a zero based unique index. Most likely these identifiers are irrelevant, but only most likely. Indices equal or greater the slot limit will be ignored and values >60 may disable the respawn functionality at all. Best is to use always values &lt;42.
* Use 20 to 80 respawn places. If using to less respawn places, the respawning process is slowed down.
+
* Use 20 to 80 respawn places. If using few respawn places, the respawning process is slowed down.
 
* If using many coins, give the user a recommendation about the slot usage, because some slots have small limits.
 
* If using many coins, give the user a recommendation about the slot usage, because some slots have small limits.
 
* Think about the respawn modes. Only coins of type 1 will stay at the defined position until caught. And only coins of type 2 fall from the sky. The choices for start and respawn places can differ.
 
* Think about the respawn modes. Only coins of type 1 will stay at the defined position until caught. And only coins of type 2 fall from the sky. The choices for start and respawn places can differ.
* Use different positions for all coin objects. Give [[automated height correction]] a chance.
+
* Use different positions for all coin objects, so that 2 coins are never placed at the same position. An exception is a starting place with type other than 1 and a respawn place; they never hold a coin at same time.
* Scatter the coins around the whole arena, but only in places, where enemies will drive. Read tutorial »[[Enemy routes in battle arenas]]« to get good enemy routes.
+
* Give [[automated height correction]] a chance to adjust positions.
 +
* Scatter the coins around the whole arena, but only in places where enemies will drive. Good places are along the enemy routes. Read the »[[Enemy routes in battle arenas]]« tutorial to get good enemy routes.
  
 
== Links ==
 
== Links ==

Revision as of 11:28, 13 September 2019

This article is about the object »coin« (object id 0x73). Coins are only used in Coin Runners mode of Battle Arenas and in some tournaments.


Settings

Only settings 2 and 3 are used by Nintendo on battle arenas. Setting 1 is used on tournaments, and the rest (4 to 8) are always 0.

Setting #2: Start or respawn place

This setting decides about the characteristic starting place or respawn place.

  • Values between 0..49 are used for starting places. Nintendo used unique numbers, but it seems, that any mix is working. At some slots, numbers >50 (may be up to 100) will work too.
  • The slots have different limits of usable starting places. It varies between 21 and 42.
  • At battle start, all usable starting places start with a coin.
  • Respawn places have always value -1 (=65535) and generally used for respawned and new coins. On some slots they are used as starting place too, if the number of starting places is too small.
  • The total number of coins is limited by the total number of coin objects. Additionally, all slots have different absolute limits for coins (not for coin objects) between 53 and 71.

Setting #3: Spawning type

Nintendo uses types 0, 1 and 2. The tests of Wiimm additionally cover type 3:

  • Type 0 and 1: Coins are inserted at place.
  • Type 2: Coins fall down from the sky and keep their X and Z value.
  • Type 3: Coins fall down from the sky when they fall on a slope they ricochet.
  • Coins from starting places of all types except type 1 are moved to respawn places at the beginning of Phase 2 (see below).

Phases

There exist 3 coin phases:

  • In Phase 1, coins are only available at start places. The game starts usually in Phase 1.
  • In Phase 2, coins of starting places (except type 1) moved to respawn places.
  • In Phase 3, additional coins (not starting coins) become available and will be spawned time by time.

The triggering of the phases are not really clear. It seems that there are different triggers for each phase.

Phase 2 is triggered:

  • when a player is damaged (is respawned and maybe hit).
  • when about the half of the starting coins are caught.
  • if to less starting places defined (slot dependent), the game starts directly in phase 2.

Phase 3 is triggered:

  • when in Phase 2 and if a player is damaged (is respawned and maybe hit) and lost at least 1 coin.
  • when many coins from respawn places were caught.
  • if there are not many starting places defined (slot dependent), the game starts directly in Phase 3 or skips Phase 2.

Observations

For the observations more than 50 setups with different number of objects and respawn types were tested by Wiimm. And here the results:

  • If no respawn slots defined, coins will not respawned.
  • In 3 setups with 63, 68 and 100 starting places, no coins were respawned. All other setups had 60 or less starting places.
  • A starting place with index of ≥60 is ignored. Moreover, it disables respawning at all.
  • With less than about 20 starting places (value may depend on slot), ...
    • ... respawn slots were used as additional staring slots.
    • ... the battle starts directly in coin phase 2 or 3.
  • There are different events (may be slot dependent) that will trigger phases 2 and 3.
  • As more respawn places defined, as faster the coins will be respawned.
  • Some original arenas defined more starting places than used by the related slot. Either this is a mistake by Nintendo, or there exists another overlooked parameter or impact.

Slot dependency

The values of the following table are extracted from file minigame.kmg and from KMP section GOBJ of the arena files.

Slot dependent limits of coins and usage of slot object
Slot Index Arena name Coins
at
start
Max
coins
Number of
start places
Number of
respawn places
Type
0
Type
1
Type
2
Type
0
Type
1
Type
2
1.1 1 Block Plaza 12–40 21–67 40 53
1.2 0 Delfino Pier 12–40 21–71 10 4 28 8 2 82
1.3 3 Funky Stadium 10–42 21–71 12 30 3 3 42
1.4 2 Chain Chomp Wheel 10–28 21–55 48 2 18 39
1.5 4 Thwomp Desert 12–30 21–55 28 52
2.1 7 SNES Battle Course 4 12–30 21–57 32 60
2.2 8 GBA Battle Course 3 10–30 21–63 50 54
2.3 9 N64 Skyscraper 10–28 21–55 40 56
2.4 5 GCN Cookie Land 12–21 21–53 27 45
2.5 6 DS Twilight House 10–30 21–57 40 11 45
Notes
  • Index is the zero based internal index to address battle dependent tables (e.g. on file minigame.kmg).
  • Coins at start (number of coins at battle start) and Max coins (maximal number of available coins) depend on the arena slot and the number of players. The related tables are placed in minigame.kmg at offsets 0x394 and 0x470.

More technical information

The coin model is not fully loaded from coin.brres. Instead, there is raw model data which contains vertex, UV and normal information into StaticR.rel. The data is found at offset 0x3A2000 for the PAL version of the game, 0x3A1A40 for NTSC-US and 0x3A17E0 for NTSC-J.

However, texture and animation data, as well as the coin's shadow and pile_coin are still used from coin.brres.

Guidelines for good custom setups

These guideline are based on the observations above.

  • Use between 20 and 42 starting places. Additional places are simply ignored. If using less than 20 starting places, curious effects like starting in phase 2 or 3 will happen (depends on slot).
  • Use unique identifiers for setting #2 of starting places. Preferred is a zero based unique index. Most likely these identifiers are irrelevant, but only most likely. Indices equal or greater the slot limit will be ignored and values >60 may disable the respawn functionality at all. Best is to use always values <42.
  • Use 20 to 80 respawn places. If using few respawn places, the respawning process is slowed down.
  • If using many coins, give the user a recommendation about the slot usage, because some slots have small limits.
  • Think about the respawn modes. Only coins of type 1 will stay at the defined position until caught. And only coins of type 2 fall from the sky. The choices for start and respawn places can differ.
  • Use different positions for all coin objects, so that 2 coins are never placed at the same position. An exception is a starting place with type other than 1 and a respawn place; they never hold a coin at same time.
  • Give automated height correction a chance to adjust positions.
  • Scatter the coins around the whole arena, but only in places where enemies will drive. Good places are along the enemy routes. Read the »Enemy routes in battle arenas« tutorial to get good enemy routes.

Links