Cubitect / cubiomes

C library that mimics the Minecraft biome generation.
MIT License
556 stars 98 forks source link

Linked gateway finding #117

Open Colin-Henry opened 3 months ago

Colin-Henry commented 3 months ago

Kriss007 and myself have written a program (gatewayChecker.c, the useful function is linkedGateway) that just takes in a seed and returns coordinates of the gateway that is generated in a pair with the first gateway generated upon killing the dragon (it returns the outer end gateway). It's EXTREMELY slow but we can't really find any ways to speed it up as it is without sacrificing the fact that it's 100% accurate. I did write a rough check algorithm that cut the runtime down by 2-3 times, but it isn't modular at all, so I decided to not include it. I can follow up with it if you'd like. Sorry if this is not the normal format to make a pull request, I've never made one before 😅

Cubitect commented 1 month ago

Thanks for your effort.

Pull requests generally submit proposed changes to the code within a project. Your code looks more like a proof-of-concept program, so I'll regard it as such, and not something I'd want to merge into the library as-is.

For the linked gateways, there are actually a couple of prerequisite sub-problems, that can be tackled independently, which would work well as new features for the library.

The first is a better surface height generation for the End dimension. This was rather lacking and slower than necessary. I've already done some work on improving this, by adding a new mapEndSurfaceHeight() function, which does all the necessary height column caching, and I was able to optimize the column generation by excluding useless cells.

The second prerequisite that can be added to the library, is the small end island generation. Your code has an implementation for 1.16, but feature generation is fairly volatile, meaning it changes more frequently across versions. (In fact the player can sometimes even influence the generation by placing blocks before the generation.)

The small island generation is where I've previously stopped perusing linked gateways, since I assumed it wouldn't be worth the effort; but I'm currently checking the other MC versions, and so far it doesn't all that difficult to implement, at least for 1.13+.

I'll try to get linked end gateways ready for the next release of cubiomes viewer.