Train movement taking a lot of UPS in my megabase

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
Steen
Burner Inserter
Burner Inserter
Posts: 16
Joined: Wed May 10, 2017 6:12 pm
Contact:

Train movement taking a lot of UPS in my megabase

Post by Steen »

I built a 3.3k spm megabase (latest version of factorio) and I am playing right now on 30 fps and 30 ups

My computer specs are: gtx 980, have an i7 5820k and 16gb

So the problem is that of those 30 ups a lot is used for trains (using the 'time-usage' tool ingame). A guy did a performance test for me:
Image
This test says that 8.3 ups is used to move the trains. Almost every other megabase i've seen uses a lot less than that.

There are 327 trains on the map with 3 different sizes (3loc-10w-3loc, 2loc-4w-2loc and 1l-1w-1l) they all run on rocket fuel around a big mainline. All these things don't really explain why the train movement uses that much ups, so it has to be something I have no control about, so my question is can you guys see what is going on here?
Image
In the attachment i dumped my save file + mod map (I don't use every mod in that map, just a few).
Attachments
Save.rar
(65.58 MiB) Downloaded 189 times

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Train movement taking a lot of UPS in my megabase

Post by Zavian »

I'm going to suggest posting your save to viewtopic.php?f=5&t=17501. (Ignore the bit in the first post about 0.12.16. I'm pretty sure Rseding91 is now interested is bases with problems in latest 0.15).

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: Train movement taking a lot of UPS in my megabase

Post by Rseding91 »

You have 366 trains totaling 1591 cargo wagons, 1463 locomotives and 49 fluid wagons and each tick they move (assuming they aren't stopped).

That's simply what trains take to move. There's nothing you can do to reduce CPU usage of them except use less trains.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2915
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Train movement taking a lot of UPS in my megabase

Post by Optera »

If you want to save UPS by reducing trains you can give LTN a try. (Link in signature)
I'm able to reduce the number of trains by more than 50%.

PS: I'd be very interested to see how much UPS you get with LTN managing all trains in that base.

quyxkh
Smart Inserter
Smart Inserter
Posts: 1028
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: Train movement taking a lot of UPS in my megabase

Post by quyxkh »

Rseding91 wrote:You have 366 trains totaling 1591 cargo wagons, 1463 locomotives and 49 fluid wagons and each tick they move (assuming they aren't stopped).

That's simply what trains take to move. There's nothing you can do to reduce CPU usage of them except use less trains.
Would you consider aggregating enroute trains that are in no danger of interaction into a single chord-lengths-from-a-point-on-a-static-path entity? Seems to me you can check for collision and cursor picking and inserter interaction by keeping occupied-rail-segment data updated, so long as there's nothing interesting near any occupied rail segment (and inserters aren't interesting if the train's moving fast enough) turn the train into a single cheap-to-process entity that can be decomposed into its originals when that changes.

edit: really, you don't even need to do that. Leave everything just as it is now, but do all the movement and fuel consumption processing at once for the train, bypassing all individual carriages, via the existing train entity, since those entirely depend on the train's lead point, speed, acceleration, mass, chord length vector and path. There's only one of each of those values for the entire train. I don't know how finicky you are about fuel consumption, but caching energy supply/density and max output with the chord lengths would let you get as precise as you want before distributing the updated values. Is the prospect of a load reduction that scales with train length enough to get a hearing? I make it (vehicle length, connection length, energy supply, density and output rate) plus five for the train as a whole, the rail paths are already being stored.

Post Reply

Return to “Technical Help”