shields - Page 2

shields

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: shields

Post by Hoi »

trepan wrote:I've added the ShieldCollision() call-in to my local source code,
along with a number of useful projectile call-outs. This should
make custom shield effects possible with lua (once committed).
could you implent diffrent forms of shields? i would like it if i could make 3 points in upspring shield1, shield 2 ect.. and make a shield between those spots
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: shields

Post by 1v0ry_k1ng »

how about making the shield use refractive water style distortion instead for less lag, because its a crime that somthing that beautiful isnt already implemented
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: shields

Post by Warlord Zsinj »

Hoi, that would be extremely difficult to do in terms of collision detection, and if done, would probably be extremely expensive because of the calculations involved. I guess with the new non-spherical code you could probably make cylindrical or rectangular prism shields.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: shields

Post by Hoi »

Warlord Zsinj wrote:Hoi, that would be extremely difficult to do in terms of collision detection, and if done, would probably be extremely expensive because of the calculations involved. I guess with the new non-spherical code you could probably make cylindrical or rectangular prism shields.
what about 2d shapes?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: shields

Post by Warlord Zsinj »

no
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: shields

Post by Hoi »

Warlord Zsinj wrote:no
why?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: shields

Post by Warlord Zsinj »

For the same reason that three point thing wouldn't work. If you link up 3 points, you have a triangular 2 dimensional object. The collision detection required to do it would need it's own code, and would be very expensive to run, compared to a projected basic 3D geometry collision system, such as the spheres we have currently, or the new expanded collision models (rectangular prisms/cylinders). I suspect even then it wouldn't really work - spring has enough trouble detecting the collision between weapons and spheres even when the sphere is a little smaller then say, a peewee.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: shields

Post by Hoi »

hmm, well i can just use a prism with a small height to make it look like a triangle
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: shields

Post by Warlord Zsinj »

Firstly, there is no triangular prism support in spring, only rectangular, as far as I'm aware.

Secondly, even if there was, it still would not work. Maybe this explanation will make it easier to understand: The weapon will not be inside the 3D volume for long enough for the engine to realise that a collision has taken place if you make it too thin. It just wouldn't act as a shield at all. Shields need quite a large amount of volume between the weapon entry point and the target for them to detect a collision before the weapon hits the target.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: shields

Post by REVENGE »

Speaking of which, we have raytraced collision detection as an option now?

Also, pardon me, but is it possible to move hit spheres around a unit model ingame? Of course, it sounds like a raytraced collision detection system would solve all problems.
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: shields

Post by 1v0ry_k1ng »

what does that do exactly?
User avatar
Noruas
XTA Developer
Posts: 1269
Joined: 24 Feb 2005, 02:58

Re: shields

Post by Noruas »

Good question...
User avatar
Relative
Posts: 1371
Joined: 15 Oct 2006, 13:17

Re: shields

Post by Relative »

Is it not possible to have a shield as a flat, square, projected plane?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: shields

Post by Warlord Zsinj »

Please read my previous posts in this thread, Relative.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: shields

Post by Kloot »

REVENGE wrote:Speaking of which, we have raytraced collision detection as an option now?
yes (if you enable it in your mod)
REVENGE wrote:Also, pardon me, but is it possible to move hit spheres around a unit model ingame?
yes
Of course, it sounds like a raytraced collision detection system would solve all problems.
mostly yes
1v0ry_k1ng wrote:what does that do exactly?
because even a crude picture says more than "a 1000" words:

Image

(p is the position of a projectile at simulation frames t, t + 1, and
t + 2, the orange arrows are rays -or rather ray segments- traced
from pos p(t) to pos + speed p(t + 1))
Relative wrote:Is it not possible to have a shield as a flat, square, projected plane?
As the image hopefully makes clear, pointless without raytracing
(which I didn't bother to implement for shields,since nobody even
seems to be aware it exists for unit vs. projectile coldet) and with
the current shield system not possible anyway.
Attachments
coldet.png
(51.58 KiB) Downloaded 190 times
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: shields

Post by REVENGE »

Wow, this is, um, major major major win.

I'm going to read up on how this works, and I'm assuming it's SVN atm.
Does it apply to "all" types of collision detection, or only weapons hit vs. model/model collisions, etc?
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: shields

Post by lurker »

I've written a quick patch to make it always hook into raytracing for the final collision point, and to actually use that for the explosion instead of the predicted movement point. It compiles and I'll finish with testing tomorrow.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: shields

Post by REVENGE »

lurker wrote:I've written a quick patch to make it always hook into raytracing for the final collision point, and to actually use that for the explosion instead of the predicted movement point. It compiles and I'll finish with testing tomorrow.
That's great news, good to hear. Nice work man. :P
User avatar
1v0ry_k1ng
Posts: 4656
Joined: 10 Mar 2006, 10:24

Re: shields

Post by 1v0ry_k1ng »

does that mean working small shields next spring rev then?
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: shields

Post by Warlord Zsinj »

What is the performance comparison between raytracing and frame based detection?
Post Reply

Return to “Engine”