Jump to content

Multi-thread Performance improvements


Recommended Posts

A question for the devs: Are there any plans for major performance improvements?

I believe that Spaced Out gives you an opportunity to run the simulation for each map in a separate thread. Is this currently feasible with how your code base is structured?

Is there anything the community can do to help out? Is this simply a funding issue, that you don't have a programmer to spare for a "feature" that will bring in no extra revenue?

To me, late game performance is THE biggest issue with this game. It would be nice to hear that there's some kind of roadmap to address the problem.

Link to comment
Share on other sites

They actually did quite a few performance improvements but at the same time they made some things run worse. It`s a work in progress. Possibly when the dlc is done it will run a bit better.

As for multithread i believe they made the pipes work in separate threads a while ago.

Link to comment
Share on other sites

24 minutes ago, Sasza22 said:

They actually did quite a few performance improvements but at the same time they made some things run worse. It`s a work in progress. Possibly when the dlc is done it will run a bit better.

As for multithread i believe they made the pipes work in separate threads a while ago.

That gives me dejavu from Factorio - after some attempts at threads they moved belts and pipes to separate threads.
ONI with Spaced Out has much better potential I think. Splitting the map into multiple maps would allow for very good parallelism with sync points on stuff like rockets and teleporters. (And well that 8/16 CPU could get to do some work finally on more threads)

Link to comment
Share on other sites

2 hours ago, MilesLong4200 said:

I believe that with Spaced Out, all of the maps are actually just right next to each other, separated by Neutronium (and you can't scroll). So in the end it's one big map.

Miles, that doesn't preclude multi-threading. The complexity comes in when you need to operate on the SAME data structures at the same time. You can access different parts of data concurrently otherwise.

For example, let's say you wanted to create a multi-threaded "gas movement" pass on a single map. You could have 1 thread do the top half excluding a line in the center, and another thread do the bottom half. You then get a mutex lock where 1 thread finishes off the final center line with shared data, with the lock guaranteeing that the 2nd thread isn't altering data as you go.

Spaced out gives you great natural boundaries where you can just do your own thing in each thread, and just sync up at the end to keep the tick counter consistent. You never have to run path finding between worlds. You never have gas or temperature interacting between worlds. Any world to world interaction can be done on a slow schedule. ie: You're not getting cargo bullets landing 60 times a second. There's lots of opportunities for massive boosts in parallel processing.

Link to comment
Share on other sites

there is one thing, game main source can be run only 1 thread.

unity basic commands by default just not work at inside multi thread.

factorio had open hands for make multi thread as i understand tools what they use not have limitations.

 

there is possible make some stuff at multi thread but not everything

that midi test mod what you seen by me in forum, for that i write some multi thread stuff as i needed run this stable as possible.

 

Link to comment
Share on other sites

1 hour ago, Engival said:

Miles, that doesn't preclude multi-threading. The complexity comes in when you need to operate on the SAME data structures at the same time. You can access different parts of data concurrently otherwise.

For example, let's say you wanted to create a multi-threaded "gas movement" pass on a single map. You could have 1 thread do the top half excluding a line in the center, and another thread do the bottom half. You then get a mutex lock where 1 thread finishes off the final center line with shared data, with the lock guaranteeing that the 2nd thread isn't altering data as you go.

Spaced out gives you great natural boundaries where you can just do your own thing in each thread, and just sync up at the end to keep the tick counter consistent. You never have to run path finding between worlds. You never have gas or temperature interacting between worlds. Any world to world interaction can be done on a slow schedule. ie: You're not getting cargo bullets landing 60 times a second. There's lots of opportunities for massive boosts in parallel processing.

Absolutely agree. That's a great breakdown.

Link to comment
Share on other sites

latest oni mod what i write is Network debugging, basically what it does i can run oni debug info inside other pc without loss allot performance inside main game

at there i plan add multi thread as well but for now it runs in singe good too.

that allows me  see weird stuff happening at game in live mode

Link to comment
Share on other sites

Well factorio is optimized to such insanity that your bottleneck is not often CPU single core speed but CPU cache speed and RAM speed. Which is insane since they made instructions so stupidly small that CPU have hard time feeding more instructions than solving them.

Ram speed in factorio can give you up to 40% more speed. Crazy!

https://imgur.com/a/JF1LR

Also we need multithreading in ONI and no multiplayer.

Link to comment
Share on other sites

ONI also has performance gains from RAM speed. It has nothing to do with "feeding instructions to the CPU" though. My large end-game map has ONI using over 12GB of memory. Those allocated structures aren't just taking memory for decoration, the game actively uses them. There's simply a speed limit to how fast you can crawl through 12GB of structures. I suspect there's some performance gains to be had by optimizing memory usage a bit.

I also don't understand your multiplayer comment. So if you don't want multiplayer, nobody should have it? What if someone else doesn't want multithreaded improvements? I guess we'll drop that idea too. If multiplayer is added, does it somehow make your life worse?

Multiplayer should be a business decision by Klei. Personally, I would drive 1 more sale to a friend who's currently not picking up ONI, but would if we played it coop. How many others in the community would drive another sale or two. I honestly don't know if it would be break-even for Klei.

Link to comment
Share on other sites

3 hours ago, Engival said:

ONI also has performance gains from RAM speed. It has nothing to do with "feeding instructions to the CPU" though. My large end-game map has ONI using over 12GB of memory. Those allocated structures aren't just taking memory for decoration, the game actively uses them. There's simply a speed limit to how fast you can crawl through 12GB of structures. I suspect there's some performance gains to be had by optimizing memory usage a bit.

I also don't understand your multiplayer comment. So if you don't want multiplayer, nobody should have it? What if someone else doesn't want multithreaded improvements? I guess we'll drop that idea too. If multiplayer is added, does it somehow make your life worse?

Multiplayer should be a business decision by Klei. Personally, I would drive 1 more sale to a friend who's currently not picking up ONI, but would if we played it coop. How many others in the community would drive another sale or two. I honestly don't know if it would be break-even for Klei.

Sadly it's a one or the other kind of deal most likely.
Both multiplaayer and multithreading are complex and join of those two ends up being problematic. Factorio went through that and some optimizations were done but some were to complex to be able to keep detriminism and gain performance that way.

Link to comment
Share on other sites

There is also the games minimum specs to consider, 2 cores ( can be one physical and 1 virtual, old cpu`s ). Its a tough developer job, as player basically soon will show up with consumer cpu`s ranging from 2-64 "cores", whatever is meant with "core" by the manufacturer.

The industry can soon mix in baby "cores" + play the virtual "cores" marketing game :lemo: IMHO the Industry is keen to head for 32/64/128 "cores" for standard consumers, an ongoing competition to write the biggest numbers big on to the package. Most consumers ride the marketing gag and have no clue what they are actually really buying, as long as it "works".

Multiplayer design also has to consider min spec people playing together with monster spec folks.

Anyways, time for a coffee ...Damn no donuts in range :(

:cupcake: NEED DONUTS !

24 real donuts, ready to eat

image.png.636c84c2722f5279f4a9267a98bcffac.png

24 donuts doubled by hyperthreading ( your imagination )

image.png.636c84c2722f5279f4a9267a98bcffac.png

= 48 donuts advertising...ONI can only eat one and a half, then the ONI belly is full

image.png.c6c1529b7cad93876568f852c8184f36.png Klei needs to become a donut munching monster !

Link to comment
Share on other sites

Can't we just get more performance? This game makes me quit way before I even start to explore all new cool stuff due to lag.

Just find whatever makes the game lags hard and dumb it down, we play games for fun not for totally accurate physics simulations, that's what PHDs on supercomputers do.

Link to comment
Share on other sites

Going by the typical development cycle it should be something like:

  1. Add features
  2. Fix bugs and refine features
  3. Optimize for performance and stability
  4. Release

Right now we seem to be around the start of (2), considering the DLC as a whole.

As Spaced Out is in Early Access fixing bugs happens in every stage, but optimization will usually still only come after the core features have stabilized.

Link to comment
Share on other sites

1 hour ago, cpy said:

Can't we just get more performance? This game makes me quit way before I even start to explore all new cool stuff due to lag.

Just find whatever makes the game lags hard and dumb it down, we play games for fun not for totally accurate physics simulations, that's what PHDs on supercomputers do.

avoid digging as much as possible, brick up old useless areas, avoid hiring more than 10 dupes and restrict their pathfinding as much as possible. I have a some late game saves on spaced out that still run at 3-4x speed by following these tricks.

Link to comment
Share on other sites

6 hours ago, Timotheeee1 said:

avoid digging as much as possible, brick up old useless areas, avoid hiring more than 10 dupes and restrict their pathfinding as much as possible. I have a some late game saves on spaced out that still run at 3-4x speed by following these tricks.

Excuses are not acceptable. Can't we just get more performance?

Just closing off rooms should be fine right? No need to fill up gas right?

 

6 hours ago, Yobbo said:

Going by the typical development cycle it should be something like:

  1. Add features
  2. Fix bugs and refine features
  3. Optimize for performance and stability
  4. Release

Right now we seem to be around the start of (2), considering the DLC as a whole.

As Spaced Out is in Early Access fixing bugs happens in every stage, but optimization will usually still only come after the core features have stabilized.

Thing about multithreading is that you do that FIRST or you will ruin your whole year if you do this at the end. It means MAJOR and I really mean big major code rewrite if you decide to multithread. So either you do it from beginning or in next game.

Link to comment
Share on other sites

More speed optimizations over the next few years would be handy :p

I have reasons to currently stay limited to one colony ( at least for the first 4000 cycles ), still digging...Dorky dork !

Still no crash, touch wood :afro:

image.thumb.png.74d73973a3ca044b0f281c42a5569302.pngimage.png.e2539b456e15dad0a44658dca8ff2f79.png

Link to comment
Share on other sites

1 hour ago, babba said:

More speed optimizations over the next few years would be handy :p

I have reasons to currently stay limited to one colony ( at least for the first 4000 cycles ), still digging...Dorky dork !

Still no crash, touch wood :afro:

image.thumb.png.74d73973a3ca044b0f281c42a5569302.pngimage.png.e2539b456e15dad0a44658dca8ff2f79.png

I do hope you are blocking access to most of those ladders or you are making a pathfinders nightmare :D

Link to comment
Share on other sites

3 hours ago, Orzelek said:

I do hope you are blocking access to most of those ladders or you are making a pathfinders nightmare :D

I will glady present you my future city tube design in a few months...if...if I make it past cycle 4000 :rolleyes::beguiled::lol: In the last 1 year Klei was never stable enough to fully get there. Around 14 months ago there was a 2 month time window for the game, where the game was super stable to do "everything". Then the DLC arrived with us. Prayyyyinnnggg !

If they someday decide to undertake some new threading adventures here and there, then I expect the game to be totally kaputt again for a year or so ( for long term save-game players ).

A 2nd big colony like "with everything super max" will probably always play like glue, at least till...lets say 2025.

Currently played 20 hours or so on the fresh save, the longest one save-game which worked for me in the past...was something like 100 hours or so. Over recent years its most times save game crashes, before playing in glue. I do wonder how the game will run in 2025. :p Prayyyyinnnggg !

A save game with Klei game content added in the last 12 months + stress under full load playing thousands of cycle in survival mode, reveals stress crashes which then creep out. Prayyyyinnnggg ! :???:

Hope the game doesn`t crash collapse again, once I get to rockets. Prayyyyinnnggg  !

image.png.2f68d94e5ef0af8783fbaf2b43d7cb30.png Its a good idea to re-re-re-design a map, once a save is down to 14 FPS

Link to comment
Share on other sites

8 hours ago, cpy said:

Thing about multithreading is that you do that FIRST or you will ruin your whole year if you do this at the end.

Yeah true, i was replying more to the text of the post than the title.

I'm not sure why multithreading is relevant though, the game seems to use all my CPU cores pretty evenly.

Link to comment
Share on other sites

20 minutes ago, yoakenashi said:

My potato of a computer still runs ONI at 69 threads. So I don’t understand why players say it is only single threaded:


image.thumb.jpg.93db5bcb793e2a9fbc5e6980ad664978.jpg

Obviously it is multithreaded.

pentium 4 with one core have threats too. that is not really same thing what people talk about.

this game have multi threats but i not see its 100%

Link to comment
Share on other sites

4 hours ago, gabberworld said:

intel?

Intel® Core™ i7-8700 CPU @ 3.20GHz × 12

I don't have any saves that really push it, but every time i've checked it the load seems pretty evenly distributed. The exception being save/load which only uses one core.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
×
  • Create New...