TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Half Tile Offset Streaming World Grids

28 pointsby Atrix256over 7 years ago

2 comments

tuukkahover 7 years ago
When you consider coordinates, Half Tile Offset is same as using hexagonal tiles, but there are mathematically (and code-wise) nicer alternatives: <a href="http:&#x2F;&#x2F;www.redblobgames.com&#x2F;grids&#x2F;hexagons&#x2F;#coordinates" rel="nofollow">http:&#x2F;&#x2F;www.redblobgames.com&#x2F;grids&#x2F;hexagons&#x2F;#coordinates</a><p>If you want to preload 6 adjecent tiles as suggested instead of 8, it seems better to make them hexagon-shaped as well (to make the distance to edges more uniform in all directions). I haven&#x27;t implemented hexagonal tiles of vector data though - any experiences?<p>On the other hand, if the tile size is relatively small and you preload multiple tiles in all directions anyway, the proportional advantage of using Half Tile Offset or hexagonal tiles diminishes and code complexity prevails. (The scaling table in the end of the original article fails to distinguish that you don&#x27;t have to preload all (2N+1)^2 square tiles either: you can approximate a circle with small squares and preload just about PI&#x2F;4*(2N+1)^2 tiles ie. 21.5% savings.)
评论 #15377046 未加载
评论 #15377051 未加载
评论 #15377467 未加载
malkiaover 7 years ago
I didn&#x27;t know it was called &quot;Half-Tile&quot;, but Treyarch&#x27;s Spiderman 2 used this approach (I think it was called &quot;bricks&quot; internally) to stream the game.<p>So when Spidey was speeding up to some direction, I think it was three bricks that would start asynchronously loading, and others would get cancelled (say CancelIoEx on Windows&#x2F;etc.)