6 ms·
Looks neat. I'm struggling to get why Rust is important in this context? Is it a demo of Rust's features and a fun way to learn, or is it a major feature of the
by moritonal 6y ago
Looks neat. I'm struggling to get why Rust is important in this context? Is it a demo of Rust's features and a fun way to learn, or is it a major feature of the game which lets you do things that games like Miecraft (in Java) couldn't do?
* I'd assume peformance was great, but is there metrics to show?
* Is the client and server written in Rust, or just the server?
- emteycz 6y agoI think it's important piece of information for HN given it's open source. I wouldn't care if it was closed source.
- zelphirkalt 6y agoRust is probably mentioned for the more up to date language concepts and type safety, as in "Look, our code is probably more reliable than the code of many other games.", which in turn might mean, that the user experience will be better. Those things could be a huge deal for any game developer, especially, when you already know Rust.
- hctaw 6y agoI think Rust makes a compelling case for production code with a high degree of reliability without sacrificing too much performance. Something I think developers don't appreciate enough is that Rust helps you write code that doesn't crash nearly as much as something in C/C++, particularly with respect to how library authors express fallable code with option/result types and the lack of memory safety footguns like iterator invalidation. Consumer software is better without crashes. It's sad how rife software is these days with segfaults that can be prevented by design.
- musingsole 6y agoBut is Skyrim even worth it if you don't have mammoths walking in the sky and broken necks from overzealous head tracking?
- imbnwa 6y agoSuperficially speaking, I've seen a lot of comments around Rust's mismatch for assuming C++'s duties in game development so perhaps this is one of those "Rust in Production" signals
- hombre_fatal 6y agoMinecraft was written in Java, so that can't be it. Open-source + built in a slightly interesting language are the only reasons we'd be discussing an MMORPG. Good luck to the team. MMORPG that anyone wants to play is probably the hardest challenge in gamedev and game design.
- imbnwa 6y ago> Minecraft was written in Java Did not know that
- vlang1dot0 6y ago> Minecraft was written in Java, so that can't be it. What does that have to do with the parent comment? The usual argument I've seen is that game developers "move too fast", "don't have everything designed ahead of time", "have to iterate quickly" and Rust's insistence on writing correct code gets in the way of that during the prototype phase. Java doesn't really have that issue as it is quite a bit more forgiving than C++ and will happily let you hammer a square peg into a round hole at the expense of performance, as evidenced by Minecraft.
- pjmlp 6y agoThe only evidence is that school kids cannot write mods like AAA studios, it wouldn't be any different if those mods were written C++, or JavaScript (Bedrock)
- Macha 6y ago> Minecraft was written in Java, so that can't be it. And everyone who plays large modpacks, goes around large buildings, or just sets off a ton of TNT has seen how it has suffered for it. On the other side, anyone who has seen the selection of mods available for Java edition vs bedrock edition (the C++ rewrite) despite a modding API for bedrock being officially supported has seen how it has benefitted from this.
- zesterer 6y agoHi, I'm the founder of the project. We chose Rust because it's performant, memory-safe, and comes with a host of modern features that make writing code with the language very enjoyable. We could have chosen C++, but I'm very glad that we didn't. Memory safety is great: I've not needed to break out gdb even once throughout the history of this project, despite the size of the project. This safety means that code is easier to review because it 'does what it says on the tin' and is much less prone to UB and non-local behaviours. It also reduces the prevalence of bugs. I've been shocked by just how much easier it is to write reliable and bug-free code with Rust than it is with languages that I've used in the past (C, C++, Python, Vala, amongst others). The type system is also very powerful and it lets us encode a lot of useful invariants that can be checked by the compiler. Knowing that what you're doing is correct-by-nature is a great help and it frees your mind up to focus on the logic of what you're writing rather than getting distracted by irrelevant details like representation. Rust plays very well with data-oriented design. This works great for us. At its heart, Veloren uses a high-performance ECS that is extremely cache-coherent. There's still lots of optimisation work to do, but we're already seeing that servers that can handle hundreds of players and millions of entities without issue, despite the fact that terrain generation is done server-side (and, as such, we have similar performance constraints to games like Minecraft). The client, server and client/server frontends (frontends are logically independent and alternative frontends can be written for the game) are all written in Rust. In addition, the in-development plugin API will allow for plugins written in Rust and compiled to WASM. In addition, Rust is also very portable. Compiling the game on (and for) many platforms is incredibly easy. The game runs well on Windows, Mac OS, Linux, BSD, and community members have even gotten it running on the Raspberry Pi and a hacked Nintendo Switch! I hope this doesn't come across as being overly evangelical, but I think I speak for all of the developers when I say that we have no regrets in the slightest about choosing Rust! That doesn't mean it's the right choice for all projects, of course. The Rust gamedev ecosystem is still relatively immature. Although this is changing fast, don't expect to find any nuts-and-bolts game engines ready to go. However, if you're not afraid of diving down into low-level APIs here and there, Rust might be a great choice. Edit: At a second glance, I see you're asking more about why mentioning the language is important. As a community-driven project, we rely on encouraging new contributors to work on the game and the choice of language is something that developers usually care about a lot. Extensibility and open development is really important for us and so 'showing the innards' is a big part of what we do when interacting with the community. Unless it's security-sensitive, we'll always discuss development issues and ideas in a public forum where anybody can add their input.
- rowanG077 6y agoIn general in most modern languages there aren't really things you "cannot" do with one language that you could with another. It's more of a question of how easy it is to do something. And in general is should be much easier to create a performance sensitive game in Rust then in Java. Besides that Rust is much more ergonomic to use.
- moldavi 6y agoRust is more performant, but Java is actually much more ergonomic, since you dont need to worry about borrow checking concerns and its frequent refactoring. Still, the tradeoff is good for a game like this.
- rowanG077 6y agoI wouldn't say so. Rust borrow checker is really only an issue for novices. Whereas Javas NullPointerException is the bane of even the most experienced dev.
- mkl95 6y agoAs a part time game developer who uses mostly C++ and a bit of Python, I have considered writing a project with Rust a few times, but I've always struggled to find meaningful examples. This is game-changing.
- Kye 6y agoThe #1 problem in MMORPGs is people exploiting bugs for personal gain at the expense of the game's economy and competitiveness in PvP. Some of those bugs end up being in NPC scripts, but most are the kind Rust helps prevent.
- spijdar 6y agoWhich bugs? I wasn't under the impression that exploiting memory safety issues was the dominant type of bug to gain an advantage in multiplayer games, but usually logic errors or some kind of broken script, corner cases in nested control structures, that sort of thing. I can see an argument that Rust could also help prevent those as it is a higher-level language and has a few language features to prevent some of the logic problems, but not that many?
- Kye 6y agoMy knowledge is many years out of date, so I might be wrong.
- spijdar 6y agoI'm also not really that familiar with either Rust or modern multiplayer games, I'm just speculating. It seems like if you could buffer-overflow the server, there are more sinister things you could do besides game-the-game... (that said, I have personally found bugs in text-based MUDs that could have been prevented by Rust. They were all "just" DoS bugs though, instantly crash the server type things)
- gpm 6y agoHonestly, I think rust actually prevents a lot of logic problems, but it's hard to quantify and a subjective feeling that I'm not sure how I'd even go about trying to "prove". Order of magnitude I'd say 50% less logic bugs than a language like Java. Why? Just good language design. Things like "enums" (algebraic data types, not C-enums) making for type checked state machines, really strict typing, immutability by default, simple language semantics, good linters that people actually use, the borrow checker actually does usually lend itself to good design too, and so on.
- renewiltord 6y agoIt’s a dev community. The language is important as a hook for people interested in writing code in the language.
- Macha 6y agoFor certain classes of developers (of which I'd include myself), Rust is more accessible than C++. The tooling is more modern, the APIs feature functional constructs I'm used to for other languages, and it's not like C++ doesn't have its own feature explosion. If you're an open source game project, then it's signalling what developers might be most interested in the source in the hopes that some will then contribute, when addressing a forum of primarily developers.
- hinkley 6y agoAs a wannabe game designer who moved on quickly to other things: object lifetime problems are a bane of game design. They give you memory leaks, and in some situations are how item duplication bugs work. In particular if you do the engine as a collaborative piece, then running a game starts to look like any other volunteer group: a bimodal distribution where few old hands keep it on the rails, a lot of new people whose raw enthusiasm overpowers their lack of experience, who need to be given tasks they can not fuck up so badly. In between it’s a race between burnout and life balance for the people who have shown up for three years. They provide a lot of the leadership and competence, but they also tend to disappear. So you need to groom the newbs to replace them regularly. The old hands are the scribes who provide historical data when those transitions don’t go smoothly. They are continuity and influence, not productivity. Any system that provides some safety for people still working out how to contribute is going to fare much better than one that is alienating. Rust to me is a mix of both, therefore plausible but not a slam dunk.