Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable despawning by vehicle type #1434

Closed
Marconius6 opened this issue Feb 23, 2022 · 3 comments · Fixed by #1441
Closed

Disable despawning by vehicle type #1434

Marconius6 opened this issue Feb 23, 2022 · 3 comments · Fixed by #1441
Assignees
Labels
DESPAWN TOOLS Feature: Clear traffic, toggle despawn, vehicle/parked/cim despawns feature A new distinct feature Settings Road config, mod options, config xml
Milestone

Comments

@Marconius6
Copy link

Describe your idea

I like to play with despawning disabled, for a more realistic and challenging experience. However, I've been noticing more and more that trains are... kind of terrible; their AI seems limited at best, and unlike road traffic, you have relatively few options to do deal with them (no lights, and they ignore yield signs half the time).

So I would like to be able to play with despawning disabled for most things, but trains still despawning as in vanilla, if they get stuck. I think this would be a good compromise, and seems relatively easy to implement as well.

Specifically, I would put a list in the options menu under the "disable despawning" setting, that would allow you to choose exactly which vehicles you want to disable despawning for. A similar list already exists under the Maintenance options for one-time despawning.

@Marconius6 Marconius6 added feature A new distinct feature triage Awaiting issue categorisation labels Feb 23, 2022
@lokpro
Copy link

lokpro commented Feb 24, 2022

I think so.
I thought the Maintenance options one-time despawning checkboxes was also for the (!🚗) icon but found it isn't.

@originalfoo
Copy link
Member

originalfoo commented Feb 24, 2022

Just checked the despawn code (notably it all routes through VehicleBehaviorManager.MayDespawn(Vehicle)) and there is currently no distinction of vehicle type in that method.

public bool MayDespawn(ref Vehicle vehicleData) {
    return !Options.disableDespawning
        || ((vehicleData.m_flags2 & (Vehicle.Flags2.Blown | Vehicle.Flags2.Floating)) != 0)
        || (vehicleData.m_flags & Vehicle.Flags.Parking) != 0;
}

Call sites would either need updating to pass in ExtVehicleType, or the method itself would need udpating to determine that (via vehicleData.Info).

image

@originalfoo originalfoo added analysing possibilities Analysing chances to create new features or implement changes to existing implementation DESPAWN TOOLS Feature: Clear traffic, toggle despawn, vehicle/parked/cim despawns Settings Road config, mod options, config xml and removed triage Awaiting issue categorisation labels Feb 24, 2022
@krzychu124
Copy link
Member

@aubergine10 we just need to pass vehicle id. It shouldn't be too hard. I'll try to create PR with changes later today.

@krzychu124 krzychu124 self-assigned this Feb 28, 2022
@krzychu124 krzychu124 added the in-progress The problem is being solved currently label Feb 28, 2022
@krzychu124 krzychu124 removed in-progress The problem is being solved currently analysing possibilities Analysing chances to create new features or implement changes to existing implementation labels Feb 28, 2022
@originalfoo originalfoo added this to the 11.6.5.1 milestone Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DESPAWN TOOLS Feature: Clear traffic, toggle despawn, vehicle/parked/cim despawns feature A new distinct feature Settings Road config, mod options, config xml
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants