3 ms·
In my experience, spawning is generally a mistake. It brings a huge amount of potential pitfalls for join in progress, and often becomes an attack vector for gr
by dleslie 5y ago
In my experience, spawning is generally a mistake. It brings a huge amount of potential pitfalls for join in progress, and often becomes an attack vector for griefing. On top of that, it makes hardware usage unbounded.
What you usually want is pools.
- rackjack 5y agohttps://gameprogrammingpatterns.com/object-pool.html https://gameprogrammingpatterns.com/object-pool.html Is this the kind of pool you're referring to? Just curious, I don't know a lot of gamedev.
- m12k 5y agoExactly that. Ideally, nothing gets allocated or freed during a given frame, it's just previously (upfront) allocated entities getting flagged as active or inactive.
- aspectmin 5y agoPools? (Vs spawns?) Good reference to learn?
- codeflo 5y agoI don’t follow. Spawning objects (which the article talks about as part of the network code) is unrelated to (re-)spawning players as a gameplay feature (which is where griefing could be an issue), neither of them make hardware use “unbounded”, and both are completely orthogonal to using pools as an allocation technique.
- dreyfan 5y agoIf you're in a competitive multiplayer game and you know that dropping an object on the ground or shooting a certain projectile will trigger new object spawns for a player who doesn't have them cached, you can do so rapidly and cause their machines to stutter/desync.
- Aeolun 5y agoIf you are building a competitive multiplayer game, maybe don’t use Godot’s basic/development network implementation?
- deleted 5y ago[deleted]
- codeflo 5y agoWhy wouldn’t those objects be loaded in a competitive multiplayer game?
- dimgl 5y agoYeah not sure about this one chief. Is this an engine specific thing? I don’t see why spawning can’t happen on an async thread.
- OhSoHumble 5y agoAnecdotally, this occurs often in the game Escape from Tarkov. New game objects entering the world can cause client stutters. This was a larger problem during earlier builds of the game because it was more pronounced and the stutters could either be used offensively by degrading performance on enemies computers or it could just be used to gauge game state. Also to note, Tarkov has several inherent design problems.
- dimgl 5y agoThis seems to be an engine specific thing though. Unity has always struggled with spawning objects in big maps. Rust had a similar problem for many years.
- dschroer 5y agoI think the two can live interchangeably. Pooling and such is more of an optimization technique. For a tutorial like this limiting the number of concepts to throw at the reader is better than making sure its 100% production ready. I would be worried if reading a post like this was all you need for your entire games netcode in prod.