Page 1 of 1

Particle-Damage?

Posted: Sun Nov 12, 2006 4:32 pm
by Jay
What i think would be cool would be the possibility of Particles (i.e. like the Spout or the rain entity) to damage pawns and the player. Also it would be cool if this feature then could be added to the predefined efffects, too.

Could be used for maybe a firebreath, firewave or even a firewall spell.


Is this possible?

Posted: Mon Nov 13, 2006 9:27 pm
by GD1
it would be cool. I don't think we can do that right now though. We can, however, attach particle effects to Projectiles, so you can have fun with that. :)

Posted: Tue Nov 14, 2006 7:02 pm
by scott
yea seems like an idea but particle damage, that would require a hell of alot of process power to calculate each paricle collsision detection, a solution to this is mabe to have an animated bounding box so when the player comes into contact with it the atribute health would be damaged, the only problem i would see with this is that the size, direction and shape of the bounding box would need to corolate to the outer edge of the particle system.

but still a good diea

Posted: Tue Nov 14, 2006 8:54 pm
by Jay
I tested the SpoutEntity for collison detection - The Bounce feature seems to work and also quite fast but it is very errorenous - partciles fly around everwhere - well maybe the collided with each other, maybe...
(with 'work' i mean that something happend :wink: )

I made a test with a birth rate of 0.01 - 100 particles per second and the Bounce feature didn't affect the framerate. However, there was just one SpoutEntity.

Mabe this can help with the implementation. :)

Posted: Tue Nov 14, 2006 9:08 pm
by scott
and how long did they last for, how many did you have on screen at any one did collision detection work on the player, as i would of thought having to calculate at least 100 items collsions per second would of killd the cpu power. cos it isnt just the decting of collision its then the bounce and where it would go next.

Posted: Wed Nov 15, 2006 4:50 pm
by Jay
ok i made new tests, one with the level with NO particle system and two with, i did them for both with and without the bounce feature. Test results:

(fps taken from the rf-framerate-shower)

1. No SpoutEntity: 40fps
2. SpoutEntity with 100 particles per second, each particle lasts 3 seconds (=>300 particles) WITHOUT Bounce feature: 33fps
3. SpoutEntity with 100 particles per second, each particle lasts 3 seconds (=>300 particles) WITH Bounce feature: 32fps
4. SpoutEntity with 250 particles per second, each particle lasts 6 seconds (=>1500 particles) WITHOUT Bounce feature: 20fps
4. SpoutEntity with 250 particles per second, each particle lasts 6 seconds (=>1500 particles) WITH Bounce feature: 18fps

As you can see there is no big framrate lag because of the Bounce feature, mainly it's the particles themselves.

But the idea of damage per second with the bounding box is also good. But you should be able to do damage per a shorter time than 1 second too, i mean like 1 damage every 0.1 seconds. I think that is even a better solution than the particles that damage something, because we can use it for many different things.

Posted: Wed Nov 15, 2006 7:24 pm
by GD1
I don't think bounce interacts with actors' bounding boxes, only level geometry, so adding calculations for contact with actors could be a different story. I've never seen too much of a slowdown from the bounce feature, but you have to realize that there would be additional calculations if damage was added and this could potentially cause slowdown. It's interesting to note that most games do not use particle damage. instead they calculate damage according to a certain radius/distance, or direct contact with a single projectile or a single bounding box for a group of projectiles. In rare instances such as Halo's shotgun they calculate several projectiles seperately, but I believe the number was less than 12.

if RF is showing you about 30fps, your really getting more like 60-90. RF's framrate counter does not work, and actually alters the framerate so you can't get an accurate reading. Try the demo of FRAPS, it's MUCH better.

Posted: Wed Nov 15, 2006 8:09 pm
by Jay
Ok have my problem solved for now. Added a simple firebolt spell - That doesn't have Damge per Second but it's a beginning:

Posted: Thu Nov 16, 2006 12:11 pm
by Juutis
I don't think bounce interacts with actors' bounding boxes
I don't know if it makes any difference, but setting 'solid = true' makes the particles collide with actors.

Posted: Thu Nov 16, 2006 1:46 pm
by Jay
Yes, but that's for actor spouts, i think...we were talking about non-actor particle systems...

Posted: Thu Nov 16, 2006 1:53 pm
by Juutis
Ahh, yes of course. My bad. :)

Posted: Thu Nov 16, 2006 2:05 pm
by Jay
No prob :)