PantsSleeve's Forum Posts

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

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • russpuppy

    That is a great question! WebRTC was my initial choice. Unfortunately there is very limited support in the browsers on iOS for webRTC. There is a browser called Bowser that supports it, but the thought about CrowdGaming is that you should only need your smart phone and not have to download any specific app to make it work. Most smartphone browsers supports websocket, which is why I went with the nodejs websocket server. When the world is ready I'll look into doing this with webRTC

    http://caniuse.com/#search=webrtc

    http://caniuse.com/#search=websockets

  • oldandgrey

    Thanks! I had my answer in preview while watching tv so I missed that you answered. More options are good

  • Hi! I'm also running this on a virtual windows machine on my mac. I'm using parallels, which is similar to VMware, if I remember correctly you can also use a bridged connection when setting up the network between your host machine and VM. This is the network setting that I'm using which allows me to connect to my VM from my Mac, and also connect to my VM with my smartphone/ipad etc.

    ---------------

    Other wise just do this.

    • Get the mac.s ip and add it to the prodUrl variable.
    • Add the server.js file as a file in the construct 2 project (so that it will be exported with the project).
    • Export from Construct 2 to some folder that you can access from your mac (so that don't have to copy paste anything).
    • Switch over to your mac, and open the terminal, cd into the directory where you exported the game to
    • type: npm install nodejs-websocket
    • type: node server.js
    • type: python -m SimpleHTTPServer 8080

    now you can browse: http://<ipOfYourMac>:8080 and everything should work fine. It will most likely run much better on the mac with the python Simple http server than it does on the VM, at least it does for me

    (or maybe it's just my mac being jealous that I spend so much time in windows?)

    use: cmd + . to stop the node and python webserver (you probably already knew that but I tend to forget those key combos so I'd figure I'll throw it in here).

  • This is what's new in the next release:

    • Avatar (controlled character) is visible in controller
    • Score tracking, in main game highest score = first place
    • Added animations, and changed sprites (in the example game collectItems).

    Server

    • Cleaned up the code, removing quite a bit of unused code.
    • Some optimizations to let the most common actions execute quicker

    ----------------------------------------

    Also since the first "Setup" video, I've changed so that you no longer need to separate construct 2 instances. The controller and the game are both in the same capx-file. In short the setup should be:

    • Install Construct 2
    • Install Nodejs
    • restart computer (if needed)
    • open a command prompt (winkey+r and type cmd)
    • type: cd "C:\Games\CrowdGaming Beta-v3" <----------- path to the directory where you have the CrowdGaming beta pack.
    • type: npm install nodejs-websocket
    • type: node server.js

    the server is now started, to stop it, click on the command prompt window and hit ctrl+c

    • Start Construct 2 (Run as administrator) set up so that you can preview over lan
    • Open the event sheet called Start and change the variable called "prodUrl" to match your ip (do not remove the port number, :8002)
    • You may need to restart Construct 2 once if you changed the preview on LAN address, setting
    • Run Construct 2 as Administrator
    • Make sure you are in the "Start" layout when you hit "Play"
    • The first browser-tab will be the MainGame, the following will be controllers, if you access the same address with a smart phone that too will be a controller.

    The test/development-cycle is very quick once you have done this initial setup, because you can code you changes and hit play and instantly play the game.

  • Amadeus

    I'm really glad to hear, I agree with you that this kind of concept opens a lot of possibilities, and turn based games are definitely one of them! I'm in the middle of some modification of the CrowdGaming server and also some tweaks and updates to the capx-file. It should be finished on pretty soon (some time between today and friday). I could give you access to the 2.1 beta pack, but I think it's better if you wait for the next release. I'll send you the link when it's ready.

    Can you PM me your email address I don't think I got it in the last PM?

  • rocky53204 thank you testing and for your feedback, and please keep the feedback coming

    Yes there was a big change, based on the feedback from rocky, I've switched it to a single capx-file. The first client that connects becomes the main game and the following clients to connect are all controllers. I will make a new video and replace the old one.

  • Version 2 of the CrowdGaming beta was just released! There is still open slots in the beta program, leave a response here if you want to join and I'll contact you and send you a link to the files.

  • rho KFC stefanos

    I've created a forum home for the CrowdGaming concept. I have a package ready and a video on how to get started, if you have time please have a look and comment:

  • Hi,

    I've completed the first beta release of a CrowdGaming concept! So what is crowd gaming?! Simply put it's people playing together using their smart phone as the controller, over a local wireless network! The cool thing is that you build the controller in construct 2 and you build the game in construct 2 as well!

    But there must surely be some complex woodo stuff connecting the two?

    Well... there is a nodejs game server that let's the controller talk to the game. The nice thing is that you only have to start it and stop it, the coding has already been taken care of.

    Controller:

    You can change the look and feel of the controller and even extend it to send different actions.

    Game:

    There is an event sheet called engine that does all the heavy lifting with interpreting the actions sent by the controller. To build your own game simply create a new layout and add an event sheet that includes the engine event sheet. An example game is included that shows how to do this.

    Inspiration:

    What could this be used for? Connect the computer running the MainGame to a big screen or projector, build a game where people get a random instrument when they connect with their smart phone, now loads of people could make awful music together, and have loads of fun! Build a dynamic backdrop for a concert where people can influence the graphics shown or vote for the encore. Office events, to promote products in public, let your imagination run wild

    A beta release will be out on the Scirra store when we have finished the test period, but we would love to hear some feedback about the project: is this a good idea? Is it the best idea ever? Which features would you like to see?

    Note:

    This can be setup to work on Linux, Mac or windows. But it's easiest on windows because you don't have to export to html5 to test the game.

    https://youtu.be/vONL80sKAyc