[Include] Map Zones - Let's end a decade of bad practices...
#3

This library has definitely become more than I ever expected it to be. Some major changes I made:
  • The data is now separated into two datasets. The first one consists of the names and sound IDs of the zones and the other one consists of coordinates of the areas associated with zones.
  • The areas are now stored by the minimum X-coordinate and GetMapZoneAtPoint now uses binary search to find the start point for the loop, decreasing the lookup times. Thanks to ****** for pointing out some mistakes I made when implementing binary search and giving me ideas for potential improvements in the future.
  • Added GetMapZoneSoundID function. Some (fewer than ten) zones are missing a sound ID in the game, I used the sound IDs of surrounding zones for them, for example “Robada Intersection” is referred to as “Tierra Robada”, “Pershing Square” as “Commerce”, etc. Thanks to spacemud for providing me an array of most sound IDs linked to area names, speeding up my work by at least an hour.
  • A constant is available for each zone, e.g. ZONE_ANGEL_PINE and ZONE_COMMERCE. The prefix is ZONE_ instead of MAP_ZONE_ so none of the zone names would need to be abbreviated.
  • Some changes to the API regarding coordinates. The readme (first post) is updated, further details are available there.
Reply


Messages In This Thread
Map Zones - Let's end a decade of bad practices... - by kristo - 02.10.2018, 16:42
Re: Map Zones - Let's end a decade of bad practices... - by kristo - 02.10.2018, 18:36
Re: Map Zones - Let's end a decade of bad practices... - by kristo - 05.10.2018, 16:16
Re: Map Zones - Let's end a decade of bad practices... - by kristo - 17.10.2018, 17:04
Re: Map Zones - Let's end a decade of bad practices... - by PT - 18.10.2018, 12:21
Re: Map Zones - Let's end a decade of bad practices... - by GameOvr - 02.11.2018, 07:30

Forum Jump:


Users browsing this thread: 1 Guest(s)