SEServerExtender / EssentialsPlugin

Dedicated Essentials Plugin
GNU Lesser General Public License v3.0
18 stars 18 forks source link

Add floating entity cleanup/control #39

Open dodexahedron opened 9 years ago

dodexahedron commented 9 years ago

Since floating entity cleanup is being removed from extender, something should be put into essentials to replace it (though much more capable/useful).

Thoughts on what might be good floating entity management schemes?

SilentSymphony commented 9 years ago

I've always thought that Per-User floating objects would be really nice to have, But i have no idea if it is even possible in extender/essentials

dodexahedron commented 9 years ago

It'd be possible, but it would still have to live within the global limit set on the server.

SilentSymphony commented 9 years ago

Well, 25 per user would be a total limit of 375-700 based on some popular servers player counts at 15-28 players, Having them all moving at the same time could get bog down the server so if they were to stop if not affected by gravity it would make hand mining much easier, Gravity collectors, Cannons all without disturbing other users hopefuly, I'm not sure how you'd handle them spawning from ships crashing, or miners/etc,

Anyway its just a thought.

dodexahedron commented 9 years ago

Hmm. Ownership is the trick, in any case. Since floating objects aren't really owned by anyone, how would I track this? I could potentially try to get the nearest player and just assume they own it, for purposes of the limit.

For crashes, or for large mining ships/platforms, that could lead to unexpected results Any ideas?

qrokodial commented 9 years ago

don't know much about how SE does things, but don't floating objects still have some sort of unique ID? can't you just map the ID of the floating objects to the associated players? if the player goes over the limit, just delete the first floating object on the player's stack.

dodexahedron commented 9 years ago

Yes, they have unique ids, but how do you know who created them in the first place?

qrokodial commented 9 years ago

well, this is a wrapper for the SE server, correct? the SE server has to, at some point, know why its creating these floating items? (so for example: I'm creating floating items here because player X just drilled the shit out of this asteroid).

again, taking shots in the dark for game internals in which I'm not fluent in. but if my speculations are correct, this would be a great feature to abstract out into an event system within the extender

zrisher commented 9 years ago

You'd have to amend the core functions that create the objects to call events or attach the entities to the player in some sort of entity manager, this is not currently done at all.

dodexahedron commented 9 years ago

Right. This is a wrapper, not a code injector. In order to do something in the middle of a native game function, that function needs to yield execution to SESE. That's only doable through things like events. If floating object creation is something people would want to hook for other things, though, a good case could be made for adding it to the SE code. Implementing an event and a public delegate in there would be pretty easy and they just might accept that kind of change.

dodexahedron commented 9 years ago

I'm all for having all sorts of events in the game that can be hooked into. It's about the ultimate in extensibility. It could potentially be a security risk on the client side, though, if the events could be hooked in scripts or via client-side plugins.