Title: Only broadcast entity actions to players who can see them · Issue #78 · feather-rs/feather · GitHub
Open Graph Title: Only broadcast entity actions to players who can see them · Issue #78 · feather-rs/feather
X Title: Only broadcast entity actions to players who can see them · Issue #78 · feather-rs/feather
Description: Currently, entity movements, actions, and such are broadcasted to all online players, regardless of distance. Ideally, players would only be notified of entities within their view distance, and entities leaving that radius should be dest...
Open Graph Description: Currently, entity movements, actions, and such are broadcasted to all online players, regardless of distance. Ideally, players would only be notified of entities within their view distance, and ent...
X Description: Currently, entity movements, actions, and such are broadcasted to all online players, regardless of distance. Ideally, players would only be notified of entities within their view distance, and ent...
Opengraph URL: https://github.com/feather-rs/feather/issues/78
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Only broadcast entity actions to players who can see them","articleBody":"Currently, entity movements, actions, and such are broadcasted to all online players, regardless of distance. Ideally, players would only be notified of entities within their view distance, and entities leaving that radius should be destroyed on the client.\r\n\r\nMuch of the functionality to do this is already implemented. In particular:\r\n* The chunks a player keeps loaded (and thus those within their view distance) are already stored in the `ChunkHolders` type. Given the position of the chunk an entity is in, we can easily find which players can see the chunk using this type. As a result, it is easy to determine which players to send entity actions to.\r\n* The entities for each chunk are stored in `ChunkEntities`, so when a player joins, we can loop over the chunks within the view distance and only send them the entities in those chunks.\r\n\r\nThis implementation consists of a few steps:\r\n* Implement a convenient way to broadcast packets to players who can see a given chunk. This would probably take the form of e.g. `fn broadcast_packet\u003cP: Packet\u003e(chunk: ChunkPosition, chunk_holders: \u0026ChunkHolders, entities: \u0026Entities, packet: P, neq: Option\u003cEntity\u003e)`, similar to the structure of `send_packet_to_all_players()`.\r\n * It might be slightly annoying to have to pass all those parameters to the function. For cleanliness, it's possible to investigate moving `ChunkHolders` into `Util` and having the function be a member function of `Util`.\r\n* Detect when a player leaves a chunk and destroy entities client-side in chunks which are no longer within the view distance.\r\n* Only send the inventories, positions, etc. of entities within the view distance when a player joins.","author":{"url":"https://github.com/caelunshun","@type":"Person","name":"caelunshun"},"datePublished":"2019-08-23T04:23:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/78/feather/issues/78"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8470cc78-94f6-87be-ca74-26e3b17928ec |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA90:16D2A2:1AB88:223D5:698E7D1A |
| html-safe-nonce | b4f1b33fb423043191715a480eee14908df6062e9035f6c237c6dc20144366ae |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTkwOjE2RDJBMjoxQUI4ODoyMjNENTo2OThFN0QxQSIsInZpc2l0b3JfaWQiOiI0MzUwMzk2MTU3MTIzMjYzNzcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 06e262c4a81e6a914ed0363c7186017efbeaef2bc7ec3a2f7ce038e013fea6b4 |
| hovercard-subject-tag | issue:484323042 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feather-rs/feather/78/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a67b5c212cfd8718f9697232f18612b26b820c8315cbc74ee12cf1147013eea3/feather-rs/feather/issues/78 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a67b5c212cfd8718f9697232f18612b26b820c8315cbc74ee12cf1147013eea3/feather-rs/feather/issues/78 |
| og:image:alt | Currently, entity movements, actions, and such are broadcasted to all online players, regardless of distance. Ideally, players would only be notified of entities within their view distance, and ent... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | caelunshun |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb2828a801ee6b7be618f3ac76fbf55def35bbc30f053a9c41bf90210b8b72ba |
| turbo-cache-control | no-preview |
| go-import | github.com/feather-rs/feather git https://github.com/feather-rs/feather.git |
| octolytics-dimension-user_id | 54925191 |
| octolytics-dimension-user_login | feather-rs |
| octolytics-dimension-repository_id | 191701609 |
| octolytics-dimension-repository_nwo | feather-rs/feather |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 191701609 |
| octolytics-dimension-repository_network_root_nwo | feather-rs/feather |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f7a12861f7011eecb14bcc4388a767d829a52dfc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width