P2P online co-op shooter game with WebRTC

Introduction

I've implemented a Touhou style shooter game. Its special feature is that you can enjoy P2P co-op play with your friend using WebRTC.

I'll introduce you how to connect with your friend. Try and enjoy!

D

How to connect and begin the game

Requirement

The game requires Windows or Android Chrome. Prolly it cannot work on other environment. The game uses WebGL to fast draw, I'll advice you to turn your hardware acceleration on.

Enter the room

Click the link.

http://takahirox.github.io/toho-like-js/index2.html

Then, you'll be in a random room.

Room number is the number follows '?' in the URL. In the above screen shot, the room number is 8147.

Share the link

Share the room URL with your friend whom you'd like to play the game with. For example, the URL is

http://takahirox.github.io/toho-like-js/index2.html?8147

Connect

When your friend enters the room, "connect" button will be available. If you or your friend push the button, the two are connected using WebRTC and "connected" message is displayed.

Note: When three or more people are in the same room, the button will be disabled because of over capacity. In such a case, move to another room, then try again.

Note: Sometimes connection is failed because of the firewall or some other reasons. In such cases, reload and then try again. When you cannot connect with your friend even if you try many times, I'm afraid you need to give up. Be careful that connection fail isn't notified to you yet. I'm gonna support connection fail detect soon.

Begin the game

After you achieve the connection, you can start the co-op game. Both two select "Start" (push Z) and then choose a character, the game will begin.

Connection practice

If you cannot understand how to connect, you can try local to local connection with two tabs, like the screenshot below.

Hint

If the game is very slow because of network latency, you can try "l=num" option, like this. ("l" is lowercase "L")

http://takahirox.github.io/toho-like-js/index2.html?8147&l=5

"l" controls input lag. "l" is greater, the game can work faster because of input lag hides the network latency (though input lag is bigger). "l" accepts from 1 to 20. The default number is 1. When both you set each "l", the greater "l" will be chosen.

Conclusion

I introduced you how to connect with your friend on my game. Let me know if you achieve the connection and how fast it worked. I need samples.

I'm afraid the game still have some bugs and unimplemented functionalities. desync, no-disconnection-detect, and so on. I'm gonna fix and implement them soon.

BTW, this is the link for single play. Enjoy sole play as well!

http://takahirox.github.io/toho-like-js/index.html