I think I've built myself into a corner.... well 4.

Post all other topics which do not belong to any other category.
Post Reply
PhatzDomino
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Jun 02, 2017 6:15 am
Contact:

I think I've built myself into a corner.... well 4.

Post by PhatzDomino »

So I've started to build my first large factory and I've hit a wall with rapidly falling FPS/UPS. From a bit of research I've done, it seems to be because of my train system being a massive loop. As you can see from the screenshot a redesign at this point (300+ hours) is looking impossible unless some of the more experienced among you have any ideas?

I know belt optimisations are on the cards but are there any coming for trains also? If not, has anyone got any tips on queezing some extra FPS/USP out of my system?

Image

evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by evildogbot100 »

Press f5 and see the train update value. I heard that trains are not as significant computationally.

PhatzDomino
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Jun 02, 2017 6:15 am
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by PhatzDomino »

evildogbot100 wrote:Press f5 and see the train update value. I heard that trains are not as significant computationally.
It's fluctuating between 1.000/0.310/23.310 & 4.000/0.310/23.310


I assume thats the number you're after?

evildogbot100
Fast Inserter
Fast Inserter
Posts: 152
Joined: Sun Dec 18, 2016 3:02 pm
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by evildogbot100 »

It seems pretty significant, cutting away unused areas might work for a while.

User avatar
ledow
Long Handed Inserter
Long Handed Inserter
Posts: 97
Joined: Sat Sep 24, 2016 3:00 pm
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by ledow »

A* pathfinding is expensive. And every track section is another node to check. That sounds about right, because even a moderate amount of nodes can bring a top end computer to its knees.

Even bots just aim for their destination without obstacles, but trains have to do all sorts of pathing.

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by Frightning »

I've long wondered about how train pathing works 'under-the-hood'. Because I would expect it to be extremely computationally efficient compared to things like belts or even bots, but it apparently isn't in some cases? I would think the smart way to do it would be to pre-compute and store a directed graph style representation of the rail network, and then use that, along with other information (which blocks are occupied or not, and such) to choose paths for trains running on the network.

SQLek
Inserter
Inserter
Posts: 45
Joined: Tue Jun 28, 2016 10:23 am
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by SQLek »

I think this factory represents edge case.

Lest hypothesize algorithm similar to A*.
  • We start on current track block.
  • We add block that are accessible to our block list.
  • If we hit destination station, job done.
  • If not, we repeat for *some* newly discovered blocks.
About some:

We can check all and get slow but always best result.

We can check N best but it will give strange results with stations that are of the same name but in different paths.

We can check best and every alternatives that are no worse than lets say 75% of best. Seams great but will give much more recurrence if You have many paths with similar score.

And now tell how many "almost best" paths You see in Your base from left up to bottom right corner.

Did i see correctly that You use runabouts on grid intersection? Hard to see from map. If yes then You can replace them with crossings, should help. How much i don't know.
viewtopic.php?f=5&t=50025 for some inspirations

User avatar
Xterminator
Filter Inserter
Filter Inserter
Posts: 981
Joined: Sun Jun 15, 2014 4:49 pm
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by Xterminator »

While the trains do seem to be a significant amount, there are quite a few other things you can do to increase overall performance. :)

- Keep your robot networks small and separated opposed to massive networks that stretch across multiple production areas.
- Solar Power over Nuclear or steam. I'm guessing you're using Nuclear/Steam or an infinite power source because I don't see any solar fields. However, solar essentially all combines into one entity so is almost completely non-existent as far as game performance is concerned. Whereas Steam and Nuclear can get pretty substantial at larger scales due to fluid/pipe stuff and just the sheer amount of entities that aren't all combined together. By the way, how much power are you using?
- Similar to the first point, use as much direction insertion as possible to avoid robots having to transfer as much stuff around.

Back to the trains thing, having your a system as large as yours as one big loop definitely can't help things. Perhaps making it not all one huge loop could help a fair bit. :)

Hope some of that helps!
Image Image Image

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by ratchetfreak »

ledow wrote:A* pathfinding is expensive. And every track section is another node to check. That sounds about right, because even a moderate amount of nodes can bring a top end computer to its knees.

Even bots just aim for their destination without obstacles, but trains have to do all sorts of pathing.
A* with a good heuristic is pretty fast. A square grid like in the OP is actually one of the best case scenarios for A* assuming the heuristic isn't too optimistic.

A* works by expanding each node that has the best potential path calculated by adding the cost from the starting point (which is known exactly) to the heuristic which is the best guess the path will take from there.

mergele
Fast Inserter
Fast Inserter
Posts: 158
Joined: Sat Aug 20, 2016 5:45 am
Contact:

Re: I think I've built myself into a corner.... well 4.

Post by mergele »

Kill the biters. At the point in the game you are at they are irrelevant anyways. Unless you want some achievements just cheat all the biter and their nests dead. Should give you quite a bit of UPS buffer.

Post Reply

Return to “General discussion”