 maxobj
 ======

 This is a small perl script to increase the maximum number of objects 
 possible in a level. You will need to set max_objects=yournumber in 
 Dark.cfg, as well. This script simple appends some space to the ObjVec
 chunk in a mission, thus allowing more than 2048 objects in your level.
 Even if your level contains slightly less than 2048 objects, the limit
 can be easily reached when objects are dynamically created in game mode.
 
 When you set max_objects=4096 or whatever in Dark.cfg, then DromEd will 
 still use as default (when it starts or you click "File|New") a mission
 with only 2048 objects. In this case, as well as when loading a mission
 that has a different number than you specified in Dark.gam, you will get
 a warning when you enter game mode. It will basically say that the portal
 uses more/less objects than you specified. Just click "Cancel" and proceed.

 Warning: If you create a mission with max_objects=4096 (or anything greater
          than 2048, then distribute it, others with 2048 in Dark.cfg will
          probably not be able to load the mission into DromEd! Advise them
          to the same settings you use, or dont use maxobj.pl!

 You can now decrease the number of maximal objects in a mission file. Going
 below 2048 is NOT recommened! This is thought as a fix for a 4096 mission.
 DromEd will report a AIPATH error when loading the mission. To make it work
 again first strip the mission from its AIPATH chunk.

 perl strip.pl -eo -sAIPATH yourmis.mis newmis.mis

 Then decrease the number of objects in it:

 perl maxobj.pl newmis.mis fixed.mis 2048

 Now load fixed.mis and it should work. The other work around is just putting
 max_obj=4096 in dark.cfg.

 Additional info: 

 Looking at 'Lord Binclair' will show you that it has the highest object ID
 close to the maximum, but there are only a couple of hundreds objects in 
 the mission. It seems that DromEd somehow is not able to close the gaps 
 in the ID space. When pressing insert or creating an object, the gaps 
 are used though. Uhm. Not sure why the gaps appear, but they are there.

 It would be possible to build a compress_objects functions, but this requires
 that the object system works 100%. This is not the case yet. Sorry.
 In the meanwhile, you can simple use "compress_br_ids" at the DromEd prompt
 to achieve the same effect.

 More thoughts: Since DromEd bails out wit 2048 objects for a mission build
 with 4096 with an error in the AIPATH chunk, it seems that the AI cells use
 the object system somehow, too. So it may well be that the limit of 2048 is
 easily reached because your complex level has too much cells that block the
 object IDs. Unsure.

Bug reports, suggestions and comments are very welcome!

email: thief at bloodgate dot com
WWW  : http://bloodgate.com/thief

