Photon Game Architecture

So I’m building a MMORPG based around Photon which it is around half complete and fully working atm (before you kill me).
I decided that it would be futile to try to have all the players on one massive world without lag etc. so I took a different approach:
Each town/city/village/whatever is setup with the line PhotonNetwork.ConnectUsingSettings(placeName+“V1.0”);
Within that, the players are put in rooms so each place may have multiple rooms of different players that can interact.

Of course this setup is awful, looking back at it; the fundamental problem being messages cannot be sent between players across worlds or even rooms (they use RPCs) and so I can’t impliment decent chat and the use of ConnectWithSettings to change world causes some problems (that I’ve now sorted) when changing between worlds due to haveing to disconnect then reconnect.

I can easily sort it out so each place is on a different room and still have multiple rooms for each place but, although neater, doesn’t sort out the problem of global chat for private messages etc.

Anyone got any ideas on how RPCs can be called across rooms or is there no hope? :confused:
Thank you all :slight_smile:

What requirements do you have for the chat? Is it global? Per region? Or … ?
All rooms you create are completely separated from each other. The player IDs used in one room are also in use in another room but for other players.
If local chat is not ok, you could open another connection, specifically for chat. This is something I’d rather explain when you described your requirements some more :wink:

Thanks for the reply :slight_smile:

When I started this project it was mainly building on the Marco Polo tutorial that comes with Photon to see what I could do so I didn’t really have much direction. This meant I was bolting bits of code on and is why it ended up badly designed. Now that it’s looking like a definite game I wanted to expand the basic chat which just sent a message to all players in the room (thus only those you can see) so you can send private messages to different maps and have it more of a game to play with people you know rather than just shouting random stuff to random strangers. Whilst login is still in the works (php/SQL based system) I can adapt that to fit with this.

All I really need is a system to send messages to individual players which could be anywhere, the local (per room chat) can be done as it is. I didn’t think you could open more than one channel at a time but that sounds like it would work best, I had considered using php again to send messages but I wasn’t sure how that would be received by unity without periodic checking (thus putting a large payload on our cloud server).

Tbf, private chat isn’t compulsory, I feel that it would jus the game a lot more attractive to players though.
Jamster :slight_smile:

I can see what you mean (about making the game more attractive).
The extra connection will be counted as extra concurrent user (thus making it a bit more expensive), which is a drawback.
Alternatively, it shouldn’t be too complex to implement server-wide chat but as long as we don’t support it in the cloud, you would have to host Photon yourself. It’s not too complex either.

Thanks, I hadn’t thought about the extra concurrent users that it might entail; I didn’t think you’d be able to connect twice (expecially to the same server) with photon and assumed it would be using the same connection.

Unfortunately this is currently in the cloud but you’re right it would be easier to implement chat with my own servers. I cant see me doing that because this was going to be a free game (with minimal ads) and I have no clue on how much interest this is going to generate.

Thank you for all your help,
Jamster

Forgot to mention that I’m now halfway through sorting out the photon code in my game to be less “bolt-on” and more optimised, should make this all easier what ever happens.

And I’ve made a backup just in case I muck it up… :stuck_out_tongue:

On my work we created a seperated chat server with a single room that everyone is connected to no matter what else they do. Works like a charm.

Can you elaborate on that? I thought that might be possible but as far as I could tell you could only be connected to one app, one server (I think thats what they’re called), and one room at a time… How did you manage it?

Thanks,
Jamster

You can use a master server to direct you to other servers by returning details for the server. Then have a client instance to manage each connection.