Closed originalfoo closed 2 years ago
Why reuse existing field and fight with limitation? I don't think it's a good idea to leave "invalid" flag values there in case of mod removal. The other problem is you will see them as numbers in ModTools and cannot cast value to get names (you can't add named "entries" to the enum) so any tries of m_flag2 to string will return e.g.: 1892323, not a names separated with commas.
I would see that either as new flags
field in ExtVehicle
or as new flags to existing (like I've already added in Aircraft DLC support PR - ExtVehicleFlags
)
ExtDriverFlags
? - calculated prior to a cim starting a journey
We'd need a very fast way to cross-reference them to a vehicle b/c vehicle AI will need to interact with them.
There are better options, no need to reuse existing vanilla structure, leave junk when mod gets unsubscribed and most importantly make the mod a way more complex to fix if they decide add few more flags.
We could store driver characteristics in
Vehicle.Flags2
spare capacity - the remaining 28 flags are unlikely to all get used by any future DLC.Flags:
IgnoresSpeedLimits
: ± value defined elsewhereIgnoresTrafficLights
IgnoresPrioritySigns
IgnoresVehicleRestrictions
IgnoresLaneRouting
: igores lane arrows, and can also change lanes while going straight ahead at junctionsIgnoresBlockedJunctions
: likely to cut across oncoming trafficOpportunisticDriver
: weaves through traffic like emergency vehicles do (but to lesser extent)LearnerDriver
: reduced acceleration, increased breaking & nodDrunkDriver
: small random offset on next frame (gives appearance of "wobbly driving")RecklessDriver
: doesn't slow down during bad driving conditionsImpatientDriver
: likely to repath if they get stuck in congestion (eg. see #1518)The flags would be derived from info about the driver, and thus can be passed to pathfinder (mainly for
IgnoresLaneRouting
andIgnoreVehicleRestrictions
). Mod options such asIndividual Driving Styles
,Reckless Drivers
,Road condition has a bigger impact on vehicle speed
, andDynamic Lane Selection
might become obsolete; they'd just be standard features - maybe keepIndividual Driving Styles
as a master switch?We could have our own
Enum
with the flags for use prior to vehicle spawning, then just|
it with the vehicle flags2 when necessary, thus making our custom stuff readily available to vehicle AI.As citizen state changes, their driving style will change. For example, if they become criminal, they ingore more rules. As they get older, they might drive slower and poor eyesight results in some rule violations. Tourists might not be aware of stuff like Old Town policy. Drivers on way to work are more aggressive. More drunk drivers at night/weekends.