PantsSleeve's Forum Posts

  • New release 4.4.1!

    • Added a simple drawing "game"
    • minor bugfixes
    • Action1 through 4 are now string only, make sure you update your event sheets and change Action1 = 2 to Action1 = str(2) or Action1 = "2"
  • justifun I've shared the 4.4 release with you. I have change some names of actions, due to spelling mistakes. This could cause a lot of problems for you if you use an old capx, with this new crowdgaming plugin. I had to rename my capx to zip, then open the archive and rename the action/conditions/expressions that had changed. Basically you start your capx, see which error C2 throws at you and then to correct these in the mgbase.xml located in the crowdgaming.capx zip archive.

    Let me know if anyone want help you clean up your capx? I don't want you to go nuts and stop using the CrowdGaming plugin since you've invested time in it.

    I will share the 4.4 release everyone else soon, wait for the email.

  • justifun I had tangled myself into a substring mess, I've cleaned it up now, thanks for spotting it!

    function getSendToObject(str) {

    var pieces = str.split('|'), to = pieces.splice(0, 2)[1], msg = pieces.join("|");

    return {to: to, msg: msg};

    }

    I'll try to update the latest beta package, or if I can't do that I'll upload a new one and notify everyone.

  • justifun PoisonDarts, sounds like fun!

    That is most likely a bug in my getSendToObject method which does some parsing. I'll have a look at it.

  • Great!! That's awesome! I'll check this out tomorrow! Thanks for sharing!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • justifun I would love to see it! I'm too tired right now though. Not that many hours before my kids will wake me up, I will try to turn on skype once in awhile to see if you're there

  • Amadeus The server doesn't know much about the game, it's basically the main game that has all the info, plus we only send actions and preferably only delta actions (when anything changes), . So if we want a controller to act/show the main game screen we would have to the that info from the main game. Only the main game know the exact state of the game.

    I would suggest that we use the System Save to send the entire state of the main game, and then use load from json in the controller to draw the state of the main game.

    You could do this with the CrowdGaming plugin as it is today, but it will require some well placed events. Or we could make this into a plugin feature. So that the main game could use an action like "Update Main Game State" which would take a string (the saveStateJson), and when this is sent to the server it will broadcast it to every controller that has activated the ListenForMainGameChanges. In the controller a On Main Game State Changed condition would be triggered with a Main Game State Json, that can be use to load the game.

    Your thoughts?

  • justifun I'm not sure if I ever got the bat file to work or not, but you will have to do an export and then run the exe-file to test the "Run file" action. But you probably already tried that since you were able to run exe-files.

    I did some research about nwjs and learned that it doesn't use any web server (which I originally thought) but instead it reads directly from disk. The export produces a file called package.nw if you rename this to package.zip and look in the zip-archive you find all your files there. However these files only work when run in the nodewebkit environment, which means I can't just "server" these file from a web server because there would be dependency errors.

    So why do we need a web server? Well we need the "controllers" to be able to connect to something. What I have done to make this work is:

    • add server.js as a project file
    • modified the nwjs plugin and added a start web server action
    • In the Start event sheet I've added Start Web Server and Run "node server.js"
    • Export with Nwjs exporter
    • Open package.nw (rename to zip and open)
    • Export with html5 exported
    • Create a directory called "controller" and add html5 export to it
    • Add the "controller" directory to the package.zip file
    • rename package.zip to package.nw
    • run the exe

    When you run the exe it will start a web server that will "serve" the html5 export on port 50000, so when you connect to ip-of-host-machine:50000 you will see the controller, as you normally would. The main game also starts the server.js file so the main game an controllers can connect to one another.

    This is a step in the right direction towards being able to package CrowdGaming games to the masses. The problem with showing the ip-that the "controllers" should connect to still remains.

  • new release - beta 4.3, with minor updates:

    • Added camera object and removed scroll to on gamers.
    • Added event sheet for camera to zoom out and in depending on where the gamers are
    • Server - reinitialize game, when main game is restarted all the connections will reappear in the game. This will be useful for when moving from one game to another and keeping the gamers. Or when having time based games (matches) that restart. More to come on this.

    make sure to "update" the plugin and that you run the new server.js file.

    Check it out!

  • justifun

    Set action1 to hit

    use the send action to and set gamers.connId as param

    Then use on message, receiveAction1 = hit, and flash away

    here is an example using the space/joystick setup in the beta package:

    with this kind of setup you could pretty easily cover a great variety of use cases.

  • justifun

    SingelActions are actions that are only used once like jump or fire.

    After you've sent them using CrowdGaming.SendActionsToMainGame or SendActionsTo a singel action will be set to zero, automatically. The condition Has new data to send will check if the current actions string (action1+action2+action3+action4) is different from the lastActionStringSent OR is any singelActionIsActive.

    So with normal actions you constantly have to feed the game is you want to change the value but with singelActions you only send 1 (on) and then it resets it self. I wanted to spare the sending of a full actionsString then a singelAction went from 1 to 0 that's why I have designed it like this.

    This optimization and sending delta is mostly important when dealing with games like platformers etc. But with turn based game it is not important at all.

    For the two example controllers in the beta package I use:

    • platformer controller

    * Action1 = 1 (left), Action2 = 1 (right), SingelAction1 = 1 (jump)

    • joyStick

    * Action1 = 0 - 360 (angle), SingelAction1 (shot)

    Let me know if you have a case where you need to send more actions, in my mind it's hard when using the smart phone as the controller to have loads and loads of buttons, I think it needs to be pretty simple.

  • justifun

    Thanks for the feedback!

    1) I'll fix it

    2) It's just a leftover from the ctrlPlatformer eventsheet (it can be removed)

    3) you cannot send more than 4 simultaneous action plus 2 singelActions, no. However an action is just a string of text. I don't see a real limitation here, but I'm willing to listen if you see any limit with this setup. In the first version there was just one action and I did all the parsing in the C2 event sheet. You could for instance use Action1 as the keyword, and Action2 as the information bearer.

    Like this:

    You could also use an array object fill it with info, use array.AsJson and then use load from Json on the "other side".

    Would these solutions cover your use cases? If not, let me know what's missing and I'll look into it

  • DUTOIT webrtc is definitely the way to go, but until it has support in the browser on iOS devices I think websocket is the best option.

  • russpuppy I haven't looked into this yet, my first priority is to get this up and running. For people that want to build CrowdGaming games in that is hosted in a "controlled way". For instance if you have a client that want's to promote their new product at an expo. You could build a cool game for them that anyone walking by their stand could connect with their smartphone and play the game with a chance to win. Or for the office party, or connect your game to one of the big screens at Times Square New York, and let anyone that walks by play the game with their smartphone

    But what you are mentioning is of course very important. I got pretty far when testing this morning. By simply including the server.js file into the project, then using NWjs run file "node ""server.js""" On Start Of Layout in the start layout (weird thing is it only connects correctly every other time (could be some sort of current directory issue?). After this I can use my smartphone to access the same ip as you do with preview over LAN, the NWjs starts a webserver on that ip, it seems. So what does this mean? Well for me it tells me it is possible to have CrowdGaming games on steam , I will look into this more when the foundation of the CrowdGaming concept feels stable enough.

    If anyone has experience with launching games on steam using NWjs I would love to know more.

  • CrowdGaming beta v4.2 is out and you should have received an email if you are in the beta program.

    There are some important things to note:

    • A lot of the logic has moved from the event sheets to the CrowdGaming plugin
    • Remember to "install" the plugin, by copying the folder "C:\Games\CrowdGaming beta v4.2\plugin\CrowdGaming" to "C:\Program Files\Construct 2\exporters\html5\plugins\"
    • The CrowdGaming plugin has a property called "server ip-address" make sure you set this to your current ip.

    Try it and let me know what you think