mr_trousers

How the hell does KSP/its mods take up so much memory?

Recommended Posts

Because others were wondering...

My old machine ran out of physical RAM every time I played KSP.

The result: If I ALT+TAB'd out of KSP and tried to open Firefox nothing would happen. It ran so slowly it would be quicker to go upstairs to fetch my phone, even though KSP ran decently fast . The computer slowed to a crawl for minutes after closing KSP while getting rid of the "swap file".

(I've run out of VRAM in a different game, it dropped down to ~3 FPS)

Edited by KerbonautInTraining

Share this post


Link to post
Share on other sites
On 4/14/2016 at 1:18 AM, Hobbes Novakoff said:

@cantab: The thing is, what if I have a super-fast rocket that can go from Ike to Eve? Or I use hyperedit? The game has to be able to handle that.

In The Olden Days (when we walked barefoot to school, uphill, in the snow, and liked it!) this was achieved by using LOD or "Levels of Detail." In Microsoft Flight Simulator it was not uncommon for an airplane model to have 6 to 12 different LOD models. There would be a close-up model in all its full glory, and depending on the distance a simpler and simpler model would be loaded; the lowest LOD models were usually not more than a rectangular shape with rectangular wing and tail surfaces as it would be rendered from a distance where even that was barely visible.

You could to the same in KSP. The surface of any planet or moon can be rendered using a 256×256 texture so you're using 192 KB (no DDS tricks needed) for each of them. Since they're not shown larger than a stamp you wouldn't notice the lack of detail. Only the texture of the planet or moon in whose SOI you are (to be loaded upon SOI change) is loaded at 4K resolution.

Map view complicates things slightly, and I'm not saying that Squad should be doing things like that; far from that. I'm only pointing out that there are various techniques to get around "everything has to be loaded all the time." From what I understand the decision to load everything at once had more to do with Unity not cooperating with smart texture loading, than anything else.

Share this post


Link to post
Share on other sites
9 hours ago, Daid said:

RAM is cheap and plentiful these days. It's rare these days to encounter anything with less then 4GB ram (unless it's only used for browsing and text editing)

I just restarted chrome and it's running just over 1 GB. Fire up a couple web apps and I'll gobble up KSP amounts of RAM just by browsing!

Share this post


Link to post
Share on other sites
On 14/04/2016 at 7:24 PM, Foxster said:

The plus side though is that it makes coding a lot quicker and simpler if you don't have to care about resource constraints. 

Until, of course, you find your codebase is a total spaghetti mess that's nigh-impossible to maintain. Which I feel confident guessing is the norm in the games industry, and based on some of the bizarre bugs reported KSP is probably included.

Share this post


Link to post
Share on other sites

Back when I was running 1.0.2 on my old machine, it would run out of physical memory whenever I tried to deploy parachutes. On my more recent 1.0.5 save, I was forced to switch to 64-bit using the community workaround. The former was stock. The latter has over 100 mods.

Share this post


Link to post
Share on other sites
On 13/04/2016 at 0:31 PM, Kerbart said:

I've always maintained that once the program barrier of 2 GB would be removed (as will be with the upcoming release, it seems) it will simply be replaced by complaints about running out of real memory. It's not like it's a different order of magnitude after all, and when people claim that having five dozen mods active is "not that many mods" one can only expect the best for the future. :)

At least if you do start banging against the physical memory limit, you can safely exit your game (albeit slowly) It's got to be better than an unexpected crash.

Share this post


Link to post
Share on other sites
24 minutes ago, severedsolo said:

At least if you do start banging against the physical memory limit, you can safely exit your game (albeit slowly) It's got to be better than an unexpected crash.

One can argue not as quick and efficient as a CTD! :D

 

Share this post


Link to post
Share on other sites

Meanwhile, in 1.0.5 on Linux I was able to run 64-bit KSP with multiple planet packs and some other mods on my old PC with 4 GB of RAM. I think the DX9 texture duplication bug is a big part of the RAM-hogging ways on Windows.

Share this post


Link to post
Share on other sites

The answer to the question in the OP is

preloaded textures

also 32 bit memory addressing.

I`d rather have a 64 bit client on a 3Gb machine than a 32 bit client on an 8Gb machine...

Share this post


Link to post
Share on other sites
5 minutes ago, John FX said:

I`d rather have a 64 bit client on a 3Gb machine than a 32 bit client on an 8Gb machine...

Can't you just cannibilize the 8GB machine and plant its memory in the 3GB machine?

 

:D (IT'S A JOKE!)

Edited by Kerbart

Share this post


Link to post
Share on other sites
1 hour ago, cantab said:

Until, of course, you find your codebase is a total spaghetti mess that's nigh-impossible to maintain. Which I feel confident guessing is the norm in the games industry, and based on some of the bizarre bugs reported KSP is probably included.

That can happen or not happen in-depended on how you manage resource constrains. And I've seen resourced constrain code grow to a steaming mess easier then something unconstrained.

(I do not know if the KSP code is a mess. But I do guess that some part is, reading the 1.1 things on modding and that they are reporting large bits of dead code/API)

Share this post


Link to post
Share on other sites

From what I understand, and has been said here in a way, is that loading everything into RAM makes the game more responsive- the RAM and CPU (and probably the gfx card) are on the mobo's frontside bus, and the pathways between them are much faster than the pathways where the HD and other hardware lies. Also, using hardware solutions is almost always faster than using software solutions.

Regarding LOD, KSP uses it already, at least for poly-pushing.

Edited by Waxing_Kibbous

Share this post


Link to post
Share on other sites
3 hours ago, Kerbart said:

Can't you just cannibilize the 8GB machine and plant its memory in the 3GB machine?

Seems a bit extreme. Just run a RAM cable from one to the other.

(You have to make sure they're both turned on for this to work properly, otherwise the bits just fall out the end of the cable)

Share this post


Link to post
Share on other sites
4 minutes ago, stibbons said:

Seems a bit extreme. Just run a RAM cable from one to the other.

(You have to make sure they're both turned on for this to work properly, otherwise the bits just fall out the end of the cable)

Eh, I usually just use my WLAN cable to download some RAM.

Share this post


Link to post
Share on other sites
This thread is quite old. Please consider starting a new thread rather than reviving this one.

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.