|
From: Alexander R. <ale...@us...> - 2002-03-19 05:22:54
|
Hi,
I had the idea that we should implement 'effect groups' in libff.
Because I want to have many effects - most of them consisting of 2 or 3
simple effects, and they won't fit in the memory of all devices, I believe.
So libff should care take of that, allow the user to design effect groups,
and then libff should find out automatically which effects to stop and which
to play.
For VS, I would have the following effects groups:
* afterburner on
- jerk 0
- wiggle x 1
- wiggle y 1
*afterburner off
- wiggle x 2
- wiggle y 2
* bolt fired
- jerk 0
- vibrate x 2
* shield hit
- jerk 0
- vibrate 1
etc etc
The numbers are meant to be effect priorities, with 0 being the highest one.
there should be an alg to handle those effect groups like this:
playEffectGroup(groupid){
foreach effect in effectgroup do {
slot=findUnusedSlot(effect); // find a completely unused slot
if(!slot){
slot=findSlotWithLowerPriority(effect); // returns the oldest currently
played slot with lower pri than the new effect
if(!slot){
slot=findSlotWithSamePri(effect); // let's try one that has got the same
pri
if(!slot){
// can't play it
}
}
}
uploadEffectToSlot(slot,effect);
playSlot(slot);
}
}
something like that.
This would have these advantages:
If you want to play too much effects at the same time, or your device doesn't
have the mem/slots, then the effect with pri 0 will get played surely - these
are the basic effect - and if your device can take it, the other effects, too.
The player could also set a variable saying 'use only effects with pri 0' or
so, when he's annoyed by too much of effects and wants to have simpler ones.
Some more questions:
If I get the number of effects with EVIOCGEFFECTS - what does this tell me?
a) the (maximum) number of effect that can be played at the same time
b) the (maximum) number of effects that can be hold in memory
Do different effect types use a different amount of memory - like, you can
upload 20 constant effects or 10 periodic effects, because periodic effects
need more mem etc?
If I am getting an error when I am updating an already existing effect (when
I am updating too fast, I mean) - does this mean
a) that this special effect cannot be updated at the moment or
b) that the device cannot be updated at the moment
If a), I could try and find another slot that is currently capable of
updating.
Alex
--
Alexander Rawass
Email: ale...@us...
http://tuxfleet.sourceforge.net http://qtreemap.sourceforge.net
...but some day you'll be a STAR in somebody else's SKY...
|