Awesome to see ShadowMap lighting live!
(game for reference)
I added dynamic updates to the world, here’s some cool gifs:
(I’m going to add my own stuff eventually )
Do you know if Q-Clash will be getting the shadowmap tech? It would make a perfect game even better!
1 Year ago I saw the small, but really cool machine on Roblox Blog here: Inverse Kinematics for Constraints Now Available in Studio - Roblox Blog
I wanted to make it, but my LUA programming knowledge wasn’t big enough to make it. Today I took some time to create this cool thingie.
You can even control it using those cool buttons!
Imagine returning home and crashing on your keyboard just to create something like what I did today.
3 Years ago, I started working on music, or at least, I started trying to make catchy melodies. Fast forward to the present day, and I finally am able to make something I feel is extremely satisfying.
To me, it might not be peak performance, but I think it comes super close. Potential volume warning to headphone users at around 00:20 by the way.
some ui stuffs (wip)
heyyy that’s pretty good
Also two ideas:
Either way that’s a pretty UI!
Yeah, I definitely want to eventually animate folder transitions. However, that kind of thing would require quite a bit of restructuring to pull off as I’m using Roact.
As for the second suggestion: I think it looks a lot better now, thanks!
Super cool I hope it turns out well
Through the past week or so, I’ve been trying to restore Roblox’s bevel feature for Super Nostalgia Zone using Roblox’s in-game CSG API. I’m happy to announce that I have succeeded!
For those who don’t know, bevels are essentially just rounded part edges. You’ve likely seen them on the blocky avatars. Back in the day, these rounded edges used to be visible on all parts, rather than just blocky avatars. They were removed prior to the introduction of dynamic lighting for performance reasons, as Roblox’s graphics system wasn’t well optimized at the time.
This bevel system is fully dynamic. Parts are solved and switched out at run-time, and they have a level-of-detail mode which switches them back to normal parts when they aren’t close to the camera.
Getting something like this to work nicely ended up being a larger challenge than I had anticipated. There were several hurdles I had to overcome in order to get everything working smoothly.
Buckle up, this is about to get insane.
Since unions do a special texture projection for decals, the surface textures I was using in the game did not align correctly to the bevel unions.
I had a few options for how I could tackle this problem
I wanted to avoid option 1 unless it was an absolute last resort, because I figured it would be very inefficient to have thousands of SurfaceGuis rendering in a scene.
I got some interesting results from option #2 (shown above), but ultimately I decided against it because it would be extremely annoying to get it working right in all conditions, and plus some of the texture ended up leaking into the bevel edges and it wasn’t really something I wanted to deal with.
Thus I decided on option 3. Every block in the game now gets 3 additional massless parts welded and parented inside of them, which represent the surfaces for those bevels. The axis parts protrude out slightly in their retrospective axes, while the edges are not occupied by any of their volumes.
Since the parts are always invisible, they don’t add any cost to rendering. The trade-off is that they take up more memory, but I was willing to live with it. I’m hoping Roblox provides better options for me to tackle issues like this in the future.
Because I was now representing bevel surfaces with additional parts, I had to make sure the welds holding the surfaces to the part were never broken by any external forces. This introduced two new constraints:
Thankfully these two problems weren’t too difficult for me to deal with. Early on in the development of Super Nostalgia Zone, I decided to handle explosion physics using Lua, and I borrowed a Lua port that Roblox made for Roblox Battle. I figured they ported it from an earlier version of the C++ code behind it, and having more precise control over the explosion physics would be a nice thing to have.
To make sure these joints were never broken, I assigned a special CollectionService tag to them and updated the explosion code to ignore any joints that use this tag, rather than using BreakJoints directly.
For the building tools in Super Nostalgia Zone, I use Roblox’s Dragger object, which works nicely as an interface to the default drag tool in Roblox Studio. However, the surface parts I added for bevels proved to cause some issues. Since the drag tool does collision checks, the surface parts were interfering with this collision checking.
To work around this, I offset the surface parts outside of the bevel part, and gave them a near-zero size so they would hopefully not influence anything else in the dragger. I then used SpecialMesh objects with a MeshType of Brick
to project them back into their original size and origin relative to the bevel part.
As I was testing bevels in-game, I had noticed that my framerate was stuttering every few seconds when a lot of bevels were on screen. I discovered that the solver was generating 92 polygons for each block, rather than the 44 that would actually be needed to properly represent the bevels.
I didn’t really want to throw any of the work away, so at the last minute, I threw together a client-side LOD system, where the LOD part uses the same system as the surface parts.
Switching between LODs worked by just flipping the LocalTransparencyModifier of the bevel part and the LOD part, which is a lot faster than having to reparent objects. I utilized a lazy update system similar to Roblox’s CPU light-grid so that detecting and switching LODs would eat up less performance than having to render all of the bevels at once.
I wasn’t sure if this would help performance, as I’ve heard previously that SpecialMesh objects aren’t good for performance. To my surprise though, it worked really damn well. The effect was pretty much seamless and it completely stopped all of the stuttering I was getting.
Since bevels are expensive to solve, I wanted to only solve each part size once. I decided to use a specific format string to check against a cache of part sizes. I limited the size of the bevels to a maximum of 30x30x30, as Roblox had done the same with their bevels in 2008.
The server handles the generation of the surface parts as well as the LOD part. I utilize CollectionService tags a lot to help with querying and signaling all of this data around to other scripts in the place (shoutouts to @Tiffblocks for this awesome feature )
Switching parts out at runtime is complicated, because a lot of the games don’t anticipate such happening. I’ve had to adjust code in a few places to compensate for this. I decided to phase this in gradually rather than all at once, so that I could diagnose place-specific issues that would arise.
The biggest challenge was getting the model regeneration code to mutually cooperate with the bevel system. This is the system that shows a message on screen, (i.e. “Regenerating Tower…”) and then replaces a model with its original form. They are used frequently in brick-battle places.
To make sure no extra work was done when a model gets regenerated, I setup some coordination between the two systems:
Without this synchronization, the bevel system would have to solve bevels every time the model was regenerated, which wouldn’t be super healthy for the server performance.
Alrighty! That was a general overview of what’s going on behind the scenes for the bevel system in Super Nostalgia Zone. Its… hard to say whether anyone has had to use crazy workarounds like this in their games before, but I’m super happy that none of the work went to waste and it all played out pretty smoothly.
Although I haven’t switched bevels on for all places in the game yet, I’m gradually working through the list. You can check the game out here for yourself:
Wow that hit me right in the nostalgia.
Also I’m curious, even though this isn’t possible to do in game (yet), weren’t bevels smooth shaded originally? It’s hard to remember because I was really young back then, but I don’t recall them appearing so flat.
They were, but unfortunately I don’t have control over that with CSG.
I figured it’s better than nothing,
SUNK - An underwater survival adventure.
With elements of story, I hope to create an atmospheric game where users can explore the unknown depths together.
I’ve been also working on creating the life that inhabits it.
I’ve also been working on a large map for the game.
Lots of work, lots of info, good stuff!
Suggest such a detailed comment could be a post of its own, and then post a reply to this thread with "Working on Bevels, details in this other post I made over here.
A suggestion: change “Test Test” to a unique name. It adds some effect to the cinematic. Overall, well done.