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

[WIP] Limited world size #22718

Closed

Conversation

Projects
None yet
4 participants
@ZhilkinSerg
Copy link
Contributor

commented Jan 8, 2018

What was changed:

  • added new world gen options WORLD_LIMIT, WORLD_LIMIT_X and WORLD_LIMIT_Y which determine if world is finite and also maximum number of overmap cells in horizontal and vertical axis after which world is looped to origin if set to non-zero (as suggested in https://discourse.cataclysmdda.org/t/limited-world-size/14616/).
@Night-Pryanik

This comment has been minimized.

Copy link
Member

commented Jan 8, 2018

This option won't appear in existing worlds, only when creating worlds, right?

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor Author

commented Jan 8, 2018

This option won't appear in existing worlds, only when creating worlds, right?

Changing world limit options in the middle of the game will most probably cause bugs (e.g. some overmaps can become inaccessible after you reduce limits and who knows what will happen with the poor character who is located on overmap which became unaccessible).

@ZhilkinSerg ZhilkinSerg changed the title Limited world size [WIP] Limited world size Jan 12, 2018

}
}

void limit_coordinates( point &p )

This comment has been minimized.

Copy link
@BevapDin

BevapDin Jan 13, 2018

Contributor

Please don't repeat the whole logic in those two functions, just forward p.x and p.y to the main function above.

Also, the name of those functions is not good, what coordinates are limited and how and why? Previously (the previous version of this branch) the name made some sense as it was scoped to overmap_buffer, now it's a global function and one does not know what coordinates it refers to. It should at least contain "om" or "overmap" to indicate it operates on overmap coordinates.

The function declaration in the header is also missing some comment explaining why and when to use it and what coordinates to use it on. (Again, this is not so important when it's a local, or even private, function of a class, but now it's global and everywhere may see and use it.)

This comment has been minimized.

Copy link
@ZhilkinSerg

ZhilkinSerg Jan 13, 2018

Author Contributor

Thanks. I've utilized inline functions to get rid of duplicate code.

The reason I moved these functions is that it seems to me to be correct place as new functions are also related to coordinate conversions. I didn't come up with the good name yet - will try something mentioning overmap.

Anyway that should've been changes to temporary local branch, but I accidentally committed to wrong branch and also pushed the changes.

@tyrael93

This comment has been minimized.

Copy link

commented Jan 17, 2018

How will you implement the actual "end of the world line"?
Will you need to create an invisible block that cannot be smashed or something like that?

@ZhilkinSerg

This comment has been minimized.

Copy link
Contributor Author

commented Jan 17, 2018

How will you implement the actual "end of the world line"?
Will you need to create an invisible block that cannot be smashed or something like that?

World map will be looped - imagine sphere or torus. You go north WORLD_LIMIT_Y overmaps and return to start location.

@ZhilkinSerg ZhilkinSerg force-pushed the ZhilkinSerg:overmap-loop-world branch to 2011b9c Sep 2, 2018

@ZhilkinSerg ZhilkinSerg closed this Sep 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.