4 ms·
When I started reading ‘college’ and ‘OOP’, for a moment I feared a solution that every bullet should be an object... :)
by thijsvandien 7y ago
When I started reading ‘college’ and ‘OOP’, for a moment I feared a solution that every bullet should be an object... :)
- thrower123 7y agoGamasutra fortunately is mostly written by actual professionals.
- weberc2 7y agoThey are objects with a reference to the gun that fired it and everything it could possibly interact with in the game and indeed the game itself. How else is it going to have a “shoot()” method with no arguments?
- thomasz 7y agoIs that really a problem outside of large scale RTS games like Supreme Commander? I would be surprised if something like Counter Strike would see more than maybe a few dozen concurrently flying bullets in any possible situation.
- Namrog84 7y agoJust fyi. I thought counter strike didn't used projectiles but used raycasts for almost every weapon. But your point still stands and applies for most shooters.
- mrguyorama 7y agoI think each bullet in Supreme Commander IS it's own object. I know they nearly all are individually simulated. That game is STILL hard to run at high framerates in certain "5000 unit vs 5000 unit" circumstances
- thomasz 7y agoI think thijsvandien meant object not in terms of simulation, but in terms of architecture: An instance of a Bullet class, instead of some sort of fancy representation optimized for SIMD.
- teddyh 7y ago> […] for a moment I feared a solution that every bullet should be an object. Why not, if you use the flyweight pattern?
- deleted 7y ago[deleted]