Skip to content

Convert CNC map to RA

baxterai edited this page Oct 3, 2020 · 3 revisions

Instructions to convert a CNC map to RA (on Linux):

  1. If necessary convert the cnc map to OpenRA (.oramap) format;
  • mono OpenRA.Utility.exe cnc --import-td-map cncmap.ini
  1. 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
  2. extract cncmap.oramap files (unzip)
  3. edit map.yaml: change RequiresMod: cnc to RequiresMod: ra
  4. 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)
  1. 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
  1. open map.ascii and note the following;
  • the first ~17 bytes (lines) appear to be header info
  • the next mapWidthxMapHeightx3 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
  1. replace all cnc terrain TilesetIDs with ra terrain TilesetIDs (see above for example)
  1. save updated object id list as mapConvertedRA.ascii
  2. open mapConvertedRA.ascii in text editor and replace all new lines with spaces
  3. 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
  1. 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
  1. 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 (where MapSize: x,x)
    • replace the entire "Players: section" with the following;
	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 ๐ŸŽฒ

Modders โœ๏ธ

Developers ๐Ÿ”ง

Clone this wiki locally