CrowdGaming - your smartphone is your controller

Discussion of tools and resources for game developers

Post » Thu Jul 09, 2015 2:42 pm

@russpuppy I think the main point is that the web socket/nodejs works great but it does take a bit of set up for anyone that wants to host (display the main screen) by having to do all the nodejs set up when the Signalling server just takes connecting to it and that's about it. Although I don't like the having to set up nodejs on a computer on the same network, I still like it more than having to deal with WebRTC and that damn signaling server crap.

Haven't tried the new version yet but setting up the basics for a multiplayer snake game was pretty damn easy so far on the last version. Thanks for all the hard work!
Twitter: https://twitter.com/pudgyplatypus

Learn to make a clicker game for cheap!
https://www.scirra.com/store/games-with ... e-game-666

Try out Pixel Golf on the Scirra Arcade!
https://www.scirra.com/arcade/sports-ga ... el-golf-67

Pudgy Platypus Games website!
www.pudgyplatypus.com
B
59
S
20
G
5
Posts: 212
Reputation: 7,390

Post » Thu Jul 09, 2015 5:06 pm

I see the biggest use of a plugin like this for couch co-op party games. There's a few out there already that use this type of multiplayer setup.

One is Quiplash: http://store.steampowered.com/app/351510/
and the other is Fibbage: https://www.youtube.com/watch?v=hqNaB_lW7oI

but there's so many cool game ideas that could use the same sort of mechanics.

Imagine and RPG where the main screen is the dungeon where you encounter monsters, and each player on their tablet is an adventurer. You could design the game so that it encourages players to talk to each other and play off each other's characters talents etc. Each player could issue commands from their phone on when to attack/heal/buff etc.

There's another game out there that i forget the name of, but its a spaceship game where each player is a different crew member. One player is responsible for steering, while the next is in charge of shields etc. Each player has a completely different set of controls on their phone screen to deal with. You all have to work together to make the ship fly.

I can't wait to keep playing with this plugin even more.

@onemuppet - Few thoughts.....

1) Its spelled "Single" not "Signel" if you were trying to describe an action that takes place only once. Or perhaps you meant "Signal"

2) also, i'm not sure in the joystick controller event sheet (event 4) where there's a condition "Action ="j"
what's that being used for?

3) Is there a way of having more than 4 actions and 2 singleactions in a project?

Keep up the great work!
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Thu Jul 09, 2015 10:49 pm

@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:
Image

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 :)
B
39
S
9
G
4
Posts: 163
Reputation: 6,516

Post » Thu Jul 09, 2015 11:12 pm

@onemuppet - Ok i guess i'm not fully understanding how the actions being sent are supposed to be used correctly.
The way i'm "thinking" it works, is that each "action" is like a button press from the player

action1 = jump
action 2 = shoot
etc

and therefore if you have a lot of input controls for your player, then you will run out.

So perhaps you could explain the differences between an "action" as you call it, and a "signelaction"

what cases would you use one or the other?
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Fri Jul 10, 2015 5:11 pm

@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.
B
39
S
9
G
4
Posts: 163
Reputation: 6,516

Post » Fri Jul 10, 2015 8:21 pm

How do i communicate from the main game to a specific controller? eg: when a player gets hit, their controller flashes for example.
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Fri Jul 10, 2015 8:36 pm

@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:
Image
Image

with this kind of setup you could pretty easily cover a great variety of use cases.
B
39
S
9
G
4
Posts: 163
Reputation: 6,516

Post » Sat Jul 11, 2015 8:34 am

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! :)
B
39
S
9
G
4
Posts: 163
Reputation: 6,516

Post » Fri Jul 17, 2015 5:48 am

@OneMuppet - I've been having a lot of fun playing with the Crowdgaming plugin.

One issue i've run into using the scenario like in your example (where the main game is sending an "action" to all of the controllers, is that its not very reliable for the controllers to receive that command.

You can see it the other way around as well, when the controllers are sending the information to the main game in the "space shooter" example you provided.

If you count how many times you press the shoot button, and how many times the bullet spawns and shoots it won't add up. Especially if you click the shoot button rapidly.

Is there any workarounds or solutions you can think of so that its a bit more reliable? I'm guessing lag is the issue, but you are the master behind this plugin.

thanks! Keep up the great work!

btw both 4.2 and 4.3 exhibit this issue.

If it is indeed a lag issue, perhaps there's some clever way i can program something in C2 to solve for it?

perhaps instead of sending a single action, i send it multiple times, but as soon as it receives at least 1, ignore the rest? I dunno, just thinking off the top of my head
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

Post » Fri Jul 17, 2015 4:46 pm

with more tinkering this morning i was able to resolve the issue. In case anyone else is experiencing similar issues, it boiled down to not following the instructions laid on in the example project properly.

wrong way: using a simple compare 2 variables (crowdgaming.onreceivedaction1 = "hit")

correct way - it should be a sub event of a "on message" event

eg: ->Crowdgaming On Message
-(crowdgaming.onreceivedaction1 = "hit") -> do stuff
B
87
S
44
G
16
Posts: 1,002
Reputation: 17,932

PreviousNext

Return to Tools and Resources

Who is online

Users browsing this forum: No registered users and 0 guests