Skip to content

O I C Which Side#1368

Merged
Fate-JH merged 4 commits into
psforever:masterfrom
Fate-JH:lilbud-sidedness
May 15, 2026
Merged

O I C Which Side#1368
Fate-JH merged 4 commits into
psforever:masterfrom
Fate-JH:lilbud-sidedness

Conversation

@Fate-JH

@Fate-JH Fate-JH commented May 5, 2026

Copy link
Copy Markdown
Contributor

Exploding Scorpion (oicw) little buddy sub-projectiles are wrapped in special entites because the little buddy itself doesn't have any vitality information and certain aspects of the damage system account chain requires vitality for that particular element. This wrapper element, however, was not properly transmitting sidedness in regards to the little buddy (even though the little buddy's originating projectile underwent special sidedness determination and attempted to pass that onto the little buddy).

As is my policy with all matters regarding use of the oicw, it's up to someone else to prove it works.

…s to the server side damage protocol, skipping sidedness check altogether
@Fate-JH Fate-JH added Fixed Not Regressed Issue is resolved pending regression testing. Weapons Weapon related issue. labels May 5, 2026
@Fate-JH Fate-JH linked an issue May 5, 2026 that may be closed by this pull request
@Dethdeath

Copy link
Copy Markdown
Contributor

Still damages players/amenities inside.

Scorpion.mp4

@Fate-JH

Fate-JH commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

What. How do the little buddy projectiles travel through the ground.

What was your setup for this test?
[A] Spawn into the lobby, grab the Scorpion, run outside
[B] spawn in(to) the same facility spawn room, wait by the terminals
[A] fire and observe

@Dethdeath

Copy link
Copy Markdown
Contributor

The player firing the scorpion spawned at the AMS you can see in the video, no buildings were entered.
Player in the spawn room spawned at the base.

@Fate-JH

Fate-JH commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

I'm so against working with the oicw so much I boiled it down to this:

   if (isCrouching && !player.Crouching) {
      //dev stuff goes here
      import net.psforever.actors.session.support.WeaponAndProjectileOperations
      import net.psforever.objects.{DummyExplodingEntity, GlobalDefinitions}
      import net.psforever.objects.serverobject.interior.Sidedness
      val projectile = Projectile(
        GlobalDefinitions.oicw_little_buddy,
        GlobalDefinitions.oicw,
        GlobalDefinitions.oicw.FireModes.last,
        player,
        GlobalDefinitions.oicw.ObjectId,
        pos + Vector3.z(value = 1f),
        Vector3.Zero
      )
      projectile.WhichSide = Sidedness.OutsideOf
      val obj = new DummyExplodingEntity(projectile, projectile.owner.Faction)
      obj.Position = pos + Vector3.z(value = 3)
      WeaponAndProjectileOperations.detonateLittleBuddy(continent, obj, projectile, projectile.owner)()
    }

This shortens a bunch of code from WeaponAndProjectileOperations that contributes to transforming a Scorpion rocket into its little buddies and then setting up the explosion. I skip the parts that are unnecessary for the explosion on the server such as the downwards fanning vectors used for the animation. Essentially, every time I crouch, a little buddy explodes above my character's head and hurts her for 60 HP and 15 armor, but it should only hit her while she is outdoors (OutsideOf).

In any event, it does only hurt while outdoors. Upon respawning in the spawn room, it fails to explode as she is indoors. Upon respawning at an AMS, and precautiously moving away from the AMS since that's not a volatile part of the experiment, the explosion indeed hurts. One side of the door is an explosion; the other side of the door is a dud. The oicw should work correctly as long as the sidedness of both attacker and target are correct.

@Dethdeath

Copy link
Copy Markdown
Contributor

Another test.

I've included the entire process in the footage below, to show where both characters spawned.
(In 2 parts because of filesize.)

ScorpionTechplant.mp4
ScorpionTechplant2.mp4

I don't know where the sidedness breaks if it even does. Perhaps adding sidedness debug output ingame would help, but every test I've done has the same outcome. It doesn't matter if the guy firing the scorpion spawns at an AMS, base or tower. It keeps doing damage where it shouldn't.

@Fate-JH

Fate-JH commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

Realized an issue with my quick line segment sphere intersection test caused by setting the start and the end point of the line segment to the same position, resulting in a Vector3(NaN, NaN, NaN) that acted like the projectile was passing through a door that wasn't there and setting it to InBetween. In an InBetween state, the projectile can hit both InsideOf and OutsideOf targets. The only affected damage proxies, sub-projectiles, and remote control projectiles, so little buddies hitting entities underground was within the realm of possibilty previously.

I dry tested it by shooting an Scorpion at nothing and ject checking the sidedness of the projectiles and am entirely relying on the above code test as proof that interior targets can not be hit by exterior explosions.

Also included was a normal player variation of the CSR-level bang command !setside which is exclusively for !setside check functionality.

@Fate-JH Fate-JH added the Commands Commands related issue. label May 11, 2026
@Dethdeath

Copy link
Copy Markdown
Contributor

It's working correctly now. 👍

… a reminder to set the sidedness correctly is issued; additionally, when using warp with a poi, the sidedness is set to outside of
@Fate-JH Fate-JH merged commit 9698ddd into psforever:master May 15, 2026
1 of 2 checks passed
@Fate-JH Fate-JH deleted the lilbud-sidedness branch May 15, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Commands Commands related issue. Fixed Not Regressed Issue is resolved pending regression testing. Weapons Weapon related issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scorpion damages players inside

2 participants