Page 20 of 20

Re: ChooChoo, a train network AI

Posted: 05 Mar 2024 13:32
by Captain Rand
Michiel wrote: 04 Mar 2024 20:47 By popular request (hi Pete!) ChooChoo now also supports left hand traffic on double tracks!...........
This is awesome!
Thank you so much!

Pete.

Re: ChooChoo, a train network AI

Posted: 06 Mar 2024 22:42
by Michiel
Michiel wrote: 25 May 2010 20:29 It should really have a lake detector... the pathfinder is still slow when it tries to find a route across or around a large body of water. Never mind, just thinking out loud :) It's fun giving it infinite money and watching it spew forth all over the map :)
It's taken almost 14 years, but today I added... a lake detector! :shock: :shock: :shock:

It's dead simple really, but the idea only came to me the other night. Consider the following mockup:
lake-detector-small.png
lake-detector-small.png (519.04 KiB) Viewed 1999 times
When trying to find a spot for a station, it'll look at the four edges of the rectangle defined by the start (crossing exit) and destination (station entrance). It checks the tiles along each edge and if it finds a long run of water (longer than the maximum bridge length it is allowed to use) it considers that edge "blocked by water". However, it will only consider this problematic if two parallel edges are blocked. In that case, it will declare it an unviable spot for a station, and look elsewhere.

This may lead to some missed opportunities (there might be a perfectly fine bit of land in between the edges), but that's fine - the network building algorithm tends to sprawl its tendrils across the map anyway. It's much better than ChooChoo sitting there, pathfinding for 20 years.

I still need to do some more testing and tweaking, but expect another release soon :D

Re: ChooChoo, a train network AI

Posted: 07 Mar 2024 11:29
by Michiel
New version with lake detector released!

Re: ChooChoo, a train network AI

Posted: 14 Mar 2024 19:43
by Michiel
Another update! After the initial concept, I never gave ChooChoo's expansion algorithm much thought. But I've now changed it so that for each crossing it is extending, it'll keep going in the same direction as far as it can (if it can place an additional crossing between its current position and the next station). Expansion of the side branches is put at the end of its task list. That should result in deeper networks with much better use of space, with mainlines extending across the map and side branches filling the remaining space, like the veins of a leaf.
leaf.png
leaf.png (673.52 KiB) Viewed 1874 times
Of course, this structure is greatly perturbed by the randomness of the actual map.
choochoo-network-anim.gif
choochoo-network-anim.gif (92.5 KiB) Viewed 1882 times

Re: ChooChoo, a train network AI

Posted: 15 Mar 2024 21:46
by xarick
Something's not right.

Re: ChooChoo, a train network AI

Posted: 18 Mar 2024 18:53
by Michiel
Thanks, I'll take a look!

Re: ChooChoo, a train network AI

Posted: 08 Apr 2024 21:41
by Michiel
xarick wrote: 15 Mar 2024 21:46 Something's not right.
Unfortunately I was unable to deduce the problem from your screenshots or savegame. For the next version, I've improved the code that captures the error, so I'll be able to get the info I need from a screenshot, but I have some testing to do for the next release.

Re: ChooChoo, a train network AI

Posted: 12 Apr 2024 11:32
by xarick
Is this more helpful? Seems to happen when creating a new network. Sometimes it happens early on, sometimes takes some years before it happens.