/PathFinding
Saihou-Heiki (talk | contribs) (Created page with "=== 便利な関連機能 ===") |
Saihou-Heiki (talk | contribs) (Created page with "==== 閉塞領域 ==== 閉塞領域を利用すれば、交差点での激突を回避できます。") |
||
| (4 intermediate revisions by the same user not shown) | |||
| Line 56: | Line 56: | ||
=== 便利な関連機能 === | === 便利な関連機能 === | ||
==== チャンクロード ==== | |||
==== | 列車がプレイヤーの遠くにいってしまってアンロードされてしまうのを防ぐために、[[Special:MyLanguage/TrainCarts/Signs/Property#Keep_Chunks_Loaded|keepchunksloadedプロパティ]]からチャンクローダーの機能を設定できます。 | ||
こちらのPropertyサインから設定ができます。 | |||
{{sign|[+train]|property|keepchunksloaded|true}} | {{sign|[+train]|property|keepchunksloaded|true}} | ||
また列車に対して、<code>/train keeploaded true</code>コマンドを入力してから<code>/train save [name]</code>で保存し、[[Special:MyLanguage/TrainCarts/Signs/Spawner#Automated_spawning|Spawnerサイン]]で自動的にチャンクローダーの列車をスポーンさせることもできます。 | |||
==== 待機距離 ==== | |||
==== | [[Special:MyLanguage/TrainCarts/Signs/Property#Wait_Property|waitdistanceプロパティ]]を利用すると、衝突を避けるために列車間に広い距離を保てます。 | ||
==== 閉塞領域 ==== | |||
=== | [[Special:MyLanguage/TrainCarts/Signs/Mutex|閉塞領域]]を利用すれば、交差点での激突を回避できます。 | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Latest revision as of 03:41, 7 July 2026
概要
列車はMinecraftのワールドの中で、Switcherサインの自動分岐を用いていろいろな場所に向かうルートを設定できます。看板を設置することで線路ネットワークのトポロジーが設定され、列車はそれを利用して目的地へと走っていきます。
列車の向かう地点は目的地(Destinations)と呼ばれ、Destinationサインを用いることで作成や設定が可能です。また線路の分岐や終点は線路網のノード(Nodes)で、Switcherサインによって指定できます。ほかにも、Blockerサインを用いることで線路の進行を一方通行に制限でき、線路の交通の流れに逆らったルートが利用されるのを防げます。
やりかた
目的地を設定する
まずは、Destinationサインを用いて目的地となる地点を設定しましょう。サインの三行目にはその目的地の名前を、四行目にはここを通った列車が次にどこの目的地へ向かうかを指定できます。なお、指定は任意で、空行にもできます。
分岐のノードを設定する
レールを分岐させたいところには、常時オンになっているSwitcherサインが必要です。目的地が設定された列車がその上を通るとき、経路が自動で計算され、適切な方向へ分岐します。
一方通行にする
もし線路の一方向からだけ列車の通行を許可したいときには、常時オンのBlockerサインを使います。たとえば、方向の逆の線路――つまり対向車線――が二本並んでいるときなどはこの機能を活用できます。経路探索システムは、Blockerサインでブロックされている線路を自動的に無視するようになっています。
試してみる
列車を線路の上に配置し、目的地設定のコマンドで列車の目的地を設定します。
/train destination [name] /train destination output
そしてSwitcherサインへとトロッコを走らせると、目的地へ向かうために自動で線路が切り替えられます。目的地を変更してからもう一度Switcherサインの上を走らせてみてください。また、BlockerサインやDestinationサインなどの複数のサインを設置してからいろいろと試してみてください。
もしSwitcherサインが誤動作をしているようであれば、経路の再計算のコマンドを行うことで強制的に探索を再試行させることができます。
/train reroute
また、Propertyサインを使うことで目的地を設定することも可能です。
上級者ステップ
基本的なシステムを理解したら、次はもうちょっと複雑で高度な機能について見ていきましょう。
便利な関連機能
チャンクロード
列車がプレイヤーの遠くにいってしまってアンロードされてしまうのを防ぐために、keepchunksloadedプロパティからチャンクローダーの機能を設定できます。
こちらのPropertyサインから設定ができます。
また列車に対して、/train keeploaded trueコマンドを入力してから/train save [name]で保存し、Spawnerサインで自動的にチャンクローダーの列車をスポーンさせることもできます。
待機距離
waitdistanceプロパティを利用すると、衝突を避けるために列車間に広い距離を保てます。
閉塞領域
閉塞領域を利用すれば、交差点での激突を回避できます。
Station Routing
Station signs can launch the train into the direction of the next destination.
Debugger
The plugin offers a debug stick with which path finding information can be displayed. Use the stick item to click on rails to show information about the route(s) that can be taken. Sneak (shift) while clicking performs a reroute, which recalculates the track reachable from where you clicked. If you have multiple smaller rail networks, this can be more efficient than executing the global reroute command.
All destinations
Use the following command to get a stick item that displays all destinations reached from a given track:
/train debug destination
The track clicked is followed until a node of the track network is found, after which all routeable destinations are listed. For every destination the total distance to it is listed, and particles are displayed leading into it. If you find that a certain destination is not listed that should be, you can move further along the track clicking occasionally to find where the break is.
A single destination
Use the following command to debug a specific destination:
/train debug destination [destination]
Now when you click on the track, particles are displayed what route is taken to reach the destination. This is useful when debugging a specific destination so no particles are displayed for routes and destinations that aren't relevant to you.
Route Manager
Normally only one destination is set at a time. It is possible to set the next destination to go to on the destination sign itself, but that means you can only have one possible route. With the route manager a list of destinations to visit can be configured, and then applied to trains. Trains will then go down this list, advancing it every time they pass by a destination on it.
Commands
First, edit a train, then use the following commands to set a list of destinations:
/train route set [destination1] ([destination2] [destination3...]) /train route set outpost hillfort dungeon
To add additional destinations to the existing route, or to remove them, use these commands:
/train route add [destination1] ([destination2] [destination3...]) /train route remove [destination1] ([destination2] [destination3...])
You can then use the destination command or property to start the route at a desired destination. Otherwise, the route is started from the beginning the moment the train hits a destination sign. To inspect the route of a train, use the base route command. The current destination the train has is highlighted green.
/train route
Persistence
The route of a train can be saved globally under a name so it can later be applied to other trains instantly.
/train route save [name]
To load a saved route, this command can be used:
/train route load [name]
Alternatively, it can be done using a property sign as well:


