Odin icon indicating copy to clipboard operation
Odin copied to clipboard

mage beam

Open teehee567 opened this issue 8 months ago • 1 comments

mage beam image image image not perfect when someone else is beaming, but first person is good image image

teehee567 avatar May 08 '25 12:05 teehee567

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 image

teehee567 avatar May 10 '25 15:05 teehee567

shoudl be done over next couple days image

teehee567 avatar May 14 '25 11:05 teehee567

Explain your changes why they are necessery what they do and what you tried

odtheking avatar May 17 '25 11:05 odtheking

Performance isnt good and im not happy with how it works under low tps will redo

teehee567 avatar May 20 '25 06:05 teehee567

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

odtheking avatar May 20 '25 06:05 odtheking

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.

image

image

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 image

teehee567 avatar May 21 '25 14:05 teehee567

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

teehee567 avatar May 21 '25 14:05 teehee567

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

teehee567 avatar May 21 '25 15:05 teehee567

cant do much better for now, not smart enough if someone else wants to do something.

teehee567 avatar May 28 '25 14:05 teehee567