Yep. This one:
This is a remake of that one.
Yep. This one:
This is a remake of that one.
Amnesia vibes, can’t wait to see how it turns out
Added in a new line for my little simulation.
Also, here’s the current map so far:
You can check it out here: https://www.roblox.com/games/3256179201/Subway-Simulation
This will be very helpful in the future. Nice work.
Since I had to re-install all of my Studio plugins, I figured I’d remake my old ones to make them more usable and efficient. First one is Script Template Manager, and it lets you set what the default script contents are. You can also enable/disable it, and all settings persist between Studio sessions. I also finally figured out how to auto-fill the creation date, which will save a lot of time in the future.
If I come back to this in the future I’d like to add more autofill options (username, game name, etc.) and seperate templates for server/local scripts and module scripts.
Been working on a pure Lua raycaster for Blox which operates directly on the block data. Compared to the old method of using FindPartOnRay, this fixes so many issues and edge cases and runs much smoother. It also makes the code much cleaner and makes raycasts possible on the server, since parts are only generated on the client side for performance.
Blocks now have bounding boxes separate from their rendered models:
Half slabs are now outlined correctly, and they behave as expected, letting you place slabs on the side of slabs, and properly place blocks on top of slabs:
Most importantly, placing blocks through liquids now works perfectly, whereas before it was almost unpredictable:
The best part is how simple the code is! Here’s the snippet doing that raycasting, pasted without changes:
local position, block, normal, hit = Raycast:cast(Placer.clientWorld, origin, direction, Placer.blockHitDistance)
No raycasting multiple times or converting between block and stud units, just one call! This will make everything so much easier to build in the future, from detecting noclip in the entity system to tracing explosions with TNT. Of course, this will all get even faster with the new Lua VM, so hype
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.