Cities: Skylines

Cities: Skylines

53 ratings
Despawn Manager
   
Award
Favorite
Favorited
Unfavorite
Mod
File Size
Posted
Updated
317.647 KB
2 Dec, 2020 @ 9:43am
6 Dec, 2020 @ 4:07am
2 Change Notes ( view )

Subscribe to download
Despawn Manager

Description
DESPAWN MANAGER ... with CargoTrain Minimum Load control

This purpose of this mod is to give the player more direct options to influence or control traffic in the city.

COMPATIBILITY with Cities Skylines
For some cause unknown to me, ever since the Green Cities DLC update, the game locks up on my computer (or even locks up the computer itself). So, I'm still playing the pre-Green Cities DLC version of the game. My point in relating this is to inform the reader that I have not, and cannot, test this mod against the current version of the game.

That said, it should be compatible with the current version of the game. The only problem I can think of in this regard would be if the developers have changed how a key Vehicle.Flags flag is being set -- this is the flag that I'm using to manage both the spawning of new Cargo Trains relative to their minimum cargo load thresholds, and the despawning of unloaded Cargo Trains and Cargo Ships. As I see it, the flag is set opposite to what its name (and what meager documentation I could find) implies. Thus, if the developers were to change how the flag is set, this key functionality of the mod would be broken ... until someone tells me about it and I can fix the mod's code.

Edit: INCOMPATIBILITY with Other Mods, Including TM:PE
I’ve been informed that this mod is actually incompatible with TM:PE, at least the current version. Since TM:PE is such a vital mod, I expect that few people will be able to use the 'Despawn Manager' mod as it was originally released.

As the 'Despawn Manager' mod "patches" some of the game’s base classes (code modules) for some of the VehicleAIs, it is potentially incompatible with other mods which modify the same VehicleAIs.

Foe example, as I was recently testing the "cheats" I added for Garbage Trucks and Hearses, I noticed that they were no longer staying within their defined Districts. So, what was happening is that both the 'Despawn Manager' mod and the Districts mod I use wanted to change how the VehicleAIs operate for these two vehicle types, and the 'Despawn Manager' mod just happened to "win".

So I have added a feature to the mod that may help mitigate such conflicts with other mods which "patch" the game's VehicleAIs

FEATURES
1) Modularity: As shown on the first screen-shot, the player may choose the vehicle types for which the 'Despawn Manager' mod will "patch" the base VehicleAs. For example, one may choose to use functionality of the 'Despawn Manager' mod for only Cargo Trains and Cargo Ships, thus leaving control of other vehicle types to the base game and/or other mods.

2) Vastly reduce the number of 7% filled Cargo Trains which are spawned into the city's rail network by setting minimum cargo load thresholds, with individual thresholds for:
- import traffic,
- export traffic,
- local traffic

2a) Unfortunately, I cannot add minimum cargo load thresholds functionality for Cargo Ships, as the base game itself doesn't set the same flags and counters for Cargo Ships as it does for Cargo Trains.

3) Improve the through-put of Cargo Trains and Cargo Ships by optionally forcing them to despawn as soon as they deliver their cargos. This has the added benefit that you can always tell exactly where a given cargo originated;

4) Provide more granular control over whether vehicles automatically despawn during road traffic congestion;

5) Optionally eliminate most dummy traffic (there are two cases that are not covered);

6) As a bonus "cheat" ... optionally force delivery trucks (of the pre-Industries DLC sort), garbage trucks, and hearses to despawn once they have completed their task and are returning to their source building.

USING the 'Despawn Manager' Features
As with any mod, the 'Despawn Manager' mod must first be enabled in the Content Manager.

After enabling the mod, go to its Options panel to choose which of its individual VehicleAI patching "modules" to employ.

When a VehicleAI patching "module" is activated (or deactivated), other functionality options for that vehicle type are enabled (or disabled).

The options you select persist; for Windows, the selected options are saved to a file at "C:\Users\[user-folder]\AppData\Local\Colossal Order\Cities_Skylines\ModConfig\DespawnManager.xml"

Aditionally, most functionality options may be activated or deactivated in-game from the Options panel, with the activation or deactivation having immediate effect.

Selecting to have the 'Despawn Manager' mod "patch" a VehicleAI not currently selected takes effect upon reloading a saved game; that is, it doesn't require going back to the Main Menu or the Desktop to enable the 'Despawn Manager' mod to "patch" a given VehicleAI.


USING 'Despawn Manager' WITH EXISTING SAVES
Assuming that the mod is compatible with your DLCs and other mods, it will be safely usable with existing saves. It doesn't write any data to the save, so it may be enabled or disabled at any time.

COMPATIBILITY WITH TM:PE
I play Cities:Skylines using Traffic Manager:President Edition, and I always have its "Disable (Congestion) Despawning" option set to 'disabled'.

In my testing of the 'Despawn Manager' mod, I saw no conflict with TM:PE. TM:PE's "Disable (Congestion) Despawning" option applies globally to congested road traffic, whereas the granular options of the 'Despawn Manager' allow for *exceptions* to TM:PE's global option.

Edit:
As I said earlier, I have to play an *old* version of the game, and consequently I use an old version of TM:PE. So, perhaps that’s why I didn’t see any conflicts between the two mods.

SADLY
Sadly, the two cases of dummy traffic which the 'Despawn Manager' mod cannot eliminare are:

1) Passenger Car dummy traffic. The DummyTraffic flag is not set for passenger cars, so I cannot distinguish dummy traffic cars from non-dummy traffic cars.

2) Passenger Trains leaving the station with 0 passengers. To force such trains to despawn, the mod must be able to:
- determine the number of passengers on the train as it is leaving the station;
- distinguish intercity passenger trains from those belonging to intracity public transit routes.
As I don't know how to make these two determinations, I cannot code the mod to despawn the correct empty trains.

HEARTBREAKINGLY
Even more sadly, I cannot add minimum cargo load thresholds functionality for Cargo Ships, as the base game itself doesn't set the same flags and counters for Cargo Ships as it does for Cargo Trains.
83 Comments
꧁Yallis꧂ 16 Jun, 2023 @ 7:45am 
hello, the update of the mods, it will be when
panamaus 7 Nov, 2022 @ 4:35pm 
Maybe it's time for a new PC, Ilion. The Green Cities update was released over five years ago.
nahuelma97 9 Oct, 2022 @ 4:33pm 
I see. Any plans for the future to remake it or something or should we just assume this is on an indefinite hiatus?
Ilion  [author] 9 Oct, 2022 @ 4:31pm 
I'm sorry that I *can't* update this to be compatible with Promenades -- ever since the Green Cities update, the base game (no DLC) locks up on my PC.
Darkangel 9 Oct, 2022 @ 2:17am 
WHAT A SHAME YOU DIDN'T UPDATE THIS TO PROMENADES LION! This was a great mod to get rid of dummy traffic especially the trains when i take of the despawn and then suddenly train queue 5 miles long because of masses off dummy trains not having anything to do with my city or importing trains when i don't want them and want my own goods instead of paying for imports on goods trains.
Darkangel 9 Oct, 2022 @ 2:11am 
Despawn Manager [Steam ID 2306554537] by Ilion

- Unsubscribe would be wise. This has major issues:
* Not working with delivery vehicles from the Industries and Sunset Harbor DLCs.
* Settings menu getting messed up (close and reopen settings might help).
* Potentially incompatible with all mods that modify the Vehicle AI.
- Unsubscribe either this one or the following mod it's incompatible with:
* [Steam ID 2489276785] TM:PE 11.7.0.1 TEST
jisuai 6 Sep, 2022 @ 10:17pm 
I made a mistake while writing it

log error messages
despawnmanager :did not patch vehicle info for type PassengerCarAI

after
162log err
Ilion  [author] 5 Jun, 2022 @ 4:50pm 
I hope this mod helps you.
nahuelma97 4 Jun, 2022 @ 5:33pm 
Lol I just read the whole thing again. I was probably tired and needed a TL;DR version. I read it now and was able to understand. I think I'll give it a go if what I'm working on right now as a possible solution doesn't work.

Btw, if you hadn't responded and I hadn't enabled notifications, I wouldn't have been able to find this mod again. I tried looking for it on my history and couldn't find it at all and was bummed out. I'll add it to favorites now so I can find it later. I've the latest everything, so I'll post here if I subscribe to it and find any problems. Hopefully everything turns out great :D
Ilion  [author] 2 Jun, 2022 @ 8:07pm 
I don't know. I was reporting something I was *told*.

You could give this mod a try abd run the game for a few months. Then, if it turns out it causes you a problem, just restart at the older saved game.

Another idea is to use one-way roads anor/or TM:PE vehicle restrictions to prevent trucks being able to return to their points of origin.