Multiple Entity Interaction in a MMORPG

Hello all,
I need some help. I am working on creating a tile based, sprite based MMORPG engine. Think MMO Zelda. My system is three teared, with a client, a transaction server, and a database for persistence. I have come to the part where I need to handle player movement. Whenever a player moves, other players in the same zone need to be notified so they can draw the changes properly. Now, I was thinking, if every time an entity moved (player or NPC) all players were notified, the bandwidth would quickly add up, so I came up with the following idea:

A data structure will be maintained for each zone that stores the position of each active entity (player and NPC). Each active will have a list of other actives within its “square of influence” (a few grid squares past the edge of the screen). Whenever an active moves, it will first drop any references that have left the square of influence, then acquire any new references that have entered the square on influence, and finally notify all references within the square that the move has been made so they can update their respective client displays. This system works based on the assumption that active A can “see” active B if and only if B can “see” A. This data structure could also be extended to allow the passing of communication messages to everyone on the screen.

Does this all make sense? Am I on the right track? Thanks,
Delta.

This is actually quite a common method to do it.
Google for ‘aura nimbus sphere’.

[quote]Hello all,
Now, I was thinking, if every time an entity moved (player or NPC) all players were notified, the bandwidth would quickly add up, so I came up with the following idea:
[/quote]
This is a big problem that is the subject of a lot of active research. Like most of MMOG development, it’s always a case of tradeoffs - PC’s these days are still far too puny to handle MMOG’s without a lot of compromises.

This will certainly work. However, 99% of the approaches to MMOG development “work”; it’s just they break whenever e.g. “more than X players in the game”, either because the algorithm uses too much memory or too much CPU.

If you want advice on what algo to use for this task, you need to sit down and very carefully think about your requirements first. You haven’t, for instance, told us the most important thing of all - which is the max number of players that any given player will ever be able to “see”. Equally, we’d need to know what limit you’re going to place on the number of players in your game.

The algo itself is perfectly good…indeed it sounds just like one that I think Ensemble Studios (Age of Empires people) proposed - although they suggested a more generic system that enabled an RTS to constantly update info in multiple different dimensions (e.g. “Line of Sight + FoW”, “Pathfinding”, “desirable locations”, etc). The aim was to provide a system that had a high cost per unit-movement, but a very very low cost per query - so that units could calculate e.g. whether they could see another unit almost instantly. Works particularly well when you have many more units “looking” at the map/data than are moving.

Actually, it makes a lot more assumptions than that, mainly to do with performance, relative numbers of moving objects, etc etc. Hopefully what I’ve mentioned above gives you a small taste of this?

To be honest, I hope you aren’t really attempting an MMOG unless you’ve got a large team or financial backing or something :). You’d be much better off doing a 16-player or 64-player or etc game. MMOG development is really really really hard, and although it’s certainly within the reach of anyone, there’s a lot of specialist stuff you have to learn in order to make your game work OK (in addition to getting all the standard things from game development right - graphics, sound, networking, collision detection, AI).

If you (or anyone else) really want to work on an MMOG, I’d suggest getting involved with WorldForge.org (Open Source MMOG development). They’ve been going for about 6-7 years, and have developed lots of technology for MMOG game development. The main benefit of getting involved is learning all about MMOG development from people who have been working through the issues for years. The main problem is that it’s OpenSource, so people come and go, and there’s a very large number of people with little or real understanding of MMOG technical problems at any one time. On the plus side, they have something like 50+ talented artists constantly churning out graphics for use in any WorldForge-based game (and it’s OS, so you can go ahead and start a new game based on their tech).

Other ommited specifications:
Max number of people per zone: approx 500
Max number of people on screen at once: approx 75

I am writing this system singlehandedly for learning purposes. I have no illusions of creating the next SWG. Since I have started, I have learned a ton about threads and synchronization, the full screen graphics API, java sound, TCP/IP, protocal design, object serialization, JDBC, and SQL.

Ditto, I think alot of people are in your position, it’s done as a learning experience, sometimes learning for the sake of it, there is no way we could compete, especially on the graphics front, they have teams for gl/dx guru’s, and we are learning. But what a learning experience it is, and there is always something to play with when you get a bit done :slight_smile:

Endolf

[quote]Ditto, I think alot of people are in your position, it’s done as a learning experience, sometimes learning for the sake of it, there is no way we could compete, especially on the graphics front, they have teams for gl/dx guru’s, and we are learning. But what a learning experience it is, and there is always something to play with when you get a bit done :slight_smile:
[/quote]
So try http://worldforge.org/ . It’s a fine place to learn. OTOH, unless you’ve already done a game, there is the advice frequently repeated here: “Start with a simple game. Get it finished…”.

Absolutly. Here are some of my prior works.
www.nukesoft.org

Hmm, you see normally I would agree with that comment, but having made the one above, I think i need to think of some justifications :). If you are after learning lots of parts of the system, getting envolved with an existing project probably isn’t the best way to go, I find the best way for me personally to learn, is to do it, make mistakes, learn from them, so unless they are going to let you rewrite everything, I wouldn’t get the coverage I can by doing a smaller project myself. Starting small means that you get somethng done. This is very true, unless you are willing to plug at it for aaaaaaaages with little or no visible results, you will get disheartened quite quickly on a huge project like an MMOG, maybe start with a few less players in mind was the best advice, lets face it, if it ever becomes really popular, you will have the cash/team to be able to add the extra M to you MOG :slight_smile:

Endolf