Skip to content
This repository has been archived by the owner on Sep 3, 2022. It is now read-only.

Progress #1281 -- ObjectManager.Update, vision and spawn rewrite #1290

Closed
wants to merge 3 commits into from
Closed

Progress #1281 -- ObjectManager.Update, vision and spawn rewrite #1290

wants to merge 3 commits into from

Conversation

Killfrra
Copy link
Contributor

@Killfrra Killfrra commented Feb 1, 2022

Changes (in no order):

  • Objects spawn at the end of the frame, after updating existing objects and after updating visibility. Visibility is now updated once per frame after updating objects.
  • Disabled autospawn for particles.
  • TeamHasVision - DEPRECATED, obj.IsVisibleByTeam(team) should be used instead.
    //TODO: Leave the option to force a vision update and a warning that it's not efficient?
  • Added private function UpdateVisibilityAndSpawnIfNecessary to ObjectManager
  • locks have been commented out as unnecessary
  • Improved documentation in NavGridCell
  • Changed the implementation of the IsVisibleByTeam function in GameObject, now it uses uint and bitwise operations to store a list of teams that we can see the object with, which is more efficient.
  • The IsSpawned and SetAsSpawned functions have been added to the GameObject, replacing the _visionUnits list in the ObjectManager. In the future, they will allow to determine for clients from which teams the object has already been spawned, which will allow to spawn objects only when they first enter the visibility zone, reducing the likelihood of cheating (individual objects will spawn for everyone, for example, minions, the time and position of the appearance of which for no one secret), and also allow to solve the existing problem that if the particle was created outside the command's visibility zone, it will not be created when entering the visibility zone, as happens with attacked objects that have a NotifyEnterVisibilityClient.
  • Everything related to *VisionUnits - removed
  • Lines marked with // TODO: send this in one place only are commented out because syncing everything and everything is done in GameManager.Update, but this may change in the future if a way is found to transmit only changes.
  • The logic of updating buffs and checking the target for correctness has been moved from ObjectManager to ObjAiBase and SpellMissile.
  • The NotifyTeamVisibilityChange function has been added to PacketNotifier, which sends the appropriate packet based on the type of the object passed to it.
  • Visibility of dead AI no longer changes, they just don't get updates

lzardy pushed a commit that referenced this pull request Feb 4, 2022
…eamAboutVisibilityChange (#1295)

Started splitting #1290 into separate pull requests, this is the first.

`PacketNotifier` now has a function `NotifyVisibilityChange` (when we talked about it, it was called `NotifyVision`), which sends the appropriate packet about changing visibility depending on the type of object. Visibility updates for attacked units and particles are merged and moved to a separate function `UpdateVision` that calls `NotifyVision`.

In fact, this is just the implementation of the idea [described in the message](https://discord.com/channels/166860156506865665/167010397428121601/937137082999119944)

I also fixed a bug that I myself created by negligence: objects are no longer updated immediately after creation (because time has not passed since their creation) 😅
@Killfrra
Copy link
Contributor Author

This has become part of my other commits, like #1329 and #1295

@Killfrra Killfrra closed this Mar 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant