Televangelist's Recent Forum Activity

  • ...I can't be the only one?

    Yes, there are limitations, but it feels eminently doable with what we've already got. Real-time interaction handled by the multiplayer object and peer-to-peer hosting of each part of the world, simple AJAX calls to a database of saved character data and world-state variables to provide persistence. Add them together and you have the most powerful tools for building a persistent world ever placed in the hands of an indie dev.

    I'm encountering difficulties as I go, albeit very surmountable ones. But ideally I'd like to get a sense of who else is building the same sort of project, so that perhaps we could all share lessons learned.

  • Say I'm building a persistent-world RPG with standard 'paper doll' equipment layered over the base player form. Some of this equipment is merely visual; some of it affects player stats. Generally, I would imagine the best way to store what equipment the player is using is via global variables, since my game will take place non-linearly across a large number of layouts.

    However, that would be a problem when it comes time to connect to another peer and 'go multiplayer'; the host (another player, not a central host) has values of their own for these variables.

    I can imagine two ways of handling this:

    1. Have instance variables on the player object that mirror the relevant data from the global variables upon entering the layout, then copy this information over when the player enters the multiplayer space as a peer.

    2. Transmit only the player's 'user ID'. The host then uses that user ID to contact the central character database and retrieve the relevant stats/information about each player.

    Or perhaps there's a third and better way I haven't thought of yet?

    Let me know what you think of this plan!

    Best,

    Joe

  • So would I!

  • Events can have more than one condition. So the value of Flying becomes an additional condition required to trigger the event... and then you can have an "Else" that gives a "your flying is too low" message if their skill isn't high enough.

  • Nick, that's a very interesting solution! The only issue is that it measures who's scored the biggest hit, not who did the most damage overall. But it does have the major virtue of elegance!

    If storing the damage of each player is difficult, here's a solution that could work well, perhaps: a slight modification of your plan so that if a player hits and he's already the 'top damager', the new damage he's done is added to his total, creating a progressively higher 'bar' for other players to clear. This would even work well to discourage kill-stealing, and should be possible to do with an easy additional comparison of name variables! Exciting, thanks.

  • This is gameplay that would be simple in a single-player context; you kill a monster, the monster drops loot, you pick up the loot.

    In multiplayer, it's tougher if you want only the highest-damage-dealing player to get the loot. My best guess is that the monster object needs to create an instance variable for every player connected, which increases when that player damages it; when the monster dies, it compares all such variables, selects the player associated with the highest number, and then when that player interacts with the corpse of the monster they get the loot.

    ...is that possible with the C2 multiplayer object? If so, how?

  • Cheating isn't the world's biggest concern to me; I'm alright with letting each peer be authoritative on the progress their own character has made. Since C2 doesn't support dedicated servers yet, peer to peer is really the only option for a persistent world unless you're going to build your whole game on a single layout.

    Thanks for the advice all!

  • Great -- but what worries me is that the dialogue has to be served by an object on the host, right, not the peer? How will the host know what the peer's "How-far-are-you-in-the-storyline" variable is set to? Will it be automatically transmitted in a one-time-fashion when the peer interacts with the NPC?

    Or can I have the dialogue served by an object on the peer, even if the NPC is on the host and just being synced to the peer?

  • In my multiplayer game, my players will sometimes talk to an NPC, and depending on where they are in the game's story, the NPC will say different things to them in dialogue. Currently, all progress the players make in the story is tracked by global variables (I assume that's the best way to do it?).

    I'm worried that this will be a problem to implement in multiplayer -- presumably the NPC will just use the host player's values for the global where-are-you-in-the-storyline variable, since the host PC supplies all the game logic and the peers just sync up to that. How do I make it so that the NPC correctly reads the where-are-you-in-the-storyline variable from each player and spits out the appropriate dialogue for each player when they interact with him?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would say is to use post requests to a php file to update a jsonValue then every 2 secounds is to use a get request to get the chat

    Yeah, that's probably the best way to do it. Just figured I'd ask!

    Would there be a way to have C2 create a new PHP file on the server during the course of the game? For example, let's say a player 'groups up' with several others, would it be easy using C2 to create a PHP file with the filename of the group leader's name on the server, and then they have their own private chat room separate from the global chat room? (assuming it would be trivial to make the chat window 'tabbed' when building the game's interface)

  • In order to build a multiplayer persistent world using Construct, the optimal construction seems to be that every area of the world is its own layout, which is then hosted 'peer-to-peer' whenever two players enter the same layout (rather than having a 'host' computer run the whole world on a single layout, which other players then connect to). So, for example, for a multiplayer Zelda-y world, every screen is its own layout, and if two players are on the same 'screen' of the world, they connect to each other; otherwise, they're not online.

    This is all fine and dandy, but it creates a serious complication for player chat. My understanding is that the current way of accomplishing multiplayer chat requires players to be on the same layout together; so your world would have local chat at that point, but no global chat.

    I'm sure there are alternate solutions, like piping in IRC or some sort of external chatroom externally. But within C2, would it be possible to simply layer a second 'layout' over the main game layout that just handles the chatroom? This way, all players would be on the same 'chat' layout and sync the chat through a multiplayer object on that layout.

  • Awesome, thanks!

Televangelist's avatar

Televangelist

Member since 12 Mar, 2011

None one is following Televangelist yet!

Trophy Case

  • 13-Year Club

Progress

13/44
How to earn trophies