More PathUnits 1.1.3

If you liked this item, please rate it up on Steam Workshop page.

Authors: algernon, Chamëleon TBN

Last revision: 10 Mar at 09:04 UTC (8)

File size: 156.49 KB

On Steam Workshop

Description:

Doubles the number of PathUnits (used for vehicle and citizen instance pathfinding) available in the game (from 262,144 to 524,288).

Just enable and start a new game, lor load an existing one – no other steps are needed.

IMPORTANT NOTE

It’s like using any other limit increasing mod (More Vehicles, More CitizenUnits, etc.) – saves made with this mod active WILL NOT BE RELOADABLE WITHOUT IT.

THIS IS NOT SOMETHING THAT CAN BE UNDONE. FUNDAMENTALLY. Once you’ve got a quart, there’s just no way of fitting it back into a pint pot.

Remember: backups are your friend!

IMPORTANT: AFTER FIRST ENABLING THIS MOD, RESTART THE GAME BEFORE LOADING ANY SAVES/STARTING A NEW CITY

Otherwise you’ll probably get ‘Array index out of bounds’ errors if you use TM:PE (which you almost certainly are).

Mod compatibility

There are currently no known incompatible mods. Note – this does not mean that they don’t exist, just that if they do, they haven’t been discovered yet!

Specifially compatible with TM:PE.

What are PathUnits?

PathUnits are the game’s internal data structure for performing pathfinding (getting from A to B). Getting a single vehicle (or citizen) from its origin to its destination will require a number of PathUnits (depending on the length of the required route).

What happens when the game reaches the PathUnit limit?

Unfortunately, unlike some of the other limits, the game doesn’t notify you when you’ve reached the PathUnit limit. A lack of PathUnits means that the game can’t direct vehicles or citizens to their destinations; public transport stops working, city services (including fire engines!) can’t spawn properly, and cargo deliveries stop happening. By the time you’ve noticed you’ve probably got multiple abandoned buildings.

Stuck cims and vehicles

Sometimes in the game, cims and vehicles can stometimes become ‘stuck’, and start spamming pathfinding requests, which uses up a lot of PathUnits.

TM:PE includes a function (under the ‘Maintenance’ settings) to reset stuck cims and vehicles; if you’re seeing very high PathUnit usage, doing this is worth a try.

Performance impact

Care has been taken to minimise performance impact; there should be no noticeable performance impact from the mod itself. Naturally, if there are more PathUnits in operation, there may be more pathfinding activity going on, which will have it’s own performance impact – but that’s not the mod, it’s just the game doing more work now that it can.

It’s a bit like the Realistic Population 2 mod – there’s no performance impact from the mod itself, but if the mod is giving you a bigger city with more citizens, then naturally things will run a little slower than before….

Modders

Please don’t assume fixed array sizes in your mods; for PathUnits, don’t use hardocded array sizes (including using PathManager.MAX_PATHUNIT_COUNT). Instead, check array sizes at runtime with Singleton<PathManager>.instance.m_paths.m_size. This is especially important when copy-pasting decompiled game code.


Meta

As above – permanently changes the savefile. Saves made with this mod will not be readable without it.

This mod uses Harmony[github.com] version 2.2 by Andreas Pardeike via the Cities Harmony mod by boformer.


Source code

[github.com].


Translations

[crowdin.com].
Please leave a message below if you’d like me to add another language on CrowdIn.


[ko-fi.com]