Convert CNC map to RA
baxterai edited this page Oct 3, 2020
·
3 revisions
- If necessary convert the cnc map to OpenRA (.oramap) format;
mono OpenRA.Utility.exe cnc --import-td-map cncmap.ini
- open the cnc map in OpenRA cnc map editor, remove all cnc specific actors (e.g. buildings/infantry), and save the map as cncmap.oramap
- extract cncmap.oramap files (unzip)
- edit map.yaml: change
RequiresMod: cnc
toRequiresMod: ra
- verify that all cnc specific actors have been removed;
- zip the map files including map.bin, and rename the zip file to ramapTEMP.oramap
- open ramapTEMP.oramap in OpenRA ra map editor and verify all actors can be read
- if there are remaining actors to be replaced OpenRA will crash and indicate which actors are not compatible with ra
- note the water, roads, and rocks will display incorrectly (these are updated below)
binary2ascii -b d < map.bin > map.ascii
- always backup relevant files before running utilities/scripts
- note to install binary2ascii on Ubuntu:
sudo apt-get install binary2ascii
- open map.ascii and note the following;
- the first ~17 bytes (lines) appear to be header info
- the next mapWidth
x
MapHeightx
3 bytes (lines) contain the terrain tiles that require conversion from cnc TilesetID to ra TilesetID - the first byte of each 3 byte map cell contains the "TilesetID" (which may require changing)
- the openRA source contains the tileset ids (OpenRA/mods/cnc/tilesets/ , OpenRA/mods/ra/tilesets/)
- the tilesets (and tileset ids) can be visually compared in the OpenRA cnc/ra map editors by simultaneously running both programs on different monitors
- for example, with Tileset TEMPERAT, the primary terrain tiles that are shared and require updating are as follows (see temperat.yaml):
- shared water [first-last]:
- ra TilesetIDs: 112 - 124 [total: 12]
- cnc TilesetIDs: 136 - 148 [total: 12]
- cnc TilesetID to ra TilesetID offset (required modification): -24
- shared roads [first-last]:
- ra TilesetIDs: 173 - 215 [total: 42]
- cnc TilesetIDs: 93 - 135 [total: 42]
- cnc TilesetID to ra TilesetID offset (required modification): +80
- shared rocks [first-last]:
- ra TilesetIDs: 135 - 172 [total: 37]
- cnc TilesetIDs: 13 - 50 [total: 37]
- cnc TilesetID to ra TilesetID offset (required modification): +122
- shared water [first-last]:
- replace all cnc terrain TilesetIDs with ra terrain TilesetIDs (see above for example)
- this can be done in Calc/Excel (e.g. cncToRaMapBinTilesetIDconversionTableExample.ods; https://gist.github.com/baxterai/70473b7728fb924450cc6ccd15fa9119)
- save updated object id list as mapConvertedRA.ascii
- open mapConvertedRA.ascii in text editor and replace all new lines with spaces
ascii2binary -b d < mapConvertedRAspaceDelimited.ascii > map.bin
- always backup relevant files before running utilities/scripts
- note to install ascii2binary on Ubuntu:
sudo apt-get install ascii2binary
- verify that all cnc tiles have been replaced with ra tiles;
- zip the map files including map.bin, and rename the zip file to ramap.oramap
- open ramap.oramap in OpenRA ra map editor and verify all terrain TilesetIDs have been upgraded
- the water, roads, and rocks should (largely) display correctly
- if the cnc map was not first created in OpenRA, then some additional tweaks may be required. For example, to configure a 2 player multiplayer map;
- add two "player spawn" actors in OpenRA ra map editor and set them to "Multi0" and "Multi1"
- edit map.yaml
- set Bounds to
Bounds: 1,1,x-2,x-2
(whereMapSize: x,x
) - replace the entire "Players: section" with the following;
- set Bounds to
PlayerReference@Neutral:
Name: Neutral
OwnsWorld: True
NonCombatant: True
Faction: Random
PlayerReference@Creeps:
Name: Creeps
NonCombatant: True
Faction: Random
Enemies: Multi0, Multi1
PlayerReference@Multi0:
Name: Multi0
Playable: True
Faction: Random
Enemies: Creeps
PlayerReference@Multi1:
Name: Multi1
Playable: True
Faction: Random
Enemies: Creeps
Players ๐ฒ
- FAQ โ
- Installation ๐ฆ
- Game Content ๐ฟ
- Hotkeys and Stances ๐ฎ
- Strategies ๐
- Settings ๐ง
- Dedicated Server โพ
- RaspberryPi ๐
- Badges & Icons ๐ฅ
- Changelog ๐
Modders โ๏ธ
- Audio guide ๐
- Traits ๐
- Palettes and Remaps ๐จ
- World Coordinate System ๐
- Map scripting
- Lua-API ๐
- Conditions ๐
- Mapping ๐ง
- Pixelart ๐
Developers ๐ง
- Contributing โค๏ธ
- Compiling
- Hacking
- Coding Standard ๐
- Branches and Releases ๐
- Release Checklist โ
- Sequences
- Glossary
- Reverse engineering ๐
- License ยฉ๏ธ