Skip to content
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

getStructurePos sometimes gets nether structures wrong #105

Open
tristanshin opened this issue Aug 16, 2023 · 0 comments
Open

getStructurePos sometimes gets nether structures wrong #105

tristanshin opened this issue Aug 16, 2023 · 0 comments

Comments

@tristanshin
Copy link

Some unexpected behavior include claiming that there is a Bastion where there is instead a Fortress and seemingly always claiming that there is a Fortress.

Example: Running the following code should tell us if there is a Bastion in the 0 0 region, if the biome is valid, and if there is a Fortress in that region.

#include "finders.h"
#include <stdio.h>

int main() {
    int mc = MC_1_19;
    uint64_t seed = -5890134850431795027;
    int xReg = 0;
    int zReg = 0;

    Generator g;
    setupGenerator(&g, mc, 0);
    applySeed(&g, DIM_NETHER, seed);

    Pos p;
    if (getStructurePos(Bastion, mc, seed, xReg, zReg, &p)) {
        printf("Bastion %d %d\n", p.x, p.z);
        if (isViableStructurePos(Bastion, &g, p.x, p.z, 0))
            printf("Valid biome for bastion\n");
        else
            printf("Invalid biome for bastion (basalt)\n");
    }
    if (getStructurePos(Fortress, mc, seed, xReg, zReg, &p))
        printf("Fortress %d %d\n", p.x, p.z);

    return 0;
}

The output is that there is both a Bastion and a Fortress that attempt to generate at (128, 144), but the biome is invalid. The actual answer is that there is a Fortress in a basalt biome.

Running the code with seed 806261106859363233 and region -1 -1 gives that there is a Fortress at (-432, -192), which is correct, but cubiomes-viewer does not display a Fortress there.

This is possibly related to #62.

As for the function always claiming a Fortress exists, it seems that this line is doing exactly that:

return 1; // fortresses gen where bastions don't (biome dependent)
Not sure if that is intended behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant