Difference between revisions of "How to create a town mod"

From VCMI Project Wiki
Jump to: navigation, search
m (Building animation)
m (Dead link)
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
  
 
== Questioning the town creation ==
 
== Questioning the town creation ==
Before creating a town, be aware that creating a town mod is lots of work. You can start creating creatures in a creature mod that can be converted into a town mod after. This way, you are sure to release something. The smallest contribution is a hero portrait that you can suggest on an existing mod.
+
Before creating a town, be aware that creating a town mod is lots of work. You can start [[How to create a creature|creating creatures]] in a creature mod that can be converted into a town mod after. This way, you are sure to release something. The smallest contribution is a hero portrait that you can suggest on an existing mod. You can also restore the former version of the [https://github.com/vcmi-mods/ruins-town/tree/1bea30a1d915770e2fd0f95d158030815ff462cd Ruins town]. You would only have to remake the similar parts to the new version.
  
 
== Make a playable town mod ==
 
== Make a playable town mod ==
Line 11: Line 11:
 
== Town screen ==
 
== Town screen ==
 
=== Background ===
 
=== Background ===
The easiest way to create the background is to use a text-to-image AI. The free most powerful AI at the moment is ''Stable Diffusion 3 Medium'' available here: https://huggingface.co/spaces/ameerazam08/SD-3-Medium-GPU
+
Beware to direct all the shadows to the same direction. The easiest way to create the background is to use a text-to-image AI. The free most powerful AI at the moment is ''Flux'' available here: https://huggingface.co/spaces/multimodalart/FLUX.1-merged
  
 
In the ''Advanced Options'', set the width to 800px and set the height to 374px.
 
In the ''Advanced Options'', set the width to 800px and set the height to 374px.
  
 
=== Buildings ===
 
=== Buildings ===
To render a building upon the background, I recommend to use an inpainting AI like ''SDXL Inpaint'': https://huggingface.co/spaces/diffusers/stable-diffusion-xl-inpainting
+
To render a building upon the background, I recommend to use an inpainting AI like ''BRIA Inpaint'': https://huggingface.co/spaces/briaai/BRIA-2.3-Inpainting
  
 
The idea is to select the area where you want to add the building. As a prompt, describe the new building. The advantage is a perfect match between the background and the building. Keep in mind that to correctly integrate a building image, it must contain the image of the background on its edges. It simulates the semi-transparency.
 
The idea is to select the area where you want to add the building. As a prompt, describe the new building. The advantage is a perfect match between the background and the building. Keep in mind that to correctly integrate a building image, it must contain the image of the background on its edges. It simulates the semi-transparency.
Line 23: Line 23:
  
 
== Map dwellings ==
 
== Map dwellings ==
On the map, the colors are more satured. The AIs badly understand the sun direction and the perspective angles. To generate the buildings on the adventure map:
+
You may want to get the same render as in the town, so you have to change the angle and the shadows. If you handle a 3D model software, you can start with ''Unique 3D'': https://huggingface.co/spaces/Gyufyjk/Unique3D
  
# Open the HOMM3 map editor
+
The map dwellings are not rendered on the map with vanishing points but in isometric. You can [https://blender.stackexchange.com/a/135384/2768 get an orthogonal render in Blender].
# Put items all around a big empty area
 
# Make a screenshot
 
# Go on an AI like ''SDXL Inpaint'': https://huggingface.co/spaces/diffusers/stable-diffusion-xl-inpainting
 
# Inpaint the (big) empty middle with the brush
 
# Use a prompt like: <code>A dark house, at the center of the image, map, isometric, parallel perspective, sunlight from the bottom right</code>
 
  
But you may want to get the same render as in the town, so you have to change the angle and the shadows. To do so, you can use ''Zero 1-to-3'': https://huggingface.co/spaces/cvlab/zero123-live
+
Without 3D, you can use ''Zero 1-to-3'': https://huggingface.co/spaces/cvlab/zero123-live
  
 
You can get higher resolution using this Video AI that can control the motion of the camera: https://huggingface.co/spaces/TencentARC/MotionCtrl_SVD
 
You can get higher resolution using this Video AI that can control the motion of the camera: https://huggingface.co/spaces/TencentARC/MotionCtrl_SVD
  
If you have to reduce the size of an image, do not use interpolation (LANCZOS, Bilinear...) to get more details, not a blurred image. If you need to increase the resolution or the quality of your template image, use ''SUPIR'': https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR
+
The buildings on the map are more satured than on town screen. If you have to reduce the size of an image, do not use interpolation (LANCZOS, Bilinear...) to get more details, not a blurred image. If you need to increase the resolution or the quality of your template image, use ''SUPIR'': https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR
  
If you use a 3D model software like ''Blender'', the map dwellings are not rendered on the map with vanishing points but in isometric. You can [https://blender.stackexchange.com/a/135384/2768 get an orthogonal render in Blender].
+
== Map buildings ==
 +
The AIs badly understand the sun direction and the perspective angles. To generate the buildings on the adventure map:
  
== Creature animation ==
+
# Open the HOMM3 map editor
The AIs are not completely ready to animate the creature but you can:
+
# Put items all around a big empty area
# Create the basic sprite with ''Stable Diffusion 3 Medium''
+
# Make a screenshot
# Create idle animations with ''Stable Video Diffusion'': https://huggingface.co/spaces/xi0v/Stable-Video-Diffusion-Img2Vid
+
# Go on an AI like ''BRIA Inpaint'': https://huggingface.co/spaces/briaai/BRIA-2.3-Inpainting
# Use poses with ''ControlNet'' or ''OpenPose''
+
# Inpaint the (big) empty middle with the brush
# Animate using ''ToonCrafter'': https://huggingface.co/spaces/Doubiiu/tooncrafter
+
# Use a prompt like: <code>A dark house, at the center of the image, map, isometric, parallel perspective, sunlight from the bottom right</code>
 
 
Otherwise, use a 3D model software like ''Blender''.
 
  
 
== Music ==
 
== Music ==
Line 90: Line 84:
 
Those themes have been generated using ''[https://udio.com Udio]''.
 
Those themes have been generated using ''[https://udio.com Udio]''.
  
== Sound effect ==
+
== Screenshots ==
To create the audio effects, I recommend to use ''Tango 2'': https://huggingface.co/spaces/declare-lab/tango2
+
Most of the time, the first screenshot is the townscreen because it's the most specific content.
 
 
The quality is better than ''Stable Audio''.
 
  
 
== Recycle ==
 
== Recycle ==

Latest revision as of 13:08, 7 September 2024

This page helps you to create from scratch a VCMI mod that adds a new town. The town mod structure is described here.

Questioning the town creation

Before creating a town, be aware that creating a town mod is lots of work. You can start creating creatures in a creature mod that can be converted into a town mod after. This way, you are sure to release something. The smallest contribution is a hero portrait that you can suggest on an existing mod. You can also restore the former version of the Ruins town. You would only have to remake the similar parts to the new version.

Make a playable town mod

Before creating your content, retrieve the content of an existing town mod like Highlands town. To download the project, click on the Code button and click on Download ZIP. The first thing to do is to change all the town identifiers in the files following the town format and manage to play with the town and the original without any conflict. To play to a town, you have to add all the files in your Mods folder. When it works, you will be able to modify the content step by step.

Keep in mind that the most important part of a town mod, above the animations, the graphisms and the musics, is the concept because if you have to change it, you have to change everything else. All the remaining content can be improved by the community.

Town screen

Background

Beware to direct all the shadows to the same direction. The easiest way to create the background is to use a text-to-image AI. The free most powerful AI at the moment is Flux available here: https://huggingface.co/spaces/multimodalart/FLUX.1-merged

In the Advanced Options, set the width to 800px and set the height to 374px.

Buildings

To render a building upon the background, I recommend to use an inpainting AI like BRIA Inpaint: https://huggingface.co/spaces/briaai/BRIA-2.3-Inpainting

The idea is to select the area where you want to add the building. As a prompt, describe the new building. The advantage is a perfect match between the background and the building. Keep in mind that to correctly integrate a building image, it must contain the image of the background on its edges. It simulates the semi-transparency.

You can also animate the building or the background using Stable Video Diffusion: https://huggingface.co/spaces/multimodalart/stable-video-diffusion

Map dwellings

You may want to get the same render as in the town, so you have to change the angle and the shadows. If you handle a 3D model software, you can start with Unique 3D: https://huggingface.co/spaces/Gyufyjk/Unique3D

The map dwellings are not rendered on the map with vanishing points but in isometric. You can get an orthogonal render in Blender.

Without 3D, you can use Zero 1-to-3: https://huggingface.co/spaces/cvlab/zero123-live

You can get higher resolution using this Video AI that can control the motion of the camera: https://huggingface.co/spaces/TencentARC/MotionCtrl_SVD

The buildings on the map are more satured than on town screen. If you have to reduce the size of an image, do not use interpolation (LANCZOS, Bilinear...) to get more details, not a blurred image. If you need to increase the resolution or the quality of your template image, use SUPIR: https://huggingface.co/spaces/Fabrice-TIERCELIN/SUPIR

Map buildings

The AIs badly understand the sun direction and the perspective angles. To generate the buildings on the adventure map:

  1. Open the HOMM3 map editor
  2. Put items all around a big empty area
  3. Make a screenshot
  4. Go on an AI like BRIA Inpaint: https://huggingface.co/spaces/briaai/BRIA-2.3-Inpainting
  5. Inpaint the (big) empty middle with the brush
  6. Use a prompt like: A dark house, at the center of the image, map, isometric, parallel perspective, sunlight from the bottom right

Music

Here are unused available themes:

  • Synthetic Horizon
    • Prompt: Dystopy, Cinematic classical, Science fiction, 160 bpm, Best quality, Futuristic
    • Initially created for: Forge town
  • Quantum Overture
    • Prompt: Clef shifting, Fantasy, Mystical, Overworldly, Cinematic classical
    • Initially created for: Asylum town
  • Warrior s March
    • Prompt: Powerful percussions, Drums, Battle Anthem, Rythm, Warrior, 160 bpm, Celtic, New age, Instrumental, Accoustic, Medieval
    • Initially created for: Ruins town
  • Clan of Echoes
    • Prompt: new age, medieval, celtic, warrior, battle, soundtrack, accoustic, drums, rythm
    • Initially created for: Ruins town
  • Enchanted Reverie
    • Prompt: Classical music, Soundtrack, Score, Instrumental, 160 bpm, ((((fantasy)))), mystic
    • Initially created for: Grove town
  • World Discovery
    • Prompt: Clef shifting, fantasy, mystical, overworldly, Cinematic classical
    • Initially created for: Asylum town
  • Enchanted Ballad
    • Prompt: Females vocalize, Cinematic classical, Harp, Fairy tale, Princess, 160 bpm
    • Initially created for: Fairy town
  • Baroque Resurgence
    • Prompt: Baroque, Instrumental, 160 bpm, Cinematic classical, Best quality
    • Initially created for: Courtyard town
  • Harvest Parade
    • Prompt: Marching band, Best quality, Happy, Vegetables
    • Initially created for: Green town

Those themes have been generated using Udio.

Screenshots

Most of the time, the first screenshot is the townscreen because it's the most specific content.

Recycle

Some mods contain neutral heroes or creatures. You can integrate them in your town mod. Don't forget to remove the content from the original mod.


Modding related articles

Main articles
Modding changelog Modding guidelines How to create a town mod Mod Handler


Formats
Mod file Format
Town Format Creature Format Hero Classes Format
Artifact Format Animation Format Hero Format
Bonus Format Object Format Spell Format


Work-in-progress formats
Building bonuses Map format
Bonus Type Format Random map template


Outdated pages
Mod system proposal