Difference between revisions of "User:Aquanim/DraftMapMakingGuide"
m (→Upspring) |
m |
||
Line 125: | Line 125: | ||
A tool for modifying models like those of tree features, etc. Might be useful if a feature is too large or too small. I'll leave this guide to somebody who actually understands modelling. | A tool for modifying models like those of tree features, etc. Might be useful if a feature is too large or too small. I'll leave this guide to somebody who actually understands modelling. | ||
+ | |||
+ | = Other Stuff = | ||
+ | |||
+ | == Features (geovents, trees, rocks, etc) == | ||
+ | |||
+ | - Put the files defining the features you want in your map file. This includes a definition in the /features subdirectory, model files in the /objects3d directory, and textures in the /unittextures directory. The easiest way to get these is to borrow them from existing maps. There is a features library as well... ask around in #zkmap for a link then update this page. | ||
+ | - Load your map in Springboard | ||
+ | - Delete any features you have marking mex locations, otherwise you will end up with two copies of them and that is bad. | ||
+ | - Place features using Springboard. | ||
+ | - Export an s11n file containing a list of the features on your map. | ||
+ | - Put this s11n file in the ./mapconfig subdirectory. | ||
+ | - Make sure that in ./libs/s11n/s11n_load_map_features.lua that the "modelPath" variable points at your s11n file. | ||
+ | |||
+ | Troubleshooting: | ||
+ | - IF your features do not move when the ground under them is terraformed (a particular problem for geovents) go to ./libs/s11n/features_s11n.lua, look for the "CreateObject" function, and change it so that SetFeatureMoveCtrl is not being used to set MoveCtrl to true. | ||
+ | |||
+ | == DNTS == | ||
+ | |||
+ | - Put the files defining the detail map (commonly grass, pebbles, rocks, etc.) you want in your /maps subdirectory. | ||
+ | - |
Revision as of 04:15, 20 September 2020
Minimal Brief Guide
For more detail on each of these steps read the later sections of the document (TODO: when these are actually written lol)
This guide assumes that you are using a version of Zero-K installed through Steam. You can still make maps if you installed by some other method but you may need to modify some of the later steps.
Some or all of these steps may be possible to do using just Springboard; I will leave that guide to somebody who is familiar with the Springboard workflow. I mostly use it for features.
Download Tools
- 7zip - https://www.7-zip.org/download.html
- pymapconv - clone or download https://github.com/Beherith/springrts_smf_compiler somewhere, then copy pymapconv.exe and nvdxt.exe to a new directory to keep things simple
- map blueprint - clone or download https://github.com/Aquanim/ZKMapBlueprint
Create Images
For a 10x10 (TitanDuel-size) map, create the following images with a tool of your choice:
- A height map grayscale image with dimensions 641 x 641, saved as an 8-bit .bmp or a 16-bit .png. (The latter is preferred but not all tools offer 16-bit output.) The brighter a pixel is the higher the corresponding part of the map will be.
- A texture map colour image with dimensions 5120 x 5120, saved as a .bmp
For a different size map, multiply the height/width of the map by 64 and add 1 to get the right size for the heightmap; multiply the height/width of the map by 512 to get the right size for the texture map.
Put these images in the same directory as pymapconv.exe from the previous step (may not strictly be required but keeps things simple).
TODO: SME and Springboard tools
Compile Your Map
Run pymapconv.exe and fill in the following fields...
- An output file name - ideally this should be the name of your map, possibly with a version number. File extension .smf, will also generate a .smt. IMPORTANT: Do not rename these files after compiling!
- Use the buttons to select the texture and heightmap images you made in the previous step.
- I expect the minimum/maximum height values to be overridden by mapinfo.lua later but you might as well set them.
- Scroll down to the NVDXT option and make sure it says "-Sinc -quality_highest". Also probably a good idea to tick the CLEAN option.
- Untick everything else, press "Save options as" if you like, then press the "Compile" button.
Construct .sdd File
- Rename ZKMapBlueprint_v0.0.sdd to have the name of your map. A version identifier is advisable as well. Keep the .sdd extension.
- Copy the .smf and .smt files produced by pymapconv.exe into the /maps subfolder of the .sdd folder. (There should be mapblueprint.smf and mapblueprint.smt files here, you can delete them.)
- In the root of the .sdd folder there should be a file "mapinfo.lua". Open this with a text editor. This file contains a bunch of stuff but there are only a few items we are interested in for now:
- Near the start of the file change the author, description, name, shortname and version variables to suit you and your map.
- Scroll down a bit to the "smf" section and change the maxheight and minheight numbers to suit your map. Also change the file name after smtFileName0 so that it has your .smt file's name.
- To test your map, copy the .sdd directory into the /maps folder of your Zero-K install. In the settings make sure that "Only featured maps" is disabled. Then open a Skirmish game, click on the current map, select your map from the list, and play. (You might want to make the enemy AI inactive. The minimap in the lobby will be blank, don't worry about this for now.)
- If you want to change your map you will need to replace the files in your ZK maps folder, then restart ZK, in order to load the new version.
Metal and Startboxes
Now that you can look at your height and texturemap ingame this is a good time to sort out your metal spots and start locations.
Metal spots
In the /mapconfig subfolder of the .sdd file there is a "map_metal_layout.lua" file. The blueprint contains two metal spots as an example; replace them with your own.
Startboxes
In the /mapconfig subfolder of the .sdd file there is a "map_startboxes.lua" file. This specifies each team's startboxes as well as default start locations.
Some hints for configuring the metal and startbox files:
- Startboxes are specified by their corner points reading clockwise around the polygon. More than one separate box for a given team is possible.
- Holding SPACE ingame will display a dialog box which (among other things) gives the X and Z coordinates of wherever your cursor is.
- The metal and startbox files are just LUA scripts. This means you don't have to write simple numbers to specify locations; you can perform arithmetic to make sure your map setup is symmetric (the startbox of the South-East team in the blueprint is an example). More advanced scripting is also possible, for example to make your startbox configuration dependent on the number of players or allyteams. See the [Startbox API page] .
Useful Tools
Optional Extras
TODO: fill these in
You can skip this for now, but refer to the sections linked below if you want...
- Features (geovents, trees, rocks, etc)
- DNTS (fancy map details and specular map)
- Fancy mapinfo stuff (lighting, water effects, etc)
- Skybox (???)
- Other nonsense (particle effects, sound, etc)
Upload
Compress the contents of the .sdd file into a 7zip, then change the file extension to “.sd7”. If you remove the .sdd from your game maps directory and put the .sd7 in its place, the map should still work.
IMPORTANT: Make sure that when you open the archive you see mapinfo.lua and not your .sdd folder! If you get this wrong the map will not work correctly.
IMPORTANT: When you compress to 7zip make sure the compression is “non-solid”.
Uploading to Zero-K Server
- Go to https://zero-k.info/Maps
- Scroll down until you find the "Upload map or game (sd7 or sdz):" file on the right-hand side
- Upload your map
If this doesn't work there are two potential reasons:
- Your map isn't set up right. Test it locally again and make sure your map works.
- Something on the server has gone wrong. AFTER testing your map locally and finding that it works there, contact an admin. Uploading your map to a file-sharing service so the admin can look at it may help.
Uploading to Springfiles for use in other Spring communities
- Make a Springfiles account at https://springfiles.com/
- Pray to your deity of choice that whoever approves Springfiles accounts checks in this month
Alternatively, get somebody else who already has an account to upload the map for you. Your name will still be listed as the author and you should still be able to upload any later updates yourself.
- Upload your map
- Pray to your deity of choice that Springfiles is actually working this week
- If your map is not listed at https://api.springfiles.com/ within 24 hours ask for help in the #zkmap channel
- Eventually see your map on the ZK website - it will be unsupported by default so make sure you set your search filter accordingly
- Test your map on the live server so there is a publically accessible replay or two - games against AIs are fine
- Ask a moderator to support/feature your map
Tools and Resources
Springboard
SpringMapEdit
Nobiax Texture Pack
Startbox Editor Widget
Load your map in ZK, press Alt-F11 to access the widget list, press "Search" and enter "Startbox". Enable the Startbox Editor. The ingame description doesn't say much so let's consult the widget source file:
...well, that's not a good sign. Scroll down a bit further:
That's more like it. Follow those instructions to create your startboxes, then open your infolog.lua (in the main zero-k directory) after you exit to retrieve the startbox information for copying into map_startboxes.lua. It's probably a good idea to turn the widget off after you are done with it.
Upspring
A tool for modifying models like those of tree features, etc. Might be useful if a feature is too large or too small. I'll leave this guide to somebody who actually understands modelling.
Other Stuff
Features (geovents, trees, rocks, etc)
- Put the files defining the features you want in your map file. This includes a definition in the /features subdirectory, model files in the /objects3d directory, and textures in the /unittextures directory. The easiest way to get these is to borrow them from existing maps. There is a features library as well... ask around in #zkmap for a link then update this page. - Load your map in Springboard - Delete any features you have marking mex locations, otherwise you will end up with two copies of them and that is bad. - Place features using Springboard. - Export an s11n file containing a list of the features on your map. - Put this s11n file in the ./mapconfig subdirectory. - Make sure that in ./libs/s11n/s11n_load_map_features.lua that the "modelPath" variable points at your s11n file.
Troubleshooting: - IF your features do not move when the ground under them is terraformed (a particular problem for geovents) go to ./libs/s11n/features_s11n.lua, look for the "CreateObject" function, and change it so that SetFeatureMoveCtrl is not being used to set MoveCtrl to true.
DNTS
- Put the files defining the detail map (commonly grass, pebbles, rocks, etc.) you want in your /maps subdirectory. -