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

TileMapPattern system improvements #95826

Conversation

MendicantNinja
Copy link

@MendicantNinja MendicantNinja commented Aug 19, 2024

Upgrades to the TileMapPattern (Which I will be referring to as patterns from now on) system. Several Roguelike devs/2D devs including Parzival, the creator of Psychworld (on Steam) have expressed a lot of interest in an improved pattern system and I personally need it for my game as well. Here's the list of what's improved and added in this pull request:

  • Patterns are now organized into pattern sets as opposed to 1 giant list. Sets can be renamed, shuffled around, or deleted (see video). This is useful for organization as well as procedural generation (picking at random from a specific list of patterns, as opposed to a single mega list or range.)
  • Patterns are now able to be renamed, shuffled around, or deleted. Previously patterns could not be resorted and their index was fixed once created. (to my knowledge and those of others).
  • Patterns can now be multilayer patterns. So if you want to procedurally generate a village full of houses with a roof layer, wall layer, furniture layer, and floor layer. You can!
  • Unrelated addition to "tree.h/tree.cpp", I wrote a get_line_editor() method as I couldn't seem to get the line_editor for a tree that I needed to implement some pattern GUI functionality.

Room For Improvement/Concerns:
-Not compatible with the old pattern system/saved patterns. The new TileMapPatterns have some new variables in the class definition and aren't stored in the same-exact place. But rolling back to a backup should fix such a thing if somebody has a lot of saved patterns.
-Some GUI stuff, like pattern sets becoming unselected after you add one and having to reselect the pattern set. Or adding the patterns display back to TileSet.
-set_pattern_multi_layer() in tilemaplayer.cpp requires a list of the TileMapLayers in the scene tree the player wants to use as a parameter (it needs to know that information somehow to set down the tiles). Perhaps there's a way around this. But I haven't found it.
-I haven't seen any red error messages (see video) when testing all the functionality. If there are any bugs, I'm confident they will be contained to the TileMapPattern system and I can fix them if the steps are reproducible.

Video link showing off the new features in-action and some super basic procedural generation I did. (the video size is too big for Github):
https://discord.com/channels/1235157165589794909/1235168195275391036/threads/1275230695781961871

Saving my progress so I don't lose it.
multi-layer patterns
Last multilayer changes before merge
Single layer patterns working correctly.
Debugging invalid tile atlas source = -1
Multilayer patterns can be dragged and dropped on the tilemap. But crashes occur on patterns being saved to a list.
Title. Currently working on set_pattern.
Not launching.
@MendicantNinja MendicantNinja requested a review from a team as a code owner August 19, 2024 23:46
@AThousandShips AThousandShips requested review from a team and removed request for a team September 21, 2024 11:48
@AThousandShips
Copy link
Member

Superseded by:

@AThousandShips AThousandShips removed this from the 4.x milestone Sep 23, 2024
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.

Upgrades to the TileMapPattern System. Related to a current pull request.
7 participants