Difference between revisions of "Custom Track Regions"

From Custom Mario Kart
Jump to navigation Jump to search
(→‎Applying Regions: The ID of the span is used by external links.)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Regions are a concept by [[Nintendo]], to allow regional or continental races in [[Mario Kart Wii]].  Nintendo defined the region from 0 to 6.  Regions ≥7 can be used for [[Custom Track Distribution]]s to isolate the users of a distribution from all other players.
+
Regions are a concept by [[Nintendo]], to allow regional or continental races in [[Mario Kart Wii]].  Nintendo defined the regions from 0 to 6.  Regions ≥7 can be used for [[Custom Track Distribution|custom track distributions]] to isolate the users of a distribution from all other players.
  
 +
== How Region Numbers Are Used Internally ==
  
__TOC__
+
[[Mario Kart Wii]] uses an unknown algorithm to assign itself a region number. The DVD type (PAL, NTSC, etc.) and the region of the [[Wii]] have them influence to determine the region. The region is then stored to an internal numeric variable.
  
== <span id=regnum>How region numbers are used internally</span> ==
+
If connecting to a region, this region number is used to create an alpha numeric region name. For versus races, the C format string "vs_%d" is used, and for battles, the string "bt_%d". The "%d" is replaced by the signed decimal presentation of the region number. This combined prefix and region number is used by the game to search player in the online matchmaking database.
  
[[Mario Kart Wii]] uses an unknown algorithm to assigns itself a region number. The DVD type (PAL/NTSC/...) and the region of the [[Wii]] have influence to determination. The region is then stored to an internal numeric variable.
+
:Example: If region 12 is active, the versus race region name becomes "vs_12" and the battle race region name becomes "bt_12".
  
If connecting to a region, this region number is used to create an alpha numeric region name. For versus races the C format string "vs_%d" is used, and for battles the string "bt_%d". The "%d" is replaced by the signed decimal presentation of the region number. This combined prefix and region number is used by the game to search player in the online matchmaking database.
+
For worldwide races, the names "vs" and "bt" without a number extension are used. This means that worldwide races don't use regions (region 0 is Japan).
  
:Example: If region 12 is active, the versus race region name becomes "vs_12" and the battle race region name becomes "bt_12".
+
== Patching for Wiimmfi ==
  
For worldwide races, the names "vs" and "bt" without a number extension are used. This means that worldwide races don't use regions (region 0 is Japan).
+
If you plan to patch a distribution for [[Wiimmfi]] and for a specific region (1234 in this example), then use the following command:
 +
wstrt patch --wiimmfi --region 1234 StaticR.rel main.dol
 +
It is important to have original versions of '''StaticR.rel''' and '''main.dol''' and to patch both files.
  
== How the region patch works ==
+
== How the Region Patch Works ==
  
 
The well known region patch replaces a 32-bit instruction of the code. The original instruction is: ''»load the content of variable region_number into the register«''. This instruction is replaced by ''»load a constant value into the register«''. Because the limit of 32 bit for the instruction, the value is a sign extended 16 bit value. So only values between 0x8000 – 0x7fff (-32768 – +32767) are possible.
 
The well known region patch replaces a 32-bit instruction of the code. The original instruction is: ''»load the content of variable region_number into the register«''. This instruction is replaced by ''»load a constant value into the register«''. Because the limit of 32 bit for the instruction, the value is a sign extended 16 bit value. So only values between 0x8000 – 0x7fff (-32768 – +32767) are possible.
Line 21: Line 24:
  
 
With this practice, 65536 (0x10000) versus regions are possible. However, changing the prefix of the string from "vs_" to something else makes it possible to use billions of different regions. Prefix modifications except »vx« and »bx« are not allowed by [[Wiimmfi]].
 
With this practice, 65536 (0x10000) versus regions are possible. However, changing the prefix of the string from "vs_" to something else makes it possible to use billions of different regions. Prefix modifications except »vx« and »bx« are not allowed by [[Wiimmfi]].
 
=== New patch version by [[Leseratte]] ===
 
 
Leseratte has created a new version of the patch, fixing the battle and friend list bug.
 
 
With a special cheat code, it is possible to use regions from -2,147,483,647 to +4,294,967,296 allowing 6,442,450,943 regions in total. But this patch currently can't be put into an ISO so it's unreleased for now. [[Wiimmfi]] does not support this extended range of regions.
 
  
 
=== Issues ===
 
=== Issues ===
Line 37: Line 34:
 
[[Wiimms SZS Tools]] fixed it and will patch 8 different places in [[StaticR.rel]]. The tools can also patch [[main.dol]] to define a login region. This login region can be used to identify the distribution of a private room.
 
[[Wiimms SZS Tools]] fixed it and will patch 8 different places in [[StaticR.rel]]. The tools can also patch [[main.dol]] to define a login region. This login region can be used to identify the distribution of a private room.
  
== <span id=apply>Applying regions</span> ==
+
=== New Patch Version by [[Leseratte]] ===
  
Since August 2017, there is a new system for applying and managing custom regions for [[Wiimmfi]]. Other servers (for example based on AltWFC) may have an own system.
+
Leseratte has created a new version of the patch, fixing the battle and friend list bug.
  
For [[Wiimmfi]], visit the page »[http://wiimmfi.de/reg-list#free List of free custom regions]«, search a free region and then use the form at »[http://wiimmfi.de/reg-apply Apply regions]« to apply one or more regions. For the second page you have to be logged-on. Read the explanations of both pages.
+
With a special cheat code, it is possible to use regions from -2,147,483,647 to +4,294,967,296 allowing 6,442,450,943 regions in total. But this patch currently cannot be put into an ISO, so it's unreleased for now. [[Wiimmfi]] does not support this extended range of regions.
  
== <span id=list>Old list of custom regions</span> ==
+
== <span id=apply>Applying Regions</span> ==
{{List of custom regions}}
 
  
=== Special regions ===
+
Since August 2017, there is a new system for applying and managing custom regions for [[Wiimmfi]]. Other servers (for example based on AltWFC) may have their own system.
{{List of special regions}}
 
  
[[Category:Distribution|!]]
+
For [[Wiimmfi]], visit the page »[http://wiimmfi.de/region/list#free List of free custom regions]«, search a free region and then use the form at »[http://wiimmfi.de/region/apply Apply regions]« to apply one or more regions. For the second page, you have to be logged-on. Read the explanations of both pages.

Latest revision as of 12:18, 15 May 2022

Regions are a concept by Nintendo, to allow regional or continental races in Mario Kart Wii. Nintendo defined the regions from 0 to 6. Regions ≥7 can be used for custom track distributions to isolate the users of a distribution from all other players.

How Region Numbers Are Used Internally

Mario Kart Wii uses an unknown algorithm to assign itself a region number. The DVD type (PAL, NTSC, etc.) and the region of the Wii have them influence to determine the region. The region is then stored to an internal numeric variable.

If connecting to a region, this region number is used to create an alpha numeric region name. For versus races, the C format string "vs_%d" is used, and for battles, the string "bt_%d". The "%d" is replaced by the signed decimal presentation of the region number. This combined prefix and region number is used by the game to search player in the online matchmaking database.

Example: If region 12 is active, the versus race region name becomes "vs_12" and the battle race region name becomes "bt_12".

For worldwide races, the names "vs" and "bt" without a number extension are used. This means that worldwide races don't use regions (region 0 is Japan).

Patching for Wiimmfi

If you plan to patch a distribution for Wiimmfi and for a specific region (1234 in this example), then use the following command:

wstrt patch --wiimmfi --region 1234 StaticR.rel main.dol

It is important to have original versions of StaticR.rel and main.dol and to patch both files.

How the Region Patch Works

The well known region patch replaces a 32-bit instruction of the code. The original instruction is: »load the content of variable region_number into the register«. This instruction is replaced by »load a constant value into the register«. Because the limit of 32 bit for the instruction, the value is a sign extended 16 bit value. So only values between 0x8000 – 0x7fff (-32768 – +32767) are possible.

If using a negative number, the region name becomes for example "vs_-12345". Tests confirmed, that this regions with 9 characters work at Nintendo's servers like all others. And Wiimmfi supports it too, but has limited the accepted range from 0 to 7999 plus some other regions.

With this practice, 65536 (0x10000) versus regions are possible. However, changing the prefix of the string from "vs_" to something else makes it possible to use billions of different regions. Prefix modifications except »vx« and »bx« are not allowed by Wiimmfi.

Issues

The old region patch has forgotten to patch the region in some parts:

  • If player A plays in region 123 and the friend B meets A using the friends list, B is registered as player of its native region, e.g. 1 for USA. So as soon as player B gets host of the race (because the original host quits), other people from region 1 can join via the "Continental VS Race" button.
  • The region patch does not work for battle.

Wiimms SZS Tools fixed it and will patch 8 different places in StaticR.rel. The tools can also patch main.dol to define a login region. This login region can be used to identify the distribution of a private room.

New Patch Version by Leseratte

Leseratte has created a new version of the patch, fixing the battle and friend list bug.

With a special cheat code, it is possible to use regions from -2,147,483,647 to +4,294,967,296 allowing 6,442,450,943 regions in total. But this patch currently cannot be put into an ISO, so it's unreleased for now. Wiimmfi does not support this extended range of regions.

Applying Regions

Since August 2017, there is a new system for applying and managing custom regions for Wiimmfi. Other servers (for example based on AltWFC) may have their own system.

For Wiimmfi, visit the page »List of free custom regions«, search a free region and then use the form at »Apply regions« to apply one or more regions. For the second page, you have to be logged-on. Read the explanations of both pages.