Jump to content

I'm worried about the possible system requirements of KSP2


Recommended Posts

2 hours ago, vv3k70r said:

Yes, most engines have some dll implemented phy for common use which is flat map on 3d or 2d. But these engines cannot handle anything like in KSP. Inside them is a made up fhisics that handle a narrow range of values that are adapted to scale, display and data structure.

Pretty much none of this is true. DLL stands for dynamically linked library. Even if physics in a particular engine comes as a dedicated library, which isn't always the case, nobody in their right mind would link that dynamically. Please, avoid using terms if you don't understand them.

And if canned physics engines couldn't handle "anything like KSP," then we wouldn't have KSP, because KSP runs on PhysX which is as plain and boring physics engine as they come. And it works because the only things that are handled by the physics engine in KSP are collisions and joint forces on the craft. That's it. That all it does and all it needs to do in KSP.

All other forces, like aerodynamics, propulsion, and gravity are applied by individual components during update. Same as in any other video game. Because when you shoot an object in an FPS and that sends the object flying, it's not the physics engine that responds to the shot. The projectile or weapon component detects a collision and then applies an impulse in exactly the same way the thruster component on a KSP craft applies impulse to the craft. None of it works any differently.

The only reason KSP exists at all is because under the hood it's not that different from any other game.

2 hours ago, vv3k70r said:

What You see in game is unity. But it is just a display from dynamicly build flat 3d of local structures that unity can handle. But speeds avilable in games allow players to crash this whole structure just by getting fast on land. In common engine You just put max_speed value and problem is solved, here it would be an offence even if terrain cannot be switched that fast.

You are literally describing streaming. It's been a problem in games for a very long time. Have you ever played GTA III or later? For modern games, it's just a fact of life that you can't have everything loaded at once. And every single modern game engine handles this pretty much the same way. The only difference with KSP is that it has a greater LOD range which comes at a cost of lower visual fidelity. Again, there is absolutely no special code because all of this is, once again, handled by Unity, which is a generic game engine, not written for games like KSP specifically.

And if I suggested to any of game designers that instead of handling streaming we'll just slow down the player movement, they'll complain against me to CTO. In basically ever game, we have to handle resource loading regardless of how fast the player is moving. In games where player is on foot, we load higher fidelity assets. In games where player is moving by vehicle or some other means, we load lower fidelity assets so it can be done faster. Most game engines will be able to adapt based on how fast you're moving. Because even in games where you can't move all that fast as a character, you do occasionally want to have camera pan around or move quickly.

2 hours ago, vv3k70r said:

In such a solution You load to graphic engine only local objects for display and handle phy on Your own process. It is why KSP quite often do not match with display, especialy when You go fast and low. It is why it need workarounds with joints strength and so on. And quickload it is just a disaster. I would not expect anything else.

That won't help if you bottleneck in physics, and any time your frame rate in KSP drops because the craft is very complex or when things collide and explode, it's not the rendering that has trouble keeping up, it's PhysX not managing to do its job. This has nothing to do with physics and rendering running in lockstep, which is standard fare for most engines. Though, many do allow  several frames of simulation to run per single rendered frame. That just won't help you unless you do have a much better physics engine, one that can actually handle higher simulation rate.

And yes, when PhysX craps out and starts lagging the sim, it increases duration of the frame, which increases the simulation time step, which makes everything worse, so once things start going bad, they continue going bad. It just has nothing to do with rendering.

2 hours ago, vv3k70r said:

Would You even think of coding everything again after years just to make it corect?

If I was working on KSP2 project, I'd just write a custom physics sim and be done with it. It'd be faster than trying to fix it any other way. But I'm one of very few people who actually does that sort of work for a living. I don't think Intercept has resources to make significant changes at this point. So they're basically stuck doing the same thing KSP has been doing, maybe finding a few small improvements along the way. Most likely by replacing some weld joints with rigid bodies.

Link to post
Share on other sites
9 minutes ago, K^2 said:

Have you ever played GTA III or later?

Last GTA I remember was top down view.

15 minutes ago, K^2 said:

And yes, when PhysX craps out and starts lagging the sim, it increases duration of the frame, which increases the simulation time step, which makes everything worse, so once things start going bad, they continue going bad. It just has nothing to do with rendering.

Intresting. I always had a problem with heavy graphics, but I didnt work with graphics and optimized phy not related to objects (more to bounding boxes without any idea how would object looks like).

19 minutes ago, K^2 said:

If I was working on KSP2 project, I'd just write a custom physics sim and be done with it. It'd be faster than trying to fix it any other way.

I will start with same aproach. I just used to do everything from scratch because market products handle many things that I do not need.

20 minutes ago, K^2 said:

But I'm one of very few people who actually does that sort of work for a living.

I'm not, just a hobby from past.

 

Link to post
Share on other sites
8 hours ago, K^2 said:

In short, a more recent architecture helps. Even between two CPUs that have comparable performance in pure math computations, the more recent architecture likely to have better cache coherence and prediction allowing for better performance in games that are designed to make good use of multiple cores. Most Unity games, however, are going to be bound by either main thread or rendering thread performance, so your best bet is to look for CPU with best single-thread performance. I don't expect that to be much different with KSP2.

Cheers for both you and @Incarnation of Chaos for taking your time and explain it. I made the mistake of simply not believing the IPC rumors of ryzen and am considering swapping my 10700K for a 11th gen  if the IPC is worth it. I really hope we end up in a full scale IPC war. 

Link to post
Share on other sites
2 minutes ago, dave1904 said:

Cheers for both you and @Incarnation of Chaos for taking your time and explain it. I made the mistake of simply not believing the IPC rumors of ryzen and am considering swapping my 10700K for a 11th gen  if the IPC is worth it. I really hope we end up in a full scale IPC war. 

https://www.cpubenchmark.net/singleThread.html

Current gen Ryzen processors are killing intel single thread performance scores currently and the 5600X seems to be the best bang/$

Link to post
Share on other sites
6 hours ago, mcwaffles2003 said:

Current gen Ryzen processors are killing intel single thread performance scores currently and the 5600X seems to be the best bang/$

You have to look at game benchmarks to get full picture. It's a bit of combination of games being generally better optimized for intel, in part due to compilers, so don't expect a quick change there; but also, games are more demanding than benchmark tests due to how they use branching and cache. And if you look at game benchmarks, the picture is more mixed. Intel is still holding ground in some price ranges quite convincingly, while AMD has penetrated a lot of high end and mid-high PCs.

Given how close everything is right now, you really have to look at benchmarks for your planned build to confirm, but two rules of thumb stand out. If you plan to overclock, generally Intel is still better value. Unless, you plan to stream your games or expect to upgrade CPU soon. In later cases, go AMD Ryzen, as they are better at supporting background tasks while playing and plan to stick with current sockets for a while longer.

Also, all of this is quickly changing, and availability is becoming a limiting factor in some cases. So you really have to do research for your specific case.

Link to post
Share on other sites
15 hours ago, K^2 said:

There's a concept of thread-local storage. It used to be a pain to implement properly in platform-independent way, but now there are standard ways of handling it in modern C/C++ and C# as well as some other modern languages. It gives you a simple way for each thread to know what it's working on.

Atomic operations are just these that are performed all at once. If you are doing anything complicated, you'll need locks or some other mutex, but the interesting cases include increment/decrement, exchange, or compare-and-exchange operations which have interlocked equivalents natively supported by modern CPUs. Again, that's something that used to have horrible platform-specific support, but now it's handled with std::atomic in C++ and Interlocked class in C#.

What the physics solver is doing, whether it's implemented directly or via something like Sequential Impulse, is solving a constrained least squares problem. Example of constraints being that contact force cannot be negative - objects don't (usually) stick to surfaces, so the contact force will only push in one direction. You can also use constraints to do traction limiting when simulating a wheeled vehicle. But the general strategy for solving these is very similar to solving a system of linear equations by an iterative method. So to get a rough idea of what the multithreaded solution would be like, think of how you'd implement Gaussian Elimination algorithm across multiple cores. Imagine that you've already brought the first N rows to  triangular form and you are now working on N+1st row. You need to subtract from current row every previous row divided by its pivot element and multiplied by the element in corresponding column in N+1st row. Lets say, I have several cores available. Rather than do one row at a time, I'll kick off the process on the first core with the first row. Once the second element of N+1st row settles, I'll launch the second core working on second row. It has all the data it needs, and so long as decrement operations on the N+1st row are atomic it doesn't matter that two threads are working on it at once. Once the 3rd element settles - that is, both cores 1 and 2 have processed it - the 3rd core can be launched on 3rd row, and so on up to the core count. The synchronization can be handled with a single monotonic counter which can also be handled with atomic increment.

This is still nowhere near 100% CPU utilization, there is a lot of overhead, especially when you consider that x86-64 CPUs still don't handle atomic increment and decrement with floating point values, and we're just talking about a toy version of the problem. There are applications where this kind of optimization is crucial. If you ever want to learn a trick or two about squeezing every last bit of performance when working with giant matrices, talk to a Lattice QCD theorist. But I don't think a physics solver for games is a use case. I'll take a simpler, more stable algorithm and I'll find something else to occupy all the other cores with. Like animation and AI. Collision is the only part of physics that, in my opinion, is worth farming out. Maybe BVH updates, depending on your implementation. But not the core solver.

For context; the specific implementation i worked with was ThreadLocal in Java. And it required quite the hassle to get working properly, ended up having to use an Abstract Class to extend Thread and then extend that into a concrete class. Even afterwards i had to cast them back and forth to get the right results.

Which all adds overhead, both on the CPU and the programmer. Also, Java is a pain to work with.

Though what's weird is despite knowing basically nothing of that background, i was thinking of a similar solution. Though i was thinking of allowing the threads to keep track of where they were within the matrix, then using a sorting solution (Merge Sort is very multithreadable, but QuickSort might be better) to basically allow any arbitrary # of cores to perform the calculations. Then crash join back into the program, spawn more and spool the data to memory where it could eventually be sorted. 

Yours sounds much cleaner, safer and faster though, cheers!

Link to post
Share on other sites

My specs(current)

Intel core i7

8gb ram

I dont have graphics card to my knowledge

 

Im getting a new PC

Specs of that

AMD Ryzen 9 3950X

32 Gb of ram

Nvidia Geeforce graphics card

Link to post
Share on other sites

I've had my current PC a few years now, still going fine, but obviously 'old tech'.   I just added a load more RAM (now 24GB) to help it along.

I will look at upgrading after KSP2 comes out and i can see what it needs.  Will see how it runs on my current machine anyway initially, but I will be well ready to upgrade by then if I can.  Just need to start saving.

Link to post
Share on other sites
2 hours ago, kspnerd122 said:

Im getting a new PC

Specs of that

AMD Ryzen 9 3950X

32 Gb of ram

Nvidia Geeforce graphics card

You might want to wait a bit and buy 5950X instead. It's a full generation ahead, has way better performance in games, and the MSRP is only $80 more. You can't get 5950X for that price right now, but that should improve in a few months.

The other reason is that situation with graphics cards is even worse. A basic RTX 2080 is currently going for significantly more than I bought my water cooled OC RTX 2080Ti for, and I got mine before the 3xxx series was even announced. This is absurd. Since good GPU is way more important than CPU for game performance, if you're planning to get good mileage of that Ryzen 9, you definitely don't want to buy a crap graphics card. And unless you're prepared to spend over $3,000 on your build, you should either wait or scale back. If you end up going with something like a 1660 Super on top of a 3950X with 32GB it'd be a Colossal waste of money. If you're looking for gaming performance, and you absolutely must buy the PC right now, you'd be way better off going with something like a 10850K or maybe even 10700KF and pairing it with something  like an RTX 2070 and 16GB of RAM. That will get you a much, much better gaming machine for roughly the same price.

Now, if you're streaming on Twitch and encoding videos in the background while playing your games, or doing some other tasks that can actually make good use of 32 threads, then yeah, maybe 3950X makes sense. But there aren't any games for which that's going to outweigh a good graphics card. And KSP specifically is notoriously bad at multi-threading, and 10700KF will actually have better performance than 3950X in KSP because of its single thread performance.

A 5950X, that's another story. That gives you both the core count and single thread performance. Yeah, the thread count isn't as high, but it does so much more with individual cores. Unfortunately, it has the same problem as GPUs right now. Supply is very short, so you can't buy it at MSRP. So unless you're comfortable overspending by a lot, waiting is a best option if you want to go with a Ryzen 9.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...