The issue with asymmetric tiles and an easy solution
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 40/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- game-dev
调研方向
未指定文件、测试或入口点。定位图块侧边的匹配逻辑,追踪边代码的生成和比较方式,然后验证对称边仍能与自身匹配,而非对称边只能与其反向表示匹配。
由索引模型根据 Issue 内容生成。
描述
the issue with the tiles in hand is the asymmetry
when you have a symmetric side on the tile, they can match to themselves (meaning the key you assigned to them), like in the first row here:

But as you can see in the second row, when dealing with tiles with asymmetric sides, the matches are incorrect. The logic used to match sides (having the same code) is not valid for asymmetrical sides, as it allows them to match themselves which is wrong visually.
A quick fix for this is to use a more complex code to identify sides and update the logic that finds that two sides match. My quick fix is to use a 3 character key for each side: '000', '111', '222', '333', ... , 'aaa', 'bbb', 'ccc', etc and for the asymmetrical sides use values as '001' and '100' for their mirrored side. When matching sides instead of comparing their code, you must compare their code vs the reversed string of their code. In this way, '000' matches '000' (which keeps symmetrical sides working just fine) but '001' will only find a match in the reversed key '100' fixing asymmetrical sides.
In the previous example 4 becomes '001' and 5 becomes '100', allowing for them to match to the correct side but not themselves.
Annex:
My suggested solution was to create a method that figures out 3 pixels colours for each side of the tile: left, center and right. Once you have them create an array with those 3 values. To connect a tile to another, just compare the array to the reverse order of itself. This implements the symmetrical / asymmetrical solution and will allow for interchangeable tiles on the fly.
- 主要语言
- JavaScript
- 星标
- 219
- 派生
- 64
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CodingTrain/Wave-Function-Collapse 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 20/100
CodingTrain/Wave-Function-Collapse#41 · 2 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 35/100
CodingTrain/Wave-Function-Collapse#38 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
CodingTrain/Wave-Function-Collapse#37 · 1 条评论 ·
-
难度 1/5 1 小时以内 新手友好度 42/100
CodingTrain/Wave-Function-Collapse#35 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
查看 CodingTrain/Wave-Function-Collapse 的全部 Issue
相似的 Issue
-
Bug
难度 2/5 1-3 小时 新手友好度 70/100
Automattic/safe-publish#594 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
难度 2/5 1-3 小时 新手友好度 70/100
NousResearch/hermes-agent#121143 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
难度 2/5 1-3 小时 新手友好度 75/100