Bun-powered MMORPG: A Brief Testimonial #13976
zimmed
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As we've finally announced a closed beta release of HeroBound, I wanted to take some time to give credit where credit is due: Bun was absolutely instrumental in being able to rapidly develop such an ambitious project and still maintain competitive performance.
I originally came across Bun about a year ago when I began this project and was reading through some discussions on the uNetworking/uWebSockets repository, a library which I had already been using for a few years. When I found out that a node alternative existed that already used µws out of the box, I was VERY interested, and so I decided to check it out.
What I discovered is that Bun is far from a Nodejs replacement. Not only is it better than node in almost every way, it also includes nearly every feature needed to manage an entire project. I ditched Nextjs, rollup, and many other libraries, because almost all of the functionality I needed from them came standard in Bun. Moreover, the addition of Bun to my project led me to Zig, and I was able to drastically increase the performance of several WASM modules by reimplementing them in Zig. One quite significant example is the NBA* pathfinder that I ported to Zig. Not only was running this pathfinder 900x faster on the client than using the 3D renderer's pre-baked navigation mesh, but it was so fast on the server that there was no need to offload pathfinding to the client! The average time for generating a 64-tile path in the Bun server is <10ns. At a 10Hz tick rate, pathfinding is a completely negligible operation even with thousands of active players.
In the last year there have been many frustrations with poorly-implemented APIs (cough babylonjs cough cough), but Bun was definitely not one of them.† And now, with an infrastructure that easily supports tens of thousands of active players on a single instance, while being able to share domain code directly between the client and server, it can be said that Bun has played no small part in turning a dream into a reality.
† Well, that's actually not entirely true. I had to throw out several libraries I had written to increase the performance of operations in Nodejs, because the same operations in Bun were impossibly fast. I mean, come on, did you REALLY have to make JSON stringify and parse SO much more performant than the binary serialization module that took a month to build? And why is Math.random FASTER than a single TypedArray lookup? Seriously, you guys need to relax. xD
All of this to say, I cannot recommend Bun enough. Bun is what Node should have been if the people contributing to it knew what they were doing.
Also, if anyone is interested, we're looking for play testers for the closed beta in November: https://heroboundgame.com/#signup
Beta Was this translation helpful? Give feedback.
All reactions