Phone as a controller

Get help using Construct 2

Post » Sat Dec 21, 2013 1:16 am

I think I'm getting in w over my head. Is it possible to use your phone as a gamepad for a PC using C2? I'm thinking about making a game for up to four players, and while most people won't have four gamepads, four phones would be much more common. Mulkaccino2013-12-21 01:17:41
B
51
S
13
G
8
Posts: 194
Reputation: 7,316

Post » Sat Dec 21, 2013 3:57 am

I think there's an app called BlueputDroid that allows you to control consoles and PC with your phone. Using it as a gamepad though, I don't know if games will support phone to PC to game but it could be doable with that app.plinkie2013-12-21 04:11:58
B
47
S
17
G
81
Posts: 2,223
Reputation: 48,093

Post » Sat Dec 21, 2013 4:13 am

If you are thinking of making a PC game that allows 4 phones to connect in, then...

It's possible, to have phone as gamepad, that connects to PC, etc. You could use bluetooth, TCP/UDP, or some networking protocol to send input information.

For Bluetooth, since HTML5 is basically a web page - it does NOT have permission to access bluetooth devices.

What about other things like TCP? In C2, We have WebSocket feature, and "WebSocket is a protocol providing full-duplex communications channels over a single TCP connection."

Is it feasible? From the C2 Manual:

[quote]WebSockets and multiplayer games
It may be tempting to use WebSockets to design real-time multiplayer games. Unfortunately, despite the fact they communicate in real-time, WebSockets are not currently a suitable choice for this. The underlying transport uses reliable transmission, meaning a single dropped packet can hold up all transmission until the packet is retransmitted successfully. For games with demanding real-time requirements, this can cause unplayable levels of latency. It is usually impossible to design around this without changing the transmission mode, which WebSockets do not support.

On the other hand, WebSockets should be suitable for games without such a demanding real-time requirement, like turn-based games. It should also be useful for application services, like chat rooms. Note this will still require you to create your own WebSocket server.

[/quote]

And one more thing to consider is:

[quote]
Using the WebSocket plugin requires a WebSocket server. Construct 2 does not provide a server nor can the WebSocket plugin be used to make a server. If you don't already have a WebSocket server set up, you will need to create one yourself using a technology like node.js with WebSocket support. This can be a significant undertaking and require server-side programming knowledge.[/quote]

That could be a bit overwhelming, and I am not saying this is the only method possible. Perhaps someone more knowledgeable in HTML5 and networking transmission might be able to address other possibilities of what you want more properly.

On a side note, you could also try some other engines, other than C2 running on mobile phone too, because C2 is strictly HTML5. keroberos2013-12-21 04:48:02
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sat Dec 21, 2013 4:24 am

You know what, I forgot to ask you one thing, @mulkaccino , which one do you actually after?

1. Any PC game, but you want phones to emulate joystick inputs to the PC

2. A PC game you made yourself and you want phones to be able to connect to. (If it is this choice, is your PC game also C2?)


EDITED: Sorry, I just saw your objective in your edited post, mulkaccino. My bad. OK, so you want number 2.
keroberos2013-12-21 04:29:43
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sat Dec 21, 2013 4:38 am

Perhaps... you could try to execute some javascript, with Browser plugin? Can we send TCP or some other messages to some IP with this javascript, and on the other end, is it possible to receive that message? This is all theory, and this is beyond me, but if it is possible, it would be quite a nasty hack.

https://www.scirra.com/manual/110/browserkeroberos2013-12-21 04:39:38
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sat Dec 21, 2013 4:50 am

But of course, just like what plinkie said, we all have these off the shelves apps anyway:

https://play.google.com/store/apps/details?id=uk.digitalsquid.droidpad&hl=en

So you can just go use those instead. :P
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
30
S
11
G
11
Posts: 411
Reputation: 8,469

Post » Sat Dec 21, 2013 4:39 pm

Thanks to you both for your replies! I'll look into those apps and see if there might be a way to leverage them.
B
51
S
13
G
8
Posts: 194
Reputation: 7,316


Return to How do I....?

Who is online

Users browsing this forum: 8tomo8, Baidu [Spider], brunopalermo and 10 guests