Multi-core support

Started by Nickname34, January 19, 2016, 12:43:34 PM

Previous topic - Next topic

Vas

We modders add most of the content to the game though.  Right now there isn't much PR/Sales going on I don't think because the game isn't on steam yet and most people wan the game on steam before they buy it.

I've had laggy gameplay without mods.  It happens often late game with huge raids and such.  Its easier to see when you have a heavily modded game though because we are using things that are available in the game's code already just in a more advanced or larger way.

Sure, we could downgrade to MS DOS and have a speed increase too.  Lets do that!
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

Fluffy (l2032)

I wouldnt say mods provide most of the content, but yes, a large amount of content is provided through mods. Problem with that is that modders don't necessarily have the same coding standards as Tynan does, and some mods are known to be quite horrible performance wise. I would hope any reasonable person understands that mods slow down a game, even the Steam crowd. In the same line of thinking, because of the game being so moddable, I don't think we can reasonably expect it to "always run smoothly". You just don't know what a modder/player decides to add (e.g. adding a building that scans ~500 cells for their contents 60 times per second..).

I did say 'remove [...] obsolete code'. MS-DOS is very much obsolete. Modern OS's have a vastly improved kernel, and every once in a while, doing a spring cleaning is not a bad idea. (Just like you should probably tone down or delete that shield mod).


Vas

The game uses quite a horrible system for mods.  We have to over writ every single thing in a Def when we change it.  No two people can modify the same def.

Example: I can't alter Hydroponics to be 1x1 in size, while someone else changes the hydroponic's HP to 7000, while someone else changes the materials used to make it.

Starbound lets multiple mods edit the same item and it work so long as the modders did it right using an _merge _overwrite method.

Ok, lets go to a modern day DOS, according to you, that would be an improvement.  Delete all UI, everything in the system, go to a modern day DOS using a new age kernel.  Like Power Shell.  No more UI of any kind.  Imagine what kind of speed boost you get then!
Honestly, my 4 year old Windows 7 laptop with a 2-3 year old operating system well used and all, cloned several times, boots up faster than my new 2 month old Windows 10 laptop with hardly anything on it yet.  And no, don't claim it's the hardware specs because this machine can run circles around my old laptop.  Just look at the specs in my sig.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

skullywag

my surface pro 3 i7 windows 10 boots from cold in < 2 seconds, i press power i see a flash then the logo and spinny thing goes for a second and then im on my lockscreen. Just saying.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

Fluffy (l2032)

Sure you can modify the same def. Create a dll and go to town. I do it all the time to make sure I don't just catch/alter vanilla defs, but all modded defs of a kind.

And yes. Generally speaking, when you remove features you don't need, your system will speed up. There's a reason some people prefer working with command line interfaces, and that there's server versions of many OS's. Wether or not your particular system is faster or not is anecdotal, and fairly irrelevant.

Fluffy (l2032)

@zombie; nope. Whole defs are overwritten.

skullywag

The last def loaded lives whole.
Skullywag modded to death.
I'd never met an iterator I liked....until Zhentar saved me.
Why Unity5, WHY do you forsake me?

StorymasterQ

Quote from: skullywag on February 11, 2016, 02:44:44 AM
The last def loaded lives whole.

That sounds like a weird pass phrase in a weird spy movie. An indie one, at that.
I like how this game can result in quotes that would be quite unnerving when said in public, out of context. - Myself

The dubious quotes list is now public. See it here

Vas

Quote from: skullywag on February 10, 2016, 10:52:06 AM
my surface pro 3 i7 windows 10 boots from cold in < 2 seconds, i press power i see a flash then the logo and spinny thing goes for a second and then im on my lockscreen. Just saying.
A minimalistic machine with nothing installed, right?  Isn't a surface pro a performance tablet or laptop?  That doesn't have a GPU or uses an integrated one that is.  Something that is incapable of doing much.  Mine is a hard core gaming machine with lots of things installed.  Not all simultaneously running of course.  Steam, Skype, and my security/maintenance tools all boot up with the machine.  Even more things boot up on my Windows 7 hard drive because it's a 4 year old system with tons more stuff installed and 4 years of preferences and settings on it.  It boots up faster than Windows 10 does.

Quote from: Fluffy (l2032) on February 10, 2016, 03:41:18 PM
Sure you can modify the same def. Create a dll and go to town. I do it all the time to make sure I don't just catch/alter vanilla defs, but all modded defs of a kind.

And yes. Generally speaking, when you remove features you don't need, your system will speed up. There's a reason some people prefer working with command line interfaces, and that there's server versions of many OS's. Wether or not your particular system is faster or not is anecdotal, and fairly irrelevant.
Not all of us can create DLLs and advanced mods like that.  Some of us can only do XML edits.  Starbound realized that and made it easy to mod the files and allowed multiple people to edit the same file via _merge and such.

Not all of us can use command line interfaces because we aren't knowledgeable enough or don't have the memory capacity to remember every command or argument to put in.
Click to see my steam. I'm a lazy modder who takes long breaks and everyone seems to hate.

Toggle

To be fair though, you honestly can't argue and complain about the xml overwriting others if you're incapable of making dll's. That's the solution, and I doubt Tynan is focusing to make modding ultra easy for everyone.
Selling broken colonist souls for two thousand gold. Accepting cash or credit.

laser50

Alphas aren't about optimizations though, which I suppose is what multi-core support could be categorized as.
Game runs fine on a Dual-core 2.1Ghz AMD processor (A very old one, laptop processor even), also had it run fine on a 2.6 Ghz Core2Duo..

Optimizations come later, any way.

Fluffy (l2032)

I feel like this topic is starting to devolve into random arguments. I like that.

First, the generic point. Adding features to any piece of code will generally make it slower. Those features may be useful or necessary to you, but they will make the code slower. A GUI is pretty much mandatory for most PC-users, but the computer would run faster without it. (Whether it would be more efficient in daily use is an entirely different matter.)

Second, the specific point about win 10 vs win 7. Let's look at the first handful of google hits for the phrase "win 10 vs win 7 boot times".
1) https://www.youtube.com/watch?v=wb4Jd6-k2pw - benchmark on a real crappy machine, win 10 performs about 10% slower, but boots several seconds faster.

2) https://www.youtube.com/watch?v=taakavJ0mDI - Win 10 boots several seconds faster.

3) No benchmarks (google, please).

4) http://www.techspot.com/review/1042-windows-10-vs-windows-8-vs-windows-7/ - win 10 is marginally slower to load from logo (whatever that means), but much faster to load from sleep/hibernate. Win 10 performs marginally better than win 7 in single thread, 7% faster in multithread. Win 10 performs much better on Futuremark PCMark 7 benchmark. Win 10 is slower with most browsers (Edge appears to be quite fast), and marginally slower in other common office applications. I/O disk operations are similar across win 7/8/10, with 7 lagging behind in one test. Gaming performance is equal for all three, with 7/10 trading blows in particular games.

5 & 6) not relevant (win 7 vs 8)

7) http://www.tenforums.com/performance-maintenance/20765-lets-hear-how-your-pcs-performing-win-10-vs-win-7-a.html - mixed, but feedback seems to be in favour of win 10. Note that this was close after release, and many gripes were (hopefully) fixed by now.

I could keep going on and on, but your one subjective measurement that win 10 is loading slower isn't really holding up against the majority of evidence out there. Now, ofcourse it's entirely possible that win 10 does boot slower on your particular machine, but saying that it loads slower in general seems like an unsubstantiated claim. Finally, we do have to take account of the fact that google is spying on me, and I wouldn't put it past them to filter search results just so that they make me happy, and more likely to click an add somewhere. We could try and test that theory - why don't you also do a google search and report back?

Finally, I actually agree with you that it would be nice to edit individual xml tags without overriding the whole tag, I actually proposed building that into CCL - but (for reasons I can't remember, but I'm sure they were good...) most modders thought that was a bad idea.

hoho

#57
Quote from: Vas on February 04, 2016, 08:09:01 AM
Quote from: hoho on January 27, 2016, 05:08:57 AMI'd be extremely surprised if Rimworld running on 4core/8virtual core CPU would get 2x faster than running singlethreaded.
How exactly do you come to this conclusion?
Experience from writing software running in parallel. I'm almost certain there is some "main" thread that runs stuff that can't be parallelized effectively and will limit the overall speed the game can run:
https://en.wikipedia.org/wiki/Amdahl%27s_law

Quote from: Vas on February 04, 2016, 08:09:01 AM
MultiCore/Thread: Game is able to offload some work to different threads.
Emphasis on "some". 
Quote from: Vas on February 04, 2016, 08:09:01 AM
Thread 1 handles temperature changes.  Thread 2 handles pawn hauling jobs.  Thread 3 handles Pawn Cleaning jobs including snow and calculates whee they should go next each job.  Thread 4 handles pawn hunger and tiredness levels, beauty calculations and other such.  Thread 5 handles mental levels and thought defs.  Thread 6 handles power grid states.  Thread 7 handles random event calculations.  Thread 8 handles Animals and Plants on the map.  Game runs at normal/fast speeds because there is nothing waiting in line to be executed.
Nice hypothesis. Too bad all these things are depending on each other meaning there is tons of synchronization and waiting for intermediate results between threads meaning it that parallelization won't give anywhere near linear increase in speed.

Quote from: Vas on February 04, 2016, 08:09:01 AM
It really sucks everyone here has taken up to trolling the community for requesting multi-core support all the time.
Most people I've seen "trollin" here are people that actually know a bit or two about programming.

Quote from: Vas on February 04, 2016, 08:09:01 AM
Even he must know by now his game has too much data to process on a single thread
I *highly* doubt that. Take Factorio - it has little to no problems handling hundreds of thousands of objects in-game at 60 updates per second without multithreading. All it takes is to use efficient algorithms, possibly with redesigning one's data structures to match those algorithms. As simple things as how variables in a structure are laid out can mean massive speed difference due to trashing of L1 cache, having not-so-good data structures (e.g linked lists instead of arrays/vectors) can mean you'll break the processor precaching leading to it waiting for hundreds of cycles for data to arrive just to spend a dozen cycles to do the math on it.

hoho

Quote from: lude on February 05, 2016, 01:39:37 PMYeah, like the things propagating per cell is very elaborate, compared to simulators like DF2, I just upped my CPU to 4.2ghz with an FSB of 240, the "mysterious IPC" is more affected by FSB increase than by multiplier, keeping the other busses at their vanilla speeds with an increased FSB netted me very nice results with most single core limited games
That seems to point to the game/mods being inefficient in their data layout in memory. Increasing FSB lowers memory latency and thus helps in scenarios where either precaching doesn't work as well or where caches get trashed.

Quote from: Vas on February 06, 2016, 10:17:00 AM
Quote from: Ectoplasm on February 05, 2016, 11:20:09 AM
Quote from: Vas on February 05, 2016, 10:15:51 AM
All game developers should be doing multi-core support by default in their game engines. 
To be fair, when Rimworld started this wasn't an option in Unity. Rimworld will be 3 in November. I think you need to consider this legacy, multi core just wasn't there in Unity.
Yes, but other engines had it and 64 bit too.
At the time, there pretty much were no other engines availiable for the price of Unity.

Also, 64bit support is trivial compared to multithreaded stuff. Pretty much the only thing you need to look out for is doing pointer arithmetic.

Also, there are scenarios where 64bit instead of 32bit computing causes performance losses.

QuoteBy the way, as stated before some things in this game CAN be offloaded to other cores.  Path finding, for example.
I'm almost certain that pathfinding in this game is one of the least expensive algorithms, unless awfully inefficient algorithms are being used right now. Maps are relatively small and there aren't many pawns running around. No, 100 isn't many for half-decent pathfinders on a 500k square area.

Again, bringing Factorio as an example, they have infinite map sizes, kind of like Minecraft - their size is limited to how far you've explored. They improved their pathfinding speed by several orders of magnitude by tuning the algorithms.

QuoteAlso, temperature calculations can be offloaded to another core in order to speed up temp checks.
As I said earlier, those checks aren't independent and depend on other things leading to having to synchronize things leading to nowhere near as fast speedups.

For example, if temperature check has to alter parameters of something it means nothing else can access that something during the operation. The data of the "something" has to be locked, modified and unlocked. Every single time anything else access that object, that lock has to be checked no matter if it is locked or not in reality. It means often times the locked status has to be transferred from one core to another, through RAM in worst-case scenarios. If something does have it locked then everyone else are just dead in the water busylooping and checking for when the lock is released. In other words, everything else waiting behind the lock are wasting CPU time while doing nothing useful.

QuoteI was saying that had I been the one choosing a game engine, I would have chosen one that had multi-core support to begin with, as well as 64 bit support.
Can you point to an engine from 3y ago that supported those things and didn't cost half a million?
Quoteand UNITY, should have been putting support for this in to begin with
Considering it took two YEARS for KSP to adapt to unity5, how long did you think unity devs had to spend to make their engine to support multithreading? IIRC, they were essentially forced to rewrite almost everything.


For the record, I'm playing the game on a CPU from 2007, Core 2 Quad 6600. A 2.4GHz CPU. The game runs roughly as fast as on my laptop with the latest I7 running at 2.8GHz. In pretty much every synthetic test, the laptop CPU is almost twice the speed of the older CPU in single-threaded loads. This, again, hints to me that isses are in algorithms and/or data layout. Most likely it's not the game but the mods used. They are probably trashing caches and thus depending heavily on memory latency. Those two are almost equal between the two PCs I have.


Last time I had any serious issues was when I was using zombie apocalypse, aparello and something that modified weather calculations. Problem was that first mod added huge waves (seeing >100 zombies was common), second added a TON of clothes that are *actively* worn (leading to several times more calculations to be made for temperature/combat and most likely a lot of other things) and last one simply made weather calculations take longer. Each mod individually probably wouldn't have made much of a problem but combined they increased some calculation requirements by at least an order of magnitude. In addition, they didn't add a constant scaling but exponential.

minami26

Hello guys, pitching in
actually RimWorld does a good job with defining individual mods and such, that's how you do "modifications" e.g tweak a particular object, and RimWorld as it is Runs fine on my 1.2 ghz dual core atom 2gb ram notebook. Its the number of entities and their pathing that makes my game gobble so much processing due to select cells being selected on a large number of objects simultaneously, which just works! *not being todd.

My elderly mods, I've made all my buildings especially my traps use Ticks which hogs processing but all I've set up is limit ticking by a quarter to optimize its usage this is defined on my old iteration of Traps where Trap Holes wait for an entity to go into a single cell every game tick, butRimWorld responds very well to this due to testing 100pcs of trap holes and nay a single process hog was encountered running fine as a dandy on my little notebook. *note that this was alpha7 I haven't played and modded since sadly :(

all in all I think Tynan is doing superb on RimWorld and I hope this piece of software he made will be a legend once its brought high above the atmosphere for everyone to enjoy. Once RimWorld goes live we'll all just look back at how we all argued what RimWorld should be, rather than what RimWorld has become.