Hands-On Rust: Effective Learning Through 2D Game Development and Play
31–40 of 83 posts
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#32Earlier quoted context omitted.
(Author here) Bob makes some good points, so I'd like to share my $0.02 on the ECS debate. The posters below who point out that a lot of Rust setups use ECS to avoid mutability issues are correct (although internally Bevy is an ECS that maps its own node graph) - and that certainly helps - but it's not the whole picture. I think it's important to separate the EC from the S in ECS. Entity-Component storage is basicall…
> Composition over inheritance (especially in Rust, which doesn't really have inheritance - although you can fake it with traits) This does not require ECS, you can happily have something like struct Entity { components: Vec >, } (Nor do I think this is a good way of setting up a traditional roguelike) > Replication; if you want to replicate state across multiple nodes, a good ECS can really help you I'm not sure wha…
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#33I can't help but be heavily skeptical of approaches to a (traditional) roguelike that use ECS. The idea is very entrenched in the rust gamedev community, but for a turn based tile based game there's extremely little benefit and a lot of added complexity. Bob Nystrom has an excellent talk on roguelike architecture [0] and rust as a language itself doesn't prevent any of these approaches. If anything, the existence of…
There's a great talk [0] from the Overwatch developers where they talk about how they built Overwatch using the ECS architecture. They barely mention performance at all, but instead talk about how it helped deal with complexity.
[0] https://www.gdcvault.com/play/1024001/-Overwatch-Gameplay-Ar...
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#34Earlier quoted context omitted.
(Author here) Bob makes some good points, so I'd like to share my $0.02 on the ECS debate. The posters below who point out that a lot of Rust setups use ECS to avoid mutability issues are correct (although internally Bevy is an ECS that maps its own node graph) - and that certainly helps - but it's not the whole picture. I think it's important to separate the EC from the S in ECS. Entity-Component storage is basicall…
> Composition over inheritance (especially in Rust, which doesn't really have inheritance - although you can fake it with traits) This does not require ECS, you can happily have something like struct Entity { components: Vec >, } (Nor do I think this is a good way of setting up a traditional roguelike) > Replication; if you want to replicate state across multiple nodes, a good ECS can really help you I'm not sure wha…
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#35I can't help but be heavily skeptical of approaches to a (traditional) roguelike that use ECS. The idea is very entrenched in the rust gamedev community, but for a turn based tile based game there's extremely little benefit and a lot of added complexity. Bob Nystrom has an excellent talk on roguelike architecture [0] and rust as a language itself doesn't prevent any of these approaches. If anything, the existence of…
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#36I can't help but be heavily skeptical of approaches to a (traditional) roguelike that use ECS. The idea is very entrenched in the rust gamedev community, but for a turn based tile based game there's extremely little benefit and a lot of added complexity. Bob Nystrom has an excellent talk on roguelike architecture [0] and rust as a language itself doesn't prevent any of these approaches. If anything, the existence of…
I think a key strategy that is not touched on too much in the talk is flexibility in your effect system, whatever your effect system may be. It should be trivial to take an effect (heal, damage, stat boost, etc) and let anything in your game apply it to actors with just a few lines of code: items, spells, tiles, regions, the whole game, etc.
As an example, lots of games will specifically give certain classes hps/mana/better chance to hit/new skills as they gain levels.
I just use my effect system for this. Now I can have items that give skills too, because items use the same effect system.
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#37I can't help but be heavily skeptical of approaches to a (traditional) roguelike that use ECS. The idea is very entrenched in the rust gamedev community, but for a turn based tile based game there's extremely little benefit and a lot of added complexity. Bob Nystrom has an excellent talk on roguelike architecture [0] and rust as a language itself doesn't prevent any of these approaches. If anything, the existence of…
We explored the topic quite thoroughly in [0] and came to the conclusion that Roguelikes are more suited for something in-between ECS and OO, named just "EC".
ECS is better suited to real-time games, or games which have a lot of iteration over large arrays and parallel (not as in multi-threading, but as in, batchable) computations, where ECS can really shine due to its data layout. Most turn-based games like roguelikes don't iterate over large arrays in the same way.
With EC on the other hand, you're a little more free to group components into their parent entity, and use interfaces (traits), which can make things more understandable.
Whether idiomatic Rust likes EC is an open question though. Idiomatic Rust tends to dislike heap allocation and virtual dispatch, both which can make life a lot easier for Roguelike games, which tend to prioritize flexibility and features, and don't need the data-oriented optimization.
Additionally, a lot of people suggest using ECS in Rust because that's the only architecture that the borrow checker doesn't fight you in, for various reasons.
[0]: https://www.reddit.com/r/roguelikedev/comments/i3xekn/ec_vs_...
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#38I can't help but be heavily skeptical of approaches to a (traditional) roguelike that use ECS. The idea is very entrenched in the rust gamedev community, but for a turn based tile based game there's extremely little benefit and a lot of added complexity. Bob Nystrom has an excellent talk on roguelike architecture [0] and rust as a language itself doesn't prevent any of these approaches. If anything, the existence of…
Personally, while my experience is a bit limited, I quite like the ECS style. It just makes logical sense to me as a way of composing entities from different parts. The implementation details (cache friendliness or whatever) are not important to me since I've never made anything of a scale where it matters, but that style of developing/designing how things act and interact is logical to me personally. I haven't watched Bob Nystrom's talk yet though (or, actually, I may have, it seems familiar, but I don't remember any details. I plan to watch it tonight).
With that said, many people find the Godot style more natural and it certainly is nice too.
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#39I can't help but be heavily skeptical of approaches to a (traditional) roguelike that use ECS. The idea is very entrenched in the rust gamedev community, but for a turn based tile based game there's extremely little benefit and a lot of added complexity. Bob Nystrom has an excellent talk on roguelike architecture [0] and rust as a language itself doesn't prevent any of these approaches. If anything, the existence of…
I've coded MUDs for about 25 years now, and I use a lot of these patterns in my code. Nice to see someone else thinks its useful. I think a key strategy that is not touched on too much in the talk is flexibility in your effect system, whatever your effect system may be. It should be trivial to take an effect (heal, damage, stat boost, etc) and let anything in your game apply it to actors with just a few lines of code…
Re: Hands-On Rust: Effective Learning Through 2D Game Development and Play
#40Book is also online: https://bfnightly.bracketproductions.com/ and on Github: https://github.com/amethyst/rustrogueliketutorial
(Author here) That's the Roguelike tutorial I created, not the Hands-on Rust book. The two are quite different beasts, with a bit of overlap. Hands-on Rust is designed for the newcomer to Rust, and carefully maps tutorial sections through teaching beginner-to-intermediate Rust concepts. It starts with some basic Rust exercises, works through a Flappy Bird clone, and then uses Roguelike development to teach a lot of u…
Mentioning this here since the tutorial linked above has a lot of procedural generation content