Re: Is there a good way to handle multiple enemies who can effect each oth

No, you can't make a queue of closures.  You can make a queue of Box<FnOnce(&mut World)>.  This is because closures are actually structs implementing the Fn traits, and each closure is a different size and with a different vtable pointer if you use it as a trait object.  It's roughly the same as my trait, but may work on more things (e.g. naked functions).

The allocation stuff isn't necessarily the end of the world, as long as rust's default allocator is still Jemalloc or your game is only doing something on the order of thousands of these or less per second.  I thought they were talking about changing the default allocator and, if they did, you can get Jemalloc back, which can handle the volume by introducing some of the optimizations languages like JS and Python use to make allocating cheap enough to just have at it all day.

There are more advanced tricks, though I don't know whether or not Rust game stuff does them.  A lot of your difficulty here with Rust goes away if you start pivoting to think about Rust how Rust wants you to.  In the standard object oriented languages, C++, etc, you're taught to think about your data from "inside" it: class Car gets implemented in terms of what the driver would do.  In Rust, you're supposed to reach in from outside/above.  The entity component system libraries solve this through things like typemap, in order to allow you to say that you want to find a specific entity's specific component without having to know in advance the full list of components (or, put another way, it's a hack to implement open tagged unions).

If this is confusing you and your goal is a finished game, I'd just not use Rust.  Obviously if your goal is learning that's different, but if you're jumping onto the bandwaggon we've got going around lately of "but anything but a native language is sloooow", don't make that mistake.  Game dev in Rust is actually harder, it's not just you, but for people who do actually need that performance it's worth it.

In the interest of full disclosure as to where I actually stand, my endgame is basically World of Warcraft for the blind, though that's very hypothetical for the moment, and I'm thinking that with a social media campaign it may be possible to get 100-200 simultaneous users, each of which might be in a different area.  I intend to use Rust for that because it's an actually hard problem and because I've got a very strong Rust background.  Something like Wayfar 1444 might also warrant Rust just because of the sheer amount of realtime simulation it wants to do all at once--most of why that failed was the guy behind it had never even heard of a tree, but some of it was Moo.  But if you're considering this from what I think of as the product management/software engineering side where what matters is a working product, you should consider carefully.

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : keithwipf1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Dragonlee via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector

Reply via email to