[HN Gopher] I spent 2 years building my own game engine (Rust, W...
       ___________________________________________________________________
        
       I spent 2 years building my own game engine (Rust, WASM, WebGPU)
        
       Author : upmind
       Score  : 143 points
       Date   : 2024-08-17 23:22 UTC (23 hours ago)
        
 (HTM) web link (legendofworlds.com)
 (TXT) w3m dump (legendofworlds.com)
        
       | brink wrote:
       | > In conclusion, I have no regrets.
       | 
       | I'm also deep into making a Minecraft-like game with a custom
       | engine in Rust with WebGPU. Having worked in dozens of languages,
       | I've found Rust to be extremely productive for what I'm building.
       | It's been great, and I have relatively few complaints.
        
         | CooCooCaCha wrote:
         | There has yet to be a single successful minecraft-like game
         | despite it being one of the most common projects for gamedev
         | beginners. Seriously, spend time in a gamedev discord and see
         | how often people talk about their voxel game.
         | 
         | So I'm curious what makes you and your game different. I think
         | one of the traps here is minecraft-likes have fun algorithms so
         | people get nerd-sniped on the technical side but the gameplay
         | side and art are severely lacking.
        
           | jt2190 wrote:
           | What is the definition of "success" you're using here? It
           | seems like a solo game dev could operate with their own
           | unique definition of success since they don't need to
           | convince others to adopt their approach.
        
           | brainzap wrote:
           | just because you don't know them, does not mean they don't
           | exist
        
           | whywhywhywhy wrote:
           | Wrong, Vintage Story is successful.
        
             | CooCooCaCha wrote:
             | Define successful. Are the devs working on the game full-
             | time?
        
               | sladoledar wrote:
               | Yes. It has an active player base that is growing daily.
        
               | CooCooCaCha wrote:
               | That's not what I asked.
        
               | jasonlotito wrote:
               | You asked them to define successful. You asked them a
               | question. I see them answering the question and defining
               | successful.
               | 
               | You are, by definition, 100% wrong.
        
               | jamilton wrote:
               | https://www.vintagestory.at/aboutus.html/
               | 
               | "The Team - The list of currently active game developers,
               | part-time and full-time"
               | 
               | Doesn't say who's full-time, but it's a team of 14 with 3
               | programmers.
        
               | wtetzner wrote:
               | How are these 2 things related? Why do devs need to work
               | on a game full time for it to be successful?
        
               | Kiro wrote:
               | If that's your criteria for success then yes, there are
               | many such games that are successful. Do you seriously
               | think Minecraft is the only voxel game that can support
               | its developers full-time?
        
             | jasonlotito wrote:
             | I agree. Any reasonable person would agree VS is
             | successful.
        
           | samiv wrote:
           | Who says the author is looking for "success" the same way you
           | seem to think. Perhaps just writing it for their own
           | enjoyment, fun or learning is success enough?
           | 
           | After all, anyone who takes a look at the games and game
           | engine market can quickly realize that the market is so over
           | saturated with content that most people can't give their
           | stuff away for free. In fact most people would have to _pay_
           | people to have a look at their content /tool/game.
        
             | brink wrote:
             | Correct, I'm building it for fun and the challenge and have
             | learned quite a bit about performance in the process. I
             | don't expect it to be a commercial success. It's also been
             | quite good at getting the attention of potential employers,
             | where they see that if I can make this, I can build
             | something great for them too.
             | 
             | I'm in the middle of building out a custom entity system,
             | and learning about the speed limitations of smart pointers,
             | and to occasionally embrace unsafe Rust for the best
             | performance at the cost of a bit of safety.
             | 
             | https://www.youtube.com/watch?v=eoPyClyO_QU
        
           | dgeiser13 wrote:
           | 7 Days to Die is a minecraft-like game that has sold 18
           | million copies. As of this moment has 92,580 players playing
           | which is 16th out of all games currently being plated on
           | Steam.
        
             | CooCooCaCha wrote:
             | Are you saying it's a minecraft-like because it's a
             | survival game? Because 7 days to die does not look like a
             | voxel game. How was that not obvious to you from this
             | discussion?
        
               | KronisLV wrote:
               | > Because 7 days to die does not look like a voxel game.
               | 
               | Here: https://7daystodie.wiki.gg/wiki/Block
               | 
               | Speaking of successful voxel games, Space Engineers also
               | seems to be well regarded: https://store.steampowered.com
               | /app/244850/Space_Engineers/
               | 
               | I'd also put Empyrion up there, though it was a bit
               | niche: https://store.steampowered.com/app/383120/Empyrion
               | __Galactic...
               | 
               | Oh also definitely No Man's Sky:
               | https://store.steampowered.com/app/275850/No_Mans_Sky/
               | 
               | Here's a cool video on how they did things for that game:
               | https://www.youtube.com/watch?v=sCRzxEEcO2Y
        
               | seanthemon wrote:
               | Also teardown!
        
               | alt227 wrote:
               | > 7 days to die does not look like a voxel game
               | 
               | It is definitely a voxel game. Both games also share the
               | same core gameplay loop of mining blocks of materials and
               | using those materials to build other blocks elsewhere.
               | 
               | The wikipedia page for the game literally says "The game
               | is voxel-based (similar in some aspects to Minecraft, but
               | with smooth terrain)".
               | 
               | The fact it doesnt look like one proves your point wrong.
               | There are many other places in the voxel game space which
               | are as yet untapped.
        
           | fwip wrote:
           | > There has yet to be a single successful minecraft-like game
           | 
           | No? Off the top of my head, there's Teardown, which has sold
           | over a million copies and has rave reviews.
           | 
           | And there's a lot more games that use voxel-tech but don't
           | make it part of their core aesthetic, especially for terrain
           | deformation/mining. Notable examples include No Man's Sky and
           | Deep Rock Galactic.
        
           | notnullorvoid wrote:
           | Minecraft-likes are among one of the most successful game
           | formulas.
           | 
           | Some examples:
           | 
           | No Man's Sky (survival, voxel, proc gen)
           | 
           | Astroneer (survival, voxel, proc gen)
           | 
           | Valheim (survival, proc gen)
           | 
           | Enshrouded (survival, voxel)
           | 
           | Terraria (survival, proc gen)
           | 
           | Like it or not there's a lot to be gained from learning how
           | to make a Minecraft-like. Does making one guarantee success,
           | NO, but same goes for any other type of game.
        
             | im3w1l wrote:
             | Of these, I'm familiar with Enshrouded. Although I suppose
             | it's voxel based in a sense it's not really voxel-based
             | like minecraft is. Like instead of displaying the voxels as
             | is, the game interpolates them into smooth shapes. Also
             | characters and placables are high-poly like you would
             | expect from any other game rather than blocky like in
             | minecraft.
             | 
             | The effect of this is that it's actually quite non-obvious
             | that it's voxel based unless you pay careful attention.
        
               | RoyalHenOil wrote:
               | I don't totally follow how this is relevant to the
               | thread? If you make your own game engine, you can design
               | it to display the voxels however you wish. It seems odd
               | to dismiss Minecraft-like games as unsellable when many
               | Minecraft-like games have sold very well by expanding on
               | the gameplay and visuals. There is no reason why the
               | developer in this article can't do the same.
        
             | nox101 wrote:
             | No Man's Sky Astroneer, Enshrouded are not voxel games
             | AFAICT. Of those, I've only played No Man's Sky, which I
             | agree at some level is similar to Minecraft in gameplay
        
               | earthling8118 wrote:
               | Astroneer is indeed a voxel game. With some trickery to
               | make it appear differently.
        
           | wmil wrote:
           | Minecraft already exists and has had over 10 years, hundreds
           | of millions of dollars of development, and a broad modding
           | community. You can't just displace it with a Minecraft clone.
           | 
           | Early builds of Deep Rock Galactic look extremely Minecraft-
           | like. There are plenty of others depending on what you
           | consider Minecraft features.
        
           | tourmalinetaco wrote:
           | I'm curious what makes you think each and every snippet of
           | code has to be monetized and turned into a product?
        
       | tapirl wrote:
       | Which games are built with it mow?
        
       | memkit wrote:
       | Kudos to the author. I think this stack will slowly acquire more
       | and more market share as time goes on.
       | 
       | I'm also working on a Rust+WASM+WebGPU game from scratch. The
       | process has been absolutely wonderful.
       | 
       | The stack (or, more generally, game dev from scratch) touches so
       | many important CS concepts: computer architecture and systems
       | programming at the bottom, all the way up to extremely abstract
       | programming language theory and front end web dev at the top. Add
       | in networking and your own distribution platform (even a simple
       | REST website) and you end up doing and learning more than you
       | would in most CS programs.
        
       | samiv wrote:
       | Two years is not much. I've worked on mine for over 4 years by
       | now ;-)
       | 
       | https://github.com/ensisoft/detonator
       | 
       | Too bad there's no actual technical information about the authors
       | engine.
        
         | bckr wrote:
         | It's called toxoid. It's here:
         | https://github.com/toxoidengine/toxoid
        
           | samiv wrote:
           | Thanks for the link.
        
             | johnhenry wrote:
             | You both have very nice game engines.
        
       | moffkalast wrote:
       | Ironically Google is now beginning the first steps of forcing the
       | bulk of Chrome/ium users back to Firefox by removing the API
       | ublock needs, Firefox which has no WebGPU support and renders
       | WebGL as a stuttery mess, so all of this extensive work may have
       | been for nothing. Back to the dark ages we go.
        
         | lagniappe wrote:
         | In "the dark ages" as you put it, we didn't conflate the
         | browser with the operating system.
        
           | moffkalast wrote:
           | Well, the dark ages of web browsers. But well, for casual
           | users that would be playing games made with such engines, the
           | browser might as well be the OS.
        
           | jayd16 wrote:
           | Yeah, we just broke out of the sandox and ran browser games
           | with random Java and Flash we downloaded from strangers.
           | 
           | Y'know, the good old days.
        
             | Intralexical wrote:
             | Don't forget ActiveX!
             | 
             | Those 3d games were pretty standout amidst the
             | Macromedia/Adobe/Shockwave/Flash platformers on Miniclip.
        
         | benrbray wrote:
         | fwiw Chrome on Linux has no WebGPU support or hardware
         | acceleration, so I often use Firefox for e.g. playing Ruffle
         | content. The story is different on different platforms, and
         | will slowly improve.
        
         | notnullorvoid wrote:
         | wgpu is the main rust crate for webgpu rendering, and it's what
         | Firefox is using for it's experimental webgpu support. It's
         | also enabled by default in Firefox nightly builds. I don't
         | think it'll be long before it ships in stable.
        
         | BearOso wrote:
         | wgpu and WebGPU aren't just for browsers. They can be used in
         | native programs as well. They're primarily a way of unifying
         | platform APIs to produce a portable graphics target.
        
       | torlok wrote:
       | Does anybody have experience with component systems like the one
       | used in the engine in large projects? I feel like they all work
       | well with components like Position and Velocity, but for anything
       | less genetic, when you need to control what updates, when, and in
       | what order, it looks like a nightmare to use. I get the same
       | vibes as when using a genetic physics engine for a game; you end
       | up messing with mass, gravity and casting a ton of rays just to
       | get the behaviour you want. Maybe in sandbox games the trade off
       | is worth it.
        
         | mpwoz wrote:
         | For context, I recently completed a game on a team of 4 devs
         | who were all relatively new to ECS for the last bevy game jam
         | [1]
         | 
         | Initially, we struggled a bit with how much ceremony there
         | seemed to be to make simple stuff like movement work within the
         | paradigm of an ECS (entity component system) engine.
         | 
         | But by the end of the week I think i can safely speak for all
         | of us when i say we came away impressed by how organized
         | everything was - despite everyone working on different pieces
         | at a frantic pace for a week.
         | 
         | One concrete example is a last minute addition of little text
         | dialog popups over various entities in response to different
         | events : enemy sighting a player, player respawning, reaching
         | an objective, etc. This ended up being trivial once the system
         | for picking which line to say was in place, largely thanks to
         | ecs and bevy's event system.
         | 
         | Now i wouldn't want to go back to the gameObject / update
         | function way of structuring things ecs and bevy actually really
         | shine once you do cross a certain threshold of size/complexity
         | - especially with multiple people working simultaneously.
         | 
         | That said i do agree with you on the generalized physics engine
         | point - we decided early on that was overkill and we could
         | write our own collision and movement much faster, with better
         | game feel to boot.
         | 
         | [1] https://itch.io/jam/bevy-jam-5/rate/2824463
        
       | Animats wrote:
       | As someone who really needs high-performance 3D from Rust [1], I
       | wish more of the people who really want to build a game engine
       | would focus on 3D. You don't need Rust for a 2D game. It's
       | overkill. There are already too many 2D engines.
       | 
       | [1] https://video.hardlimit.com/w/7usCE3v2RrWK6nuoSr4NHJ
        
         | Kiro wrote:
         | Rust is a great fit for 2D games with massive amount of
         | particles. See Gnorp Apologue and
         | https://gnorp.dev/news/10-Hats-And-Rust/
        
       | JKCalhoun wrote:
       | Hopefully constructive criticism: the glow from the light sources
       | bothers me because it washes out the player and background. The
       | opposite would be preferable -- darken all but a "gradiated"
       | region around the light sources.
       | 
       | That or use a different form of compositing -- something
       | equivalent to "Lighten" or "Screen" (using standard paint-program
       | parlance).
        
       ___________________________________________________________________
       (page generated 2024-08-18 23:01 UTC)