AllenSeitz / DimDungeons

A Minecraft mod which adds proceedurally generated dungeons.
15 stars 13 forks source link

Dungeons spawn at different xyz coords? #40

Closed JetpackRescue closed 2 years ago

JetpackRescue commented 2 years ago

It appears that the dungeons spawn at different xyz coords for every world? I'm using dimension stacking and a teleport feature to get people to the dungeons when they complete a quest but it appears the dungeons xyz coords change? I just tried to teleport to coordinates of a previous dungeon and it wasn't there?

Could you make dungeons always spawn at 1 1 1 so this will work?

AllenSeitz commented 2 years ago

I'm sorry I missed this ticket. I try not to let anything go without a response.

I can't make the dungeons always spawn at (0,0,0) I'm sorry. The big deal there is that I would have to demolish the old dungeon before building the new one and that would take twice as long. Also, what happens to any players who are currently in that dungeon? Or who logged out inside one?

The dungeon dimension is a container that holds all of the dungeons. Creating a new dimension for each dungeon is wasteful since most dungeons are never revisited once they're cleaned out. Instead I create the illusion of each key being a separate dimension by teleporting the player to far apart coordinates within that dimension.

However I think I can still help you with your quest rewards. If you need fixed coordinates for a dungeon then you can alter the nbt of a key to take you to a predictable coordinate. This technique might be useful if you've pre-built the dungeons or modified them for an adventure map. To hack the coordinates of a key set the "dest_x" and "dest_z" values to anything from 0 to 8192. Two keys with the same dest_x and dest_z will always go to the same place.

If you don't mind me asking, what are you using dimensional stacking and teleporting for exactly? If you wanted to teleport the player to a randomized dungeon for a quest reward then couldn't you just give them a blank key and the means to activate it?

AllenSeitz commented 2 years ago

Good news! I actually did this in my most recent update! If you try version 154 for Minecraft 1.18.2 the dungeons will now be built in consecutive order along the Z-axis. And this order will be consistent from world to world too. (So the 5th dungeon in every world will have the same coordinates.)

Jetpack-Cat commented 2 years ago

Awesome! Any plans to do this for 1.16.5?

AllenSeitz commented 2 years ago

Ahhhhhhhhh... gosh. To be honest probably not. The code needed to do this was a total rewrite. Backporting this would be kind of big.