game-arch / mmo-arch

Base Architecture for creating scalable games using microservices through Angular, Phaser, NestJS, NATS, and MySQL
33 stars 4 forks source link

Feature Request: Instance Management #3

Open JoeyHengst opened 4 years ago

JoeyHengst commented 4 years ago

It would be nice to have a microservice which would facilitate in managing instances

The microservice could be used as an example to build rooms for dungeons, raid bosses etc..

jwhenry3 commented 4 years ago

One way we can accomplish instancing is to have a massive map with clones of locations so we can limit how many map servers we need to spin up for instances.

We will need to limit socket traffic to a subset of x/y coordinates so we can present the data for the "instance" only to those that care about it.

we can label a "room" as "instance-1" with a scope of x1:0 y1:0 and x2:200 y2:300 if we want to only notify users in instance-1 about events happening within x (0-200) and y(0-300).

This kind of filtering might also be useful for non-instanced areas.

JoeyHengst commented 4 years ago

Interesting. Am I right that with this approach we probably can also use this to have like "specific quests" events which are only visible to the user? Or would that be better to have that handled in a separate Quests Microservice which would handle user quests, clan quests, etc..?

jwhenry3 commented 4 years ago

We can work in quest specifics of a map like NPCs and objects to be on the same map but with a filter. I believe phaser has collision groups we can add players and mobs to so events and collisions only fire when they match the right groups. We can discuss that further as that feature gets closer

jwhenry3 commented 4 years ago

Looking at how FFXIV and some other big boys do this, we might just have clones of the same map (channels) and once that capacity is reached, have a queue for those waiting to enter. The map instancing is currently being worked on so it would go hand in hand with this.

jwhenry3 commented 4 years ago

Auto-scaling up map servers could be something we look into later but for now we shouldnt need it