awesome-pages wiki modding folder reorg

This commit is contained in:
Yair Morgenstern
2023-07-02 23:42:07 +03:00
parent d83c14af03
commit 6e0dbea6d4
8 changed files with 26 additions and 22 deletions

View File

@ -4,8 +4,9 @@
Images in LibGDX are displayed on screen by a SpriteBatch, which uses GL to bind textures to load them in-memory, and can then very quickly display them on-screen.
The actually rendering is then very fast, but the binding process is slow.
Therefore ideally we'd want as little bindings as possible, so the textures should contain as many images as possible.
Therefore, ideally we'd want as little bindings as possible, so the textures should contain as many images as possible.
This is why we compile images (ImagePacker.packImages()) into large PNGs.
However, due to limitations in different chipsets etc, these images are limited to a maximum size of 2048*2048 pixels, and the game contains more images than would fit into a single square of that size.
What we do, then, is separate them by category, and thus rendering proximity.
The 'android' folder contains Images, but also various sub-categories - Images.Flags, Images.Tech, etc.
@ -19,7 +20,7 @@ Each map tile is comprised of several layers, and each layer needs to be rendere
For example, we don't want one tile's unit sprite to be overlayed by another's improvement.
This layering is done in TileGroupMap, where we take the individual parts for all tiles, separate them into the layers, and add them all to one big group.
This also has a performance advantage, since e.g. text and contruction images in the various city buttons are not rendered until the very end, and therefore swap per the number of of cities and not for every single tile.
This also means that mods which add their own tilesets or unit sprites have better performance than 'render entire tile; would provide, since we first render all terrains, then all improvements, etc,
This also means that mods which add their own tilesets or unit sprites have better performance than 'render entire tile; would provide, since we first render all terrains, then all improvements, etc,
so if my tileset provides all terrains, it won't be swapped out until we're done.
## Debugging
@ -28,4 +29,4 @@ Android Studio's built-in profiler has a CPU profiler which is perfect for this.
Boot up the game on your Android device, open a game, start recording CPU, move the screen around a bit, and stop recording.
Select the "GL Thread" from the list of threads, and change visualization to a flame graph. You'll then see what's actually taking rendering time.
You can find various games to test on [here](https://github.com/yairm210/Unciv/issues?q=label%3A%22Contains+Saved+Game%22) - [This](https://github.com/yairm210/Unciv/issues/4840) for example is a crowded one.
You can find various games to test on [here](https://github.com/yairm210/Unciv/issues?q=label%3A%22Contains+Saved+Game%22) - [This](https://github.com/yairm210/Unciv/issues/4840) for example is a crowded one.

View File

@ -1,6 +1,9 @@
nav:
- Mods.md
- Making-a-new-Civilization.md
- ...
- Images-and-Audio.md
- Creating-a-custom-tileset.md
- Creating-a-UI-skin.md
- Unique-parameters.md
- uniques.md
- mod-file-structure

View File

@ -6,11 +6,11 @@ In order to add a UI skin mod (yes, UI skins are just another type of mod), all
The game will then recognize the skin, and allow you to pick it in the options menu.
Just like [tilesets](4-Creating-a-custom-tileset.md), UI skins can be used to alter the appearance of Unciv. Please note that UI skins do not support custom icons and fonts and not every UI element can be customized yet too.
Just like [tilesets](Creating-a-custom-tileset.md), UI skins can be used to alter the appearance of Unciv. Please note that UI skins do not support custom icons and fonts and not every UI element can be customized yet too.
We use so called 9.png (or Ninepatch) files for every skin image because UI elements need a way to be resized based on game window size and resolution. Ninepatch files can be created manually by adding black pixels around your custom images in a specific manner or by using [Android Studio's Draw 9-patch tool](https://developer.android.com/studio/write/draw9patch) or [this tool by romannurik](https://romannurik.github.io/AndroidAssetStudio/nine-patches.html) for example. You may also check if your favorite image creation tool supports nine patches itself to generate them more easily.
A skin image can either be gray scale and later be colored in game by modifying the `tint` in the [skinConfig](5-Creating-a-UI-skin.md#tint) or be colored directly in the image. When coloring the image directly it is important to set the tint of the UI element to white. Please note that tileable ninepatches and ninepatches with multiple stretch areas are not supported because of technical restrictions by libgdx.
A skin image can either be gray scale and later be colored in game by modifying the `tint` in the [skinConfig](Creating-a-UI-skin.md#tint) or be colored directly in the image. When coloring the image directly it is important to set the tint of the UI element to white. Please note that tileable ninepatches and ninepatches with multiple stretch areas are not supported because of technical restrictions by libgdx.
There are 6 basic shapes which can be placed inside the `Images/Skins/MyCoolSkinExample` folder:
- checkbox
@ -20,7 +20,7 @@ There are 6 basic shapes which can be placed inside the `Images/Skins/MyCoolSkin
- select-box
- select-box-pressed
These shapes are used all over Unciv and can be replaced to make a lot of UI elements change appearance at once. To change just one specific element use the [table](5-Creating-a-UI-skin.md#Available-UI-elements) below to create an image at the specified directory using the specified name inside `Images/Skins/MyCoolSkinExample`. See the image below for an example file structure. ![skinExample](https://user-images.githubusercontent.com/24532072/198904598-0d298035-5b02-431b-bfb4-7da4b9c821c9.png)
These shapes are used all over Unciv and can be replaced to make a lot of UI elements change appearance at once. To change just one specific element use the [table](Creating-a-UI-skin.md#Available-UI-elements) below to create an image at the specified directory using the specified name inside `Images/Skins/MyCoolSkinExample`. See the image below for an example file structure. ![skinExample](https://user-images.githubusercontent.com/24532072/198904598-0d298035-5b02-431b-bfb4-7da4b9c821c9.png)
## Limitations
@ -137,7 +137,7 @@ These shapes are used all over Unciv and can be replaced to make a lot of UI ele
## SkinConfig
The skinConfig is similar to the [tilesetConfig](4-Creating-a-custom-tileset.md#tileset-config) and can be used to define different colors and shapes for unciv to use.
The skinConfig is similar to the [tilesetConfig](Creating-a-custom-tileset.md#tileset-config) and can be used to define different colors and shapes for unciv to use.
To create a config for your skin you just need to create a new .json file under `jsons/Skins/`. Just create a .txt file and rename it to MyCoolSkinExample.json. You only have to add things if you want to change them. Else the default values will be used.
@ -179,7 +179,7 @@ Defines the color unciv uses in most ui elements as default
A dictionary mapping string to a SkinElement. Default value: empty
These variants can be used to define a different image, tint and/or alpha for a specified UI element. The string used to identify the UI element can be taken from the [table](5-Creating-a-UI-skin.md#Available-UI-elements) above by appending the name to the directory.
These variants can be used to define a different image, tint and/or alpha for a specified UI element. The string used to identify the UI element can be taken from the [table](Creating-a-UI-skin.md#Available-UI-elements) above by appending the name to the directory.
```
| Directory | Name |
|-----------------------|---------------|

View File

@ -21,7 +21,7 @@ You will need to supply the graphics for new elements - a new unit needs its ico
- The path and name of the image file need to conform to the rule: `Image[.AtlasName]/Type-specific/Objectname.png` (Type-specific means "TechIcons" for a Technology, "NationIcons" for a Nation and so on. See vanilla game folders. Objectname is the exact name as defined in json, before translation.)
- All path parts are case sensitive.
- Unit Pixel sprites and [Tilesets](4-Creating-a-custom-tileset.md) follow special rules.
- Unit Pixel sprites and [Tilesets](Creating-a-custom-tileset.md) follow special rules.
- Promotions can be named "`[Unitname] ability`". In such a case, if `UnitIcons/Unitname.png` exists it will fall back to that unit icon when `UnitPromotionIcons/Unitname ability.png` is missing.
- Promotions can be named "Something I" (or " II" or " III"). The suffix will be removed and painted as little stars, only the base `UnitPromotionIcons/Something.png` will be loaded.
- The special rules for promotions can be combined, e.g. "`[Warrior] ability III`" will fall back to the Warrior unit icon and paint 3 Stars on it.

View File

@ -32,7 +32,7 @@ The JSON files that make up mods can have many different fields, and as not all
- [ModOptions.json](5-Miscellaneous-JSON-files.md#modoptionsjson)
- [Tutorials.json](5-Miscellaneous-JSON-files.md#tutorialsjson)
- [Stats](3-Map-related-JSON-files.md#stats)
- [Sounds](../3-Images-and-Audio.md#sounds)
- [Sounds](../Images-and-Audio.md#sounds)
- [Civilopedia text](5-Miscellaneous-JSON-files.md#civilopedia-text)
## General Overview of JSON files

View File

@ -121,14 +121,14 @@ A mod can define new Tilesets or add to existing ones, namely FantasyHex. There
| Attribute | Type | Default value | Notes |
| --------- | ---- | -------- | ----- |
| [useColorAsBaseTerrain](../4-Creating-a-custom-tileset.md#useColorAsBaseTerrain) | Boolean | false | |
| [useSummaryImages](../4-Creating-a-custom-tileset.md#useSummaryImages) | Boolean | false | |
| [unexploredTileColor](../4-Creating-a-custom-tileset.md#unexploredTileColor) | Color | Dark Gray | `{"r":0.25,"g":0.25,"b":0.25,"a":1}` |
| [fogOfWarColor](../4-Creating-a-custom-tileset.md#fogOfWarColor) | Color | Black | `{"r":0,"g":0,"b":0,"a":1}` |
| [fallbackTileSet](../4-Creating-a-custom-tileset.md#fallbackTileSet) | String | "FantasyHex" | null to disable |
| [tileScale](../4-Creating-a-custom-tileset.md#tileScale) | Float | 1.0 | |
| [tileScales](../4-Creating-a-custom-tileset.md#tileScales) | Dictionary | empty | |
| [ruleVariants](../4-Creating-a-custom-tileset.md#ruleVariants) | Dictionary | empty | see below |
| [useColorAsBaseTerrain](../Creating-a-custom-tileset.md#useColorAsBaseTerrain) | Boolean | false | |
| [useSummaryImages](../Creating-a-custom-tileset.md#useSummaryImages) | Boolean | false | |
| [unexploredTileColor](../Creating-a-custom-tileset.md#unexploredTileColor) | Color | Dark Gray | `{"r":0.25,"g":0.25,"b":0.25,"a":1}` |
| [fogOfWarColor](../Creating-a-custom-tileset.md#fogOfWarColor) | Color | Black | `{"r":0,"g":0,"b":0,"a":1}` |
| [fallbackTileSet](../Creating-a-custom-tileset.md#fallbackTileSet) | String | "FantasyHex" | null to disable |
| [tileScale](../Creating-a-custom-tileset.md#tileScale) | Float | 1.0 | |
| [tileScales](../Creating-a-custom-tileset.md#tileScales) | Dictionary | empty | |
| [ruleVariants](../Creating-a-custom-tileset.md#ruleVariants) | Dictionary | empty | see below |
ruleVariants control substitutions when layering images for a tile, they are list looking like:

View File

@ -42,9 +42,9 @@ This is done by adding a `"isBaseRuleset":true` configuration to your [modOption
## Audiovisual components
In addition to changing the rules - or even without doing so - mods can override existing graphics or sounds, or add music tracks. For details, see [Audiovisual Mods](3-Images-and-Audio.md).
In addition to changing the rules - or even without doing so - mods can override existing graphics or sounds, or add music tracks. For details, see [Audiovisual Mods](Images-and-Audio.md).
Custom tilesets and unitsets are a subgroup of these - see [Creating a custom tileset](4-Creating-a-custom-tileset.md) - as are UI skin mods, see [Creating a UI skin](5-Creating-a-UI-skin.md)
Custom tilesets and unitsets are a subgroup of these - see [Creating a custom tileset](Creating-a-custom-tileset.md) - as are UI skin mods, see [Creating a UI skin](Creating-a-UI-skin.md)
Such mods are candidates for the "Permanent audiovisual mod" switch available on the Mod Management Screen.
Note that this feature includes graphics or sounds from the selected mod in _all_ games, even those started before installing the mod.
@ -126,7 +126,7 @@ If you feel there should be additional topics supported in-game, then the course
The primary use of mods is to add them when starting a new game, or configuring a map. This will mean that both the ruleset of the mod, and the images, will be in use for that specific game/map.
For mods which are primarily visual or audio, there is a second use - through the mod manager, you can enable them as **permanent audiovisual mods**. This means that the images and/or sounds from the mod will replace the original media everywhere in the game, and contained music will be available - [see here](3-Images-and-Audio.md#supply-additional-music).
For mods which are primarily visual or audio, there is a second use - through the mod manager, you can enable them as **permanent audiovisual mods**. This means that the images and/or sounds from the mod will replace the original media everywhere in the game, and contained music will be available - [see here](Images-and-Audio.md#supply-additional-music).
## Mod location for manual loading of mods