Spike objects cause too much performance increase, for how often they're used
Spike objects seem to have pretty heavy thinkers, and in certain maps (DSZ2, CEZ2) they're used liberally, making them perform worse (especially in netgames*). This seems to be a combination of several factors that add up quite a bit:
- Spikes, like many of SRB2's default objects, are quite small, so a considerable number of them needs to be placed to cover larger areas.
- As of 2.2, where Amy and Metal Sonic can break spikes, it's basically required to have spike objects with individual collision. This makes it harder to use an older, more optimized method of spike placement, where the collision is handled via an invisible FOF and the objects are purely decorative.
- Retracting spikes seem to cause even more performance increase, and would be even harder to set up using FOFs.
While it would help to reduce the number of spikes used in maps that use them a lot, any code-side optimizations to them would be extremely welcome, but I think the best solution would also be to change their size and placement methods. One potential idea to reduce the amount of thinkers would be to make "spike cluster" objects, which would cover a specific area in spike objects, where only one spike would handle all the thinking, and the rest would copy its behavior.
* A test netgame hosted by LJ saw high CPU usage on maps with a lot of spikes, which could be lowered significantly by destroying them as Amy/Metal Sonic.