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

Worldmap experiments #631

Merged
merged 34 commits into from
Dec 22, 2021
Merged

Worldmap experiments #631

merged 34 commits into from
Dec 22, 2021

Conversation

ryfactor
Copy link
Member

No description provided.

ryfactor added 28 commits June 3, 2020 15:01
Without this fix, attempting to use the continue statement introduced in this commit would cause some locations to appear in the ocean occasionally. The trick is not to spawn() until it is certain that there is enough room for all the locations. The clues were all there.
Use FastNoise to seed the world map using Simplex noise
Also added missing 96x96 world size.
Scaling appears to be inherent, irrespective of aspect ratio.
Divulged in in-game dialogue with the Priest of Valpurus.
Also added a tweak to make the the Underwater Tunnel Exit the centre of worldmap location placement.
…eriments

# Conflicts:
#	Main/Source/iconf.cpp
Depending on the shape of the world. Cylindrical worlds player movement can wrap through x boundaries, toroidal worlds player movement can wrap through x and y boundaries of the world map. Only allows movement if terrain is walkable on the other side.
Select world seed, and generate with this seed.
Allow land type selection to affect noise frequency.
Player movement wrapping in the world map, according to world shape.
Count the number of forced world regenerations, make the sample radius dependent on this number.
Kill a bunch of segfaults by making the small world size 49x49 instead of 48x48, which was triggering all kinds of insane bugs. Not ideal, but seems to work.
Final fine-tuned values for noise frequencies.
Also fixed a bug where the screen does not get re-drawn for the one-screen world size.
Add generation limit for bad seeds, including bad seed detection and message.
Allowing multiple terrain types for each dungeon helps to expedite dungeon generation.
Take the additional edits to owterra.dat with a grain of salt, they will be rolled back.
@ryfactor ryfactor marked this pull request as ready for review September 13, 2021 05:27
@@ -150,7 +150,7 @@ pyramid
AttachedDungeon = PYRAMID;
CanBeGenerated = true;
HideLocationInitially = true;
NativeGTerrainTypes = { 1, DESERT; }
NativeGTerrainTypes = { 2, DESERT, JUNGLE; }
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@red-kangaroo would it be acceptable if the pyramid has the flexibility to generate in either desert or a jungle tile? The generator would try to place the pyramid on a desert tiles first, as a matter of preference. On a minority of tiny sized worlds, the sampler might not pick up any desert tiles, so this change gives the generator the option to fall back to jungle terrain. This means the generator does not need to generate as many worlds. Like, ~10 worlds instead of ~100-1000 :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, no problem. :)

@red-kangaroo
Copy link
Contributor

This is great! :) Compiles OK on Linux, haven't run into any bugs yet.

When using Pangea, the generator puts all locations on a single "part" of the landmass - eg. if the continent goes north and warps to the south, all locations will only be in the northern part and the sounthern part will be empty, even though it's easily reachable. I understand it's probably a limitation of the current location reachability check?

It seems that the disappearing main manu from #587 was merged into pull request, too. I don't think that feature should be merged in its current state - there are some white artifact pixels when parts of the graphics disappear, plus I would like if it was toggleable in config (that's just me, I don't want my main menu disappearing ;) ).

@ryfactor
Copy link
Member Author

I think the changing menu background must've been added in #600.
Probably need to restore menu.png, and put a condition in void igraph::LoadMenu() which is in Main/Source/igraph.cpp.

Regarding Pangea, the generator uses the underwater tunnel exit as the starting point and fills up locations nearest to that. So that's one complication.
Another one is void worldmap::CalculateContinents(). I haven't touched the continent calculator, so it's still the old one. I think it is based on a simple floodfill algorithm, or something like that. The floodfill algorithm would need to be updated so that it checks the other side of the worldmap as well - depending of course on the world's shape. But what is the right stopping criterion? I guess you wouldn't want the floodfill to wrap around the world more than once... (in the cylindrical case - I don't know about a torus)? I think asking the internet how to do a "floodfill on a torus", or a "floodfill on a cylinder", or even a sphere could yield some relevant info.

red-kangaroo
red-kangaroo previously approved these changes Oct 7, 2021
Copy link
Contributor

@red-kangaroo red-kangaroo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main menu should be fixed by #632 and the Pangea-locations-in-one-part-of-landmass is more of an enhancement proposal, so everything seems fine.

@@ -1169,6 +1275,15 @@ void ivanconfig::Initialize()
configsystem::AddOption(fsCategory,&AllowImportOldSavegame);
configsystem::AddOption(fsCategory,&HideWeirdHitAnimationsThatLookLikeMiss);

fsCategory="World Generation";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this category up, to leave the Advanced Options last in the menu?

@@ -1502,7 +1502,7 @@ priest
FriendlyReplies =
{
14,
"@Dd talks to you: \"Valpurus the Great Frog is the highest of all gods. The Wise know that the world is really a square pancake which He carries on His back. This is why this Cathedral and the whole city of Attnam is dedicated to His worship.\"",
"@Dd talks to you: \"Valpurus the Great Frog is the highest of all gods. The Wise know that the world is really a @ws which He carries on His back. This is why this Cathedral and the whole city of Attnam is dedicated to His worship.\"",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. :D

{
BitmapPos = 0, 64;
NameStem = "empty area";
NameStem = "Erno's House";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a level map?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, just a fun easter egg in the script :)

@red-kangaroo
Copy link
Contributor

Does IsCoreLocation flag force the dungeon to generate on the same continent as UT exit and Attnam?

@ryfactor
Copy link
Member Author

Does IsCoreLocation flag force the dungeon to generate on the same continent as UT exit and Attnam?

Yup. The flag is set for the original dungeons Attnam and GC at this stage, and it really only is needed for Continents. If you select Pangea, the generator will put everything on the same (contiguous, lol) landmass anyway.

@ryfactor ryfactor merged commit 473297a into Attnam:master Dec 22, 2021
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

Successfully merging this pull request may close these issues.

2 participants