-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Area Instancing #97
Comments
This is kind of opinionated but I think that logging back into a destroyed instance should emit an event so the developer can decide what to do. An example implementation might involve recreating the instance, then dropping the player back in to a starting room. |
What I wanted to make for it was the ability to pass in a config object that you can utilize for npcs and objects. I would have to make my own custom helpers, but if you did area.clone(config) and had something like config = { health: 1.4, ...} and have that that health percent be applied to all the npcs being loaded. Essentially be able to scale the attributes on items or npcs being loaded in the zone. |
|
I'm not understanding what you mean...like added to RoomManager / AreaManager type of thing?
I agree with Sean, just emit an event.
I suspect that we should also approach mobs in a similarly careful way. It wouldn't be out of the ordinary for games to incorporate features that might reference a mob. Such as taming, or npc memory. We'd want any references to mobs from previously existing instances to be handled well. For general modes of operation, I feel like there are two distinct ways games tend to use instances.
I wonder how this would interact with quests? They have an area in their id. Here's an odd thought, when cloning an area as a new instance, perhaps you leave the area part of the entityReference the same, and add an instance id onto each of the id's for mobs, rooms, items...I don't know, maybe that would be terrible implications, maybe not, haven't looked into it versus changing the area part of the entityReference. Or maybe there's an elegant way to go underneath all of that anyway, I'm not sure.
I LOVE THIS IDEA BRIAN!!! SO GOOD!
Well considering Ranvier engine at the moment doesn't serialize rooms, probably not. |
I don't see why there couldn't be event hooks in place that, with a custom DataSource, would enable saving instanced zones. But you are correct that it does not serialize rooms by default. |
Basic instancing functionality is now testable on the Overview
title: Test Area
instanced: player Non-falsey values of Areas which have a non-falsey value for Creating an instanceAn example implementation can be seen here https://github.com/RanvierMUD/bundle-example-player-events/tree/instancing The gist being:
Removing an instanceLike creating an instance, how an instance gets removed and cleaned up is entirely up to the bundle developer. The |
As to @nelsonsbrian 's idea I've added events for an area when an NPC is added/removed. This currently happens when an NPC is spawned by To accomplish something like that you would create 2 effects. The first being an It would look something like: Somewhere a configuration exists that says Whenever an NPC gets spawned in that area your effect will be listening for it and when it does will be able to create a new effect like |
I've found some an unexpected thing come up with using the instancing branch. Largely it works awesome! Basically, if you try and use state.RoomManager#getRoom to fetch a room from an instance that isn't loaded, it can't find it. Maybe this makes since as the rooms don't technically exist yet. I've run into it using the teleport command, as well as the starting room. I've been using this function, which comes from someplace else. Just figured I'd share in case anyone else runs into this.
|
There are currently a few architectural road blocks preventing multiple instances of a single area.
There are other questions but I think the answers to these are in the responsibility of bundle developers:
The text was updated successfully, but these errors were encountered: