#4865: Fix campaign map files -------------------------------------------------+------------------------- Reporter: Forgon | Owner: Type: patch (an actual patch, not a | Status: new request for one) | Milestone: Priority: normal | unspecified Component: Data: Maps | Version: Keywords: | git/master Blocking: | Blocked By: | Operating System: All | /Non-Specific -------------------------------------------------+------------------------- == Fix object property "id" in campaign maps
If objects on a map have their "id" property set to 0, FlaME automatically changes its value to the smallest available positive integer. To avoid this, the AWK script `fix_object_ids` corrected all object "id" values of 0 found in BJO campaign map files in the same manner as FlaME would. == Fix overlapping objects in campaign maps Objects overlap if droids, features or structures occupy the same tile. All objects are positioned around a center specified by tile coordinates given in BJO, INI or JSON files, depending on the game's version. Features and structures have a specific width and length specified by the "width" and "breadth" property given in their stat files, which are found at: * data/base/stats/features.json * data/base/stats/structure.json * data/mp/stats/features.json * data/mp/stats/structure.json In contrast, droids are treated as having width and length 0, so that they can never occupy more than one tile, regardless of their actual size. The following object combinations are valid even if they overlap: * oil derricks built on top of power resources * (VTOL) factories with up to 2 factory modules * power modules for power generators * research modules for research facilities Overlapping objects are treated as errors in FlaME, which means that they prevent map compilation unless they are fixed. Their error message is defined in flaME/FlaME/frmCompile.vb at line 228: {{{ resultItem.Text = "Bad unit overlap on tile " & X & ", " & Y & "." }}} The AWK script `find_overlapping_objects` detected all overlapping objects in BJO campaign map files. The output of `./find_overlapping_objects | sort` was: {{{ ./data/base/wrf/cam1/cam1a 13 14 ./data/base/wrf/cam1/cam1a 14 15 ./data/base/wrf/cam1/cam1a 27 7 ./data/base/wrf/cam1/cam1a 38 29 ./data/base/wrf/cam1/sub1-2 33 33 ./data/base/wrf/cam1/sub1-5 21 12 ./data/base/wrf/cam2/cam2b 80 11 ./data/base/wrf/cam2/cam2b 80 12 ./data/base/wrf/cam2/cam2b 80 13 ./data/base/wrf/cam2/cam2b 85 12 ./data/base/wrf/cam2/sub2-2 41 10 ./data/base/wrf/cam2/sub2-2 42 10 ./data/base/wrf/cam2/sub2-2 44 10 ./data/base/wrf/cam3/sub3-3 14 36 ./data/base/wrf/cam3/sub3-3 17 22 ./data/base/wrf/cam3/sub3-3 3 45 ./data/base/wrf/cam3/sub3-3 37 24 ./data/base/wrf/cam3/sub3-3 38 23 ./data/base/wrf/cam3/sub3-3 38 24 ./data/base/wrf/cam3/sub3-3 39 23 ./data/base/wrf/cam3/sub3-3 7 39 }}} Some overlapping objects cannot be placed at all in the game and should thus be removed. This is the case with a Boulder1 feature on the Alpha 1 map, placed below the guard tower of a scavenger base (shown in the attached image flame_unit_overlap_error.png). In all other cases, objects were placed as close as possible to their original destination. These changes are unlikely to affect campaign balance. In mission cam1/sub1-5, FlaME reported a "Bad module" for a factory owned by the New Paradigm faction. The entire factory has been rebuilt and given a new ID to suppress this error. In missions cam2/cam2b and cam2/sub2-2, FlaME warned about water tiles pointing in the wrong direction. These warnings can be avoided with its menu option "Tools->Water Triangle Correction". I have, however, not included these changes in the attached commit. All of the changes to TTP or MAP files resulting from saving campaign maps in FlaME have been ignored, because I am too unfamiliar with their format. The attached archive corrected_campaign_maps.zip contains them along with all the other data FlaME generated when compiling campaign maps. == Remove unused file droid.json for Alpha 1 map Alpha 1 contained an unused file droid.json, which was a remnant of {{{ commit 72caa085d39eaff3e0e5fd12505d983393ad9bb4 Author: per <p...@wz2100.net> Date: Fri Oct 24 00:40:34 2014 +0200 Conversion INI -> JSON using Qt5: Actually commit the JSON files. Also, remove the INI files. Finally, fix two smaller bugs. }}} == Remove duplicate tutorial map file The tutorial map folder contained an unused duplicate of the file newtut.gam, which was a remnant of {{{ commit 85ab4e02e97a7acc73ba5dda116186632b439930 Author: Dennis Schridde <devuran...@gna.org> Date: Fri May 23 21:42:44 2008 +0000 Move base files from data/ into data/base/ (and stuff from warzone.wz to base.wz respecitively). Should not create any problems, buildsystems were changed (MacOSX, please test). Reason: Organisation, later: simplification. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5156 4a71c877 -e1ca-e34f-864e-861f7616d084 }}} -- Ticket URL: <http://developer.wz2100.net/ticket/4865> Warzone 2100 Trac <http://developer.wz2100.net/> The Warzone 2100 Project _______________________________________________ Warzone2100-project mailing list Warzone2100-project@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/warzone2100-project