Closed ClobberXD closed 5 years ago
This is something I plan to look into for MT 5.0.0 but I doubt that it will be much, if any more efficient. The Lua raycasting method I use is really quite efficient as dot products are not computationally expensive. It also saves a lot of the Lua to C++ communication which itself carries significant overhead.
However, the in-built raycasting will be a lot more accurate than my current method so if the performance is not made worse by any noticeable amount then I will likely switch to using that.
For now the raycasting is partly broken in 0.4.16-stable and I'm not sure whether the fix was back-ported to 0.4.17.x
Here are a couple of important reasons to switch to Raycast
:
I have decided to go with minetest.raycast
since it does simplify the code significantly. It also much improves the mob-mod compatibility. My guess is there should be a slight increase in performance with PVE, though there may be a very slight decrease for pure PVP mode (no entity or node detection) however, I hope this should be compensated by the other optimisations I have made.
Great to know, thanks! :)
No problem, this can be closed now since this part is now completed in the development version.
This would result in cleaner code and possibly more efficiency.
Also prepares the mod for 5.0.0