I’m trying to code an instance dungeon. (Sorry in advance for what you are about to read)
For those who do not know what an instance dungeon is, it is an area specific to player or group. Say you walk into a forest with your party (group of players), however you do not want players to crowd said forest, you would create a duplicate area for just those specific players to play in.
A few major setbacks are collisions, and being in multiple rooms at the same time.
There are two methods I thought of to implement my instance dungeon, Z-Stacking and overlapping. I kinda veto-ed Z-stacking as it removes the ability to be in multiple rooms at once, and if there are many rooms (resulting in the rooms needing to be stacked extremely far away) may cause floating-point errors.
The overlapping method has a main problem: collisions.
I would use collision groups, but that would be awfully restricting because of the 32 collision group limit.
I also thought of no-collision constraints however I would need a ton of no-collision constraints for each and every instance (as no-collision constraints sadly doesn’t respect inheritance) affected by physics.
The last solution I came up with (which is very rough) is to handle collisions specific to each room from the client. But I hate to trust the client with physics, and would much rather filter collisions on the server.
Are there any alternative methods to filter collisions? One hopefully mostly server-sided. Thank you for reading, sorry if confusing.
Hi!
Maybe you should consider “layering” instead. That will solve the overlapping problem with zones. Just because you change zone, doesn’t mean that you change layer. You can have larger layers for cities, which will bring players from smaller layers onto the large city layer, after they’ve spent enough time in a city, and then remove them again, when they’re spent enough time in the wilderness.
I’m not saying that you even need the “larger city layer” it was only an idea.
Thank you for the response! I am a bit confused what you mean by layers, something like z-stacking? The main problem with overlapping was the collisions, however overlapping is the only way (that I know of) to allow players to be in multiple rooms at a single time. I am probably not understanding what you mean though, if so my bad .
Uhm, I am sure that your game does not need more than 32 layers that runs simultaneous.
You can have multiple players on the same layer, if that layer gets overcrowded, put X amount of players on a new layer in the same zone, when that layer is no longer needed, merge it together with another existing layer. Layers capacity should be defined by the amount of people, not how many people that is in a specific area. You could ofc take that into account aswell, so the maximum players in specific zones cannot exceed 5 for example.
I know I am being picky, for that I am sorry, but isn’t that still z-stacking, but with a few extra steps? (although I may still be misunderstanding) This still holds the problem that leaves the player unable to see multiple rooms at a single time. Also, I hope there to be a way to create single-player (or party-based) environments for many people, not needing to worry about how many collision groups I take up. (Which again is picky, my bad since you keep giving me solutions) I will likely go with your solution if there is no other choice though, so thank you
I apologize if I am reiterating myself, (I’ve also never played Dungeon Defenders, will look into that though) I know this solves the player/party issue, however how would this solve the being-in-multiple-dungeons-at-once issue?