beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
224 stars 102 forks source link

CEGs: priority for rate limits #356

Open sprunk opened 2 years ago

sprunk commented 2 years ago

Here's a recursive CEG which has a root "particle" which is just a spawner (this is a simple version of how e.g. the ZK nuke mushroom cloud works):

sub_particle = {
    -- bla
},
root_particle = {
    class              = [[CExpGenSpawner]],
    count              = 10,
    properties = {
        delay              = [[0 i30]],
        explosiongenerator = [[custom:sub_particle]],
    },
},

Currently, when near the particle limit, each particle has some hardcoded chance of going through (which goes down to 0 as particle count approaches limit). This means that the root particle of the nuke (which is an important visual indicator) has the same chance of being blocked as some random sparks from a flea shot (which are just eye candy).

The request is to add some sort of priority such that important particles have a lower chance of being blocked, possibly to the extent that existing lower-priority particles are dropped to make room.

sprunk commented 1 year ago

903 reminds me of another facet of this problem. CEGs far away from the camera are just as likely to be let through as those near.