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

Region system #896

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mothbeanie
Copy link
Contributor

@mothbeanie mothbeanie commented Oct 31, 2022

Changes:

This PR adds a map region system. Regions allow the minimap to display only part of a level even if the level has larger bounds (for example, a 5x5 region in a 20x16 level). Regions can also have custom images. If regionid.png is present in /graphics, then the minimap will display that image when the current region is id. The default region is 0, and in region 0 the map will display minimap.png (instead of region0.png) if it is present, in order to maintain forwards compatibility. There are a maximum of 401 regions, from 0 to 400.
It adds three commands to manage them:
setregion(id,x,y,x2,y2) - sets region id from x,y to x2,y2.
changeregion(id) - sets the current region to id. If region id doesn't exist, then it will act as if you aren't in any region at all.
removeregion(id) - removes region id from the array.

Here is a demonstration video:

Regiondemo.mp4

This PR will not break forwards compatibility. Playing a level which uses this system with an older version of the game probably won't even affect their ability to navigate, although they might end up seeing rooms on the minimap that the level creator intended to be outside of the bounds of the displayed map.

Regions are saved to and loaded from a level's save file, as well as what the current region is. The map cursor and icons for trinkets and teleporters will display properly - if the player/a trinket/a teleporter is outside the bounds of the current region, it won't render on the map screen.

This also cleans up a lot of map code, moving more things into MapRenderData. Thanks to Ally and Dav999 for help with this!!!

Legal Stuff:

By submitting this pull request, I confirm that...

  • My changes may be used in a future commercial release of VVVVVV
  • I will be credited in a CONTRIBUTORS file and the "GitHub Friends"
    section of the credits for all of said releases, but will NOT be compensated
    for these changes

@InfoTeddy InfoTeddy self-assigned this Nov 2, 2022
@mothbeanie mothbeanie marked this pull request as ready for review November 7, 2022 00:15
@mothbeanie mothbeanie changed the title Region system (draft) Region system Nov 7, 2022
@mothbeanie mothbeanie closed this Aug 24, 2023
@mothbeanie mothbeanie reopened this Aug 24, 2023
@mothbeanie mothbeanie force-pushed the region-system branch 2 times, most recently from 62d6082 to bf8ca30 Compare August 24, 2023 20:56
@mothbeanie
Copy link
Contributor Author

This has been updated to work with the current map code!

@mothbeanie
Copy link
Contributor Author

This has been updated to work with the current map code. Again.

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

Successfully merging this pull request may close these issues.

2 participants