-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Massive lag/TPS drops when generating structures #95
Comments
In my modpack, it takes over 70 seconds to generate a dungeon. If the world is created at the same time as the dungeon. |
This problem may itself exist in the Greymerk version. |
Hmmm @fnar how do you feel about sharing a list of mods that currently clash with RLD? |
Roguelike Dungeons -- Fnar's Edition I deleted version f in version 7.1. Old dungeon, much smoother. There's not that much lag. |
This is a very sure thing. |
If the old Roguelike Dungeons still has problems. Then this integration package can only delete all content related to Roguelike Dungeons. There are already a lot of people complaining about slow loading. |
The greymark ver of roguelikedungeons have no issues of generating for me. I think there is an incompatibility with Geographicraft. |
Geographicraft may be in part. But alnl modpack only recently joined Geographicraft. |
Yeah, actually, the greymark version has little serious impact. The impact is small enough. |
I've just realized that isn't geographicraft while trying to reproduce it, it must be another mod influencing it. For my spark profiler it did say geographicraft. I will look more into it myself. |
Nvm, problem still persisted with ksyxis, world gen seems to be slightly better wiithout it, but freezes for upwards for minutes still occur. Deleted my initial reply |
Thanks for the attention to detail on this. There are some adjustments that can certainly impact the generation cost. For starters, this mod is super un-optimized. Structure generations are not contained to only the chunks that are generating. Instead, it has the very real problem of cascading world-gen, where generating a chunk that spawns a dungeon may cause additional chunks to generate and, you guessed it, possibly cause additional dungeons to spawn, recursively. As a user, you can ensure that the distance between dungeons is great, by increasing the Limiting the size of dungeons can also reduce the number of chunks that generate and by consequence reduce cascading world gen. This can be accomplished by designing dungeons with shorter hallways and fewer rooms. In general, the smaller the dungeon, the fewer chunks it affects during generation, the fewer chunks it cascades into generating. Nextly, the cost of dungeon generation is expensive in general. This is because of the recursive nature of resolving "dungeon settings." Think of it like how code looks up functions by name in a function look-up table. Dungeons settings reference each other by name, so each generation requires building the entire context and compiling it to ensure that the dungeon generates correctly using the latest setting. It isn't cheap. The more dungeon settings files you have, the more expensive it can be. If you're using the mod out-of-the-box, it's generally cheaper than using a large set of dungeon-settings files. Nextly, of course, dungeon/chunk generation can be dramatically sped up by having a super powerful processor. This isn't a realistic option for most folks, but if you have the option to choose between a server with a poor CPU or a mega CPU know that this will impact chunk generation time, especially while using this mod. What are our paths forward?
As always, the pull requests are open. |
I don't get this massive lag when I switch to the Greymerk version instead of Fnar. When using the Fnar version, the chunks that the dungeon is trying to spawn in can take up to 5 minutes to load and while this happens you can't do anything or load any other chunks because of the immense tick lag this introduces. Just to let you know in case it helps. |
@al-wei I've been thinking about this for a while. In your logs, you should see a message like the following:
You mention your world startup takes 5 minutes -- how long does RLD:FE believe it's taking to generate dungeons? Can you clear your logs, generate a new world, and then send me the logs? (in case there are multiple dungeons generating) |
You can try the 7.0 modpack link above for yourself With the mod pack update i removed the content about rld: fe and used rld |
Still digging into this. Exploring @beltxd's profiling tool, I observe that while RLD is at the top of the call stack that's at 45%, it quickly hands off 44% to Climate Control. What determined that RLD was the culprit here? (It certainly has flaws, just trying to find the evidence in this case.) |
I'm pretty sure it's not CC/CG, because my modpack just joined CC/CG a while ago, but the lag problem did exist before. You can delete cc/cg or even rtg, etc., in the test. |
You can see in my profiling I don't use that mod either and there is nothing that causes any tick lag anything close to RLD: fnar (RLD at %32 while the closest mod to that at %4 of the whole %42 caused by world gen in total.) Also it is the DungeonGenerator_1.12.Generate() method. I don't understand much about modding minecraft and java but I do have some kind of programming knowledge and this seems to be some kinda fault in your code (somehow idk). Even though none of the mods mentioned by others in this thread were in it, I was still using a relatively big modpack so this might very well be a mod incompatibility. |
@al-wei , I don't have the answer, but I have a strong lead. Adding more logging to RLD:FE yields this using your modpack (during world creation):
The function This function works by delegating to Forge's function In your modpack, you have configured the following value in These should be checked in order, so it's likely the case that when checking for The simplest answer is to not use this feature and clear the value. This is something you would do in your configuration by setting the value to On my end, I can release an updated version which exposes the durations of common operations so that we can dig into optimization more. Analogously, I could also modify the default value for which structures are avoided so that others don't face this problem with their packs. Mind you, using this mod in isolation has no performance problem with this check, so there is likely still another mod contributing to each of your problems, such as an additional worldgen mod. I tested this approach using your pack and this was the result:
From this, I reason the issue lies within a configuration / mod conflict issue. |
How exactly do I turn this feature off? When I delete the "Stronghold,Mansion,Monument,Village,Mineshaft,Temple" thing it comes back after i launch the game. @fnar |
Yeah, sorry about that. That's a quirk of how the original mod handles configuration to ensure that default values are present. If it's blank, the value will reset to the default. To "clear it out" just put any noise into it, such as the text string "nothing" (without quotes). With this, a value will be present and it won't reset to the default (even though the value is invalid). |
It seems to have fixed the lag issue completely from my testing so far. I think it would just be better if you removed that feature with the distance check all together because so many people use large modpacks on 1.12.2 and the issue seems to stem from using this mod with big modpacks with perhaps a lot of structures. But that is my opinion anyways. It fixed the issue... @fnar |
Happy to hear it helped and thanks for the input. I'll leave this issue open for a little while longer and then close it when traffic dies down. |
@Deepfriedyag , @beltxd is there somewhere that I can get a copy of your modpacks? Are you by chance using RTG and/or Yung's Better Mineshafts? |
Yes I am using Yung's better mineshafts and RTG plus, I will try the advice you just suggested. |
!!!! it runs well! For the past days I was trying to get to the bottom of the issue, and it seems to have worked. I will do more testing, but this is extremely promising, great catch. |
Not RTG but Yung's Better Mineshafts yeah. Why? |
I suspect the intersection of these two mods is the source of this issue (just gathering data). |
Yung's better mineshaft + RTG work alongside with your ver of RLD, I've tested it the first time around. I think there may be a mod influencing world gen that somehow affects vanilla structure checks, that was what I was trying to boil it down to. |
I use mods that add a lot of structures like recurrent complex and ancient warfare 2. Those might be worth investigating but sadly I don't have the time for it currently. (in my modpack witchery is the only mod that adds structures which show up when using the /locate command alongside mineshafts etc. This is a little weird as well) |
My modpack has a lot of structure mods. |
Possibly related: Given, that the stack trace mentioned here in the initial comment contains ClimateControl and findNearestStructure in the call stack: |
https://spark.lucko.me/c4ue0a6JEU
Tested with the latest version of RLD, looking into it. Structure generation completely freezes world for minutes at a time. (NOT CAUSED BY GEOGRAPHICRAFT)
The text was updated successfully, but these errors were encountered: