PantsSleeve's Recent Forum Activity

  • 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

  • Amadeus

    I do think that this setup will cover a majority of cases. One action can contain a lot of information, that you could "parse" with your own logic. Or you could use the Array Object, fill it with data:

    use Action1 = "array" and

    Action2 = array.AsJson

    and then on the receiver side write the logic:

    On Message

    CrowdGaming.ReceiveAction1 === "array"

    Array Load From Json CrowdGaming.ReceiveAction1

    You could do things like that to send and receive whole objects, but that is more for turn based games than platformers of course, because of the data size.

    That said I would love to hear more thoughts and ideas. I could add a "send custom actions string" Action that you can use to send anything you want and then also a simple receiveCustomActionString expression that would be filled when On Customer Action String is triggered, for example.

    russpuppy could you PM me your email address, if you havn't allready and I'll add you to the list of beta testers.

    I have finished creating the first version of the plugin and I have also converted the example games and example controllers to use the new plugin. I will test it a bit more and in a best case scenario send out a the beta version 4 pack to day, otherwise tomorrow.

  • justifun ximo Amadeus russpuppy rocky53204 nonom oldandgrey socialpilgrim miketolsa stefanos

    I've given it some thought regarding creating a plugin for the CrowdGaming Controller and MainGame, and I've decided to give it a shot. I will build a custom plugin that modifies and extends the current websocket plugin. This will expose less of the paring logic to the developer since this is done in the plugin.

    I have a fairly ok plugin right now and the next step is to start converting the example games and controllers so that they are using the plugin instead of excessive event sheet string parsing.

    A brief plugin featurelist:

    • Set Action1, Action2, Action3, Action4, SingelAction1, SingelAction2
    • Send Actions, checks if there are anything new to send and sends it
    • Send Actions To, same as above but to specific "player" OR use 'all' to broadcast to all players at once.
    • Send Avatar Type To, send avatar type to specific player
    • When OnMessage is triggered, ReceiveAction1, ReceiveAction2 etc will be available
    • On Avatar Received
    • On Player Dropped

    And some more things

    Because of this the beta v4 release has been a bit delayed, but hopefully I will have enough time the coming days to release it this week.

    Looking forward to your feedback!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ximo justifun

    Thank you! I really think this can open up some interesting new possibilities for Construct 2 developers!

  • Ashley I agree that it could be a good idea to make it into a plugin, I will keep that in mind when moving forward. Thanks for the input! My approach when using the existing plugins, so far is to abstract away everything "complex" so that a developer would only have to "include" the engine event sheet, to build a game, or the controller event sheet to build a controller. I've also included examples of controllers and games, built on top of the engine/controller "base event sheets". This of course gives the developer 100% control to change the base if they want to. That said I do think simplicity weigh heavier than control.

    Also here is a preview of the CrowdGaming beta v4, new in this release:

    • joystick controller
    • new template game (simple shooting game)
    • made it a bit more generic, the actions are now only called action1, action2, action3 instead of left, right, jump etc then it's up to the game maker to decided what to do with the value of those actions.
  • Ashley responded on Twitter:

  • russpuppy

    I think it could be possible to distribute the nodejs binaries together with your game, it's not something I've tried yet. If anyone knows more please share.

    I also think that the NW.js exporter could be a good choice since we could start files from the OS with the nwjs plugin. Hypothetically we should be able to run a .bat file or equivalent On Start of layout in the "Start" layout and when running that bat command try to find out the ip (ipconfig) and then start the nodejs server (node server.js) then instead of having prodUrl as a static variable in the construct 2 project we could read this from a file which we modify in the start.bat with something like:

    for /f "delims=[] tokens=2" %%a in ('ping %computername% -n 1 ^| findstr "["') do (set thisip=%%a) echo %thisip% So then the user would just click on the CrowdGaming.exe file from the NW.js export and everything would setup itself. That's just from the top of my head and that will need quite a bit of work and tuning to be streamlined but it should be possible. I'll look into a bit more regarding the server pushing out messages, I'll probably rewrite the nodejs abit to make it more generic, so messages starting with p are interpreted as from p(layers) and messages starting with a s are from the s(erver) and if it comes from the server without specifying to whom it is for it will be interpreted as a broadcast message, that will be sent to all clients. I'm also very interested in knowing if @Ashley are considering looking into adding binary data sending into the websocket plugin? What are the know issues and the reason it has not been added yet? With binary data it would be a lot easier to minimize the load sent between the controllers and the server. Thanks for all the great ideas everyone keep messing around with the beta package and I'll send out an update when I have something new. Next I will keep adding to the example game, making the server more generic and also add new example controllers. But it's great that people are thinking ahead about steam publishing and so on, it's always good to consider those things early.

PantsSleeve's avatar

PantsSleeve

Early Adopter

Member since 2 Oct, 2012

None one is following PantsSleeve yet!

Connect with PantsSleeve

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies