Flat collectors DO harvest crops, but the farm detection ray is being cast at a 90 degree angle.

Chris Bode shared this bug 20 days ago
Reported

Flat collectors look for crops to harvest in the wrong direction.

This is probably related to the previous issue flat collectors had with a rotated collection hit box. The item collection hitbox is now correct, but the farm detection ray is being cast in the wrong direction.

BuildInfo correctly shows the improper farm detection angle.

I have recorded an example of the behavior in a completely unmodded save.

Video Link

The save from the video is attached.

Poking at the game's IL, Sandbox.Game.Entities.Blocks.MyCollector.UpdateBeforeSimulation100 is hardcoded to use m_collectorDummyMatrix.Forward for the farm detection ray. This is correct for the other two collectors, but the flat collector is oriented such that the business end points along the "Up" vector.

Replies (5)

photo
1

Unless I'm missing something with regards to the coordinate systems involved here, it seems a trivial fix would be to replace

Vector3D.Normalize(Vector3D.TransformNormal(m_collectorDummyMatrix.Forward, base.WorldMatrix));
with

Vector3D.Normalize(Vector3D.TransformNormal(m_collectorDummyMatrix.Translation, base.WorldMatrix));


as all collectors' detector_collector dummies have translations in the direction the farm detection ray should be cast, and you're already normalizing the result as it is.

photo
1

Assuming it isn't simpler just to remake the asset with a properly transformed detector dummy.

photo
photo
3

And a visualization of the issue (via buildinfo) using the normal small grid collector as comparison. It appears the flat collector was designed rotated 90 degrees compared to the original collector blocks, but without any configuration to allow the farmplot collection mechanic to work with this differently oriented design.

image

image

photo
1

Can confirm that it in deed doesn't work all tho i didn't try the 01 side it doesn't want to pick up the crops. Here are some tests i ran.

photo
1

Ah, it is indeed simpler to solve it on the asset side. The engine does not respect rotations for collection area geometry, but the rotation information IS respected by the farm detection raycast, so you simply need to add a 90 degree rotation about the X axis to the detection area.


I have made a mod implementing the fix if anyone wants it. It modifies the collector blocks in-place and can be removed once Keen figures out which way is up.


0f3a306f52756443ea947bbe8af83068

photo
2

Hello Engineers,

Thank you for reaching our forum with this problem.

Thank you for extensive steps to reproduce, save(s), images etc. Than helped a lot.

We successfully managed to reproduce this problem on our side and put it into our internal system.

Kind Regards,

Keen Software House: QA Department

Leave a Comment
 
Attach a file
You can't vote. Please authorize!