-
Notifications
You must be signed in to change notification settings - Fork 340
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
Tile Rules do not take into account other tiles in same tilemap #27
Comments
On our project (Sparklite) we modified the RuleTile to have what we call "sibling" tiles. When deciding if a rule matches, instead of just comparing to 'this' we also see if it's a sibling. |
We also have siblings PER RULE but I'm wondering if that's a hack cause it feels hacky. |
Dang nice work edward! |
Checking for other types of tiles or extending the distance of checks is certainly possible, but we wanted to keep the use of the current RuleTile simple. Lets see if an extended RuleTile would make sense. |
Hi ChuanXin, I agree with this. the default version should be simple to grasp, and it is! This is the first time I have used the RuleTile and ran into the issue of needing to extend the functionality so I thought I would mention it as I believe it will be necessary for many users. |
I agree that we should keep the current RuleTile simple to use. Extension code (Update with 16/6/2018): public class MyTile : RuleTile<MyTile.Neighbor> {
public bool customField;
public class Neighbor : RuleTile.TilingRule.Neighbor {
public const int Null = 3;
public const int NotNull = 4;
}
public override bool RuleMatch(int neighbor, TileBase tile) {
switch (neighbor) {
case Neighbor.Null: return tile == null;
case Neighbor.NotNull: return tile != null;
}
return base.RuleMatch(neighbor, tile);
}
} |
I have submitted a pull request for this requirement: #37 |
ooh nice! is this pulled? I can't seem to tell. thanks for this! |
This branch can be found here: When the author did not confirm the merger of these changes, I suggest not to update it for the time being because everything may change. |
** Desperate Noob Here **
My End Goal: develop a tile randomization script that will generate custom maps, based on normal tiles and rule tiles. So that in a sense, i'm able to create biomes and coastlines and such that make sense. |
Rule tiles do not take into account positions of other tiles in the same grid even if they are on the same tilemap. It would be nice to have a toggle to allow rules to take other tiles (non rule tile or normal tiles) into account when deciding which sprite to use.
The text was updated successfully, but these errors were encountered: