Actions

Difference between revisions of "Making Might and Magic maps with Trenchbroom"

From MM6 Wiki

 
(17 intermediate revisions by the same user not shown)
Line 12: Line 12:
  
  
There are premade texture packs for Trenchbroom:
+
There are pre-made texture collections for Trenchbroom:
  
*[https://mm6.wiki/files/mods/trenchbroom/Might_and_Magic_Trenchbroom.zip Might and Magic VI]
+
*[https://mm6.wiki/files/mods/trenchbroom/textures/MM6_Trenchbroom.zip Might and Magic VI]
 +
*[https://mm6.wiki/files/mods/trenchbroom/textures/MM7_Trenchbroom.zip Might and Magic VII]
  
The pack can be extracted anywhere, just make sure to note its location.
+
*[https://mm6.wiki/files/mods/trenchbroom/textures/Minecraft_Trenchbroom.zip Minecraft]
 +
 
 +
Select one of depending on the game. Then extract it somewhere.
  
 
''More information on how to make a custom texture pack can be found on the [[Talk:Making Might and Magic maps with Trenchbroom|Discussion]] page.''
 
''More information on how to make a custom texture pack can be found on the [[Talk:Making Might and Magic maps with Trenchbroom|Discussion]] page.''
  
 
====Trenchbroom configuration====
 
====Trenchbroom configuration====
By default it seems that BMP image support in Trenchbroom is not enabled. That can be solved by creating custom configuration file for a game that needs it.
+
By default it seems that BMP image support in Trenchbroom is not enabled. That can be solved by creating a custom game configuration file.
  
[https://mm6.wiki/files/mods/trenchbroom/MightAndMagic.zip Might and Magic game preset for Trenchbroom]
+
[https://mm6.wiki/files/mods/trenchbroom/MM_Trenchbroom_gameconfig.zip Trenchbroom game config]
  
 
To add this configuration: extract the ZIP file into the '''Trenchbroom/Games''' directory.
 
To add this configuration: extract the ZIP file into the '''Trenchbroom/Games''' directory.
If the configuration files worked then a new entry will be visible when creating a new map:
+
If the configuration files worked then the new entry will be visible when creating a new map:
  
 
<br />[[File:Mm6 trenchbroom select game.png|frameless|700x528px]]
 
<br />[[File:Mm6 trenchbroom select game.png|frameless|700x528px]]
  
  
Now Trenchbroom needs a path where the textures are stored. To set it, press the '''Open preferences...''' button. And set the path for '''Might and Magic''' to the folder that contains '''Bitmaps''' folder with the textures ('''Might and Magic Trenchbroom''').
+
Now Trenchbroom needs a path where the textures are stored. To set it, press the '''Open preferences...''' button. And set the path for '''Might and Magic''' to the folder that contains the '''textures''' directory.
  
 
<br />[[File:Mm6 trenchbroom configure engines.png|frameless|928x755px]]<br />
 
<br />[[File:Mm6 trenchbroom configure engines.png|frameless|928x755px]]<br />
Line 41: Line 44:
  
  
Now creating new map with Might and Magic preset will be loading the project folder and the textures will be available. To proceed start a new map using Might and Magic preset.
+
After the path to textures is set Trenchbroom will be able to load all the texture collections within the directory.  
  
  
The textures will be available once texture collection is selected. Open the '''Face''' tab and in the '''Texture Collections''' section double click on the '''bitmaps\MM6''' collection. Once the texture collection is loaded the textures should be visible in the Texture Browser.
+
The textures will be added once at least one texture collection is imported. Open the '''Face''' tab and in the '''Texture Collections''' section double click on any available texture collection. Once the texture collection is loaded the textures should be visible in the Texture Browser.
  
  
Line 70: Line 73:
 
[[File:Mm6 trenchbroom object ready.png|1899x1899px|frameless]]<br />
 
[[File:Mm6 trenchbroom object ready.png|1899x1899px|frameless]]<br />
 
<br />
 
<br />
====Optimizing the object with _Invisible_ texture====
+
====Hiding colliding faces using the _Invisible_ texture====
  
  
Line 82: Line 85:
  
 
[[File:Mm6 trenchbroom object ready 2.png|frameless|1899x1899px]]
 
[[File:Mm6 trenchbroom object ready 2.png|frameless|1899x1899px]]
 
  
 
===Export to MMEditor===
 
===Export to MMEditor===
Line 144: Line 146:
  
 
[[File:Mm6 trenchbroom ingame.png|frameless|641x641px]]
 
[[File:Mm6 trenchbroom ingame.png|frameless|641x641px]]
 +
 +
==Sample maps==
 +
 +
===Minecraft===
 +
<youtube>rBuNyAvVqfE</youtube>
 +
 +
[https://mm6.wiki/files/mods/trenchbroom/maps/Minecraft/minecraft.bitmaps.lod minecraft.bitmaps.lod] - LOD with map textures
 +
 +
[https://mm6.wiki/files/mods/trenchbroom/maps/Minecraft/map.dat map.dat] - MMEditor project file
 +
 +
[https://mm6.wiki/files/mods/trenchbroom/maps/Minecraft/Minecraft.map Minecraft.map] - Trenchbroom map file
 +
 +
Texture collection for Trenchbroom used to make this map can be found in the section above.

Latest revision as of 14:32, 28 June 2020

Making maps for Might and Magic is a little bit tricky since it requires usage of some 3D software like Blender or 3Ds Max. To make it easier map editor can be used. MMEditor is used to edit Might and Magic maps. It can import 3D models in OBJ format. That means that any program that can export such models can be used for making objects or even entire maps for the games.


Trenchbroom is a map editor for Quake-based games.


Setting up the editor[edit | edit source]

There are pre-made texture collections for Trenchbroom:

Select one of depending on the game. Then extract it somewhere.

More information on how to make a custom texture pack can be found on the Discussion page.

Trenchbroom configuration[edit | edit source]

By default it seems that BMP image support in Trenchbroom is not enabled. That can be solved by creating a custom game configuration file.

Trenchbroom game config

To add this configuration: extract the ZIP file into the Trenchbroom/Games directory. If the configuration files worked then the new entry will be visible when creating a new map:


Mm6 trenchbroom select game.png


Now Trenchbroom needs a path where the textures are stored. To set it, press the Open preferences... button. And set the path for Might and Magic to the folder that contains the textures directory.


Mm6 trenchbroom configure engines.png


Making a map / object[edit | edit source]

After the path to textures is set Trenchbroom will be able to load all the texture collections within the directory.


The textures will be added once at least one texture collection is imported. Open the Face tab and in the Texture Collections section double click on any available texture collection. Once the texture collection is loaded the textures should be visible in the Texture Browser.


From now on the process is very similar to making a custom map for Quake, so the general tutorials for Trenchbroom apply.

Limitations[edit | edit source]

Might and Magic engine has its own limitations that are not present in Quake engine.


  • The textures can not be rotated
  • The textures can not be flipped
  • The textures can not be scaled


None of that will be applied after the model is exported and will lead to inconsistent results between the editor and the game.


To avoid some of those things untick Texture Lock and UV lock in the Edit menu:


Mm6 trenchbroom texture lock.png

Mm6 trenchbroom object ready.png

Hiding colliding faces using the _Invisible_ texture[edit | edit source]

When building with boxes (brushes) there are usually a lot of faces (segments) which are not necessary for the shape. The ones that are inside the object, or the ones that overlap. Generally these are the elements of the model that will not or should not be visible during gameplay. To remove them, they need to be marked with the texture named _Invisible_. The texture is already included in a premade texture pack, it is in a group named mmeditor.


In Might and Magic engine if two model faces overlap each other they will blink / flicker and such. That effect is also known as Z-fighting. Face overlapping is very common when modelling with a Quake editor. That happens because instead of modeling with polygons directly, shapes are made using brushes / boxes.


The texture itself can be anything, the only rule is that it has to be named exactly like that. The texture can be made in any image editor and then loaded within any texture collection.

Mm6 trenchbroom object ready 2.png

Export to MMEditor[edit | edit source]

Once the object is finished export the model by using File -> Export -> Wavefront OBJ ...

Doing that will create 2 files: .OBJ and .MTL


Importing the model[edit | edit source]

MMEditor is used for editing maps in the game. Follow the steps for installation of MMEditor, afterwards run the game once to generate the required files and directories.


For MMEditor to correctly process the model the following script: mtl.lua

needs to be placed at the /Scripts/General directory.


Once the game is loaded press alt + F1 and open any internal map.

To import the model click on the Import button.

Select Cancel when asked to delete models, that will keep the rest of the map intact.

If the model was created not far from the center of coordinates in Trenchbroom it will be placed somewhere around 0,0,0 coordinates in the game, which is the center of the map. The newly imported object should be there.


Mm6 trenchbroom mmeditor import.png


Moving the object[edit | edit source]

Many building in the game are considered to be a single object by the engine. Those had many shapes merged in one using 3D software. In Trenchbroom objects are built using brushes and usually there are many brushes that constitute one object. When Trenchbroom exports a model it keeps the shapes separate. That means that the object can not be selected all at once.

To move imported object:

  1. Click on any face on the model
  2. Press the Model button
  3. Hold the Left Shift key and select the other parts


Mm6 trenchbroom mmeditor object selected.png


Now there are 2 options:

  • Use arrow keys + Page Up / Down to move the object around
  • Move the party to the destination and press the Move To Party button

! Note that the Land function will not help to align the object to the ground since it will align every segment individually and not the entire group.

The result:


Mm6 trenchbroom ingame.png

Sample maps[edit | edit source]

Minecraft[edit | edit source]

minecraft.bitmaps.lod - LOD with map textures

map.dat - MMEditor project file

Minecraft.map - Trenchbroom map file

Texture collection for Trenchbroom used to make this map can be found in the section above.