Is it faster than Roblox raycasts? And what edge cases do you fix?
Performance is really good with the new system since itâs specifically aimed at voxel worlds where the bounding boxes for every block are AABBs.
The algorithm traverses the voxels in the order which the ray intersects them, starting at the voxel containing the origin point and moving forward. If the block is âtargetableâ (a property of blocks used to control whether they can be targeted by raycasts) and has a bounding AABB, it performs a Ray-AABB intersection test, and if successful, returns the voxel position, block ID, surface normal and precise hit location at the point on the ray where the intersection occurred. Since all these operations can be performed very quickly, with minimal allocations, the raycasting can perform anywhere from a bit faster to miles faster, in most typical cases running under 10 ms (correction: 0.07 ms, which is well under 10 ms). It still performed really well, even when the distance from origin to hit point was in the tens of thousands:
With the added benefits of server-side raycasting without generating instances, more natural fit with the rest of the API and precise control over how special cases are handled (e.g. if youâre stuck in a block, you want to break the one youâre in rather than the one youâre looking at), and with the future performance boost from the new Lua VM, itâs a no-brainer
Yeah I really like how you dont need to create instances on the server
Though 10ms seems really slow, I thought you could do hundreds/thousands of Roblox raycasts per frame; did you mean 10 ns? XD
Iâm bad at SI units lol, just realised 10 ms is over half a frame at 60fps. Itâs definitely faster than that, I can do tons of them per frame without any noticeable drop in performance
edit: yup Iâm a dummy, it actually takes 0.07 ms on average, it rises by about 0.02 ms if youâre looking through tons of targetable blocks with small AABBs (measured based on the raycasting code used to find the block youâre pointing at, for context)
edit 2: to answer your âedge casesâ question, some block models like plants can end up giving ambiguous results for things such as normal direction, because plant models are made of two planes angled exactly at 45°, so the normal would end up exactly between two cardinal directions, leading to inconsistent behaviour. It also didnât play nice with some other blocks like water, which is rendered specially to remove invisible blocks and so it would be impossible to target water while submerged, for example. This would make things like buckets impossible to implement down the line, but also led to tons of inconsistencies in the block placing code to deal with the physical water model not lining up with the water blocks in the world data.
If I tried hard enough, I could get it to work, but at that point itâd be so complex and overengineered that this more specialised solution would make more sense anyway ÂŻ_(ă)_/ÂŻ
A amateurâs attempt at lighting :,)
Not the best, but proud of what i was able to do without much experience in building
Thats very cool, thanks for answering all my questions )
Not too shabby, my friend.
Thanks, do you have any tips to improve the scenery? (or the ligthing)
Maybe lighten up on the orange color. It looks a bit too dark.
Thanks, iâve tried to give my game a different atmosphere from the other obbys game, in general, the obby iâm working at is a attempt at giving new experiences that are not âPick a pathâ or âGoing inside a copyrighted characterâ. The level in that screenshot is a level where the player needs to use a sword to jump.
made footsteps more efficient (now it actually has a ray on each foot, also uses attachments)
External MediaGnarly stuff, dude.
I love it but try tweening it with easing?
like enum.EasingStyles.Quint, and also enum.EasingDirection.InOut
Remember when you said you couldnât build boats?
Looks very nice, I love the style.
A downgraded version of the RooM engine. took away the weapon sway, simplified the movement and replaced the map/weapons and voila
Probably could do with being half a stud to a stud higher so that the player can costly see over the car, nice though.
Iâll be working on another camera for my vehicles soon.