Multiplayer Platformer Engine Problems

0 favourites
  • 4 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • I had an older topic about this engine, but I think I might as well start a new one, considering it's been a couple of months.

    For context: I have a modular platform engine with multiplayer functionality that can incorporate any number of characters who can interact with each other, using a linked series of objects, starting with two objects for a Player, and a second object to handle that player's controls, enabling customization for controls. The second set of objects is the actual player character and the 'skin' that visually represents that character, both objects are also assigned to families. To make this work, 'for each' loops are used to link the Platform object with the right input object. Certain events that can't go in this specific loop, such as trigger events, go in a separate set of sub-events.

    Well, here's my problem - while this is all fine and dandy when every player character is unique, but if there are two players with the same character, then there are inevitable conflicts. Player 1 will control just fine, but Player 2 will not only control slightly differently, but also hang up at the end of certain animations, which are supposed to transition back to the "main" action. Note that the problem areas are triggers.

    Now, the big question is, how do I get both players to work exactly the same without having to create a whole bunch of new events to work around the triggers?

    .capx here, of the stripped-down version of my engine with just one character with two players, for simplicity. Requires r159, Personal/Business Edition.


    Player 1: WASD for movement, hold Shift for running, mouse buttons for attacking.

    Player 2: Arrow keys for movement, JKL; keys for jumping, basic attack and running, and control for secondary attack.

    Sorry about the lack of comments in the events, but hopefully you'll be able to get a good idea of what I'm trying to do with them.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You should be creating custom variables to ID each player object. relying on different player objects is not a good way to design anykind of multi control system.

    1 Player object, create isntances, name each instance for each player

  • I really don't see how that would remotely help at all, unless you're suggesting merging the Player, Input and Character objects completely. Which, aside from this resulting in a ridiculous amount of variable bloat for each object, I still don't see how it would help much, since you still have to deal with the skins.

    Edit: Actually, you know what? I'll give it a shot, and hope it works. We'll see.

  • So, I tried merging the Player_Stats, Input and Platformer objects into a single object, and much to my surprise, the end result works... Sort of. Apologies to jayderyu, I was mistaken. I guess I can work with a more bloated set of variables in exchange for better functionality.

    Here's how I have it now:

    <img src="" border="0" />

    (Alternatively, the "for each skin" events are packaged with its own seperate "for each MultiPlayer" loop, rather than being sub-events, they seems to work the same either way)

    While, for some reason Agumon works perfectly when there's two or more of them, Renamon and Gabumon, when there is duplicates, results in, well, complications. Neither Renamon or Gabumon can turn around, and Gabumon's attacks, depending on the target, can cause unrelated players to be damaged.

    Well, I think I might be able to fix this by duplicating Agumon's events and modifying them to accommodate Renamon and Gabumon to see if that solves the problem, but I'm not sure. We'll see. Either way, the current solution does work better for 'duplicate characters' when it comes to just one particular character, it seems.

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