nuke-haus / mapnuke

An open-source map generator for Dominions 5 and 6
http://map.nuke.haus
GNU General Public License v3.0
25 stars 14 forks source link

MapNuke

An open-source map generator for Dominions 5

HOW TO USE

  1. Run the program.
  2. In the main menu you'll see a list of players on the left. Choose a player count and select which nations will be used.
  3. Click the generate button. The generation process could take up to 3 minutes depending on the player count and your computer specs.
  4. Once the map is generated, you can move the camera around by clicking and dragging.
  5. Right click a province node or connection node to open the editor panel for that node.
  6. Once you are happy with the map, click the export button. Maps are exported to the data folder.

CREATING YOUR OWN ART STYLE

MapNuke now allows you to add your own custom art styles. The sprites and materials used by the map generator are dictated by the art style. Here's a step by step guide for adding your own.

  1. Fork this repository on GitHub.
  2. Clone your forked repository using SourceTree or some other source control app.
  3. Install Unity Hub.
  4. Download Unity version 2019.2.11f1 through the Unity Hub then open the MapNuke project using that Unity version.

Only Unity 2019.2.11f1 is compatible with this project! Using any other version will cause issues.

  1. Create the folders you'd like to store your art assets in. For example, the default art assets are stored in Gfx/MapArt/Default. Your folder will be named something like Gfx/MapArt/MyArtStyle.

Step 5

  1. Add your desired sprite assets in your new folder. Click on art assets to view and edit their import settings.

Make sure your sprites have the "Art" packing tag in their import settings or they will have rendering issues! If you aren't sure about something, just copy the settings used in one of the default sprites.

Do not use a perfectly white color (ie. a color with 100% red, green, and blue) in your sprite. It will cause issues. Dominions 5 uses that color to track province positions. If you need to use white in your sprite, make it an off-white.

Step 6

  1. Create the folders you'd like to store your materials in. For example, the default materials are stored in Gfx/Materials/Default. Follow a similar naming convention to what you did in step 2 here. Import any textures being used for the province materials (if applicable) into this folder. You can examine the default materials which use a noise shader to see how those are done. You'll want to use a different shader if you're doing a texture-based material.

Step 7

  1. Open the main scene (File -> Open Scene -> Scenes -> Main) and navigate to the Resources/Prefabs/ArtStyles folder in the project browser. Duplicate the Default art style prefab and rename it (in this example, the newly created prefab is MyArtStyle).

Step 8

  1. Double click on the newly made art style prefab and examine its properties. You'll see a collection of art configuration properties you can modify.

Step 9

It's a bit complex so i'll try to describe what the values for each terrain type do:

Each sprite has several parameters:

  1. Add your materials from step 3 to the material list.

Step 10

  1. Click the play button and test your art style out. It should appear in the art style dropdown list next to the nation picker menu.

PROVINCE SHADERS

Custom art styles can specify which materials each province type uses. There are several custom shaders included with MapNuke you can make use of in your custom materials.


Custom/Perlin3, Custom/Perlin4, Custom/Perlin5

Perlin Noise

The perlin noise shaders create a randomized set of colorful blobs. Perlin3 lets you choose 3 colors, Perlin4 is for 4 colors and Perlin5 is for 5 colors.

There are some special perlin noise shaders used in niche cases:

These use stencil buffers to create a shoreline effect in bodies of water (and rivers). The materials for sea provinces would use the Perlin5write shader and the shorelines would use the Perlin5read shader.


Custom/Texture1024, Custom/Texture2048, Custom/Texture4096

Texture

These shaders are useful for just basic textures. In many cases it's probably preferable to use this shader since handmade textures are always nicer than basic perlin noise. The size of your texture needs to match the shader, ie. Custom/Texture2048 should be used with a texture that is 2048x2048 pixels.

I recommend using 2048x2048 as your texture resolution. 1024x1024 is a bit low and 4096x4096 is a bit overkill.

There are some special texture shaders used in niche cases:

These use stencil buffers to create a shoreline effect in bodies of water (and rivers). The materials for sea provinces and rivers would use the TextureXXXXwrite shader and the shorelines would use the Texture1024read shader.

Your texture import settings should look something like:

Texture Import

Use point filtering if you want crisp pixel art and bilinear/trilinear filtering if you want antialiasing.


Custom/TexBlend2, Custom/TexBlend3, Custom/TexBlend4

Texture Blend

These shaders combine perlin noise with textures. Could be useful for some niche cases.