Tutorial; HW1 to HW2 Map Conversion - HWRM/KarosGraveyard GitHub Wiki

HW1 to HW2 Map Conversion

by Mikali.

You can discuss this page here.

Luke 'B1FF' Moloney created a perl script to convert HW1 maps for HW2, which he included with his Homeworld Classic mod. Tefeari then used this script to convert over 140 HW1 maps (available here). Recently, I created my own map converter (available here), and used it to create my own archive of converted maps.

Update: my map converter now exists on GitHub as well.

There are still some issues, however, related to the map conversion process, that may or may not have been addressed properly in any of the efforts, so far:

1. Map Scale

The scale is a bit different in the two games; maps sizes need to be adjusted. In B1FF's map converter, a value equal to the speed of an HW2 frigate divided by the speed of an HW1 frigate (e.g., 161 / 325, or roughly 0.5) is used to scale the maps. This value is also used by my converter.

Note: recent investigations over at RelicNews have uncovered that HW may use feet for its units of measurement, whereas HW2 uses meters. If this is true, the correct conversion ratio should be 1 meter / 3.280839895 feet.

2. RU Conversion

The RU amounts are different in each game. In B1FF's map converter, RU values are adjusted by a factor equal to the cost of an HW2 frigate divided by the cost of an HW1 frigate (e.g., 700 / 575). I used this as the basis for my own RU conversion rates, except that I've doubled everything to cover the cost of research and upgrades.

HW1

Asteroids

  • Asteroid0 (11RUs, non-harvestable)
  • Asteroid1 (25RUs)
  • Asteroid2 (40RUs)
  • Asteroid3 (100RUs)
  • Asteroid4 (400RUs)

Dust Clouds

  • DustCloud0 (50RUs)
  • DustCloud1 (108RUs)
  • DustCloud2 (250RUs)
  • DustCloud3 (700RUs)

Nebulae

  • Nebula0 (100RUs)
  • Nebula1 (100RUs)
  • Nebula2 (100RUs)
  • Nebula3 (100RUs)
  • Nebula4 (100RUs)

Note: need to figure out what the differences are between these "chunks".

Gas Clouds

  • GasCloud0 (0RUs, invisible)
  • GasCloud1 (0RUs, invisible)
  • GasCloud2 (0RUs, invisible)
  • GasCloud3 (0RUs, invisible)
  • GasCloud4 (0RUs, invisible)

Note: "Gas Clouds are not supported and thus should not be used, they will crash your map if used." - from the Map Makers Archive

HWC

Asteroids

  • Asteroid0 (11RUs, non-harvestable)
  • Asteroid1 (160RUs)
  • Asteroid2 (720RUs)
  • Asteroid3 (2600RUs)
  • Asteroid4 (7920RUs)

Dust Clouds

  • DustCloud0 (50RUs)
  • DustCloud1 (108RUs)
  • DustCloud2 (250RUs)
  • DustCloud3 (700RUs)

Nebulae

  • Nebula0 (100RUs)
  • Nebula1 (100RUs)
  • Nebula2 (100RUs)
  • Nebula3 (100RUs)
  • Nebula4 (100RUs)

Crystals

  • dcrystal0 (6000RUs)
  • dcrystal1 (10000RUs)

HW2

Pebbles

  • I'm not sure how this is done in HW1, but the perl script adds them.

Asteroids

  • Asteroid_1 (0RUs, non-harvestable, 0 latch points)
  • Asteroid_2 (0RUs, non-harvestable, 0 latch points)
  • Asteroid_3 (9000RUs, 1 latch points)
  • Asteroid_4 (18000RUs, 2 latch points)
  • Asteroid_5 (40000RUs, 3 latch points)

Salvagable Debris and Containers

  • container (3000RUs)
  • staticcontainer (700RUs)
  • staticcontainerlow (200RUs)
  • hgn_hscore (3000RUs)
  • slv_chunk_lrg01 (700RUs)
  • slv_chunk_lrg02 (700RUs)
  • slv_chunk_lrg03 (700RUs)
  • slv_chunk_lrg04 (700RUs)
  • slv_chunk_lrg05 (700RUs)
  • slv_chunk_lrg06 (700RUs)
  • slv_chunk_sml01 (700RUs)
  • slv_chunk_sml02 (700RUs)
  • slv_chunk_sml03 (700RUs)
  • slv_chunk_sml04 (700RUs)
  • slv_chunk_sml05 (700RUs)
  • slv_chunk_sml06 (700RUs)
  • slv_chunk_sml07 (700RUs)
  • slv_chunk_sml08 (700RUs)

3. Missing Resource Objects

Harvestable dust clouds and nebulae are missing in the converted maps. Since harvestable nebulae and dust clouds don't exist in HW2, they would need to be created from scratch. B1FF's converter simply adds an additional asteroid near the original dust cloud to cover the cloud's RU component. I'm not sure what he did with respect to nebulae (my converter ignores them). I've created a map function, called "addBranch" (available in my Map Functions archive, here), that distributes objects using a similar method to how nebulae are arranged in HW1. However, HOD files for the individual nebula chunks would still need to be created from scratch.

4. Resource Placement

Positioning of resources is done differently in the two games. In HW1, instead of being placed individually, "fields" of resources are placed on a map and then automatically filled randomly with the desired "distribution". My map converter uses the same convention, and utilizes a similar syntax. See this page for an explanation of the methods and syntax used by my function.

Here's the original HW1 syntax: (taken from the HW Map-Makers Archive)

Resources resourcetype, posx, posy, posz, layout, distribution, numResources, radius, length, roty, rotz, properties

where

  • resourcetype is Asteroid, Nebula, GasCloud, or DustCloud
  • posx, posy, posz are positions
  • layout is Sphere, Cylinder, Nebula (Nebula is a sphere, see section below) Note: layout can also be Rectangle (actually a box-shaped prism).
  • distribution refers to distribution file
  • numResources is # of resources
  • radius is radius of cylinder or sphere
  • length is length of cylinder or the *diameter* of the sphere (not relevant for spheres)
  • roty, rotz are angles of rotation (not relevant for spheres)
  • properties is...

Note: In HW2, X is to the left, Y is up, and Z is forward when looking at the 180 marker on the Sensors Manager pie-plate. In HW1, X is to the right, Z is up, and Y is forward when looking at the 300 marker on the Sensors Manager. Both games use a right-handed coordinate system. -Mikali

Note: for the Rectangle layout (actually a box-shaped prism), radius, length and roty refer to its x, y, and z dimensions, respectively. (There's no way, in this case, to rotate it around the y-axis.) Also for boxes, the length, width, and height paramaters are the distances from the box's center to the its sides--not the distance from one end to the other as in the case of cylinders.

Example contents of an HW1 distribution file:

Asteroid0 0 0 Asteroid1 3 3 Asteroid2 2 2 Asteroid3 1 1 Asteroid4 0 0

Note: The first value after each resource refers to the relative amount of the resource in proportion to the other resources. The second value refers to its amount after regenerating, and should probably be ignored.

5. Ships & Derelicts

The derelicts and other ships are different in each game. My map converter uses a table to substitute HW1 ships and derelicts with ships available in stock HW2. I think B1FF's converter ignores ships & derelicts.

6. Map Backgrounds

The HW1 map backgrounds are missing. Except for the stars, Crook's background tool can be used to port HW1 backgrounds to HW2. I haven't tried this myself, though.

7. Slipgates, Meteor Storms & Crystals

Slipgates and meteor storms, as well as the explosive properties of crystals, aren't supported by HW2. Slipgates might be implementable using a modified Balcora Gate. Gates could be linked to each other using scripting methods, much as hyperspace gates are linked together during normal gameplay.

Meteor storms might be doable if meteors were made into a new type of ship and given random starting points and destinations. HOD files from the existing asteroids could be recycled. Collision would either need to be enabled or simulated using a weapon with a range of zero. A new avoidance family would need to be created so that the asteroids don't move around objects that lie in their path.

Crystals could be made explosive by lowering their health and adding an explosive effect upon death. However, I don't think they could be fired upon simply by changing their family.

However, the greatest obstacle to enabling any of these items is the issue of player ownership: these objects would need to be assigned to a player--thereby using up a valuable player slot. One can't have dummy players in HW2 like one could in HW1. (Ships assigned to Player -1 can't be manipulated using scripting methods.) And, in HW2, there's a maximum limit on the number of players--in this case six.

8. Numbers of Objects: Lag, and Path Obstruction

HW1 maps feature lots and lots of asteroids. When converted to HW2 this causes several problems: Firstly, HW2 cannot tolerate the same numbers of objects that HW1 can. Large numbers of objects cause the game to lag. Secondly, when converted to HW2's smaller map sizes, objects will inevitably overlap, causing the resource collectors' paths to become crossed and the resource collectors to become stuck. My map converter can decrease the overall number of map objects, and increase the remaining objects' RU values by the same factor to compensate. This ensures that the total number of RUs on the map remains the same, while improving game performance.

9. Resource Collection Rate & Camping

Resources are collected at a much slower rate in HW2 than in HW1. This means that players in HW2 will exhibit a greater proclivity toward "camping" in a particular area. I've ignored this issue in my own map converter, as I don't know of a solution.

HW1

  • resourcesAtOneTime 660 ; number of resources it will try to get before returning home
  • maxresources 650 ; carrying capacity
  • harvestRate 3 ; eat asteroid every n+1 frames. This value must be 1,3,7,15, or 31
  • harvestAmount 5 ; harvest asteroid for this many RUs every n+1 frames specified above Note: in HW1, a frame is 1/16 second. After doing the math, one finds that the HW1 resource collector collects resources at a rate of 20RUs per second.

HW2

  • ResourceCapacity 200 RUs
  • ResourceRate 8 RUs per second
  • DropOffTime 4 seconds Note: this is much slower than in HW1.
  • Harvest Distance From Resource 300 meters

10. Resource Amounts

HW1 maps simply have fewer resources than HW2 maps.
In HW2, a "typical" map has 2.5 resource patches per player. Each resource patch, in turn, is composed of one "Asteroid_3", one "Asteroid_4" and one "Asteroid_5". This means that there are "typically" 2.5 * (9000 + 18000 + 40000) RUs per player (and 2.5 * (1 + 2 + 3) latch-points per player). In HW1, however, a four-player map, such as Iron Curtain, has 125000 RUs in total (though, there are many, many more latch-points).
Additionally, in HW1, it's possible for resources to regenerate over time. This is not possible in HW2, AFAIK.

11. Cost of Building and Research

One cost factor that exists in HW2 that didn't in HW1 is the cost of building subsystems.
My map converter doubles all RU values to compensate for the cost of building subsystems--though this might still be insufficient.

12. Speed of Building and Research

Though not directly related to the conversion of maps, another difference that affects how maps play is the speed of building and research. In HW1 the speed of building and researching is much greater than it is in HW2. This is due to the fact that one could build and research several items simultaneously in HW1, whereas in HW2 one can only build and research items consecutively. In addition to the decreased resource collection rate in HW2, this may affect resource patch camping, as well as how players move across the map and occupy territory during the course of the game, in general. Maps designed for HW1 may not translate well to the changed movement patterns.

Related Pages

Page Status

Updated Formatting? Initial
Updated for HWRM? Initial