プロのゲーム攻略サイト

www.zgtz168.com

酸素は含まれていません – 小惑星の作り方

このガイドでは、Oxygen Not Included のカスタム ワールドを設計する際の .yaml の操作の基本について説明します。

はじめに

ここに詳述されている情報は、Oxygen Not Included 小惑星の改造に関心のあるすべての人の学習プロセスを改善し、より多くの人々にそうするように促すことを願っています.

ONI のモッディング専用の wiki はないようなので、このガイドは worldgen に関連する情報のリポジトリとして部分的に機能します。ここに記録できるのは、ゲームのモッディングを行ってきた短い時間で得た、明らかに不完全な知識だけです。 worldgen についてさらに学び、より多くの時間を手にすることができるようになるにつれて、このガイドを更新し続ける予定です。ある時点で付録を追加します。

.yaml を編集するには、Visual Studio Code を使用することをお勧めします。また、ゲームの言語を話せるようになるまで、かなりの忍耐力を行使することをお勧めします。

ファイルの場所

ガイドのこのセクションでは、小惑星を作成するときにアクセスする必要がある場所をリストして説明します。

要素

OxygenNotIncluded_DataStreamingAssetselements

このフォルダには、液体水素 (LiquidHydrogen) など、ゲームで使用される要素の ID が含まれています。

他の ID は「worldgen」ディレクトリにあります。それらの中で最も関連性の高いものは、サブワールドの境界線の種類をリストする「borders.yaml」と、大部分の生き物 (基本モーフのみ) と植物、およびいくつかの間欠泉をリストする「mobs.yaml」です。

テンプレート

OxygenNotIncluded_DataStreamingAssetsテンプレート

このフォルダには、拠点と関心のあるポイント (POI) のテンプレートが含まれています。テンプレートは、サンドボックスやデバッグ モードを使用してゲーム内で作成し、.yaml に保存するか、手動で .yaml に作成することができます。

POIは、ゲーム世界にランダムに生成された過去の植民地の遺跡です。新しいマップの開始時に最も近い環境 (印刷ポッド、オキシライトの塊、床など) で構成される「ベース」にある開始ベースは、テンプレートのもう 1 つの主な例です。

必要に応じて、テンプレートから世界全体を作成し、マップ上にランダムに生成された要素を持たないようにすることもできます。ただし、通常、テンプレートはマップにフレーバーを追加し、指定された場所に特定のフィーチャを生成する方法です。間欠泉と火山はこの好例です。

ワールドゲン

OxygenNotIncluded_DataStreamingAssetsworldgen

このディレクトリには、ワールドのランダム生成に関連するファイルとフォルダが含まれています。

「worldgenworlds」

ワールドは、組み合わせてマップを埋め、完全なワールドを作成するサブワールドのコレクションです。

「worldgensubworlds」

サブワールドは、ゲーム内でバイオームとして一般的に知られているものです。それらは通常、アビサライトまたは花崗岩の境界によって他のサブワールドから分離されています。

「ワールドゲンバイオーム」

バイオームは、各サブワールドに対して生成される地形要素のタイプと、それらの生成のパラメーターを決定します。これは、サブワールドがどのように見えるかを最も直接的に制御できる場所です。

「worldgenfeatures」

機能は、サブワールド生成のオプション コンポーネントです。これらは、水域などのサブワールドに特定の要素のポケットを挿入するための非常に便利な方法です。テンプレートや POI とは異なり、.yaml で設定されたパラメーターに従って、形状とサイズがランダムに生成されます。通常、POI は間欠泉または人間活動の残骸ですが、フィーチャは要素の自然な形成をより重視しています。

サブワールド機能は、「StreamingAssetstemplatesfeatures」にあるグローバル機能と混同しないでください。デフォルトのグローバル フィーチャは、一般的な間欠泉と火山のみです。

「ワールドゲンノイズ」

ノイズは、バイオーム データが生成されるパターンを決定します。同じバイオーム データでも、与えられたノイズ パラメータに応じて分布と構造が異なります。

ワールド

ガイドのこのセクションでは、world .yaml の各部分について説明します。使用例は「worldsVolcanic.yaml」です。 Volcanea は、このガイドの大部分でサンプル ワールドとして使用されます。

名前と説明はコンパイラなしでは編集できませんが、このガイドでは扱いません。

難易度とティアによって、ワールド選択メニューでのワールドの位置が決まります。設定できるデフォルトの難易度は次のとおりです:

0.理想
1.多分
2.おそらく
3.中程度
4.限界
5.スリム

SpriteName は、ゲームのワールド選択画面でワールドに使用される画像を指定します。

CoordinatePrefix は、シード番号の前にワールド座標として表示される省略名です。

DisableWorldTraits は、小惑星のワールド トレイトの生成を無効にします。これは「true」に設定でき、デフォルトでは「false」です。ワールド トレイトは、「worldgentraits」ディレクトリにあります。このパラメータは、Volcanea や、Terra 以外のデフォルトの小惑星には表示されません。デフォルトの世界と非常に似たスタイルの世界を生成する場合を除き、世界の特性は無効にする必要があります。

Worldsize は、ワールドの幅 (X) と高さ (Y) の寸法を決定します。幅は高さよりも小さくする必要があります。そうしないと、ゲームがクラッシュします。

SubworldFiles は、worldgen 中にワールドで使用するためにロードされたすべてのサブワールド ファイルです。ワールドにサブワールドを生成するには、ゲームがアクセスできるように、ここにリストする必要があります。使用されるディレクトリは worldgen であるため、すべてのサブワールド ファイルはそのディレクトリ内に配置する必要があります。サブワールドのデフォルト フォルダーは worldgensubworlds です。サブワールドについては、このガイドのサブワールド セクションで詳しく説明します。

StartSubworldName は開始サブワールドの場所です。

StartingBaseTemplate は、「StreamingAssetstemplatesbases」にある開始ベースのファイル名です。

StartingBasePositionHorizo​​ntal と startingBasePositionVertical は、開始サブワールド内の開始ベースの位置を決定します。デフォルトではほぼ中心です。

globalFeatureTemplates は、ワールドで生成されるテンプレートのタイプと数を決定します。デフォルトでは、グローバルテンプレートを許可するサブワールドで、12 の間欠泉が世界中でランダムに生成されます。グローバル機能は「StreamingAssetstemplatesfeatures」にあります。

UnknownCellsAllowedSubworlds は、世界でサブワールドを生成する方法を決定する場所です。

Tagcommand は、サブワールド生成の場所パラメーターを決定します。これらは:

開始サブワールドを生成するデフォルト。

DistanceFromTag は、指定されたタグから設定された距離でサブワールドを生成します。このタイプは、距離範囲を設定する必要があります。

AtTag は、指定されたタグの場所にサブワールドを生成します。

タグは、ロケーション生成の基準点を決定します。これらは:

  • ワールドの開始位置を基準点として使用する AtStart。
  • 世界の底を基準点として使用する AtDepths。
  • 世界の頂点を基準点として使用する AtSurface。

MinDistance と maxDistance は、指定された参照ポイントからサブワールドを生成できる最小距離と最大距離を設定します。これらのパラメーターは同じ値を持つことができます。最小値:1 と最大値:2 のように、それらの値が異なる場合、サブワールドはその範囲で生成されます。

コマンドは、サブワールドが他のサブワールドに関連して生成される方法を決定します。これらは:

  • 指定された場所のすべてのインスタンスで、指定されたサブワールド全体を生成する置換。その場所で以前に生成されたサブワールドはすべて削除されます。
  • UnionWith は、サブワールドの境界に関係なく、指定された場所で指定されたサブワールドの乱数を生成します。これにより、UnionWith を使用して生成されたサブワールドがそれに隣接するサブワールドとマージされる、部分的なサブワールド境界になります。指定された場所が範囲の場合、生成されたサブワールドの乱数は範囲全体に分散されます。
  • ExceptWith は、その範囲を制限するために UnionWith と組み合わせてのみ使用できます。次のセクションに例があり、Volcanea の生成の各ステップが説明され、図示されています。

SubworldNames は、ファイル名によって生成されるサブワールドを決定します。

TemperatureRanges は、温度によって生成されるサブワールドを決定します。複数の温度値を指定できます。指定された温度に適合する subworldFiles で指定されたサブワールドは、ランダムに生成されます。ゲームの温度値のリストは、「worldgen」にあります。

火山

ガイドのこのセクションでは、Volcanea の worldgen について説明します。

UnknownCellsAllowedSubworlds

.yaml のこのセクションでは、Volcanea のサブワールドがブロックごとに生成され、中心から外側に向かっています。 Worldgen はこれらを直線的に読み取るため、.yaml で後で生成されたサブワールドは、それらの前に生成されたサブワールドを常にオーバーライドします。

SandstoneStart、SandstoneMiniMetal、SandstoneMiniWater は、プレイヤーの開始サブワールドを構成し、ゲーム内の温帯バイオームに対応します。バランス調整については、以下を参照してください。

それらのすぐ周囲には HotMarsh と Jungle のサブワールドがあり、それぞれゲーム内のスライムとコースティック バイオームに対応しています。

さらにマップの端まで進むと、海と氷のサブワールドも生成され始めます。これらは、それぞれゲーム内の塩と寒冷バイオームに対応しています。

これらすべてのサブワールドは、Replace コマンドを使用して生成され、重なり合うことなく明確な境界線を持つ必要があります。ただし、Worldgen が完璧であることはめったにありません。

標準の 256×384 ワールドでは、開始位置から水平方向におよそ 4 ブロック、垂直方向に 5 ブロックが許容され、5 を超える minDistance を使用する必要はありません。5 番目のブロックには 999 の maxDistance を使用する必要があります。ここに表示されない場合、worldgen が壊れます。

バランス調整について

開始サブワールドは通常、アスタリスクの形をした 7 つの「ミニ」サブワールドで構成されます。 Volcanea では、場所 1-1 に 2 つのサブワールドが生成され、SandstoneStart を囲む各ブロックで MiniMetal または MiniWater が生成される可能性が等しくなります。これは、最悪でも 32 シードごとに 1 つが開始サブワールドに MiniMetal または MiniWater サブワールドしかないことを意味します。これは多くの状況で注意することが重要ですが、おそらく最も重要なのは、開始サブワールドで水域を生成する場合です。

開始サブワールド内のミニ サブワールド。1 ~ 7 の番号が付けられています。

オイルポケット

ここで worldgen はマップの下部を基準点として使用し、その点から 1 ~ 2 ブロックの距離に石油のサブワールドを生成します。この時点で、それらの場所で以前に生成されたサブワールドは上書きされます。 AtDepths は、地図の中心や下部の 1 点ではなく、地図の下部全体を指すことに注意してください。

表面

ここで、worldgen は表面のサブワールドを作成し、すぐに世界の表面に表面の破片の層を追加します。

マグマベント

ここで worldgen は、Volcanea で非常に認識可能なマグマ ベントを作成します。 Depths からの 1 ~ 4 の場所の値は、開始場所の境界にマグマ ベントを配置します。この最初の UnionWith は、その範囲内の世界中のどこにでもマグマ ベントを生成しますが、2 番目の UnionWith は、マップの端にマグマ ベントを生成します。 AtEdge は地図の両端を指すことに注意してください。ただし、小惑星は丸いものとして扱われるため、技術的には 1 つの端と見なされます。

2 番目の UnionWith は重要です。これがないと、マグマ ベントがマップの下半分にかなり薄く広がってしまうからです。 2 つ目の UnionWith を 0 ~ 1 のかなり狭い範囲で追加して、ワールドの端に通気孔を生成すると、すべての Volcanea シードがマップの両側から上昇する独特のマグマを持つようになります。 ExceptWith は、こ​​れらのベントがサーフェスの 1 ~ 4 ブロック内で生成されないようにします。それがなければ、エッジのマグマ ベントが地表までずっと生成されます。

下の画像では、MagmaVent サブワールドが他のサブワールドに割り込まれたり、割り込まれたりする様子に注目してください。これは、上の OilPockets を示すイメージでも明らかです。これは UnionWith 生成の結果です。

ここで、マグマで満たされたマップの下部が生成されます。

地表の岩

ここで、ボルカニアのやや独特な側面が生成されます。表面の岩が世界の本体に生成され、時折、表面下にスペースのポケットができます。 SurfaceCrags サブワールドには Gravitas POI が含まれているため、地表の下に Gravitas が生成されたシードが見つかることがあります。

ワールド サイズ

worldgen では、距離は常にあいまいです。重複は常にあり、UnionWith は Replace とは異なるスペーシング ルールに従います。サブワールドの間隔を完璧にするには、ワールドをテストし、多くのワールドジェンで微調整する必要があります。

サブワールド

このセクションでは、サブワールドの生成方法について説明します。

The default subworld groups, each of which corresponds to a folder in the “subworlds” directory, are:

  • Barren
  • Forest
  • Frozen
  • Jungle
  • Magma
  • マーシュ
  • Ocean
  • Oil
  • Rust
  • Sandstone
  • Space

Each subworld group contains a number of subworlds. In Volcanea, the Sandstone subworlds used in worldgen are “SandstoneStart”, “SandstoneMiniMetal”, and “SandstoneMiniWater”. (“Sandstone” is loaded, but not generated.) The topographical differences between those subworlds are relatively minor. The most notable difference is the presence of lakes, which “SandstoneMiniMetal” does not generate.

Looking at other Sandstone subworlds not used by Volcanea, we can find subworlds with similar topographies but different environments, as in the case of the “Cold” Sandstone variants. Note the only difference between the two subworlds below, “SandstoneMiniMetal” and “SandstoneMiniMetalCold”, is the temperatureRange parameter.

More noticeable differences can be found elsewhere. “JungleFrozen”, a subworld not used in Volcanea, contains no lifeforms indigenous to the “Jungle” subworld, except the morb. This is because the flora and fauna of the Jungle subworld require high temperatures to grow. See below.

This example should be followed as a rule. Generating critters or plants in a subworld that is too cold or hot for them to survive has very limited function and is generally bad design.

Subworld borders should be an important consideration in this regard. Avoid generating subworlds adjacent to others that vary drastically in temperature without an abyssalite border.

An exception to this can be seen in the Oasisse asteroid, where part of the world’s difficulty is in the need to quickly insulate the borders of the starting subworld against the enroaching heat of the surrounding subworlds.

By default, starting subworlds have a granite (“rocky”) border, which offers limited insulation. Abyssalite (“hardToDig”) border should not be used for the starting subworld, primarily so that the player has the opportunity to explore without needing a Duplicant skilled in Superhard Digging.

More creative uses of worldgen will naturally deviate further from typical world types, and may bend or break the usual rules of world building. See below for an example I generated for the sake of this guide. Whatever type of world you build, the most important criterion to hold it to should be whether or not other players will find it fun to create a colony in it.

Below are all the subworld parameters whose functions I have tested and understand to some degree.

biomeNoise determines the subworld’s terrain structure. An illustration of each noise type will be given in the Noise section of the guide.

temperatureRange determines the temperature of the subworld. Possible temperature ranges can be found in “worldgentemperatures.yaml”.

pdWeight determines the size of the subworld. Smaller values generate smaller subworlds.

minChildCount seems to determine the population of the subworld, with higher values seeming to generate less critters and plants. More testing is needed.

borderOverride forces the given subworld border type. Possible border types can be found in “worldgenborders.yaml”.

biomes references biome data (“name”), found in “worldgenbiomes”, determines the distribution of that data throughout the subworld when referencing multiple biomes (“weight”), and determines the flora and fauna of the subworld (“tags”).

centralFeature and features determine which features can be generated in the subworld, but do not guarantee that any feature will be generated. I have not tested centralFeature enough to determine how it is distinguished from other features, but I would assume that it takes precedence during worldgen. Features can be found in the “worldgenfeatures” directory.

pointsOfInterest determines which templates will be generated in the subworld. If a subworld lists a POI to be generated, exactly one instance of all instances of that subworld in the world will have the given POI generated in it. If multiple POI are listed, each POI will have equal chance of being generated.

tags assigns particular limits to the subworld. I have not tested the function of most of these. NoGlobalFeatureSpawning is the one that I have found to be most relevant. Global features by default are geysers, vents, and volcanoes. Global features can be found in the “StreamingAssetstemplatesfeatures” directory.

Biomes

This section of the guide explains how biomes work, and provides illustrations of different biome data.

Biomes are the elements that make up the terrain of subworlds. The distribution of solid elements, gases, and liquids are all determined by the subworld’s biome. In default biomes, with the exception of magma and liquid hydrogen and oxygen, liquids are not generated. When generating bodies of water for the player, features are used instead. This is because, unless the liquid occupied the majority of space in the subworld, using biome data to generate water would create rivulets and scattered pockets of it throughout the subworld, which would be disruptive rather than functional.

The image below is of “biomesMagma.yaml”.

MagmaPool, MagmaBed, CooledMagmaBed, and MagmaVent are the sub-biomes, which are specified in the subworld .yaml, below.

In the MagmaVent subworld given above (right), the sub-biome used is MagmaVent. Therefore, when generating a MagmaVent subworld, worldgen will assign it the content given in the MagmaVent sub-biome, namely obsidian and magma.

bandSize dictates how much of a given element will be generated. In theory, if two elements share a bandsize of 0.5 in a sub-biome with no other elements, they should have equal distribution in that biome. Bandsize does not always follow the expected logic, however.

In order to illustrate bandsize in worldgen, I have generated a sample world filled with columns of duplicated MagmaVent subworlds. From outermost (0-0) to innermost (4-4), the bandsize of obsidian/magma in each column is 2.0/0.1 (0-0), 1.5/0.1 (1-1), 1.0/0.1 (2-2), 0.5/0.1 (3-3), 0.01/0.1 (4-4).

As you can see, 3-3 by no means has 5 parts obsidian to 1 part magma. Since I do not have access to the game code and do not have a background in mathematics, I can only guess at how bandsize is generated through experience and testing in worldgen. At a certain point it becomes intuitive, and I recommend experimenting on your own until you reach that point.

Features and POI

This section of the guide explains what features and POI are and the difference between them.

Features

This is “featuresjungleBleachRoom.yaml”, a default feature generated in Jungle subworlds.

Shape determines the shape of the feature. Known shapes are:ShortWide, TallThin, Blob, Splat, Circle, and Square.

borders seems to extend the elements listed under “RoomBorderChoices” beyond the area set by blobSize by the given number of cells. Needs further testing.

blobSize determines the size of the feature, measured in cells.

RoomCenterElements generates elements in the center of the feature.

RoomBorderChoices generates the feature’s border. Multiple border types can be used to restrict a certain element to one section of the border.

Element generates the given element. Element id’s can be found in the “StreamingAssetselements” directory.

Weight determines how much of the given element will be generated relative to other elements.

Points Of Interest

This is a custom POI, created in debug mode then edited in .yaml. The contents of the POI are shown by the selected cells in the picture below.

Default POI .yaml’s tend to be exceptionally long. Because there are no randomly generated elements in POI, each .yaml contains a cell-by-cell list of all of its elements and their properties.

Cells lists every gas, liquid, solid, or special element in the POI. The properties of elements can be:mass, temperature, location_x, location_y, diseaseName, diseaseCount.

Buildings lists the structures in the POI with which the player can interact, e.g., heatsinks. These are usually destructible.

pickupables lists all the non-elemental objects in the POI that dupes can sweep, e.g., seeds.

ElementalOres lists the elemental objects in the POI that dupes can sweep, e.g., water bottles.

OtherEntities lists anything which does not fit in or is an exception to the above types, e.g., critters. These are usually indestructible.

Features and POI are distinct in two main ways.

First, features are randomly generated during worldgen. POI have no variation and are generated exactly as they appear in their template.

Second, when a subworld .yaml contains any number of POI, one of the given POI will always be generated in one instance of that subworld in the world. Further, only one of each POI can be generated in the same world. If “poi_magma_bigvolcano” exists in the world, no other instance of it can be generated. Features, however, may or may not be generated in a given subworld, and do not consider features generated in subworlds other than their own.

In the Frozen subworld, as with most other subworlds that generate POI, there are multiple POI groupings.

One POI in each of these groupings will be generated in a subworld somewhere in the world, provided there are enough subworlds to fit them.

Each POI has the same chance of being generated as every other POI in its grouping.

Troubleshooting

This section of the guide goes over the different types of worldgen errors and crashes, and common causes of each.

Before you start editing, create a backup of “StreamingAssets”, then create a subdirectory in “worldgen”. Keep all the worldgen files that you edit in that subdirectory, excepting POI, which must remain in the default POI directory in order to be generated.

Be sure to maintain the spacing rules shown in any default .yaml while editing. Failing to do so will usually cause gamecrash.

Because the game is so fragile to alterations in .yaml’s, you will probably encounter a lot of crashes when you first start, and much of the time you will probably not feel sure what caused the crash.

The most useful piece of advice I can impart is to test worldgen after even the smallest changes. It can be a little tedious to exit the game only to make the slightest change to your .yaml before you test it again, over and over, but by doing so you will almost certainly save yourself from having to backtrack across several changes without knowing which caused the crash or error, and risk losing track of what you changed to the point that you have to reconstruct your entire worldgen.

There are two common points in worldgen where errors will occur, pictured below.

If the loading bar resets itself multiple times from “freezing ice formations”, the asteroid will load as a block of either abyssalite or unobtainium. This usually means that your error is related to the blocking of subworlds, that is, dividing the world into blocks and assigning a subworld to each. Look for errors in your world .yaml first, or in how your subworld borders are generated.

If the loading bar freezes at “establishing personal boundaries”, your error is mostly likely related to biome or subworld generation. If a subworld is attempting to access biome data that does not exist, for example, you will face this error. Look for errors in your subworld .yaml’s first.

The black hole can be caused by the tiniest of things. A typo somewhere in one of your files, weighting a subworld outside the accepted parameters, generating an invalid POI, a line of bad code basically anywhere in any of the files used in worldgen… pretty much anything can cause a black hole. They are usually triggered when attempting to load the world selection screen.

The best way to deal with black holes is to revert to a stable version of worldgen, figure out what you did wrong in the process, and try again.

Miscellanea

Traits

While most modded worlds will have world traits disabled, there is room for ones that follow the rules of default worlds closely enough that world traits could be enabled without disrupting worldgen. In these cases, custom world traits could be created to give the player an additional level of control over worldgen. Default world traits are found in the “worldgentraits” directory. Note that a decompiler would be needed to make custom world traits.