Immersive Railroading

Immersive Railroading

3M Downloads

immersiverailroading.render.entity.MagicEntity causing frame lag?

joker-119 opened this issue ยท 25 comments

commented

image
What is "render.entity.MagicEntity", what does it do, and why does it require so much frame draw time?

commented

The MagicEntity is an entity rendered by ImmersiveRailroading located on the player. It keep the tracks and locomotives rendered across chunk borders. You may have seen other mod's large entities disappearing if the center is off your screen. The MagicEntity tricks the client into rendering everything.

TL;DR
It's the large entity that renders the mod.

commented

The odd thing is, it seems to only be a problem when I'm in my base. When out in the wild, I'm at 130+ fps and the magic entity is only at 20-25k ns/Frame, but in my base it jumps up to close to 1 sec/frame (usually 590-920k ns/frame)

Is this simply because my base has more stuff than the wilderness? Is there any way I can solve this? I personally don't even use the mod, but it's part of the server because one of the Moderators is dedicated to everything Immersive related, but it's causing me (and the other person living in my base) big issues for seemingly no reason.

commented

how much RAM have you allocated, and what are your system specs?

commented

CPU: AMD FX-8350
GPU: Nvidia GeForce GTX 960
Ram: 32GB Corsair Vengeance Pro
Motherboard: ASUS Sabertooth 990-FX
HardDrive: Samsung EVO 850 SSD

I currently have 12GB of RAM allocated to the game, of which is consumes 7-9.3GB, it's never gone above about 10gb, even when I begin to lag in the base, and the GPU thread usage never goes above ~45%

Again, the issue with MagicEntity only seems to take place when in my base, and gets worse when looking at a specific block in my base, Entering my base I drop from 70-90fps to around 25, and looking at a specific block of air in the base seems to drop it even more to around 9-12, I've replaced this block of air with various things and nothing makes it better, so It doesn't appear to be a corrupt block.

When in the wild, or other peoples less-fancy bases, MagicEntity takes about 20-40k nanoseconds/Frame to render, but in my base that jumps up to 550kns-1sec/frame for no apparent reason. I don't even have anything Immersive related in my base. Is it by chance forcing the game to render things it shouldn't be from other mods? Perhaps mods that already have something similar for their multiblocks and TE's that IR is trying to re-render because it thinks it has to?

commented

try allocating 3 - 4GB to MC. Java can have performance drops if it has to manage too much unused but allocated RAM, and make sure MC uses your GPU to render.

commented

I don't know if that low of an amount of RAM will even be runnable, the modpack we are running is very large. But I'll try lowering the ram amount and see where that gets me, though I'm not very sure lowering it to below what it normally sits at will be helpful at all.

commented

Lower it until you regularly use about 70-80% of the allocated RAM.

commented

Well, at 12gb allocated, avging 9gb used, that's 75% usage. But I'll lower it a tad and see how it goes.

But the issue seems to stem from the fact that immersive railroad's magic entity jumps from 20-30k ns/frame to 500k+ ns/frame when in the base. I would assume since I have no immersive anything in my base, this would be a bug on the mods end, as the FPS drop affects anyone on the server who comes into the base, though removing Immersive Railroading completely is a big leap, may give t a go on a backup world in SP and see what happens after I test running with less RAM.

commented

which version of IR are you using?

commented

1.3.2.

As suspected, reducing the allocated ram by any amount less than it's normal consumption just tanked my game performance, increasing it back up so about 75% of it's allocation is used brought it back up to how it was, going to try removing IR on a backup of the server world and see how it does

commented

IR should be able to render a few hundred pieces of stock without any drops in performance.

commented

Are you running any shaders or texture packs? better FPS mod/optifine mod?

commented

those wouldn't add much specifically, although I haven't heard of the MagicEntity itself slowing.
Just curious, what are the coordinates of the specific block in your base?

commented

Texture pack Chroma Hills and KUDA shaders, the problem is persistent with and without them both on.

Testing in the backup world VIA Single-Player went as follows.

With IR installed: 2mins after loadup: Looking out front door of base, 28FPS. Turn around to face center of main room: 13FPS.

Without IR Installed, same world: 2mins after Loadup: Looking out front door of base, 48FPS. Turn around to face center of main room: 35FPS.

Using LagGoggles shows me that IR's MagicEntity was using 512k ns/frame at the first FPS point and 1.4s/frame at the second.

LagGoggles shows that in both tests, the other frame render entities took approxamately the same amount of overall time to render during both tests (each was +/- 5% in ns/frame but overall excluding MagicEntity it was actually about 300ns/frame faster during the first test at both FPS points.

commented

The lag spike seems to emanate from X 1413, Y 78 Z -509 (That is, standing with my head in that block looking in any direction results in 30+ FPS, but looking directly at said block results in 15-25FPS Which is part of my Draconic Evolution Battery multiblock, but neither deactivating the multiblock nor removing all of the draconic materials used for it, or replacing that block seem to fix anything. The lag spike is still somewhat noticeable looking at the block without IR installed, but much less drastic. from a 20-30FPS loss down to a 5-10fps loss.

commented

then are you sure the issue is caused by IR. There is a config setting that causes the client to do additional calculations if there is lag on the server. Since you still have some fps drop without IR, that looks probable. It's possible you may be operating the the limit of MC with so many mods installed, and having the IR clientside do additional calcs may be too much for it to handle at optimal speeds.

commented

I'm unsure if the root cause of the lag is IR, all I know is IR was making the lag spike render the area nearly unplayable, so this is where I came as it's the only specific mod that I could tell was causing any issue at all.
Where's this setting so I can mess around with it?

commented

in the config

commented

I'll try disabling it and going back to my server client and let you know how it behaves.

commented

Disabled the setting both client and server side, restarted both after the change. Still this
image
image
image

commented

and any screenshots with the debug screen?

commented

image
image

commented

something inside is causing 25 chunk updates/second

commented

Only because I was moving, when I sit still there's no chunk updates
image

commented

Looking at the lag goggles report, the problem is not IR. 1% of frame time is negligible.

Some other mod is causing that issue and it is not showing up in lag-goggles.