Anyone using C2 multiplayer to build a persistent world?

  • ...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.

  • I had made a test of a persistent world using firebase service.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh Rex... it's always so bittersweet when I get a reply seeing you've built something. Because I can always count on two things to be true:

    1. What you've built will be awesome, and at the leading edge of C2 development in a given area;

    and

    2. As a layperson I will have virtually no idea what you've done or how to adapt it into my projects, because it only provides the explanation an expert user will require.

    If only there were a 'noob whisperer' who followed behind you and explained your great works to the masses.

    (By the way, I noticed your online filehosting is set to the Chinese language... 你说汉语吗?)

  • These testing/samples lack of documents. I am busy in making new plugins or fixing bugs of existed plugins. I only could provide basic document for each plugin.

    Fortunately, jomo would like to help me to pack my plugins into templates with full documents and supporting, sold in scirra store in the future. ( Supporting is much harder than making plugins, IMO. )

    ----

    Yes, I come from Taiwan. Since we are in scirra forums, it is better using english only.

  • These testing/samples lack of documents. I am busy in making new plugins or fixing bugs of existed plugins. I only could provide basic document for each plugin.

    Fortunately, jomo would like to help me to pack my plugins into templates with full documents and supporting, sold in scirra store in the future. ( Supporting is much harder than making plugins, IMO. )

    ----

    Yes, I come from Taiwan. Since we are in scirra forums, it is better using english only.

    Makes sense! I'll probably pay someone who understands your plugins better to teach me.

    (Very cool that Construct 2 users are all over the world! I was just in Taipei a few months ago, my first time in Taiwan and it was an amazing country.)

  • Think it'll be useful to include these links here:

    @CrazyVulcan 's project: viewtopic.php?f=147&t=126237

    my project: http://keo.land

    Subscribe to Construct videos now
  • Honestly, the idea is pretty exciting. A persistent world is one of the only moderately reliable ways to both monetize and avoid piracy issues (sure, there are advertisements, and there's always the possibility of pirate servers, but those are both pretty minor in both regards).

    Doing it with C2 would be a game changer. Particularly if somebody made it really convenient and accessible...

    @rexrainbow you're amazing!

  • Televangelist http://c2rexplugins.weebly.com

    Don't know if you knew that this page existed but all Rex's plugin's are listed here. The documentation to myself is very complete and useful. Only complaint is that the example capx don't show much in the way of what they can be used for, simply how they function. Hope this helps

    I am too working on a similar project only its more of a single player game with a lobby for MP but I intend to have a asyncreness Over World where there is a overmap and players battle for areas

  • Very interesting, CV!

    @rexrainbow -- I'm curious, for building a persistent world, do you think Firebase would be well-suited for:

    a) the database of player characters' statistics and inventories

    b) tracking all the various events going on in the world -- which NPCs are happy, which ones are angry, what time of day is it, etc. etc.

    ...or c) both of those?

    Looking at your example and trying it out on multiple PCs I was impressed with how well it worked for that purpose.

    Just trying to make the right decisions early on in my project so I don't end up having to redo major things down the road.

  • Televangelist

    Since firebase is a database, point a) is possible. For point b), it is also possible because that firebase allows users to monitor the changing of values.

    But these features would not be easy to put into project directly. Maybe it needs some custom plugins for specific application.

    My plan is to build social features (friend lists, private messages, message board, etc...) first, since these might be general for most multiplay games.

    BTW, firebase is one of possible backend solutions, so it might have another better solution than firebase. Surveying these solutions is another important work, IMO.

  • Televangelist

    Since firebase is a database, point a) is possible. For point b), it is also possible because that firebase allows users to monitor the changing of values.

    But these features would not be easy to put into project directly. Maybe it needs some custom plugins for specific application.

    My plan is to build social features (friend lists, private messages, message board, etc...) first, since these might be general for most multiplay games.

    BTW, firebase is one of possible backend solutions, so it might have another better solution than firebase. Surveying these solutions is another important work, IMO.

    Understood. I'm still searching for a guide out there that breaks down which database types are suitable for which sorts of games... if I can't find one, I'll probably create one.

  • Very interesting, CV!

    rexrainbow -- I'm curious, for building a persistent world, do you think Firebase would be well-suited for:

    a) the database of player characters' statistics and inventories

    b) tracking all the various events going on in the world -- which NPCs are happy, which ones are angry, what time of day is it, etc. etc.

    ...or c) both of those?

    Looking at your example and trying it out on multiple PCs I was impressed with how well it worked for that purpose.

    Just trying to make the right decisions early on in my project so I don't end up having to redo major things down the road.

    I currently am learning the firebase system of handling files to do part A of your question. Using CSV's I am attempting to have the player download their CSV off the firebase and use that to handle all their inventory. So when the game loads and the player logs in it will call firebase

    for var player name = MyUsername

    call order by key MyUsername; == str("MyUsername"&Character.CSV)

    Then with that CSV file Pull any needed data for that one object in this instance my character

    ",Weapon,Body,Head,HeldItem

    AA,Lv1WS,Lv1BClok,None,Potion3

    Then you will have an array (Or another CSV which is my aim) with all your items listed.

    ",ItemName,Attk,Speed,Value

    Lv1WS,Level One Wooden Sword,3,5,20 Gold

    Lv2WS,Level Two Wooden Sword,6,4,25 Gold

    Lv1SS, etc etc etc"

    This way each item of your character CSV can have links to the master for its information so long as the row name is the same as the string of that item. This should work for any needed data and to save you having to call the masterCSV every time you need something just make variables with a value from that masterCSV

    So you can make a variable for the damage you deal when you hit something like Var Attack == masterCSV.At(CharacterCSV.At("AA","Weapon"), "Attk)"

    Then when you hit something just set enemyHealth == enemyHealth - Attack

    I wish I know code to more esaly say that but that is why I use C2 lol.

    tldr

    Login>Call CharacterCSV>Use that to reference a MasterCSV(the .At of first as the row name of second)>make variables based off that call for faster processing

  • CrazyVulcan

    Static data might put into C2 exported folder.

    In this demo this big map is stored in csv format, put at event sheet. Or user might put at external file, read by AJAX.

  • Televangelist

    I classify the requirement of multiplay in 4 types in this table. Does it make sense?

  • Rex, that makes a lot of sense to me, thank you! I'll share that table with the C2 Multiplayer discussion group, I think people will appreciate it.

    I'm guessing my game will be a mix of the 'action' and 'MMO' types you describe. It's an action game (gameplay similar to Zelda or Mario) in a persistent world, but every screen of the world is a different C2 layout and the game world itself will not be centrally hosted (you're basically singleplayer until you move into a section of the world at the same time as other people, at which point it will be peer-to-peer hosting via the official multiplayer plugin) with the clients pinging a central database for both global variables (who controls Castle A, what time of day is it) and each player's specific data (what's in your inventory, do NPCs like or dislike you).

    Just like CrazyVulcan is discussing for his project, those 'calls' should be fairly simple, I think... the main thing I worry about is making sure changes are synchronized properly and not missed or handled out of order.

    For these tasks, how should I choose between AppwarpS2, Photon, and Firebase? Is there a strong advantage to one over the other? Are they equally easy to integrate into C2?

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