GM4_Datapacks icon indicating copy to clipboard operation
GM4_Datapacks copied to clipboard

Inconsistent raycasting techniques.

Open SpecialBuilder32 opened this issue 2 years ago • 2 comments

Different modules use inconsistent techniques for raycasting from the player to a block they just placed or interacted with.

It is possible to raycast without the need for a temporary entity (AEC or Marker), and this is likely preferable for performance (less selector resolution). Note Block Interface uses this technique currently, see that for reference. Note that raycasting for the sake of block placement will need some additional checks; see backup ray behavior in lib_brewing

This bug will track the conversion of the scattered raycasting methods to entityless versions.

  • [ ] Liquid Tanks ink sign interaction
  • [ ] Machine Blocks (CC creation - right click with crafting table)
  • [ ] Book Binders Placement
  • [ ] Trapped Signs placement and interaction
  • [ ] lib_brewing Brewing Stand Placement
  • [ ] gm4_fruiting_trees Sapling Placement

any additional instances, please comment in this bugs thread and this main comment will be updated.

SpecialBuilder32 avatar Oct 18 '22 03:10 SpecialBuilder32

It would be so nice if we could somehow pass parameters to functions and dynamically call functions, Then we could make a library for this and avoid this issue by reducing duplicate code.

I guess this would be possible if we had something like beet parse the files and generate the raycast, but that would make development quite a bit more complicated.

Bloo-dev avatar Oct 19 '22 20:10 Bloo-dev

That was the thought I had. There was a discussion with some of the beet/bolt people in #technical regarding some of the things gm4 should consider if we started incorporating beet into development more fully. https://discord.com/channels/151141188961828864/294610104270192651/1031763397483700304

Though I also think we shouldn't move to incorporate beet/bolt into any existing modules until we've like, tried making a new one entirely in the beet ecosystem

SpecialBuilder32 avatar Oct 19 '22 22:10 SpecialBuilder32