My dream of making a multiplayer, browser based .io type game is coming true and you’ll have the opportunity to learn a little bit about what it takes to make something like this. I think it will be fun.
Hope you enjoyed the video!
View Math Arena here:
Join my Discord server and come say hi:
Check out some code on my GitHub:
Send me a Gab:
Other Social:
SmoollBrain
02.04.2022In my opinion, I don't think games like Slither.io (those snake type .io games) are multiplayer, but I could be wrong.
Caret
02.04.2022what Io games have in common is the false multiplayer advertisement, hope your game is not
peace
28.03.2022Hi! The explanation is amazing! Do u have videos on sockets? Or on servers and networking in general
Zac Koch
28.03.2022Whoa, that means I was ahead of my time from when I demo'd it 🙂 I wasn't ready for the custom player names 🙂
Nice work – lmk if you want me to load test it lol
Kumar Vishal
28.03.2022Socket has the room feature 🤔 would that work instead of using redis
613see
28.03.2022Don’t send a user’s position to the server. Someone can modify your clients code to send any position he wants. You should send the keys/buttons the user pressed. And of course your server must verify any important user’s action in case he tries to cheat.
impossible441
28.03.2022That is awesome EM! Keep us posted on the future development
Cadet Kosmov
28.03.2022Are you gonna run this in a single instance? With redis as a centralized data store it wouldn't be difficult to scale to multiple ones. Would be really interested in how to load balance a websocket server, never done that before.
João Marcos Polo Junior
28.03.2022I remember watching a video about most of these io games being fake multiplayer (LOL). Anyways, that soo cool! Congrats!!!!
Jarrod Price
28.03.2022Awesome, I like the concept, my only problem with it is that it should’ve been called: "QuickMaths.io" https://youtu.be/el8T6-JXbmo
Beesha
28.03.2022Lovely !
Herman Morris
28.03.2022I love watching your stuff. And Trust Me! baldr – endless things on spotify!
Benjamin Harvey
27.03.2022I’m about 90% my way through building an online multiplayer browser card game. I’m kind of doing it old school. Front end is HTML and JS. Back end is PHP and MySQL on an Apache web server. No web sockets, I’m polling the database for changes, then sending some JSON from server representing the game state. This then gets updated in the browser.
For a card game this method works. But after seeing your method it looks like it could simplify the code quite considerably.
Maybe it’ll get a rewrite.
Anon Anon
27.03.2022I've been wanting to make something like this for ages so it would be awesome to see someone else's approach!
voidz
27.03.2022can u see krunker.io u will be shocked it is like minecraft and csgo had a baby but in browser
ScruffyGaming
27.03.2022No sorry, that's mot really multiplayer 🙂 it might as well just be a single player. But I still found it really interesting. thanks.
Get In the car
27.03.2022As much as want to learn the things you do in the vids i have watched, I'm just lost. I can turn on computer and type in a site i want. It's a start, lol.
Дмитрий Жучков
27.03.2022Nice game mechanic explanation. Thank you!
DrRippchen
27.03.2022Have you thought about socket.io with the feature of rooms? If yes, is there an advantage using the publish-subscribe method instead of socket.io rooms ?
Paper Benni
27.03.20220:25 They're usually faking their multiplayer and full of dodgy ads or cryptominers xD
maxhouseman
27.03.2022Flux would be great for state handling. You could also split up your react components a little bit more for better maintaining as the game will get bigger.
Manuel Novella
27.03.2022I'm learning so much with you!
Peter Chou
26.03.2022d
Peter Chou
26.03.2022hi engineering man I'm also building a IO game (link: https://game-dungeonio-test.herokuapp.com/ github repo: https://github.com/PeterChou1/dungeonio )
One problem I have is slow down when too many players are connected, do you encounter any problems when large amounts of player are connected?
Its also interesting to see that you used React to build your game why not use a dedicated game JavaScript game framework like Phaser.
PowerUser
26.03.2022This will be the most stressful io game
Hsein Bitar
26.03.2022Looking forward to its completion
Mehmet Yatkı
26.03.2022Great work so far… How do you plan to solve scalability? Would you push the players to the Redis as well? or have another idea? Cheers,
Mike B
26.03.2022Very cool dude! Next challenge: spawn && shoot projectiles that can hit the other players. I guess at that point it gets a bit more tedious.
If you had to implement the UI part another way, how would you go about that? Instead of calculating the styles.
Inspirational stuff. Thanks for sharing this.
Vlad Macovei
26.03.2022I remember that socket.io has the concept of rooms. Couldn't that be used instead of Redis? Also, have you considered using canvas in combination with requestAnimationFrame? I believe even the 2d canvas context uses hardware acceleration, i don't think css left/right get hardware acceleration but translateX/translateY might.
This video might help with timing and CPU efficiency: https://www.youtube.com/watch?v=MCi6AZMkxcU
my second account
26.03.2022snek.
Mechant Loup
26.03.2022React will bring about a huge performance penalty. I would do this in Vanilla JS.
al20ov
26.03.2022Great video, but I have to ask you this: have you considered webgl2, or any library using webgl (babylon, threejs, twgl, or even raw webgl code)? As much as I like React, canvas+webgl seems like a much better contender for a real time game, even a 2D one, it would probably perform much better than react for this use case and maybe make way for some educational content (I would love to see some WebGL content from you).
Anyway, keep up the good work and good luck for your project!
Specy
25.03.2022Some stuff:
1) why are you using class components instead of functional components in react (I prefer class components but everyone tells me to not use them and instead use functional ones)
2) you should probably create your own game "protocol" instead of using JSON. Once you have many connections it's going to consume a lot of data. What .io games do Is create an array buffer data, say that you have an array, you divide them in 2 parts, first is the type of action, second is the value. So for example:
[1,2000,2,2000] could be, 1 = x, 2 = Y, and 2000 is the value.
Daniel Joachim
25.03.2022<3
Mitesh Kumar
25.03.2022You should incorporate some sort of consensus algorithm so that you can run the backend on a cluster and if one server goes down, the clients can reconnect their WebSocket connection to another server without losing substantial progress.
Susie Smith
25.03.2022Your Craig’s List Scamming a Scammer was in my recommendations. Loved what you did.
Harshit Joshi
25.03.2022Why do you use atom ?
Coding Nuggets
25.03.2022Now this seems like a cool idea. So glad I found your channel. Thanks for the awesome content. See you soon!
DialM4Microcontrollr
25.03.2022Feature request: new player enters the game and a banner across the top states"$player_ has entered the game"
Rabindra Joshi
25.03.2022With socket rooms or namespaces, you can determine who is subscribed to what and publish events to a particular room id. The only case I'd throw Redis into the mix is to scale horizontally – because I can't get 2 users wanting to connect to the same game connect to the same server, all servers need to share the game state for all games in real-time. Redis pub-sub would work the best, Kafka will probably have even higher throughput (if we care about that).
Waiting for the next video. 😊
Kappa2000
25.03.2022These videos make me doubt if i still want to study programming…
Thomas Carlsen
25.03.2022Making an .io project seems like a cool thing to do – but why ain't you using es6 modules?
B Targ
24.03.2022Interesting that you made your own engine when there are so many javascript and HTML game engines, very complicated but super cool
EpicGrowtopian
24.03.2022Love this game idea!
Ù´
24.03.2022paper.io isn't multiplayer. Try disconnecting the wifi mid-game, and everyone keeps playibg
Sansha Kuvakei
24.03.2022I'm late to the party, but I'd like to hear your thoughts on using React vs Canvas for this project. Do you have any concerns that you'll experience performance issues as the game grows in scope? To my knowledge Canvas tends to be more effective in this type of situation, though I understand there are benefits to using React for state management, I was mostly wondering how you weighed those options against eachother. Thanks for the great video as always!
Kevin
24.03.2022Hands down my favorite io game is krunker.io
Jared Wende
24.03.2022Is this project still alive?
Alter VR
24.03.20220:19 That is where your wrong. Haven’t you hear of… BOTS?
K Ken
24.03.2022Hi,
I'm research/learning on the subject cuz I want to make something like Eve online.
I have learned Unity and Unity can create WebGL.
My question is, would it be possible to use webGL to substitute for node.js/react/reddis?
And do you have any suggestions on where to host a web browser game? (is Hostinger a valid option?)