Yeah, there's really no need to be doing anything with the modelindex if the mod supports custom model setting. Thankfully Quoth provides that with the
mapobject_custom entity - which will also precache whichever model you supply it so you aren't restricted to models the mod already uses. The
mapobject_custom is basically an
info_notnull in every other way, so if you were to apply other hacks to it they'd work fine.
I stopped short there of saying "go ahead and use hacks", as they can cause problems, but I do still keep them in mind when designing things. For example, one of the features I've considered for Quoth is
aggressive entity optimisation. This would basically be runtime consideration of which entities don't actually need a full entity slot to themselves (yet), along with a way to let entities share slots for the time being.
The
path_corner is the simplest example of how this would work. Even with all the exciting extra features added to them in Quoth, you only need about half a dozen fields to store everything relevant about a
path_corner. I've written code that will take those vital fields and stash them into one of four field-sets, making an entity with a "library" of 4
path_corners. The pool of library entities also doubles as the active
path_corner entities, which are dynamically generated as a monster heads towards one.
So if this is all done and working, then why isn't it going into 2.2? The reason is hacks. The logic that says you only need 6 fields to store the relevant info from a
path_corner breaks down if someone performs any kind of hack on the
path_corner. Because there's no limits to what might be hacked, you can't predict what extra fields you'd need to store to restore the hack to working order, and the fact that potentially you'd need to store any field means there's no space to store even a second
path_corner. Even if you could, dynamically generating the
path_corner is equally toxic to potential hacks, as the
path_corner might not exist at the vital moment the hack is to be triggered.
I can see two ways round this: one would be to create a global opt-in flag like the model optimisation flags: the flag would mean "This map is free of hacks, so go ahead and aggressively optimise it". The alternative would be a local opt-out flag on entities, meaning "don't optimise this entity, I'm performing a hack on it!". While I'd prefer the latter, I suspect it wouldn't be backwards compatible.
Some might say that surely
path_corner is a safe thing to optimise, that nobody would hack. However
1)
There's already a hack involving them
2) Imagine the same principle applied to unspawned monsters
The take-home message is this: Map hackers of the world, you are being considered, but you make it hard on us!