Pavement Drive Assist Continued

by azaghal

Introduces a driver assistance system that autonomously follows paved roads, while maintaining a preset cruise speed if desired.

Content
a month ago
1.1 - 2.0
15.5K
Transportation

i [INPROGRESS] Airborne vehicles should not follow roads or stop on signs even with Drive Assist enabled

18 days ago

As the title suggests, helicopters and aircraft from other mods such as HelicopterRevival and most other vehicles I'm sure follow the roads when they shouldn't, even when you have the Drive Assist enabled, more over they stop dead when flying over a stop sign.

18 days ago

Hello alincrys ,

Hm... I will have to think a little about it whether that should be made a hard-coded behaviour or configurable in some way. Just in case someone wants to be able to navigate with airborne units on top of roads.

Things like stop-signs can also be useful in doing some kind of weird logic with the vehicles (back in the day I had implemented automatically populating car inventory with items when it hits a specific stop sign - helps that it gets stopped in place, just as an example).

Best regards,
Branko

18 days ago

Thank you for the reply. I believe it is safest to make it an option. I haven't thought about how it could be used, however Factorio is a game where the freedom is absolute and more options for the player is always best.

17 days ago

IMHO it should be by default off for air vehicles regardless of the Drive Assist toggle with an option in settings to have it work normally as it would with land vehicles.

14 days ago

So, I have been looking into this for last couple of days, and have at least some kind of initial solution. It has proven a bit more challenging with what the code looks like currently, though - at least if you want to maintain sane and consistent state (when you toggle the settings, players join/leave in multiplayer etc). I think the mod is ripe for some refactoring, but that will be a bit of a process to ensure nothing breaks down.

Best regards,
Branko

14 days ago
(updated 14 days ago)

Perhaps you are over thinking it. How about a player sided flag that checks for the entity name and disables Drive Assist and stopping on signs when you get in the aircraft? You can have a list of modded aircraft names. There really aren't that many aircraft mods in factorio. :)) And if people make aircraft mods, you can have occasional updates that adds the aircraft names to your mod. Cheers

14 days ago

Perhaps you are over thinking it. How about a player sided flag that checks for the entity name and disables Drive Assist and stopping on signs when you get in the aircraft akin to pushing the Drive Assist button? You can have a list of modded aircraft names. There really aren't that many aircraft mods in factorio. :)) And if people make aircraft mods, you can have occasional updates that adds the aircraft names to your mod. More over if you are in the aircraft and manually enable Drive Assist by pushing on the button it will also stay on the next time you get inside that vehicle. ;))

Cheers, Alin

14 days ago
(updated 14 days ago)

Perhaps you are over thinking it. How about a player sided flag that checks for the entity name and disables Drive Assist and stopping on signs when you get in the aircraft akin to pushing the Drive Assist button? You can have a list of modded aircraft names. There really aren't that many aircraft mods in factorio. :)) And if people make aircraft mods, you can have occasional updates that adds the aircraft names to your mod. More over if you are in the aircraft and manually enable Drive Assist by pushing on the button it will also stay on the next time you get inside that vehicle. ;))

Not at all. Checking if a vehicle is airborne is super easy. Creating a list of such vehicles is super easy. You simply check the collision mask - worked like charm for both an aircraft mod and helicopter revival one.

Finding all the right places to plug in those checks is a bit more complicated, particularly if you do not want to break existing savegames, or if you want to maintain sane state that the mod keeps internally when the setting is turned on or off in the middle of the game. This can get further complicated if you are in a multiplayer setting. Or if the player decides to toggle the setting while sitting in a vehicle on top of a sign. Or if a player decides to toggle the setting while driving the vehicle that has had its speed limit capped off by speed limit sign.

It is not necessarily super hard, but there are corner cases to think about. And some of those checks do not necessarily fit in nicely with the existing code (like you just change 1-2 lines in the code).

Best regards,
Branko

New response