Skip to content

Commit 4ca5bba

Browse files
authored
Flesh out Ebiten blog post with more content and links
1 parent 9bbbe46 commit 4ca5bba

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

content/en/blog/making-a-game-with-pion.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ date: 2025-09-09
55
authors: ["Srayan Jana"]
66
---
77

8+
(The following was adapted from a talk I gave at [DWeb Weekend 2025](https://dwebseminar.org/weekend/) at the Internet Archive in San Francisco on August 17, 2025)
9+
810
# Simplifying WebRTC Datachannels for Games
911

1012
First of all, to get some stuff out of the way, instead of using the "super complicated" WebRTC datachannels, why don't we use something simpler?
@@ -20,18 +22,22 @@ First of all, to get some stuff out of the way, instead of using the "super comp
2022
## The Case for Web Transport
2123

2224
- Replacement for Websockets, uses QUIC instead of TCP.
23-
- Has been in development for a long time, and I want to get started now.
25+
- However, it has been in development for a long time, and I want to get started on making games now.
2426
- Current issues:
2527
- [Caniuse WebTransport](https://caniuse.com/webtransport)
2628
- Official demos on [GitHub](https://github.com/w3c/webtransport) do not work on Firefox on Windows.
2729
- [GitHub Issue](https://github.com/w3c/webtransport/issues/675)
2830
- [Firefox Bugzilla](https://bugzilla.mozilla.org/show_bug.cgi?id=1969090)
29-
- **Potential**: Will probably solve most problems once finished.
31+
- **Potential**: Will probably solve most problems once finished and would be the best choice for making a multiplayer game on the web.
3032

3133
## Datachannels: A Hidden Gem of WebRTC
3234

3335
- **Feature**: Lets us send unreliable packets over the web using SCTP.
3436
- Advantage: We don’t need WebTransport; we can use this today.
37+
- They were created in part for exactly this use case
38+
- [See the reasoning for unreliable datachannels in the official specification itself](https://datatracker.ietf.org/doc/html/rfc8831#name-use-cases-for-unreliable-da)
39+
- [Not to mention that one of the original implementers of WebRTC wanted to enable this usecase](https://news.ycombinator.com/item?id=13264952)
40+
![Comment from original WebRTC team member](/img/comment_from_webrtc_team.png)
3541

3642
## Benefits and Drawbacks of WebRTC
3743

@@ -56,7 +62,9 @@ First of all, to get some stuff out of the way, instead of using the "super comp
5662
- [webrtc-rs](https://github.com/webrtc-rs/webrtc) - Rust (using Tokio Runtime).
5763
- [str0m](https://github.com/algesten/str0m) - Rust (sans-io).
5864
- [sipsorcery](https://github.com/sipsorcery-org/sipsorcery) - C#
59-
- [GameNetworkingSockets](https://github.com/ValveSoftware/GameNetworkingSockets) - Uses ICE and STUN/TURN for Peer to Peer.
65+
- [GameNetworkingSockets](https://github.com/ValveSoftware/GameNetworkingSockets)
66+
- Uses ICE and STUN/TURN for Peer to Peer.
67+
- Created by Valve and made for Steam, which means if you've ever played a game like Counter Strike or Deadlock, you've already seen this library in action!
6068

6169
### Existing Game Networking Libraries Using WebRTC
6270

@@ -67,7 +75,7 @@ First of all, to get some stuff out of the way, instead of using the "super comp
6775
- [Matchbox](https://github.com/johanhelsing/matchbox) - WebRTC datachannel library for Rust, compiles to both native and WASM.
6876
- [PeerJS](https://github.com/peers/peerjs) - Great for browser-only apps/games, not specifically for game networking.
6977
- [Netplayjs](https://github.com/rameshvarun/netplayjs) - Untested but seems to work well.
70-
- [Godot's WebRTC Native](https://github.com/godotengine/webrtc-native) - Official Godot bindings to libdatachannel for Godot’s multiplayer API.
78+
- [Godot Engine's WebRTC Native](https://github.com/godotengine/webrtc-native) - Official Godot bindings to libdatachannel for Godot’s multiplayer API.
7179

7280
## Real-World Uses
7381

@@ -76,7 +84,11 @@ First of all, to get some stuff out of the way, instead of using the "super comp
7684
- [Xash3D Launcher](https://github.com/ololoken/xash3d-launcher)
7785
- [Counter Strike 1.6 on the web](https://turch.in/cs/index.html)
7886
- ![Counter Strike](/img/counter_strike_on_the_web.png)
79-
87+
- **Hypersomnia** - Open source 2D shooter made with C++ and libdatachannel
88+
- Has cross platform capabilities between both
89+
- The [native Steam port](https://store.steampowered.com/app/2660970/Hypersomnia/)
90+
- And in the browser (On [CrazyGames](https://www.crazygames.com/game/hypersomnia) and [the official website](https://hypersomnia.io/))
91+
- [Github Link](https://github.com/TeamHypersomnia/Hypersomnia)
8092
## Why Go for Development?
8193

8294
- Efficient: It just gets the job done.
@@ -86,25 +98,40 @@ First of all, to get some stuff out of the way, instead of using the "super comp
8698
## Why Not Rust?
8799

88100
- Preference: I like Rust, but Go has a more active scene/easier help for WebRTC.
89-
- Compilation: Big ecosystem, besides C, C++, and C#, that can compile to game consoles (Rust cannot yet).
90101
- Speed of development: It's faster to code in Go compared to Rust.
91102

92103
## Why Ebitengine for Game Development?
93-
104+
- [Website Link](https://ebitengine.org/)
94105
- **Versatile**: 2D game engine that works across various platforms.
95-
- **Potential Crossplay**: Nintendo Switch, PC, and browser.
96-
97-
## Showcase
98-
99-
- **Pion PR**: [Example WebRTC Applications](https://github.com/pion/example-webrtc-applications/pull/351)
100-
- If time permits: Show a version that works with the web at [ValorZard](https://github.com/ValorZard/gopher-combat)
101-
102-
## Games That Use WebRTC
106+
- The creator, [Hajime Hoshi](https://hajimehoshi.com/), has ported the engine (and the Go language!) to [the Nintendo Switch](https://ebitengine.org/en/blog/native_compiling_for_nintendo_switch.html) and other game consoles
107+
- **Battle Tested**: Has been used for actual games like
108+
- [From Madness with Love](https://playism.com/en/game/frommadness-withlove/)
109+
- [Steam Link](https://store.steampowered.com/app/2101130/From_Madness_with_Love/)
110+
- Coral & The Abyss
111+
- [Steam Link](https://store.steampowered.com/app/3123920/Coral__The_Abyss/)
112+
- [Nintendo eShop Link](https://www.nintendo.com/us/store/products/coral-and-the-abyss-switch/)
113+
- Rakuen
114+
- [Steam Link](https://store.steampowered.com/app/559210/Rakuen/)
115+
- [Nintendo eShop Link](https://www.nintendo.com/us/store/products/rakuen-deluxe-edition-switch/)
116+
- And more on the [Ebitengine Showcase Page](https://ebitengine.org/en/showcase.html)
117+
- **Potential Crossplay**: You could make a cross platform multiplayer game in pure Go that works between the Nintendo Switch, PC, and the browser!
118+
119+
## Official Pion Example
120+
- We now have an official example using Ebitengine in the Pion [example-webrtc-applications](https://github.com/pion/example-webrtc-applications) repository
121+
- This includes an bundled in signaling server so you can host your own lobby, and connect with another player.
122+
- [**Github Link to Game**](https://github.com/pion/example-webrtc-applications/tree/master/ebiten-game)
123+
- **PR where it was merged in**: [Example WebRTC Applications](https://github.com/pion/example-webrtc-applications/pull/351)
124+
- **Limitations**
125+
- Right now, this can only support two players on the same computer
126+
- Could probably work between two different computers, but we would need to figure out how to setup CORS properly for the signaling server
127+
- The machinery is there to support more than two players in a lobby, but as of writing this article it is [currently hardcoded](https://github.com/pion/example-webrtc-applications/blob/5c7005933879d34fa19b4d0c744bb884a247f5dc/ebiten-game/game/main.go#L154) to just two
128+
![Picture of game](/img/game_on_web_and_desktop.png)
129+
130+
## Other Games That Use WebRTC
103131

104132
- [Tough Love Arena](https://toughlovearena.com/)
105133
- [Counterpick Labs](https://www.counterpicklabs.com/)
106134
- [2D Soccer](https://2dsoccer.com/)
107-
- [Hypersomnia](https://github.com/TeamHypersomnia/Hypersomnia)
108135

109136
## Possibilities with WebRTC
110137

465 KB
Loading

0 commit comments

Comments
 (0)