KANI Rail System: Difference between revisions

From CivWiki
Jump to navigation Jump to search
Content added Content deleted
(Created page with "The '''KANI Rail System''', usually reffered to as just '''KANI ('''''Knot and Nexus Interchange''), formerly '''NIG'''(''Nexus International Gateway'')")
 
(Add KANI logo)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{infobox
The '''KANI Rail System''', usually reffered to as just '''KANI ('''''Knot and Nexus Interchange''), formerly '''NIG'''(''Nexus International Gateway'')
| above = KANI

| image1 = [[File:KANI Logo by Gotter.png|frameless]]
| caption1 = The KANI's logo, made by [[Gotter]]

| image2 = [[File:KANI EOTW Map.png|frameless]]
| caption2 = KANI's coverage as of December 5th, 2021

| header1 = '''Community Project'''

| label2 = Goals:
| data2 = Automatic Rail Routing<br>Maintenance and Expansion of Rail Networks

| label3 = Administrators:
| data3 = [[Amelorate]]

| label4 = Website:
| data4 = [https://amel.pw/kani/ amel.pw/kani/]

| label5 = Project Github
| data5 = [https://github.com/Ameliorate/KANI KANI]

| label6 = Discord:
| data6 = [https://discord.gg/4JuByFCQqJ 4JuByFCQqJ]

| label7 = Status:
| data7 = Inactive
}}

[[File:KANI ERS.png|thumb|200px|The KANI ERS, used to route between rail stations]]

The '''KANI Rail System''', usually referred to as just '''KANI''' (''Knot and Nexus Interchange''), formerly '''NIG'''(''Nexus International Gateway'') was a [[routing standard|rail routing standard]]. It was the largest rail system in [[CivClassic 2.0]], competing with the [[GOR]], the [[AURA]], and [[SARS]]. The system was originally based around many interconnected switching roundabouts, but later the system was retrofitted to support routing along straight rails such as the [[HITS]].

The routing standard was created by [[Amelorate]] for the remodeled [[Nexus]] rail hub using the [[Icenia Transit System]] as a base.

== Specification ==

The KANI was strictly specified from the system's inception. Originally the specification was listed on Amelorate's website<ref>https://amel.pw/#NexusInternationalGateway</ref>, but it was eventually moved to the KANI discord. <ref>{{Cdisc|sender=Amelorate|sender-link=Amelorate|date=2021/6/22|url=https://discord.com/channels/844377164781715456/844377562573832214/856738494679089162|text=The [ ] is made up of many CanonicalDestinations.|channel=switch-standard|server=KANI|access-date=2024/5/29|screenshot-link=https://civwiki.org/wiki/File:KANISpec.png}}</ref> Routing data on the KANI is stored in a Github repository in TOML files in the <code>data</code> folder. By convention, Terminal Stations, Junctions, and Stations are stored in different folders based on the quality of the switch, however this is not required. Additionally, there was an unspoken rule that as long as things work equivalent to the specification, it is okay to bend the rules of the specification in order to be compatible with other standards or routing concepts.

=== Canonical Destination ===

A Canonical Destination is a unique identifier for a place on the KANI. Usually it is all lowercase, and to specify namespacing such as junctions or nations it uses a colon (<code>:</code>). If a Canonical Destination starts with <code>j:</code> that indicates it is a Junction. In the KANI data repository, the point's Canonical Destination is specified by the file's name, and its location must be set in the <code>x</code> and <code>z</code> attributes. Additionally, all files in the repository must specificy all destinations the point is connected to in the <code>links</code> list.

=== Terminal Station ===

A Terminal Station is an end-point in the KANI, and is the simplest possible station. This designation is used to indicate that the station is a "dumb" station, where the only possibility is to get out of your minecart if you arrive, or get on the minecart to depart. When routing using the ERS, the <code>links</code> list is only considered when the start or end destination is set to the Terminal Station. In the KANI TOML data file format, a Terminal Station is determined by the lack of a <code>station</code> or <code>switch</code> field.

=== Junction ===

A Junction is a point on the KANI where routing of some sort occurs. This is either a roundabout, a directional switch, or some non-standard switch. Non-standard switches are usually accompanied by a warning message because of how they often misroute players. A junction shall have <code>switch = true</code> in its KANI data file.

=== Station ===

Stations are a combination of a Junction, and a Terminal Station. At a station, you can be automatically routed towards another Canonical Destination, or automatically stop at the station. They were once required to have a track allowing easy disembarking from the station without using a special destination, but this requirement was dropped when the ERS was introduced because all routes to a station now included <code>CanonicalDestination:exit</code> in the /dest command. A station must have <code>station = true</code> in its TOML KANI data file in order to route correctly.

=== Routing on the ERS ===

The ERS routes players by following a strict algorithm. It starts at the player's starting point, and uses a routing algorithm such as A* to find the shortest path through Junctions and Stations to the player's desired destination. Then, for each Junction and Station in the path it adds the required destination to get to the next Junction/Station to the /dest, and then finally removes any duplicated destinations from the command. Additionally, if the player's desired destination is a Station, it adds the station's Canonical Destination followed by <code>:exit</code> to the /dest command.

=== Lines ===

Lines are implemented using the <code>BadLinks</code> subsection in the KANI data file format. Every three-way junction on the line is given its own Canonical Destination, but each data file should specify the junction that's "next" and "previous" on the line with a consistent <code>BadLinks</code> entry. For example, <code>j:hits_atlantis</code> has <code>j:hits_ll</code> to the north of it, so the <code>BadLinks</code> says that <code>j:hits_ll</code> should be replaced with <code>hits:north</code>. This is repeated for each switch in the line in both directions. When routing from one end of the line to another, the ERS would emit a destination similar to <code>/dest thoria hits:south hits:south hits:south hits:south september september:exit</code>. The next step of the ERS automatically removes the duplicate <code>hits:south</code> entries to become a valid /dest command.

== History ==

The first prototype of the KANI was a simple one-way roundabout [[RailSwitch]] system around downtown [[Icenia (CivClassic 2.0)]]. Using this system, Amelorate reasoned about the various rail systems they've seen around the server and eventually came upon one solution for the spaghetti junctions RailSwitch had become known for. At the time, there was no modularity to the destination command, so the only two ways to implement a routing network was to either have all rails return to a central hub for routing, or to have every switch be aware of every destination in the network. Most networks did neither.

Amelorate modified the RailSwitch plugin to implement the now well-utilized word-splitting OR mechanic in the destination command, and then started to remodel [[Nexus]] and the j:knot junction. Nexus featured several elements that weren't nearly as emphasized in future stations. For example, Nexus had a disembarking track that ran back and forth for about 20 seconds to allow players to get off the switch and retreive their minecart. This was implemented at the time because players were expected to write their destination commands manually and they would likely omit the 0,0:exit element. At this time, all switches were documented on [https://amel.pw/wiki/#NexusInternationalGateway Amelorate's personal website], and players were expected to write their own destination commands.

[[File:Old KANI ERS.png|thumb|200px|The first iteration of the NIG ERS]]

After a few switches were built, the KANI started to outgrow its TiddlyWiki documentation. Most players didn't understand the layout of the network, which made it very difficult to write a /dest command and get to their desired destinations. To significantly ease these issues, Amelorate wrote what was at the time called the [https://amel.pw/kani/ Nexus International Gateway Express Routing System] (''NIGERS'', pronounced nai-jers). An announcement was made upon the CivClassic subreddit, and Amelorate was quickly threatened into renaming the NIG because the post lacked the pronouncement of the web app<ref>https://old.reddit.com/r/civclassics/comments/kkb4bh/announcing_the_nexus_international_gateway/</ref>.

During this time, Amelorate contempted ending their efforts on the NIG because of this threat. However, in a sudden revelation it was revealed to Amelorate a suitable name for the rail system: KANI. Not only was the name based on the Japanese word for crab, but it also sounded like Cunny. Additionally, if the KANI were to ever be connected to the GOR the combined acronym of the two (KANI-GOR) contains the rail system's original name. These factors helped to reinforce the idea that Amelorate was a true anime fan, so continuing the KANI became a desirable idea for Amelorate.

[[File:EarlyKANICCMap.png|thumb|200px|Earliest map of the KANI on [[CCMap]]]]

With the new name and an increased presence on the CivClassic subreddit, the KANI entered a new age of player contribution. [[Gjum]] rewrote the ERS web app to compute the command in the web browser which significantly reduced load times for the ERS<ref>https://old.reddit.com/r/civclassics/comments/ozcwg4/kani_update_10/</ref>, as the previous version downloaded a JSON file containing the command for each pair of origin and destination. More nations got connected to the KANI, and a KANI layer was added to [[CCMap]]<ref>https://old.reddit.com/r/civclassics/comments/o4hjn6/kani_changelog_06202021/</ref>.

Around this time, the KANI also got competition. Namely, the [[AURA]] and [[SARS]]. The SARS eventually became [[OneDest]] on future servers, however on CivClassic it never expaned outside the [[South Augusta]] area. The AURA aimed to be a strict superset of the KANI, however it eventually fell victim to its complexity as it allowed too many different kinds of switches. However, taking influence from the AURA, the KANI implemented functionality to implement two-way trunk rails. This eliminated a common complaint that destination commands for trunk rails were too long. Before this change, destinations that traveled from one end of a trunk rail to the other would refer to each junction along the rail. This functionality could have one day been used to integrate the KANI with the GOR without impacting the usage of the GOR without the KANI.

When Amelorate's interest in CivClassic waned, the routing system slowly decayed into disrepair. At this time, Amelorate expected the community to fix rails as they came across issues. This did not happen and the KANI gained a poor reputation for being in poor repair by the end of CivClassic 2.0. One factor that compounded this issue was the fact that there was no one central [[NameLayer]] group for KANI infrastructure. In fact, most infrastructure was on unknown groups after being repurposed unused rails, and thus was very difficult to repair.

When CivClassic 2.0 ended, Amelorate announced the KANI would not move to any future [[Civ]] server although others would be allowed to implement the standard. Nobody implemented the standard as the [[OneDest]] standard was better, so the KANI naturally dissolved at this time.

== Trivia ==

* The KANI connected to the GOR through [[Mount Augusta (CivClassic 2.0)]]'s rail system around [[South Augusta]], specifically <code>j:sa:west</code>. South Agusta had a section of rail that went above ground and eventually merged with the GOR. This was not represented in the ERS in order to prevent controversy.<ref>https://github.com/Ameliorate/KANI/blob/master/data/CompliantSwitches/Line/sa/j%3Asa%3Awest.toml#L11-L12</ref>

== Media ==

<youtube>igpAYWDzsNk</youtube>
<youtube>svEUDRS_TZ0</youtube>

== External Links ==

* [https://amel.pw/wiki/#NexusInternationalGateway Nexus International Gateway's original documentation]
* [https://amel.pw/kani/ Express Routing System]
* [https://github.com/Ameliorate/KANI KANI Github]

== References ==

<references/>

[[Category:Routing Standards]]

Latest revision as of 18:53, 29 May 2024

KANI
The KANI's logo, made by Gotter
KANI's coverage as of December 5th, 2021
Community Project
Goals:Automatic Rail Routing
Maintenance and Expansion of Rail Networks
Administrators:Amelorate
Website:amel.pw/kani/
Project GithubKANI
Discord:4JuByFCQqJ
Status:Inactive
The KANI ERS, used to route between rail stations

The KANI Rail System, usually referred to as just KANI (Knot and Nexus Interchange), formerly NIG(Nexus International Gateway) was a rail routing standard. It was the largest rail system in CivClassic 2.0, competing with the GOR, the AURA, and SARS. The system was originally based around many interconnected switching roundabouts, but later the system was retrofitted to support routing along straight rails such as the HITS.

The routing standard was created by Amelorate for the remodeled Nexus rail hub using the Icenia Transit System as a base.

Specification

The KANI was strictly specified from the system's inception. Originally the specification was listed on Amelorate's website[1], but it was eventually moved to the KANI discord. [2] Routing data on the KANI is stored in a Github repository in TOML files in the data folder. By convention, Terminal Stations, Junctions, and Stations are stored in different folders based on the quality of the switch, however this is not required. Additionally, there was an unspoken rule that as long as things work equivalent to the specification, it is okay to bend the rules of the specification in order to be compatible with other standards or routing concepts.

Canonical Destination

A Canonical Destination is a unique identifier for a place on the KANI. Usually it is all lowercase, and to specify namespacing such as junctions or nations it uses a colon (:). If a Canonical Destination starts with j: that indicates it is a Junction. In the KANI data repository, the point's Canonical Destination is specified by the file's name, and its location must be set in the x and z attributes. Additionally, all files in the repository must specificy all destinations the point is connected to in the links list.

Terminal Station

A Terminal Station is an end-point in the KANI, and is the simplest possible station. This designation is used to indicate that the station is a "dumb" station, where the only possibility is to get out of your minecart if you arrive, or get on the minecart to depart. When routing using the ERS, the links list is only considered when the start or end destination is set to the Terminal Station. In the KANI TOML data file format, a Terminal Station is determined by the lack of a station or switch field.

Junction

A Junction is a point on the KANI where routing of some sort occurs. This is either a roundabout, a directional switch, or some non-standard switch. Non-standard switches are usually accompanied by a warning message because of how they often misroute players. A junction shall have switch = true in its KANI data file.

Station

Stations are a combination of a Junction, and a Terminal Station. At a station, you can be automatically routed towards another Canonical Destination, or automatically stop at the station. They were once required to have a track allowing easy disembarking from the station without using a special destination, but this requirement was dropped when the ERS was introduced because all routes to a station now included CanonicalDestination:exit in the /dest command. A station must have station = true in its TOML KANI data file in order to route correctly.

Routing on the ERS

The ERS routes players by following a strict algorithm. It starts at the player's starting point, and uses a routing algorithm such as A* to find the shortest path through Junctions and Stations to the player's desired destination. Then, for each Junction and Station in the path it adds the required destination to get to the next Junction/Station to the /dest, and then finally removes any duplicated destinations from the command. Additionally, if the player's desired destination is a Station, it adds the station's Canonical Destination followed by :exit to the /dest command.

Lines

Lines are implemented using the BadLinks subsection in the KANI data file format. Every three-way junction on the line is given its own Canonical Destination, but each data file should specify the junction that's "next" and "previous" on the line with a consistent BadLinks entry. For example, j:hits_atlantis has j:hits_ll to the north of it, so the BadLinks says that j:hits_ll should be replaced with hits:north. This is repeated for each switch in the line in both directions. When routing from one end of the line to another, the ERS would emit a destination similar to /dest thoria hits:south hits:south hits:south hits:south september september:exit. The next step of the ERS automatically removes the duplicate hits:south entries to become a valid /dest command.

History

The first prototype of the KANI was a simple one-way roundabout RailSwitch system around downtown Icenia (CivClassic 2.0). Using this system, Amelorate reasoned about the various rail systems they've seen around the server and eventually came upon one solution for the spaghetti junctions RailSwitch had become known for. At the time, there was no modularity to the destination command, so the only two ways to implement a routing network was to either have all rails return to a central hub for routing, or to have every switch be aware of every destination in the network. Most networks did neither.

Amelorate modified the RailSwitch plugin to implement the now well-utilized word-splitting OR mechanic in the destination command, and then started to remodel Nexus and the j:knot junction. Nexus featured several elements that weren't nearly as emphasized in future stations. For example, Nexus had a disembarking track that ran back and forth for about 20 seconds to allow players to get off the switch and retreive their minecart. This was implemented at the time because players were expected to write their destination commands manually and they would likely omit the 0,0:exit element. At this time, all switches were documented on Amelorate's personal website, and players were expected to write their own destination commands.

The first iteration of the NIG ERS

After a few switches were built, the KANI started to outgrow its TiddlyWiki documentation. Most players didn't understand the layout of the network, which made it very difficult to write a /dest command and get to their desired destinations. To significantly ease these issues, Amelorate wrote what was at the time called the Nexus International Gateway Express Routing System (NIGERS, pronounced nai-jers). An announcement was made upon the CivClassic subreddit, and Amelorate was quickly threatened into renaming the NIG because the post lacked the pronouncement of the web app[3].

During this time, Amelorate contempted ending their efforts on the NIG because of this threat. However, in a sudden revelation it was revealed to Amelorate a suitable name for the rail system: KANI. Not only was the name based on the Japanese word for crab, but it also sounded like Cunny. Additionally, if the KANI were to ever be connected to the GOR the combined acronym of the two (KANI-GOR) contains the rail system's original name. These factors helped to reinforce the idea that Amelorate was a true anime fan, so continuing the KANI became a desirable idea for Amelorate.

Earliest map of the KANI on CCMap

With the new name and an increased presence on the CivClassic subreddit, the KANI entered a new age of player contribution. Gjum rewrote the ERS web app to compute the command in the web browser which significantly reduced load times for the ERS[4], as the previous version downloaded a JSON file containing the command for each pair of origin and destination. More nations got connected to the KANI, and a KANI layer was added to CCMap[5].

Around this time, the KANI also got competition. Namely, the AURA and SARS. The SARS eventually became OneDest on future servers, however on CivClassic it never expaned outside the South Augusta area. The AURA aimed to be a strict superset of the KANI, however it eventually fell victim to its complexity as it allowed too many different kinds of switches. However, taking influence from the AURA, the KANI implemented functionality to implement two-way trunk rails. This eliminated a common complaint that destination commands for trunk rails were too long. Before this change, destinations that traveled from one end of a trunk rail to the other would refer to each junction along the rail. This functionality could have one day been used to integrate the KANI with the GOR without impacting the usage of the GOR without the KANI.

When Amelorate's interest in CivClassic waned, the routing system slowly decayed into disrepair. At this time, Amelorate expected the community to fix rails as they came across issues. This did not happen and the KANI gained a poor reputation for being in poor repair by the end of CivClassic 2.0. One factor that compounded this issue was the fact that there was no one central NameLayer group for KANI infrastructure. In fact, most infrastructure was on unknown groups after being repurposed unused rails, and thus was very difficult to repair.

When CivClassic 2.0 ended, Amelorate announced the KANI would not move to any future Civ server although others would be allowed to implement the standard. Nobody implemented the standard as the OneDest standard was better, so the KANI naturally dissolved at this time.

Trivia

  • The KANI connected to the GOR through Mount Augusta (CivClassic 2.0)'s rail system around South Augusta, specifically j:sa:west. South Agusta had a section of rail that went above ground and eventually merged with the GOR. This was not represented in the ERS in order to prevent controversy.[6]

Media

External Links

References