xXastaspastaXx / Dimensions3

The third rewrite of Dimensions :'(
1 stars 0 forks source link

Something is wrong with Portal finding #1

Closed wolfkarst closed 2 years ago

wolfkarst commented 2 years ago

2022-07-30_01 09 35 Hello, I have Set up my previous world an made a border-Ratio of 4 to get a 1:16 Ratio between my main and my hub-world. But the portal-finding makes still Problems. Even with a search-Radius of 64 ... = 64^2 = 4096 !!! The Portal-connection should target mathematical the middle of those 4 Portals in the picture, but it destroys one Portal to create a new one inside.

xXastaspastaXx commented 2 years ago

When you mean it destroys a portal to create one inside, does Dimensions build a new exit portal where another portal is? Can you send me the world borders you are using and the locations of your portals so I can test it out? I will run a few tests because I am not sure 100% what the issue is yet.

wolfkarst commented 2 years ago

The world has the standard border of 59999968 (2x29999984 max world size) In the Hub-world I have set the worldborder to 14999992 ( quarter of 59999968 to get a ratio of 16)

The Portal in world is at 242 70 213 (middle-Point) and entry is from North/South The four Portals Hub-world are arranged (like in the Picture shown) with a distance of 3 Blocks around 15 40 13 (should be 240 40 208 in world)

When I enter the northern Portal in Hub a new Portal in world is created at 241 66 184 facing north/south When I enter the eastern Portal in Hub a new Portal in world is created at 239 65 190 facing west/east When I enter the southern Portal in Hub a new Portal in world is created at 226 64 198 facing north/south When I enter the western Portal in Hub a new Portal in world is created at 235 66 182 facing west/east 2022-07-30_08 47 15

my confix.yml: consumeItems: true fallbackWorld: world generateNewWorlds: true searchRadius: 128 safeSpotSearchRadius: 128 debugLevel: 2 teleportDelay: 1 enableParticles: true enableNetherPortalEffect: true enableMobsTeleportation: true enableEntitiesTeleportation: true checkForUpdatesOnStartup: false defaultWorld: world configVersion: 0.6 ReplacePortalRuins: 0.9 ConsumeItems: true Worlds: world: MinHeight: 0 MaxHeight: 320 world_travel: MinHeight: 0 MaxHeight: 320

My Portals/reisewelt.yml: configVersion: "3.0.0" Enable: true DisplayName: Reise-Welt Portal: Frame: Material: 'lapis_block' Face: all InsideMaterial: NETHER_PORTAL LighterMaterial: FLINT_AND_STEEL ParticlesColor: "0;0;0" MinimumWidth: 4 MinimumHeight: 5 MaximumWidth: 16 MaximumHeight: 25 Options: EnableParticles: true DisabledWorlds: [] TeleportDelay: 4 BuildExitPortal: true SpawnOnAir: false World: Name: 'world_travel' MaxHeight: 320 MinHeight: -64

Hope this helps

xXastaspastaXx commented 2 years ago

First things first 59999968 / 14999992 != 16 59999968 / 16 = 3749998 so the world border should be 3749998 (Idk if my math is wrong, I base it on the fact that 59999968 /8 = 7499996 which should be the border of nether (but isn't because wtf??))

Now about the portal finding issue You mentioned something about the search radius being squared. That is because I use the location#distanceSquared method in order to not use sqrt (which is resource-intensive) and since it calculates the distance between many portals, it might cause lag to the server. So actually the search radius is not 4096 blocks but rather sqrt(4096)=64

After the calculation for the "actual" search radius, it would become something that would not make too much sense image (Yes the calculation could be simplified)

I made a few changes to the Dimensions code but since I found out that some things do not work the way i thought they would, I will add the option to edit the world size to whatever they want to use (instead of forcing people to change their world border). I will also change the search radius to searchRadius/ratio unless mentioned otherwise in the config (because i will make it configurable per world)

I hope I understood your issue correctly and the update (probably tomorrow) will satisfy your needs.

wolfkarst commented 2 years ago

First things first 59999968 / 14999992 != 16 59999968 / 16 = 3749998 so the world border should be 3749998 (Idk if my math is wrong, I base it on the fact that 59999968 /8 = 7499996 which should be the border of nether (but isn't because wtf??)) image

If I understand your code correctly, you calculate the ratio from destborder^2 / actborder^2 which means the ratio is also a squared result. There for i must use a ratio of 1:4 in the borders to get a 1:16 ratio in the dimensions-traveldistances. Proof of fact: The Portal at 1310 65 1809 is creating a portal at the Hub at 82 65 119 (=ratio 1:16) with the setting i told before.

For the search-Radius I like to have a Radius of 16 Blocks in the Hub-world and 16x16 = 256 Blocks in the Overworld. I would prefer, if the y-coordinate is ignored. The Method how it's been calculated doesn't matter for me, as long I know how to set it up ...

If you need further help in Testing/Analysing, I would be glad in helping you ... Please PM me if needed ...

xXastaspastaXx commented 2 years ago

Yes, that was a mistake i made and i changed it so its now not being squared and then divided. That was a mistake of mine and thank you for noticing and letting me know.

For the search-Radius I like to have a Radius of 16 Blocks in the Hub-world and 16x16 = 256 Blocks in the Overworld. I would prefer, if the y-coordinate is ignored. The Method how it's been calculated doesn't matter for me, as long I know how to set it up ...

In the new update, the world ratio is now calculated like that image

and then the new search radius is image

So if you wanted to search in a 16 block radius away from the teleport location you would need to set the searchRadius to 181 also you would need to change the world border to the size/16=smaller world size I replicated what you are trying to do above and for me this ^^^ worked just fine

You can check it out with the new update and let me know if things still don't work as intended.

You will have to set World.[world].Size: because it no longer takes it from the world border but from the config.yml

xXastaspastaXx commented 2 years ago

Ok, i noticed that the new search radius calculation also does not make sense but i am not going to change it right now (in order to not spam update). Just letting you know that for Dimensions 3.0.2 you have to use search radius of 181 in order to achieve what you want, but after the next update you will have to change it to 256.

Sorry for the mess, i am trying to speed fix everything because i dont have enough time and i cant double check everything