How do I...(multiplayer) create multiple copies?

  • Normally...

    Have 4 instances of one sprite using for each and instance variables to dictate each location, no biggy...just normal stuff.

    But want to spawn them over multiplayer.

    *on peer connect create(for each)...[this appears not to work, but I might just have no clue]

    have the 4 instances of one sprite appear on layer abc located via each sprites instance variable cx,cy (dictated through sync).

    I may need to just create 3 clones and create, sync, and locate them individually??, but I thought I'd ask before doing that.

    Danke in advance!

  • I'm just curious if it's a me issue, if it is I'll just keep studying.

  • After fiddling for a week, I still can't get the "for each" to work on multiplayer (info relays) so I just made separate sprites and did it long hand, works fine. Someone figures that out share the wealth

  • It sounds like you want to determine position on the peer side on an object synchronized from the Host. that will not work.

    The host needs to adjust the locations/spawn synched objects on locations, and they will appear so on the peer side on the location determined by the host. The peer can send commands to the host where he needs to move/create them though.

  • The weaknesses of having a user be the host and not a dedicated server

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The weaknesses of having a user be the host and not a dedicated server

    It is in the approach of the multiplayer plugin.

    It is based on a scenario where the host is one of the players.

    Eliminating the need of a server.

    This has has the obvious upside.

    The downside is that it is not the approach most gamers would expect, and those generally start out applying methods based on an incorrect idea of the expected game mechanic.

    One really needs to envision the steps of: (simplistic)

    Host wants to move

    The host simply moves his object and its movement is synched in a broadcasting like method, telling all the peers where the host object needs to go.

    Peers wants to move

    In most synched scenarios, the peer needs to tell the host where it wants to move, the host then move the object on the host game, and it broadcasts it to all the peers, including the peer wanting to move.

    Peer forced moving:

    When the peer wants to optimize the positioning of its object; while sending the movement to the host, the peer can also move its synched object in the direction it has told the host it wanted to move. This forces it in a direction, closer to the next synched position the peer will receive for its own movement, potentially increasing more smoothness on the moving.

  • Turns out this I'd doable....but the "associate with" jacks it up an for some reason restricts copies to 2. A msg substited works fine for condition and presto one object synced as copies. I was trying to not have multiple copies of a single troop type, its clunky but works. Since each two player battle is in a separate room I eliminated the message from host as a trigger and just left it blank...helped the speed and who cares if the peer can't see the host ID...its 2 player. Any who just thought I would update...

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)