游戏开发论坛

 找回密码
 立即注册
搜索
查看: 4430|回复: 0

Roguelike???????

[复制链接]

1万

主题

1万

帖子

3万

积分

论坛元老

Rank: 8Rank: 8

积分
36572
发表于 2019-12-13 10:48:37 | 显示全部楼层 |阅读模式
QQ??20191213104822.png


?????????????????????????

Roguelike Vision Algorithmswww.adammil.net

??????????????????implementations????

??

??Roguelike?????????????????????????????????????????????????????????????????????????????????????????????????????????

???????/ field of view / FOV?????????????????????????????????tiles????????????tile???/ line of sight / LOS????????????tile????????????????????????????????????/ line of targeting / LOT??

???????

??????????????????????????????????????????????????

  • ????Symmetry?? ????tile A?????tile B?????tile B????????tile A????????????????????????LOS?LOT????????????????????????
  • ?????Expansive Walls????????????????????????????????????????????????????????????????????????????????????????????
  • ??????? ?????????????????????????????????????????????????????roguelike?????????????????????
  • ????? ?????????????tile???????????????????????????????????????????????????????????tile???????????????????????????????????????????????????????????????????????
  • ?????Artifacts?? ?????????????????????????????????????????????????????????????????????????????????????????????????????????????bug?
  • ??? ?????????????????????????tile?


????

???????????????

?????Ray casting?

??? ???????????????????????????

??? ????????????????????????

??????????????????????????????????????????????????Bresenham'???[0]?????????????????????????????????????

  • ???? Bresenham????????????????????????????????????????????????????
  • ????????????????????????????????????????????????????????????
  • ???????tile????????????????????????????????????


??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????4?????????????????????????????????????

image003.jpg

???http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html#raycode

???????tile?????? Shadow casting?

????????????????????????

???????????????????????????????????????????nontrivial??

??????????????????????????????????????????????????????????????????????????????tile????????????tile???????????????????????????????????????????????????????????????????????????? ????????????????????????????????Light casting?Ray casting???????????case????????????tile?????????????

??????????????tile?????tile???????????????????tile????????????????????????????????? ??????????????????

image004.jpg
???45????????45???????????????????????????????????0?1??????????????????????????????????????????tile???????????????????????????????????

image005.jpg
??????????????????????????>>??????????????

image006.jpg
????????>>???????????????

image007.jpg
??????????????????????????????????????????????????????>????????????

image008.jpg
?????????????????????tile??

????????????????????????????????LOS==LOT?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????LOS????LOT???????????????????????????????????????????

??????????????????????????????????????????????tile?????tile????????tile??????????????????????tile??????????????????????????

image011.jpg

???http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html#shadowcode

?key point is the strategy of how to determine a tile is visible: just need the sector cover the tile? or need to cover the center point? or cover a certain percentage of area? ?????????????????????????????????????????

????Diamond walls????tile?????

????????????????????????????????

??????????????????????????????????????????

??????????????tile??????tile???????????????????tile????????????????????????????????????????????????????????????????????????tile?????????????????????????? ??????????????????????????????????????????tile???????????????

??????????roguelikes???????????roguelikes????????????????????????????????????????????????????????????????????????? ????????????????????????

image012.jpg

image013.jpg

image014.jpg

?????????????????????????????????????????tile????????????????????????????????????????????????????????????????????

image015.jpg

image017.jpg
??????????

image019.jpg
??????????????????????????????????

???http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html#diamondcode

????Half-width walls?

???? ??????????????????

??????????????????????????????????????tile??????????????????????????????????????????????????? ???????????????????????????????????????

???FOV?Permissive field of view??tile to tile?

??? ???????????????????

??? ????????????????????????

?????tile????????tile??????????????????????tile???????????????????????????????????????????????????????????????????????????????????????????????????Jonathon Duerig[1]?????????????????????????????????????????????????????????????????????????????????????

??????????????????????permissivity??????????????????????????????????????????anyway?

image021.jpg

??? http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html#permissivecode

Digital FOV?????

?????? ???FOV?????

Digital FOV???tile?????????????????????????????????????????????tile?????????????FOV?????????????????? ????????????????????????????????????digital straight line segments????????????? One interesting feature of the algorithm is that the knowledge of the digital line segment from a line-of-sight calculation allows easy tracing of a projectile path through space without hitting any walls, even down somewhat twisted tunnels (such as the Kuo corridor above) ??????????????

????

???????????????ray casting?????????????????????????ray casting????????????????????????????

  • ????????????
  • ???????
  • ?????????????????????????????
  • ?????????????
  • ????????????????????
  • ???????????
  • ?????????
  • ????
  • ????
  • ?????


????????????????????? ?????2???????????????????????????????????

image022.jpg

image023.jpg

1.        ?????tile???????????????????

2.        ??????????????tile???

3.        ???????????size???tile?1/2???????tile???

4.        ????????????????????????

????????????????????????????????????????????????????????????tile??????????????????????????????????????

?2??????????????????????????????????????????????????????tile???????????????????????????????????????????tile??????????????????????????????????tile????????????

???????????????????????????????????????????????????tile???????????????????????????????tile???1/2???????????????3/8??????????????????????????????????????????????????????????????1 /2????????????????????????????tile???????????????

image025.jpg
?????????1/2???

?????????????????????????????????????????????????????

1.jpg

???????????????????????????????????????????????????????????????????

2.jpg

???????????????????????????????????????????????FOV???????????????????

???http://www.adammil.net/blog/v125_Roguelike_Vision_Algorithms.html#mycode
[0] Bresenham's algorithm: https://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
[1]Jonathon Duerig: https://user.xmission.com/~tyrecius/

?????
?????https://zhuanlan.zhihu.com/p/94699665


您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-8-17 20:11

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表