What are you working on currently? (2019)

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 :stuck_out_tongue:

4 Likes

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

1 Like

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 :stuck_out_tongue:

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 ¯_(ツ)_/¯

3 Likes

A amateur’s attempt at lighting :,)
Not the best, but proud of what i was able to do without much experience in building

1 Like

Thats very cool, thanks for answering all my questions )

1 Like

Not too shabby, my friend. :v:

1 Like

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.

1 Like

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.

Deciding how much motion is too much :thinking: https://twitter.com/ScriptOnRoblox/status/1137881850699845632?s=19

1 Like

made footsteps more efficient (now it actually has a ray on each foot, also uses attachments)

12 Likes

making a shoulder-mounted flamethrower.

10 Likes

Gnarly stuff, dude. :slight_smile: :ok_hand:

I love it but try tweening it with easing?

1 Like

like enum.EasingStyles.Quint, and also enum.EasingDirection.InOut

1 Like

Remember when you said you couldn’t build boats? :triumph:

Looks very nice, I love the style.

1 Like

A downgraded version of the RooM engine. took away the weapon sway, simplified the movement and replaced the map/weapons and voila

Camera stability testing is fun :smiley:

8 Likes

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.