playMaker

Author Topic: Back to Photon (Game Plan Check)  (Read 1658 times)

markfrancombe

  • Sr. Member
  • ****
  • Posts: 338
Back to Photon (Game Plan Check)
« on: September 29, 2013, 09:46:36 AM »
Hi,

I spent a lot of time earlier trying (unsuccessfully) to get my multiplayer game set-up with Photon.
A long time has now elapsed and a lot has changed, PlayMaker Versions/ Photon /PlayMaker Photon actions etc.
After alot of work working on the graphical part of my game its about time I finally sat down with a blank slate and got this multiplayer thing working, and IN GAME instead of in a separate project. I am scared that merging the multiplayer functionality later is just going to cause problems with PlayMaker versions and something will go horribly wrong. In many previous threads I think I came to some solutions but never got them completely functional.

Here I want to lay down a list of requirements and solve them one by one.

1. Its a four player game.
The 1st player should create a server and 3 people should join THAT game (no choices of rooms.
2. The 5th player in should create a new server, and the NEXT 3 people join THAT game.
3. The 9th player.. etc the same ad infinitum.
4. The players all need separate characters to play, and this choice is NOT left up to the user, but CHOSEN RANDOMLY
5. There needs to be 4 different character models spawned
6. HOWEVER, its a 1st person game so the USER needs to view the game via a 1st person character controller, while the OTHER player view him as a character.
7. There is no chat during the game, but I dont want to remove this option completely as I may turn on chat at the end of the game so the players can discuss their experience.

SO now I would like to try to suggest my conclusions regarding the above.

1. Setting the Max players here is irrelevant. We dont want the game to FAIL when more than 4 people are in, we want it to make a new game
2. I had this working, was relatively OK, including different models, but with a hard coded room name.
3. Did NOT get this working.
I tried naming the Room by using the current date, and created a room with the date, however could not get other players to join, as that name needed to be sent out by Photon to new players, and not just a global variable.
4. I did not get the randomising of characters working, although a solution suggested was to add the characters to an ArrayMaker and have them assigned randomly till the array was empty. Then when/if a player quits his character becomes available in that game. But HOW would a new player join THAT game as as THAT character, if a new game had been started subsequently?
5. I did get this working, as hardcoded players, and presumably using ArrayMaker this would work.
6. Havent tried this, but am assuming that during the Instantiation of the players model, I could just use an "Is Mine" action, and if its NOT it gets a 3rd person avatar, but if it IS, they get the 1st person controller (that would be shared by all players) Although I would need to know WHICH player I was as some in game stuff would depend on which character was there. (some doors may only open for specific characters) I think I can get around that IN GAME however, by just naming each player, and assigning roles/abilities to them.

I dont have a specific question here really, Im just looking for some feedback regarding the logic of what Im suggestion, and maybe some alerts regarding stuff that could be done a better or simpler way.

There has been some updates to the Photon Actions I believe, so need to know if theres something there that is really relevant for me to look into.

Sorry for long rambling post.

Mark






jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Back to Photon (Game Plan Check)
« Reply #1 on: September 30, 2013, 01:43:34 AM »
Hi,

 I think your issues with designing such game is not in using Photon per say.

 Have you tried to do this logic without Photon? it's very important. Photon only gives you access to multi players network, it will not deal with how you want to manage your rooms and players in your game logic. that's important to make this distinctions.

-- you must have a system somewhere online to check for available rooms ( rooms with less than 4 players),

-- you must maintain a logical approach to your room management. Room properties is very much the way to go here. So experiment with room properties.

-- forget about chat, it's something completly separated from your initial hurdles.

so in short, most of your problem are not related to Photon, but to the logic management of your game.

Are you able to create a system that creates a new gameobject ( acting as a room), and fill an arrayMaker array of four "player", each with role assigned. Work on this, once you have this working, you will be able to move to photon based room management, cause essentially, instead of querying gameobjects, you will query photon, that's all there is to it as far as the logical difference the two. Have y very simple interface ( "NEW PLAYER" button for each new joing player") and work your way with room creation and role assignment.

Bye,

 Jean