playMaker

Author Topic: How would you make a networked pickup spawn manager (non-Photon)?  (Read 2136 times)

Gevarre

  • Playmaker Newbie
  • *
  • Posts: 49
I think this is more a problem with my logic than anything else, so I'm looking for thoughts or tips here.

I've got a networked game going (again, this is not using Photon). In the main scene I have an object with an FSM to spawn a bunch of pickups randomly at various spawnpoints.

The way the manager is set up, after the scene loads, it does a "IsServer" test. If it's true, then it runs the spawn actions. If false, it ends. All good so far. Everyone can see the pickups.

The trouble is, since the manager is a scene element, for each subsequent player that joins and loads that scene, the "IsServer" test is run on each computer, and the one that is the server then goes through the whole process again, so you end up with multiple copies of the pickup at each place, one for each player that's joined.

I'm hoping this is just a problem with my sequence of events, but I won't be surprised if I have to do something completely different. I've seen a thread on here about Pool Manager, but I have no idea if it is network-capable. It looks like a good solution if it is.

Has anyone else done this that wouldn't mind sharing how or that could at least point me in the right direction?
« Last Edit: May 21, 2013, 03:22:23 PM by Gevarre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How would you make a networked pickup spawn manager (non-Photon)?
« Reply #1 on: May 21, 2013, 02:06:40 AM »
hi,

 if you check whether the gameObject is the server, then something is odd, cause it should return only on one machine only.

Can you confirm this is ok, that you get false when the running instance is not the server.

 Then, in your logic, you need to account for both cases, when the server runs for the first time and when a new user joins, the logic will be slightly different I guess.

Also, if the Object you spawn ARE network enabled, you don't need to manage them on non server instances, since they are automatically managed by the network engine itself.

 Does that make sense?

I am not sure how pooling framework works in network games, you should enquire with the author directly so see if they have implementation directives and all.

bye,

 Jean

Fletch

  • Junior Playmaker
  • **
  • Posts: 66
    • SneakOnTheLot.com
Re: How would you make a networked pickup spawn manager (non-Photon)?
« Reply #2 on: July 18, 2013, 12:40:47 PM »
I'm working on the same exact type of thing in the Photon world and am having pretty much the same experience.  Not sure where to go from here.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How would you make a networked pickup spawn manager (non-Photon)?
« Reply #3 on: July 28, 2013, 12:32:42 PM »
Hi,

Could you share the project? I am not sure I properly picture the issue you both have actually.. Indeed, I think it's simply a problem of concept, but I am not sure where in your implementation the concept of networking instantiation is lost :)

bye,

 Jean