React is strong at UI development but lags with actual game development. Game engines are great for that but bad at UI. How to combine both?
This talk has been presented at React Summit 2022, check out the latest edition of this React Conference.
React is strong at UI development but lags with actual game development. Game engines are great for that but bad at UI. How to combine both?
This talk has been presented at React Summit 2022, check out the latest edition of this React Conference.
Jonny became an engineer to save time, both for himself and others, so they can have more time to play games.
Jonny has used Cocos2D and Godot game engines for game development. He finds Godot more time-efficient due to its tooling.
Jonny is a web engineer at a social media company with a blue logo, but not Facebook. In his free time, he enjoys riding bicycles and developing games, both board games with his dad and electronic games.
Jonny prefers using React for web development because it allows for declarative programming, making it easy to create responsive UIs and design systems.
React may not be the best choice for game development due to performance issues with animations and lack of specialized tooling for game development.
Jonny recommends using Godot for game development because it is free, popular with a large community, exports to multiple platforms, and has a powerful editor with an integrated scripting language.
Some drawbacks of using Godot include complicated layouts due to lack of FlexBox or Grid, and challenges integrating external SDKs like those for social media authentication or sharing.
WebAssembly is a binary instruction format that allows applications to compile to a binary format instead of JavaScript. It is relevant to game development as it enables native engines like Godot to compile their code for web deployment.
WebGL is a JavaScript API for rendering 3D and 2D graphics. It allows games to render graphics directly into a canvas element on a web page, making it essential for web-based game development.
Jonny combines React with Godot by using a React UI to interact with a Godot game running on a web host. The game is exported from Godot to WebAssembly and WebGL, allowing seamless integration and communication between the React UI and the game.
Hey everyone, it's Jonny, and today I'm talking about marrying WebAssembly and WebGL games with React, or in some other words, using the right technology for the right job. In my free time, I love to ride bicycles. And the other big hobby I have is games.
Hey everyone, it's Jonny, and today I'm talking about marrying WebAssembly and WebGL games with React, or in some other words, using the right technology for the right job. So, first about me, I work at a social media company as a web engineer, that media company has a blue logo, but it isn't Facebook. In my free time, I love to ride bicycles. That can be helping my brothers with bicycle advertisements, can be a road bike, it can be a mountain bike, as long as it's bicycle related I probably like it. And the other big hobby I have is games.
Together with my dad, I have been making multiple board games and developing electronic games. I became an engineer to save time and want to talk about picking the right tool for the job. I started using the Godot game engine and React for time efficiency. React is declarative and great for making a responsive UI. However, it may not be the best choice for games with complex animations and performance is a consideration. Using the correct tooling can greatly speed up game development.
Together with my dad I have been making multiple board games, for example Lost Valley, Nord, Half-Band Heroes, they are usually funded via some crowdfunding campaigns. And since high school, I've also been developing multiple electronic games.
Initially, they were all iOS based, recently I've been branching out a bit, as you might notice from the talk, I talk about making games on the web. Why did I become an engineer? I became an engineer to save time, to save my time and to save other people's time, so they have more time available to play games. And that brings me to the first thing I want to talk about, picking the right tool for the job.
My previous games I largely made with Cocos2D, but Cocos2D is a very code driven game engine, so it's familiar for a developer to just write out the code, but it's not very time efficient because there's no tooling. I started using the Godot game engine, which is enabling me to save a lot of time on the web development side. I love to use React, which is also allowing me to save a lot of time, and I intentionally put it on the board game side here because there's one interesting similarity in board game development and web development with React, and that is being declarative.
If I come up with a new rule to play on the table with my other testers, I just roughly explain them the rule and declare my goal, my intention, what is this rule change supposed to do? Then they will interpret it and use their brain processing power to come up with an interpretation on how to actually move it into the game system, how to execute the rule. On the other hand, if I want to teach a new rule to the computer to play games with, I need to be very precise about everything.
Let's ask the question, what's the quickest way to make a game and why might React be a good choice for that, and why might Godot be a good choice for that? Also, very importantly, what's the most fun way to make a game? Because in the end, this is a talk with no commercial interest. This is just about having fun developing some games.
Okay, so why React? Some people might remember my talk from React Summit Remote Edition in 2020, where I talked about making Diagonal 4. The interesting thing about that game is, first, it's very declarative. I just have a very simple discrete board state. In the end, it's just a bitfield of eight by seven pieces. I can just go from that bitfield, and I can calculate all available moves for every player, and I can just calculate the view very directly because it's just a very simple state and very simple rendering. That maps well to React.
The other great advantage of using React is that it's very easy to make a responsive UI and to have some design systems, making that even easier on the web. Why might React be not the best choice to make a game or modern game on the web? Let's look at this example, Blood Fever. It's a game of a vegetarian vampire defending his coffin against zombies. But the important point is that there might be hundreds of enemies who all are running animations on their own. They don't have a very discrete position. It's more like a continuous state. Some functional Reactive Programming purists might say it's still a state and you can still do like very atomic calculations to come up with possible actions by the player. And then put that in a very big state machine. On the other hand, with animations, it's just not the best thing, I would say, to keep a nice performance running. So just the performance aspect, React might not be the best choice here. And also tooling. Gamedev gets a lot quicker if you use the correct tooling.
We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career
Comments