Keen:Planet Modding/In-game map: Difference between revisions
CptTwinkie (talk | contribs) mNo edit summary |
CptTwinkie (talk | contribs) mNo edit summary |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{: | <noinclude>{{SEO|image_url=http://www.medievalengineerswiki.com/images/8/8a/AtlasCoordinateUsage.png|description=Maps in Medieval Engineers are generated based on terrain and buildings on it. This means that they will work for any modded planet in their default form.}} | ||
{{Keen:OCH}} | |||
Line 5: | Line 6: | ||
|release=0|major=4|minor=X|suppress=true}} | |release=0|major=4|minor=X|suppress=true}} | ||
[[Category:Keen_Modding_Guides]]</noinclude> | [[Category:Keen_Modding_Guides]]</noinclude> | ||
==[[ | ==[[Keen:Planet Modding/In-game map|In-game map modding]]== | ||
Maps in Medieval Engineers are generated based on terrain and buildings on it. This means that they will work for any modded planet in their default form. That being said, the way map is generated is also fully moddable. | Maps in Medieval Engineers are generated based on terrain and buildings on it. This means that they will work for any modded planet in their default form. That being said, the way map is generated is also fully moddable. | ||
Line 12: | Line 13: | ||
In Medieval Engineers there are 2 view modes of map. Kingdom view which is showing entire kingdom and region view which is zoomed part of a kingdom map. Region is 1kmx1km large on 10 km diameter planet. Both views display different elements. | In Medieval Engineers there are 2 view modes of map. Kingdom view which is showing entire kingdom and region view which is zoomed part of a kingdom map. Region is 1kmx1km large on 10 km diameter planet. Both views display different elements. | ||
What is shown in these views depends on what layers it contains | What is shown in these views depends on what layers it contains | ||
< | <syntaxhighlight lang="xml" line> | ||
<Definition xsi:type="MyObjectBuilder_PlanetMapDefinition"> | <Definition xsi:type="MyObjectBuilder_PlanetMapDefinition"> | ||
<Id Type="MyObjectBuilder_PlanetMapDefinition" Subtype="Main"/> | <Id Type="MyObjectBuilder_PlanetMapDefinition" Subtype="Main"/> | ||
Line 23: | Line 24: | ||
</KingdomView> | </KingdomView> | ||
</Definition> | </Definition> | ||
</ | </syntaxhighlight> | ||
BackgroundGenerator refers to a definition of background texture that serves as a background on top of which all the map elements are placed. | BackgroundGenerator refers to a definition of background texture that serves as a background on top of which all the map elements are placed. | ||
< | <syntaxhighlight lang="xml" line> | ||
<RegionView> | <RegionView> | ||
<Layers>...</Layers> | <Layers>...</Layers> | ||
</RegionView> | </RegionView> | ||
</ | </syntaxhighlight> | ||
The three dots in middle represent layers of elements that show in region view. List and description of all layers is in next section of this document. | The three dots in middle represent layers of elements that show in region view. List and description of all layers is in next section of this document. | ||
< | <syntaxhighlight lang="xml" line> | ||
<KingdomView> | <KingdomView> | ||
<Layers>...</Layers> | <Layers>...</Layers> | ||
</KingdomView> | </KingdomView> | ||
</ | </syntaxhighlight> | ||
The three dots in middle represent layers of elements that show in kingdom view. List and description of all layers is in next section of this document. | The three dots in middle represent layers of elements that show in kingdom view. List and description of all layers is in next section of this document. | ||
(I did not Kingdom view in its expanded form because it would take up too much space.) | (I did not Kingdom view in its expanded form because it would take up too much space.) | ||
Line 41: | Line 42: | ||
===Layers description=== | ===Layers description=== | ||
< | <syntaxhighlight lang="xml" line> | ||
<Layer xsi:type="MyObjectBuilder_MapBackgroundLayer" /><!-- This layer draws the background. As generated based on chosen background definition. --> | |||
<Layer xsi:type="MyObjectBuilder_AreaDevelopmentLayer"><!-- This layer displays icons based on amount of blocks there is in an area. You can set the block thresholds, or mod the textures. It is also possible to add more thresholds. 80x80 px, png. --> | <Layer xsi:type="MyObjectBuilder_AreaDevelopmentLayer"><!-- This layer displays icons based on amount of blocks there is in an area. You can set the block thresholds, or mod the textures. It is also possible to add more thresholds. 80x80 px, png. --> | ||
<Threshold BlockCount="10" Sprite="Textures\GUI\Map\SmallGrid.png"/> | <Threshold BlockCount="10" Sprite="Textures\GUI\Map\SmallGrid.png"/> | ||
Line 47: | Line 49: | ||
<Threshold BlockCount="60" Sprite="Textures\GUI\Map\LargeGrid.png"/> | <Threshold BlockCount="60" Sprite="Textures\GUI\Map\LargeGrid.png"/> | ||
</Layer> | </Layer> | ||
</ | </syntaxhighlight> | ||
[[File:Smallest Settlement.png|150px|frameless]] | [[File:Smallest Settlement.png|150px|frameless]] | ||
[[File:Medium Settlement.png|150px|frameless]] | [[File:Medium Settlement.png|150px|frameless]] | ||
[[File:LargestSettlement.png|150px|frameless]] | [[File:LargestSettlement.png|150px|frameless]] | ||
< | <syntaxhighlight lang="xml" line> | ||
<Layer xsi:type="MyObjectBuilder_RegionFastTravelLayer" Name="FastTravel" Visible="false"><!-- This layer shows fast travel overlay for region, when fast travel button is pressed. You can define which colors are used for displaying accessibility. --> | <Layer xsi:type="MyObjectBuilder_RegionFastTravelLayer" Name="FastTravel" Visible="false"><!-- This layer shows fast travel overlay for region, when fast travel button is pressed. You can define which colors are used for displaying accessibility. --> | ||
<UnreachableColor R="255" G="255" B="255" A="128"/> | <UnreachableColor R="255" G="255" B="255" A="128"/> | ||
Line 67: | Line 69: | ||
<TaxIcon>Textures\GUI\Map\TaxIcon.png</TaxIcon> | <TaxIcon>Textures\GUI\Map\TaxIcon.png</TaxIcon> | ||
</Layer> | </Layer> | ||
</ | </syntaxhighlight> | ||
[[File:Taxes.png|frameless]] | [[File:Taxes.png|frameless]] | ||
< | <syntaxhighlight lang="xml" line> | ||
<Layer xsi:type="MyObjectBuilder_PlanetMapPositionLayer"><!-- PlanetMapPositionLayer displays player icon above area where they are. --> | <Layer xsi:type="MyObjectBuilder_PlanetMapPositionLayer"><!-- PlanetMapPositionLayer displays player icon above area where they are. --> | ||
<LocalPlayerImage>Textures\GUI\Map\PlayerPosition.png</LocalPlayerImage> | <LocalPlayerImage>Textures\GUI\Map\PlayerPosition.png</LocalPlayerImage> | ||
<OtherPlayersImage>Textures\GUI\Map\AllyPosition.png</OtherPlayersImage> | <OtherPlayersImage>Textures\GUI\Map\AllyPosition.png</OtherPlayersImage> | ||
</Layer> | </Layer> | ||
</ | </syntaxhighlight> | ||
[[File:Ally.png|frameless]] | [[File:Ally.png|frameless]] | ||
[[File:Player.png|frameless]] | [[File:Player.png|frameless]] | ||
< | <syntaxhighlight lang="xml" line> | ||
<Layer xsi:type="MyObjectBuilder_ActionTrackingLayer"><!-- Shows icon over an area on map with fighting / destruction. --> | <Layer xsi:type="MyObjectBuilder_ActionTrackingLayer"><!-- Shows icon over an area on map with fighting / destruction. --> | ||
<ActionImage>Textures\GUI\Map\Action.png</ActionImage> | <ActionImage>Textures\GUI\Map\Action.png</ActionImage> | ||
</Layer> | </Layer> | ||
</ | </syntaxhighlight> | ||
[[File:AttackedArea.png|frameless]] | [[File:AttackedArea.png|frameless]] | ||
< | <syntaxhighlight lang="xml" line> | ||
<Layer xsi:type="MyObjectBuilder_CurrentMapSelectionLayer"><!-- This is highlight of a region, that player selected with his mouse. --> | <Layer xsi:type="MyObjectBuilder_CurrentMapSelectionLayer"><!-- This is highlight of a region, that player selected with his mouse. --> | ||
<SelectionImage>Textures\GUI\Map\MapSelection.dds</SelectionImage> | <SelectionImage>Textures\GUI\Map\MapSelection.dds</SelectionImage> | ||
Line 105: | Line 107: | ||
<PlayerAllyEnemyIcon>Textures\GUI\Map\PlayerAllyEnemyLandIcon.png</PlayerAllyEnemyIcon> | <PlayerAllyEnemyIcon>Textures\GUI\Map\PlayerAllyEnemyLandIcon.png</PlayerAllyEnemyIcon> | ||
</Layer> | </Layer> | ||
</ | </syntaxhighlight> | ||
Line 112: | Line 114: | ||
All settings for map background are in MedievalMapBackgroundDefinition. The definition also in Content\Data\Screens\MapDefinition.sbc. I will go through various parts of the definition. | All settings for map background are in MedievalMapBackgroundDefinition. The definition also in Content\Data\Screens\MapDefinition.sbc. I will go through various parts of the definition. | ||
< | <syntaxhighlight lang="xml" line> | ||
<Id Type="MyObjectBuilder_MedievalMapBackgroundDefinition" Subtype="FundinhoDoMapinha"/> | |||
Type of the definition says that this map background definition. Subtype is name of this specific background definition. If create your own background with unique subtype | Type of the definition says that this map background definition. Subtype is name of this specific background definition. If create your own background with unique subtype | ||
Make sure you create your own background with unique subtype | Make sure you create your own background with unique subtype | ||
Line 144: | Line 147: | ||
</SpriteSheet> | </SpriteSheet> | ||
</Definition> | </Definition> | ||
</ | </syntaxhighlight> | ||
===Map Coloring=== | ===Map Coloring=== | ||
You can use colors in material or biome map of a planet to appear on the game map. (roads for example). You define map coloring in a node called ”Features”. The coloring uses colors from planet material texture. You can learn more about material texture in biomes modding and surface material modding. | You can use colors in material or biome map of a planet to appear on the game map. (roads for example). You define map coloring in a node called ”Features”. The coloring uses colors from planet material texture. You can learn more about material texture in biomes modding and surface material modding. | ||
< | <syntaxhighlight lang="xml" line> | ||
<Feature Material="67"> | <Feature Material="67"> | ||
<Color R="75" G="30" B="0" A="255"/> | <Color R="75" G="30" B="0" A="255"/> | ||
</Feature> | </Feature> | ||
</ | </syntaxhighlight> | ||
This specific feature is used for painting roads on map with dark brown color. In Color you define which color will be the in-game map colored. Material=”67” decides where will be the color applied and refers to a red channel value on planet material texture. | This specific feature is used for painting roads on map with dark brown color. In Color you define which color will be the in-game map colored. Material=”67” decides where will be the color applied and refers to a red channel value on planet material texture. | ||
< | <syntaxhighlight lang="xml" line> | ||
<Feature Biome="60"> | <Feature Biome="60"> | ||
<Color R="130" G="100" B="42" A="80"/> | <Color R="130" G="100" B="42" A="80"/> | ||
</Feature> | </Feature> | ||
</ | </syntaxhighlight> | ||
This specific feature is used for painting forests on map with opaque brown. In Color you define which color will be the in-game map colored. Biome=”60” decides where will be the color applied and refers to a green channel value on planet material texture. | This specific feature is used for painting forests on map with opaque brown. In Color you define which color will be the in-game map colored. Biome=”60” decides where will be the color applied and refers to a green channel value on planet material texture. | ||
Line 165: | Line 168: | ||
===Sprites=== | ===Sprites=== | ||
Medieval Engineers map can also place sprites on map based on terrain shape. All the sprites are on one texture | Medieval Engineers map can also place sprites on map based on terrain shape. All the sprites are on one texture | ||
< | <syntaxhighlight lang="xml" line> | ||
<SpriteSheet Texture="Textures\GUI\Map\BackgroundSprites.png" BaseSize="64"> | <SpriteSheet Texture="Textures\GUI\Map\BackgroundSprites.png" BaseSize="64"> | ||
<SpriteCount>100</SpriteCount> | <SpriteCount>100</SpriteCount> | ||
Line 178: | Line 181: | ||
</BiomeSprite> | </BiomeSprite> | ||
</SpriteSheet> | </SpriteSheet> | ||
</ | </syntaxhighlight> | ||
[[File:AtlasCoordinateUsage.png|512px]] | [[File:AtlasCoordinateUsage.png|512px]] | ||
Line 186: | Line 189: | ||
<noinclude>View the full [[ | <noinclude>View the full [[Keen:Planet Modding - Full Guide|Planet Modding Guide]]</noinclude> |
Latest revision as of 20:25, 18 July 2022
OFFICIAL CONTENT NOTICE |
---|
OFFICIAL CONTENT This article contains official content from or verified by the developers at Keen Software House. This information is intended to be accurate at the time it is posted, but may become obsolete over time. If you find errors in this article please describe the errors in the Discussion Page. |
Version: | 0.4 |
In-game map modding
Maps in Medieval Engineers are generated based on terrain and buildings on it. This means that they will work for any modded planet in their default form. That being said, the way map is generated is also fully moddable.
We definitions for map are located in Content\Data\Screens\MapDefinition.sbc. To mod maps you will have to alter/add definitions in this file, all vanilla textures for maps can be found in Content\Textures\GUI\Map. Feel free to use/alter any of them for creation of mods for Medieval Engineers. Map content modding (Friend/foe display, tax notifications,... In Medieval Engineers there are 2 view modes of map. Kingdom view which is showing entire kingdom and region view which is zoomed part of a kingdom map. Region is 1kmx1km large on 10 km diameter planet. Both views display different elements. What is shown in these views depends on what layers it contains
<Definition xsi:type="MyObjectBuilder_PlanetMapDefinition">
<Id Type="MyObjectBuilder_PlanetMapDefinition" Subtype="Main"/>
<BackgroundGenerator Type="MyObjectBuilder_MedievalMapBackgroundDefinition" Subtype="FundinhoDoMapinha"/>
<RegionView>
<Layers>...</Layers>
</RegionView>
<KingdomView>
<Layers>...</Layers>
</KingdomView>
</Definition>
BackgroundGenerator refers to a definition of background texture that serves as a background on top of which all the map elements are placed.
<RegionView>
<Layers>...</Layers>
</RegionView>
The three dots in middle represent layers of elements that show in region view. List and description of all layers is in next section of this document.
<KingdomView>
<Layers>...</Layers>
</KingdomView>
The three dots in middle represent layers of elements that show in kingdom view. List and description of all layers is in next section of this document. (I did not Kingdom view in its expanded form because it would take up too much space.)
Layers description
<Layer xsi:type="MyObjectBuilder_MapBackgroundLayer" /><!-- This layer draws the background. As generated based on chosen background definition. -->
<Layer xsi:type="MyObjectBuilder_AreaDevelopmentLayer"><!-- This layer displays icons based on amount of blocks there is in an area. You can set the block thresholds, or mod the textures. It is also possible to add more thresholds. 80x80 px, png. -->
<Threshold BlockCount="10" Sprite="Textures\GUI\Map\SmallGrid.png"/>
<Threshold BlockCount="30" Sprite="Textures\GUI\Map\MediumGrid.png"/>
<Threshold BlockCount="60" Sprite="Textures\GUI\Map\LargeGrid.png"/>
</Layer>
<Layer xsi:type="MyObjectBuilder_RegionFastTravelLayer" Name="FastTravel" Visible="false"><!-- This layer shows fast travel overlay for region, when fast travel button is pressed. You can define which colors are used for displaying accessibility. -->
<UnreachableColor R="255" G="255" B="255" A="128"/>
<ReachableColor R="100" G="255" B="100" A="0"/>
<BlockedByTerrainColor R="0" G="0" B="0" A="224"/>
<BlockedByPlayerColor R="240" G="192" B="0" A="128"/>
</Layer>
<Layer xsi:type="MyObjectBuilder_AreaOwnershipLayer"><!-- This layer defines color overlay over map areas based on ownership. You can mod which color is used for allies, your own areas or for enemies -->
<AlliedBgColor Hex="#806464FF" />
<PlayerBgColor Hex="#8064FF64" />
<EnemyBgColor Hex="#80DC6415" />
</Layer>
<Layer xsi:type="MyObjectBuilder_AreaUpkeepLayer"><!-- This layer displays tax icon on areas that belong to you and require tax payment soon. Texture is 80x80 pixels, png. -->
<TaxIcon>Textures\GUI\Map\TaxIcon.png</TaxIcon>
</Layer>
<Layer xsi:type="MyObjectBuilder_PlanetMapPositionLayer"><!-- PlanetMapPositionLayer displays player icon above area where they are. -->
<LocalPlayerImage>Textures\GUI\Map\PlayerPosition.png</LocalPlayerImage>
<OtherPlayersImage>Textures\GUI\Map\AllyPosition.png</OtherPlayersImage>
</Layer>
<Layer xsi:type="MyObjectBuilder_ActionTrackingLayer"><!-- Shows icon over an area on map with fighting / destruction. -->
<ActionImage>Textures\GUI\Map\Action.png</ActionImage>
</Layer>
<Layer xsi:type="MyObjectBuilder_CurrentMapSelectionLayer"><!-- This is highlight of a region, that player selected with his mouse. -->
<SelectionImage>Textures\GUI\Map\MapSelection.dds</SelectionImage>
</Layer>
<Layer xsi:type="MyObjectBuilder_PlanetMapGridLayer"><!-- This layer sets which color is the grid drawn. -->
<GridColor R="0" G="0" B="0" A="228"/>
</Layer>
<Layer xsi:type="MyObjectBuilder_KingdomFastTravelLayer" Name="FastTravel" Visible="false"><!-- This layer shows fast travel overlay for kingdom, when fast travel button is pressed. You can define which colors are used for displaying accessibility. -->
<UnreachableColor R="255" G="255" B="255" A="128"/>
<ReachableColor R="100" G="255" B="100" A="0"/>
<BlockedByTerrainColor R="0" G="0" B="0" A="224"/>
<BlockedByPlayerColor R="240" G="192" B="0" A="128"/>
</Layer>
<Layer xsi:type="MyObjectBuilder_RegionOwnershipLayer"><!-- RegionOwnershipLayer generates textures used to express ownership on regional map. -->
<PlayerIcon>Textures\GUI\Map\PlayerLandIcon.png</PlayerIcon>
<AllyIcon>Textures\GUI\Map\AllyLandIcon.png</AllyIcon>
<EnemyIcon>Textures\GUI\Map\EnemyLandIcon.png</EnemyIcon>
<PlayerAllyIcon>Textures\GUI\Map\PlayerAllyLandIcon.png</PlayerAllyIcon>
<PlayerEnemyIcon>Textures\GUI\Map\PlayerEnemyLandIcon.png</PlayerEnemyIcon>
<AllyEnemyIcon>Textures\GUI\Map\AllyEnemyLandIcon.png</AllyEnemyIcon>
<PlayerAllyEnemyIcon>Textures\GUI\Map\PlayerAllyEnemyLandIcon.png</PlayerAllyEnemyIcon>
</Layer>
Background generator (trees, mountains, roads,...)
Map background is where all the trees, mountains, hills are drawn. It is also capable of coloring map based on what is in planet’s material map (this is how we make roads for example). All settings for map background are in MedievalMapBackgroundDefinition. The definition also in Content\Data\Screens\MapDefinition.sbc. I will go through various parts of the definition.
<Id Type="MyObjectBuilder_MedievalMapBackgroundDefinition" Subtype="FundinhoDoMapinha"/>
Type of the definition says that this map background definition. Subtype is name of this specific background definition. If create your own background with unique subtype
Make sure you create your own background with unique subtype
<DrawHeightmap>false</DrawHeightmap>
When set on “true” planet’s heightmap is drawn under the map.
<Resolution>4096</Resolution><
Sets resolution of the generated in-game map.
<Features>
<Feature Material="67">
<Color R="75" G="30" B="0" A="255"/>
</Feature>
<Feature Biome="60">
<Color R="130" G="100" B="42" A="80"/>
</Feature>
</Features>
<SpriteSheet Texture="Textures\GUI\Map\BackgroundSprites.png" BaseSize="64">
<SpriteCount>100</SpriteCount>
<Sprite Name="HillSmall" X="768" Y="192" Width="127" Height="64" />
<Sprite Name="ForestSparse" X="0" Y="320" Width="64" Height="64" />
<HeightSprite AltitudeDiff=".09" Altitude=".20" Priority="1">
<Sprite>HillSmall</Sprite>
</HeightSprite>
<BiomeSprite Biome="60" Density=".1" Priority="6">
<Sprite>ForestSparse</Sprite>
</BiomeSprite>
</SpriteSheet>
</Definition>
Map Coloring
You can use colors in material or biome map of a planet to appear on the game map. (roads for example). You define map coloring in a node called ”Features”. The coloring uses colors from planet material texture. You can learn more about material texture in biomes modding and surface material modding.
<Feature Material="67">
<Color R="75" G="30" B="0" A="255"/>
</Feature>
This specific feature is used for painting roads on map with dark brown color. In Color you define which color will be the in-game map colored. Material=”67” decides where will be the color applied and refers to a red channel value on planet material texture.
<Feature Biome="60">
<Color R="130" G="100" B="42" A="80"/>
</Feature>
This specific feature is used for painting forests on map with opaque brown. In Color you define which color will be the in-game map colored. Biome=”60” decides where will be the color applied and refers to a green channel value on planet material texture.
Sprites
Medieval Engineers map can also place sprites on map based on terrain shape. All the sprites are on one texture
<SpriteSheet Texture="Textures\GUI\Map\BackgroundSprites.png" BaseSize="64">
<SpriteCount>100</SpriteCount>
<Sprite Name="HillSmall" X="768" Y="192" Width="127" Height="64" />
<Sprite Name="ForestSparse" X="0" Y="320" Width="64" Height="64" />
<HeightSprite AltitudeDiff=".09" Altitude=".20" Priority="1">
<Sprite>HillSmall</Sprite>
</HeightSprite>
<BiomeSprite Biome="60" Density=".1" Priority="6">
<Sprite>ForestSparse</Sprite>
</BiomeSprite>
</SpriteSheet>
Note: Illustrates how sprite is defined on our spritesheet. Example sprite: <Sprite Name="HillSmall" X="768" Y="192" Width="127" Height="64" />
View the full Planet Modding Guide