Giter VIP home page Giter VIP logo

Comments (19)

popstarfreas avatar popstarfreas commented on June 13, 2024

That seems like a good addition. It seems like a client-state synchronisation issue similar to #41. Is it better to send the server the information on the projectile upon switching or is it better to attempt to remove it?

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

Transferring the projectiles over is nearly impossible: Even if the client is able to keep the owner+ident combo of the projectiles, the chances that the global(server) projectile id is unused in the new dimension are pretty slim.
So killing off projectiles seems like the way to go: Buff-based projectiles will be respawned by the buff refresh loop on the client, Equipment-based projectiles will be respawned by the equips update loop on the client.
Letting the client start off from scratch (like after running /clear projectiles) will cause the least issues.

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

I don't think that's how it works from what I remember. The client decides on an id, and that is bound with their player id (what you said about owner+ident) to identify projectiles, the server will search through its array until it finds that combination for any projectile updates, I don't remember any server-side projectile id. I don't know how that interacts with the client when their player id changes though.

Buff-based projectiles may be respawned, but do you get things like the Solar Flare shield getting reset? That might be problematic.

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

Also each client knows about the projectiles of other players. And when you jump dimensions those "other" projectiles will just lay dormant in the client memory. (That is if the client doesn't have one global 1000 projectiles array and instead keeps arrays for each player... Which I doubt)
Making the client forget everything about the previous dimension and then feed it information about the new dimension (we might have to send all server projectiles of the new server during the transition 🤔 ) leads to a more synchronized behavior.
I will check how Solar Flare works, thanks for the heads up.

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

Solar Flare isn't a projectile but rather client-side Dust(s). Works directly off of Buffs (type 170, 171, 172).
This buff (and the chloro buff in the example above) check their consistency every tick.
tl;dr: The player will keep his current Solar Flare level and the Solar Flare levelup counter.

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

How about minions? Does that reset the minions spawned?

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

Minions are projectiles, so yes. And might be for the better since the new dimension might have different inventory/permissions.

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

Yes but I don't believe that should be the responsibility of Dimensions. The server itself could easily remove them on the case that it doesn't want them. It would be especially annoying in the case that no SSC is involved, and the user is constantly getting their minions removed.

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

Constantly? I guess there's a use case involving a LOT of dimension shifts.
Guess emulating all the ProjectileNew packets will be the solution?

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

I'm just not sure how the server will react to new projectiles a mile away from where the player appears or even off the map if the world size is different.

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

Would it be possible to add a config option for the switcher to either push the projectiles over or to kill them? If the target dimension is SSC and the transferred projectiles don't line up with their SSC inventory it could trigger an anti-cheat.
Or at least lower the Player.State below 10 until they are fully aware of the new dimension?

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

Well a config option might work, because that way the host can choose which one fits what they're doing best. May also be possible to give the option to clear "always" or "ssc", so that they can enable it for SSC only? Since that sounds like the biggest reason to use clearing.

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

Great idea since you can detect if the target dimension is in SSC mode 👍
"never", "ssc", "always"

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

I assume that you're not up for programming it, so I self assigned it but if I am wrong then I'd be welcoming to a PR that adds it, since I don't have a lot of time to work on it.

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

I've never used typescript/javascript so you clearly have more expertise in this.
...
Nobody has time nowadays, I know 😃

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

I know it's been a while and I've not worked on it yet, I'm hoping that I can get around to it soon once I have time off.

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

You can test the build using the zip at #56 and let me know if that does what you want yet. It keeps track of client projectiles and will send destroy projectile for each active projectile to the client when receiving world info while switching.

from dimensions.

popstarfreas avatar popstarfreas commented on June 13, 2024

Oh and I forgot to mention that you need to add the following to the config:

        synchronization: {
            projectiles: {
                enabled: true,
                type: "clear",
                when: "ssc",
            }
        }

from dimensions.

Commaster avatar Commaster commented on June 13, 2024

The problem with "keep" is that you can't guarantee that the target dimension will have free/enough projectile slots. They are hardcoded to 1000 slots and run out very quickly with a couple of players. Mostly only possible for small minigame-like dimensions.

from dimensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.