mage beam
mage beam
not perfect when someone else is beaming, but first person is good
getting close to having sheep be a single line have exam soon, will make new code better with code review stuff and upload after wed. New code has better render performance
shoudl be done over next couple days
Explain your changes why they are necessery what they do and what you tried
Performance isnt good and im not happy with how it works under low tps will redo
Instead of having unique handling for sheep just check for straight lines and ignore beams that are too short You can also collect particles based on player view direction and find all packets which are straight line from that
Original solution:
Original solution was a basic connect the dots implemenation based on when a particle is sent to the game. This results in heavy artifacting with broken lines and overall isnt something id be happy using.
ther were a couple implementations that built on connecting particles but none of them worked very well.
Solution 2: use the PCA
this is built around the PCA algorithm and the idea that a beam should be built around an axis as they are all lines. the algorithm is designed around this https://builtin.com/data-science/step-step-explanation-principal-component-analysis
the code first uses a basic PCA implementation to create a vector that is the direction of the beam, once this has been found, every particle gets assigned to a beam that is along the axis constructed by the pca algorithm, this is mostly to support turnign the sheep line into 1 line and isnt really necessary and i am sure some of it could be cut out. However this works horribly with low tps
Instead of having unique handling for sheep just check for straight lines and ignore beams that are too short You can also collect particles based on player view direction and find all packets which are straight line from that
If you mean beams that are too short as in below the full beam length then this might not work well in areas where there are blocks in the way. Collecting particles on view direction might work for displaying other player beams, but I play on 250 ping and it wont work for my own beams. Half the time im 7 blocks away when the particles come to my client
il do some more reading but from: https://www.reddit.com/r/computervision/comments/ks9yi9/comment/gif1skq/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button one of T-Linkage, PEARL, Multi-X might be the final implementation assuming it performs well
cant do much better for now, not smart enough if someone else wants to do something.