Remix.run Logo
JamesTRexx an hour ago

I made version 12.2 my programming hobby project. First time I tackled it years ago was to have it run at real time instead of the default fast pace (even with the day length patch). Worked great including a feature to really schedule routes and have working yards for vehicles to wait. But when I wanted to change internal mechanics to add other features I hit the spaghetti code wall several times (and the code after 12.2 is just more complex with every version bump).

Took a break from it for a while and picked it up again, this time by not doing anything much feature-wise but pulling the code apart and de-C++-ing it. Bit by bit building a categorised code tree with single functions per file, deconstructing classes to plain functions and data structs, with the goal to convert from C++ to clear C. And then one day consolidate code to have for instance the same diagonal road options as current train tracks.

Might be pointless and take a long time to finish, but it's comforting to turn something overly complex into simple, small pieces and also create a unique code formatting style to visualise elements of a line of code for easier reading. Another fun part is reading about data design and coming up with a custom data container to replace the std::vector uses.

netsharc 12 minutes ago | parent [-]

How fast do the trains and buses run on "real time" speed?

I suppose a 15 meter bus going 50km/h travels roughly its own length (13.40 meters to be exact) every second, so it takes 3 seconds to pass a grid square - checking out a YouTube video, it seems that's already the speed right now!