-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Allow JSON linear terrain and unhardcode anthill mapgen #51474
Allow JSON linear terrain and unhardcode anthill mapgen #51474
Conversation
Is this limited to mutable specias, or can one straight up define a new connection type with JSON mapgen? |
You can define a new linear terrain type and use it in fixed or mutable overmap specials, but it won't be a connection, in the sense that connections can be defined for roads and subways. Those connect different specials together. That is yet to be JSONized. This was an important step in that direction, but we're not there yet. |
242691a
to
5bf23ad
Compare
ef4ed6c
to
3d681b6
Compare
Previously this would fail with an error which didn't explain where the problem was.
Linear terrain (roads, ant tunnels, sewers, etc.) was not previously possible to define in JSON. This was because the rotation wasn't correctly calculated for linear terrain. Make it be.
We already jsonized the overmap generation for anthills. This further jsonizes the regular (tile) mapgen, and completely rips out the old hardcoded overmap generation. As part of this process, all the overmap terrains became rotatable, and so needed to be migrated. This fixes the issue where ants were not spawning in the tunnels for the new-style anthills. However, for the time being only regular anthills are being generated, not acid anthills. I plan to re-add acid anthills later.
3d681b6
to
824ceba
Compare
CI looks clean except for LGTM, and I can't tell what went wrong there; maybe just a timeout. |
Should this close #24628? |
No, the monster spawning is using the same mechanism, so I'd expect that issue to be the same. (That said, in the future I want to make it so that ant tunnels connect with other underground stuff like the basement, so perhaps we can fix that bug by making the tunnels penetrate the basement, rather than by stopping the spawning ;)). |
Summary
Infrastructure "Allow JSON-defined linear terrain and unhardcode anthills"
Purpose of change
We want to move more mapgen from hardcoded to JSON.
One major obstacle to that was linear terrain, which previously only supported hardcoded mapgen.
Linear terrain is used for things like roads and tunnels that must connect from one OMT to the next.
Describe the solution
This is a PR built on top of #51317 and includes the changes therefrom. It fixes the biggest issue with #51317 in that now ants spawn properly in the tunnels as they should.
The additional changes are:
Describe alternatives you've considered
My ant tunnel definitions are pretty simplistic. For example, all chambers are exactly the same layout. There's plenty of room for improvement, but they're roughly as interesting as the old ones, so I think it's sufficient for now.
Currently I've completely removed all acid anthills. I want to re-add those but it requires either (a) duplicating everything to define a bunch of nearly identical terrains or (b) adding new mapgen parameter features to allow them to be used in overmap special and overmap terrain definition. I want to do (b) but it is a major new feature, so it would be too much for this PR.
The bug of not being able to escape from anthills is also still present. The fix I have planned for that also requires a new feature.
Testing
Loaded old games and verified migration works. Teleported to new overmap and verified that new anthills are generated.
Additional context
Some screenshots follow. The ones with no ants were because I did some testing before I added the ant spawns to these new terrains.