Forum

> > CS2D > General > Curtailed explosion
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Curtailed explosion

2 replies
To the start Previous 1 Next To the start

old Curtailed explosion

mozilla1
User Off Offline

Quote
Can someone explain to me how the curtailed explosion option in cs2d works? what is the exact algorithm to calculate how it negates damage behind wall?

My guess is that you cast a ray in all directions with the explosion center as origin and check any walls in the path, however i'm not sure

old Re: Curtailed explosion

DC
Admin Off Offline

Quote
Yes, it basically works like that. It just doesn't shoot rays in all directions. Instead it does this:

• All objects (players, hostages, breakable entities, dynamic objects) within the explosion radius are detected (with a simple radius distance check)

• if curtailed explosion is on, a single ray is shot from the center of the explosion to the center of the object (per object). Only if the ray isn't blocked the game applies the damage.

• if curtailed explosion is off, the game just applies damage and skips the ray check.

And it really shoots rays just from center to center? Isn't that quite imprecise? Yes it does and yes it is - but it's good enough. That's because targets are mostly smaller than walls and when a ray doesn't hit it means - in most cases - that like 50%+ of the target are covered behind a wall or something.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview