Realistic Terrain Generation

Realistic Terrain Generation

3M Downloads

SGCraft doesn't generate Stargates in Desert Temples

whichonespink44 opened this issue ยท 30 comments

commented

Closing this for now as this feature is currently broken and disabled by default in SGCraft.

commented

Well this is harder than I expected.

commented

Yeah, hard to see exactly what's going on with most of the code being at the same package level.

Does it print/log any messages when you get to a temple?

commented

Nope, it doesn't get to that point. I've set up a debugger with the mod (by having it as a library) and I sort of understand what it's trying to do:

onInitMapGen in FeatureGeneration happens normally (no error gets printed), but the SGStructureMap is never actually used (the code makes structureMap a "SGStructureMap" instead of HashMap and overrides some stuff to make sure the Component (FeatureUnderDesertPyramid) gets loaded.
I suspect MapGenScatteredFeatureRTG has probably something to do with it. I tried loading the Temple Components in different ways by including FeatureUnderDesertPyramid here with no success.

commented

Tried to change what should be changed in our own MapGenScatteredFeatureRTG. The changes are below.
It prints the messages it should print, but no structure....
image
I can't do this anymore, I've spent a fair few hours today on this thing alone.
If someone wants to tackle it just import the SGCraft jar as a library in IntellJ and link the source code provided in the website above to it. If it works wihout the jar in your mods folder, you have debugging.

commented

I spent some time on this last night but didn't make much progress. Probably worth getting the author of SGCraft involved as he might be able to spot something in MGSFRTG that we're just not seeing.

Worst-case scenario, if we can't get the Stargates to generate using MGSFRTG, we could always add a config option called enableScatteredFeatureModifications, similar to the others we have, and if set to false, RTG would use the vanilla MapGenScatteredFeature instead of MGSFRTG.

commented

It would mean players would have to choose between Stargates in desert temples or vanilla structures in mod biomes, but at least it would be something.

commented

Sounds fine to me, if we can't find another solution.

commented

Yeah, most likely there's some trick going on and he'll know it but we won't without a lot of code review.

commented

The frustrating thing is I did spend a few hours doing just that - I'm pretty sure I understand what it's trying to do - but while it should work, it doesn't...
Pink's hack is the only solution it seems.

commented

@Ezoteric Yeah you have to enable a config option for it to work. Which makes this less worth to fix.

commented

wasnt this not working in vanilla also ? i dunno but i think i looked that up once as it didnt work for me either (before i even knew about rwg :P )

commented

@VelocityRa I figured but it stil didnt do much back then :P

commented

Hey guys, original poster of the issue here. @Ezoteric, I'm not sure if the config option (in SGCraft) used to do nothing, but it certainly does now; we've found around 5-6 Stargates in temples in previous worlds. Anyways, thanks a ton for looking into this for us!

commented

@Ezoteric It does, I tested them. You have to go to one of the 2 "towers" on the sides of the temple. There's a ladder near the door leading down to the room with the Stargate.
The config option you have to enable is "augmentStructures".

commented

I knew that all, but i think it was an older version as back then i read something about it that it didnt worked orso :P

But its nice to know if it works in RTG :) as my modpack also has it :P

commented

No, it's a different hack :)

Since SGC won't generate the temples, I'm making RTG handle it by creating the FeatureUnderDesertPyramid component and adding it to the list of components in MGSFRTG. If I add both the vanilla and stargate components, it only generates the vanilla pyramid, so I tried adding just the stargate component on its own, and that's the first screenshot above.

Just need to figure out why it's not generating both.

commented

have you tried adding them in different orders? one of them may fail if the other is already there

commented

Nope, but that's a good idea ๐Ÿ‘

commented

Progress!

I've managed to get it so that it either spawns the SGCraft portion of the temple or the vanilla temple, but not both. Not sure why it's only one or the other, but it's getting there.

Hopefully I'll make more progress tonight.

commented

Nice! Did you do the "hack" you were talking about or is it a proper solution?

commented

soo... did that do the trick? or how did you fix it

commented

Fixed in 01b33d3

The reason it would only generate one or the other is because of the way MPSFRTG was choosing which scattered feature to generate. For some reason, it was choosing a random structure from the ones that had been added, and since previously there was ever only one structure getting added to the list, it basically had no effect. But when I added the stargate to the list, it was choosing between the stargate and the temple itself, but never both.

So I just refactored MGSFRTG a bit and voila! ๐Ÿ˜„

I'm not entirely happy with the approach that I used in order to get this to work, but... I just couldn't for the life of me figure out why SGCraft wasn't generating the stargate. If the author of SGCraft ever sheds some light on this, I'll go back in and do it properly, but for now...

ยฏ_(ใƒ„)_/ยฏ

commented

2016-05-29_15 15 13

commented

did you check into the swamp hut genning on top a desert temple in the swamps ? @whichonespink44

commented

Are these changes only for the 1.8.9 version and if so will see the changes in the 1.7.10 version? Cause yes we are experiencing the same issue in our 1.7.10 modpack.

commented

This issue was only reported in (and fixed for) the 1.7.10 version, so it will be working in the next 1.7.10 release.

commented

Doh! Accidentally left some debugging code in... removed it in 8371e53 and everything seems to be working fine again. Let me know if not.

commented

Ok testing it now :)

Yes this did the trick ;)