Commit Graph

233 Commits

Author SHA1 Message Date
ecb27deeae When sync_me is false avoid:
* Logging a warning when deleting the entity and it is not in any
  Region.
* Searching every single region for an entity that is in none of them.

Also:
* Add workaround for bug in specs where deleting any entity clears the
  components before checking that the generation is correct (surprised
  that we haven't encounted bugs from this yet).
* Properly update `tracked_entities` inside `RegionMap` when deleting
  an entity. Previously, we just relied on this being updated in
  `RegionMap::tick` by the absence of the `Pos` component at that index.
  However, this means if a new entity is created at that index after
  deletion and before calling `RegionMap::tick`, then this can be
  interpreted as an entity moving between regions rather than one being
  deleted and another created. It seems like this could lead to
  synchronization bugs like not creating the new entity on the client
  (although I haven't noticed this before, I think maybe we use newly
  inserted `Uid`s to detect new entities rather than the region system?).
  I think it could at least lead to sending redundant messages to
  synchronize the new entity.
2023-08-11 20:09:55 -04:00
cdca700297 Properly check conditions for when the client's physics components should be synced 2023-08-11 20:09:55 -04:00
a01f75b38d Add sync_me parameter to Presence that must be set to true for
entities with the `Presence` component to be synced to other clients.
2023-08-11 20:09:55 -04:00
Sam
1cc99c9c4a Fixes to animations and making ability that the animation system thinks is being used more correct 2023-07-29 19:03:56 -04:00
0b213b6149 Move common code into a separate function to avoid the complexity of calling delete_entity_recorded from handle_exit_ingame 2023-06-04 22:29:19 -04:00
599e25c9c6 Address review on !3971 2023-06-04 21:12:39 -04:00
ea77a443a2 Fix conditions on some error logging spots 2023-06-04 12:59:09 -04:00
65efa779b5 Steps towards properly synchronizing when a client exits in-game to
return to the character screeen. And other related improvements.

* Uid now optional when removing an entity from IdMaps since that Uid
  may have been transferred to the new entity created when the client
  exits "in-game".
* Added notes about making sure to update the CharacterId mapping when
  changing the `kind` field of `Presence`.
* Add a parameter to `delete_entity_recorded` that indicates whether it
  is being called from `handle_exit_ingame` and that provides the `Uid`
  that was removed from the entity so that we can more explicitly and
  correctly handle that case.
* We now add the Uid of the client to the deleted entities list when it
  exits "ingame". (still need to rework code so that the client doesn't
  delete its own entity).
* Improved integration of possession code with ForceUpdate logic.
* Don't remove `Presence` component from old entity in possession so
  that deleting that entity will properly handle updating the
  CharacterId unmapping (if the old entity isn't going to be deleted we
  still remove the `Presence` component so that it doesn't keep terrain
  loaded).
* Added a couple TODOs on existing tangential things I noticed.
2023-06-04 12:58:16 -04:00
a8fbfc026a Fix compilation errors from recent changes 2023-06-04 12:58:16 -04:00
c60f994c7f Some random changes and a fmt 2023-06-04 12:58:16 -04:00
f11baed9fa Adapting various things to the new interface, fixing compilation errors,
and progressing on half done things. Also, added a few TODO comments.
2023-06-04 12:58:16 -04:00
4094887997 Rename UidAllocator to IdMaps everywhere, also rename lookup_entity to
uid_entity.

Also made more progress on changes in common/src/uid.rs

(does not compile so don't know if all rebase quirks resolved)
2023-06-04 12:58:16 -04:00
35922866a8 Start refactoring UidAllocator to contain mappings for different Id
types.

* Add new `IdMaps` type that contains mappings to Entity from Uid, CharacterId, and
  RtsimEntity.
* Add PresenceKind::LoadingCharacter variant for when the CharacterId
  has not actually been confirmed to exist and belong to the logged in
  client. Switches to the regular PresenceKind::Character once the
  character is loaded from the database and that is used to update the
  entity.
* Start refactoring `delete_entity_recorded` to check for CharacterId
  and RtsimEntity values that may need to be removed from the map (just
  very start, not near complete).
* Other misc tweaks.
2023-06-04 12:58:16 -04:00
3277d18265 Rename retrieve_entity_internal to lookup_entity 2023-06-04 12:58:16 -04:00
ea725fffde Cleanup UidAllocator and Uid a bit:
* Remove unnecessary Marker/MarkAllocator trait implementations.
* Delete excess functions
* Change some methods to take Uid instead of u64
2023-06-04 12:58:15 -04:00
ec3a7d1898 Make items vanish after 5 minutes 2023-06-01 14:51:19 +01:00
777a69e576 adressed review comments 2023-05-22 23:20:11 +02:00
ec5e3fe716 Avoid re-fetching system data on every link persist 2023-05-13 12:31:19 +01:00
6674cce2cc intercat with sprites on ships 2023-05-09 19:43:09 +02:00
73c84dfcc2 Clippy 2023-05-05 00:04:13 +01:00
8d9625d6ee Addressed comments 2023-05-04 23:18:40 +01:00
ee971e4056 Added item merging 2023-05-04 22:12:25 +01:00
3548b464da orient airships correctly on load 2023-04-14 11:25:59 +02:00
16e3227f78 Correct localisation of numeric values, use coordinate conversions in rtsim 2023-04-12 10:36:11 +01:00
0bb6fa7946 add flag to clamp to ground for RepositionOnChunkLoad 2023-04-12 10:17:49 +02:00
6be4a2b33f only add RepositionOnChunkLoad to rtsim npcs and don't add Waypoint if it doesn't exist 2023-04-12 09:24:07 +02:00
edcc2f1870 Overhauled chat message representation to allow for more exhaustive localisation 2023-04-11 15:46:36 +01:00
d7ba4ecef7 Allow OnDeath event to handle all actors 2023-04-09 19:25:58 +01:00
3e0f5295c0 Added CharacterActivity, made NPCs look at the player when speaking to them 2023-04-09 19:25:57 +01:00
364255c7fe Allowed rtsim NPCs to greet nearby actors 2023-04-09 19:25:55 +01:00
6035234c6e Removed old rtsim 2023-04-09 19:25:55 +01:00
1a117f1331 rtsim vehicles 2023-04-09 19:25:54 +01:00
0b4d3c9e20 Fixed scaling of airships 2023-04-09 19:25:53 +01:00
e8b489a71a sync 2023-04-09 19:25:53 +01:00
afd9ea5462 site pathing 2023-04-09 19:25:52 +01:00
c168ff2f9b Added rtsim saving, chunk resources, chunk resource depletion 2023-04-09 19:25:51 +01:00
c34e5ad4ed Small fixes 2023-03-29 23:11:59 +00:00
Sam
a3d655970e Heavy stance required abilities 2023-03-21 19:56:32 -04:00
Sam
9875008efa Added stance component that persists even after sheathing weapon (does not yet work with M1 replacement). 2023-03-21 19:29:34 -04:00
Sam
4c79936c07 Added wrapper type to durations related to buffs and auras. 2023-03-11 16:47:11 -05:00
Sam
663db06844 Made auras no longer need to be mutably accessed every tick. 2023-03-11 16:45:12 -05:00
Sam
9efac9957d Changed buff effects so they did not need to mutably change buffs every tick. Buff system now no longer mutably accesses buffs component. 2023-03-11 16:45:11 -05:00
Sam
b1b41e95f6 Queueable buffs now work with buffs without using a timer, tests too 2023-03-11 16:45:11 -05:00
Sam
89aa934c3c Initial work 2023-03-11 16:45:10 -05:00
74ee861dde Add glow to dropped lanterns 2023-01-23 16:13:43 +00:00
78845a0d73 Implement potion sickness, which causes diminishing returns on healing from potions. 2023-01-19 15:06:12 -05:00
Sam
500e0ae3d0 Heavy abilities 2022-10-27 20:06:34 -04:00
ff781198d3 Fix 18-slot pets (they now properly get inventories based on their body type, which is usually 1-slot).
Also fixes a related issue where pets lose their natural weapons/armour.
2022-09-30 14:51:49 -04:00
986d104faa Update Rust toolchain. 2022-09-08 15:43:53 -07:00
334937568e Add an entity view distance setting that allows limiting the distance
entities are synced from and displayed in.

NOTE: Syncing entities work at the granularity regions which are
multi-chunk squares but the display of entities in voxygen is limited in
a circle with the radiues of the supplied distance.

Additional details and changes:
* Added `ViewDistances` struct in `common` that contains separate
  terrain and entity view distances (the entity view distance will be
  clamped by the terrain view distance in uses of this).
* View distance requests from the client to the server now use this
  type.
* When requesting the character or spectate state the client now passes
  its desired view distances. This is exposed as a new parameter on
  `Client::request_character`/`Client::request_spectate`. And the client
  no longer needs to send a view distance request after entering these
  states. This also allows us to avoid needing to initialize `Presence`
  with a default view distance value on the server.
* Removed `DerefFlaggedStorage` from `Presence` and `RegionSubscription` since the
  change tracking isn't used for these components.
* Add sliders in voxygen graphics and network tabs for this new setting.
  Show the clamped value as well as the selected value next to the
  slider.
* Rename existing "Entities View Distance" slider (which AFAIK controls
  the distance at which different LOD levels apply to figures) to
  "Entities Detail Distance" so we can use the former name for this new
  slider.
2022-08-25 23:24:43 -04:00