#4775: align all campaign features
-------------------------------------------------+-------------------------
 Reporter:  Forgon                               |             Owner:
     Type:  patch (an actual patch, not a        |            Status:  new
  request for one)                               |         Milestone:
 Priority:  normal                               |  unspecified
Component:  Campaign                             |           Version:
 Keywords:                                       |  git/master
 Blocking:                                       |        Blocked By:
                                                 |  Operating System:  All
                                                 |  /Non-Specific
-------------------------------------------------+-------------------------
 Features should be aligned, which means that their x and y coordinates are
 positioned at a corner or the center of a tile. Otherwise, warnings are
 printed (see './src/feature.cpp:208'). For example, starting campaign
 mission Alpha 1 lead to the following 5 warnings:

 {{{
 warning |21:00:00: [buildFeature:208] Feature not aligned. position
 (5422,4658), size (1,1) (**Further warnings of this type are suppressed.)
 warning |21:00:00: [buildFeature:208] Feature not aligned. position
 (5068,4689), size (1,1) (**Further warnings of this type are suppressed.)
 warning |21:00:00: [buildFeature:208] Feature not aligned. position
 (5323,4676), size (1,1) (**Further warnings of this type are suppressed.)
 warning |21:00:00: [buildFeature:208] Feature not aligned. position
 (1908,1923), size (1,1) (**Further warnings of this type are suppressed.)
 warning |21:00:00: [buildFeature:208] Feature not aligned. position
 (5474,6205), size (1,1) (**Further warnings of this type are suppressed.)
 }}}

 These features are now aligned, as are all other campaign features. This
 slightly changes the appearance of a few campaign maps (compare [raw-
 attachment:alpha1_feature_alignment_old.png] with [raw-
 attachment:alpha1_feature_alignment_new.png]).

 The positions of campaign features are stored in binary files named
 "feat.bjo", of which the following were modified:
 * ./data/base/wrf/cam1/cam1a/feat.bjo
 * ./data/base/wrf/cam1/sub1-3/feat.bjo
 * ./data/base/wrf/cam2/cam2b/feat.bjo
 * ./data/base/wrf/cam2/cam2c/feat.bjo
 * ./data/base/wrf/cam2/sub2-1/feat.bjo
 * ./data/base/wrf/cam2/sub2-2/feat.bjo
 * ./data/base/wrf/cam2/sub2-5/feat.bjo
 * ./data/base/wrf/cam2/sub2-6/feat.bjo
 * ./data/base/wrf/cam2/sub2-7/feat.bjo
 * ./data/base/wrf/cam2/sub2-8/feat.bjo
 * ./data/base/wrf/cam2/sub2-d/feat.bjo
 * ./data/base/wrf/cam3/sub3-3/feat.bjo

 To correct feature positions in these files, I wrote an AWK script, which
 is attached.

 The format of 'feat.bjo' files is documented in './src/game.cpp'. The bulk
 of its content is defined by the data structures OBJECT_SAVE_V19 or
 OBJECT_SAVE_V20 (see './src/game.cpp:224'). Their field "inFire" is of
 type "int32_t", but read as unsigned value in
 './tools/map/mapload.cpp:235' and './tools/map/mapload.cpp:369'. Should
 this be fixed?

 I also noticed two other oddities, which may require further
 investigation:
 * file './data/base/wrf/cam3/sub3-x/feat.bjo' is of version 2, which is
 unsupported (the minimum supported version is 8).
 * many of the early campaign missions contain garbage in the name fields
 of their 'feat.bjo' files: Following the null character which terminates
 the feature names, parts of other feature names are printed in their
 remaining bytes. My guess is that this was caused by faulty software.

--
Ticket URL: <http://developer.wz2100.net/ticket/4775>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project

Reply via email to