Author Topic: Shield Mesh/Hull Damage Intricacies  (Read 2381 times)

0 Members and 1 Guest are viewing this topic.

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Shield Mesh/Hull Damage Intricacies
Hello, I am here to discuss the interaction between shield meshes and incoming projectiles, specifically, their behavior regarding hitting "unshielded" portions of the hull, specifically with regards to non-standard shield arrangement.

Take for example, a ship with a forward only shield, which is fully enclosed, illustrated here by the GTF Brick, with a powerful frontal-only blue-colored shield!


So let's shoot at it from the front. This is no different from a ship fully enclosed by the shield, so as expected, everything works fine.

When shot at from the "outside", all is good. The shield mesh stops the projectile and damage is assigned to the relevant shield quadrant.

However, ugly things begin to happen when the GTF Brick is attacked from behind.

If the projectile path would intersect with a face of the shield mesh, it will pass through any hull in the way, and only collide with the shield mesh, assigning shield damage.
However, if there is no shield mesh face along the flight path of the projectile, it collides with the hull without issue, and assigns hull damage.

Okay, so maybe the game assumes that the shield is fully enclosing the model always, and this is there to prevent the little bits sticking out from taking hull damage, which is an assumption, but an understandable one. What happens when we remove the back side of the shield that we don't really need/want for a purely-frontally shielded fighter? Logic would dictate that if there's no shield mesh face along the path with the correct normal, it should behave like if we were "inside" the shield mesh - that is, collide with the hull and do hull damage, right?

Wrong.
[imghttp://puu.sh/5lI2v.png[/img
Having a one-sided shield does indeed cause the projectile to collide the hull, as desired. However, damage is not assigned to the hull, but to the shields! Thus while visually correct, the way the engine assigns damage is unchanged from as if the shield mesh were closed...disappointing.

EDIT: Right. This is precisely what happens, it seems my testing was fouled by subsystem hitboxes, and has no problems after I added the "collide submodel" flag. Disregard.


It might be fine to leave the behavior of the fully-closed shield mesh as it is - after all, changing it so that it collides with whatever is first be it hull or shields may cause some existing models to be more "leaky" with their shields than they should be, but, fix the bug with the one-sided shield mesh, which would not affect retail behavior and allow for more interesting ship designs - let partial shielding be a thing! Either way, the behavior as it stands is rather counter-intuitive, and can cause some what-appears-to-be-wonky projectile collision behavior, and isn't even necessarily consistent - you can hit bits sticking out from certain angles but not others/ probably should be addressed in some way.
« Last Edit: December 30, 2013, 01:33:26 pm by Droid803 »
(´・ω・`)
=============================================================

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Shield Mesh/Hull Damage Intricacies
How are you creating the one sided shield mesh?  Is this something you're trying with the new model point shields?  Otherwise, how is FSO assigning the default/required 4x shield quadrants for the GTF Brick?

(or in other words, have you got a sample mod that demonstrates the bug?)
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Shield Mesh/Hull Damage Intricacies
How are you creating the one sided shield mesh?  Is this something you're trying with the new model point shields?  Otherwise, how is FSO assigning the default/required 4x shield quadrants for the GTF Brick?

(or in other words, have you got a sample mod that demonstrates the bug?)
here is what i found these results with while testing
-o version has the closed shield mesh
the other has the one-sided shield mesh
the shield meshes were made in 3ds max - I haven't tried with point shields - it's using the default 4-quadrant assignment (I think all of it is "front" since its all in the front quarter)
(´・ω・`)
=============================================================

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Shield Mesh/Hull Damage Intricacies
thanks for the info & data.  I'll have to have a detailed read of the shield collision code to see if I can figure out how hard this would be to fix.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Shield Mesh/Hull Damage Intricacies
so, err... I can't reproduce the problem with the open shield mesh :nervous:.  In fact, it seems to behave as you'd expect.  i.e. from aft, firing at the thrusters, and the hull is being damaged, not the shields.  You do get weirdness from the front, you can shoot through the "spire" and hit the shields behind it, but that's pretty much the behaviour you described from the partial-but-closed shields.  i.e. FSO seems to believe that from the direction of the front of their mesh, shields are *always* hit before the hull is ;)

Anyway - here's the mod I was testing with, I just added some tables & a mission to your data.  I tested FSO 3.7.1 r10060 DEBUG, and r9766 DEBUG.
http://www.mediafire.com/download/2e26d9utggnc7p3/droidshields.7
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Shield Mesh/Hull Damage Intricacies
A theory as to what is happening (This is not based on any actual reading of the code at this time, appropriate amounts of salt should be taken):

I think what's happening is that as soon as a projectile's path crosses the bounding box of the shield mesh, any hits are automatically assumed to be against the shield. No polygon-level hit evaluation is taking place. Maybe this should be looked at?
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Shield Mesh/Hull Damage Intricacies
:bump:

Droid803, is there anything else you want done with this? I was kinda waiting to see if you agreed with my analysis of the partial-open shields, and I thought you said that you didn't need the partial-closed shields thing changed/fixed (which I believe is what The E was taking about)?
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

  

Offline Droid803

  • Trusted poster of legit stuff
  • 213
  • /人 ◕ ‿‿ ◕ 人\ Do you want to be a Magical Girl?
    • Skype
    • Steam
Re: Shield Mesh/Hull Damage Intricacies
After further testing, it seems that (at least in the latest nightly), the partial-open shields behave as you described, which is good. :)
(´・ω・`)
=============================================================