ohrrpgce
ohrrpgce copied to clipboard
Add vehicle setting to respect NPC zones, hide "Override walls" setting
The vehicle "override walls" setting causes all wall checking to be ignored if you're standing on a tile that matches those A/B bits. This is just bizarre and not very useful. (Discussed also in bug #764 and Adam's Oct 2009 email "Unintuitive "override walls" setting".) The plan is to deprecate it, either move it to an Obsolete Settings submenu or just hide it entirely unless it's already used.
James suggested also deprecating the "blocked by" setting, but I think that one is useful and not unintuitive. It causes tiles with that bitmask to act as walls while riding the vehicle.
We should add a setting which causes the vehicle to respect the NPC's normal obstruction rules, including movement and avoidance zones. Except we should allow walking on step-on NPCs, hmm, messy. You could then use zones instead of "blocked by", and maybe it's best to have only one way to set up vehicle obstructions?
Additionally, if the vehicle bitset "Pass through walls" is set all collision/wallchecking (except walking off the map edge), including the "Blocked by" setting and collisions with NPCs, is completely disabled. (It should be renamed "Pass through walls and NPCs" or "Pass through all obstacles", and in fact maybe split into two or more bits.)
When we add vehicle zones we need to either:
- Change it so that in combination with zones it instead acts like the NPC setting "Ignore Passmap" (only ignores ordinary walls) plus ignoring collisions. But for backcompat it should still disable "Blocked by" (separately, maybe we could add a backcompat bitset to disable that).
- Hide and disable that setting when using zones, and add an NPC definition setting to let the NPC walk through other NPCs which you can use instead together with "Ignore passmap". (Currently there's only an NPC instance setting to do that, only accessible via scripting)
I suggest we go with (2) and have a vehicle setting "Walls/Collisions: Respect NPC zones & settings/Use passmap bits". "Blocked by", "Override walls" and "Pass through walls and NPCs" would only appear when using the second, but "Override walls" would be hidden if it's not already set. We could also have a third option "Use fixed settings" to get options to set the movement and avoidance zones and "Pass through walls" and "Pass through NPCs".
Hey wait a minute, I just noticed vehicles does have a "Pass through NPCs" setting, which does absolutely nothing! "Pass through walls" does both those things. Using git log -S pass_npcs it seems VehicleData.pass_npcs has never done anything since VehicleData was added in 2009. We might need more than one backcompat bit...
My ideas are:
Add one fix bit which causes loading older files to replace the "pass through NPCs" setting with the same value as the "pass through walls" setting (if what you say above is true).
Keep the "override walls" setting available, but perhaps change its name, and possibly hide it in a "advanced options" menu or require a INI setting to display it.
See my own issue #1248 about independent vehicles for some further details (some of which I have not written yet but will write in a few minutes, probably). (For one thing, I have an idea about zones which might be helpful too)