Plan for raising NPC-per-map limits

From OHRRPGCE-Wiki

Jump to: navigation, search

[edit] NPC definitions

  1. Store NPC pictures in an array of memory buffers, rather than an allmodex screen page (done)
  2. Optimize NPC picture array to behave as a cache, only storing each set once, and automatically adding new entries when alter NPC changes an NPC's picture (done)
  3. Update the N lump. (not required, could still happen later)
    • remove bsave header
    • store record size in BINSIZE.BIN
    • get rid of 1920 wasted bytes in each record (done)
    • store N lump record count to MAP lump
  4. Update all code that assumes that exactly 36 NPCs exist
    • take special care that accessing non-existent NPC IDs <= 35 from a plotscript fails gracefully (why was this a problem?) (Not sure, since accessing a non-existent NPC ID <= 35 does nothing anyway) (N/A)
  5. Increase the NPC limit (done)
  6. Increase the limit even more!

[edit] NPC locations

...and while we are at it...

  1. Convert custom to use NPCInst objects instead of an array
  2. update the L lump.
    • remove BSAVE header.
    • store data grouped by NP instance, not grouped by type of data
    • 2 wasted bytes in each record
    • get rid of off-by-one's
    • store L lump record count to MAP lump
  3. Update all code that assumes that exactly 300 NPC instances exist
  4. Update code that saves/loads temporary map state
  5. update Save to store instances more sensibly
  6. raise NPC instance limit

Note that just because you will be able to use lots of NPCs on a single map, don't go hog-wild, because too many extra NPCs will have a performance impact, both on display and tag-checking.

Personal tools