A Maze Ed in Roblox

I made a maze with Roblox - https://www.roblox.com/games/9397399366/demo-maze-1


Setup

For … reasons … I wanted to know more about Roblox and how to make games in it.

Up until this point, my perception had been that this was another like-Minecraft with some LEGO aesthetics. The motivating incident imparted the wisdom to me that this was wrong but I remain confident that the visuals strongly contribute to this perception.

In reality, Roblox the product would be better described as an SDK and platform for user-created games. Typically, Minecraft is viewed as a game that focuses on building a world, city, castle, whatever with peers. Roblox’s base “software” doesn’t have this (or any) functionality itself, and, requires user-created content to launch. Roblox the product places much closer on the spectrum to Unity3D than Minecraft - a detail I hadn’t realised.

Background

Roblox the platform works building “places?” or “experiences?” in contemporary parlance. This is the sort of design I think VR vendors and slobbering over but can’t quite bear to implement as it’d mean they lost some amount of proprietary control over their revenue.

The platform aggregates a whole project into a single file (in one of two formats) that is either stored/built/exported locally or “in the cloud” provided by Roblox Corporation. The thing is an XML tree with various sections including map/scene definition and Lua source code embedded as <![CDATA[ section. It seems that there is some amount of collaboration functionality, titled “Team Create” available - however, I struggle to believe that this aspect isn’t a glass ceiling for project development. 3rd Party tools seem to be capable of detecting and updating the files, and AFAIK, the platform itself seems indifferent to this.

The whole thing is sandboxed - places and their scripts cannot access stuff on or from the user’s PC.

There is some amount of HTTP request functionality, which makes the concept of ideas like crypto miners or other dark web batch processors translated into Lua and read/.wrting from servers via that. I could be mistaken; there were notes about allowed domains for the HTTP requests, so, perhaps there’s some amount of server-side monitoring that Roblox Corporation can snuff this out. This would not (however) threaten a user’s PC, just annoy them.

The produced places will remain “safe” to download and play, at the cost of some quirky constraints on creativity.

Attempt

Feeling that the structure of the places wasn’t conducive to anything serious, I started by trying to learn more elaborate toolsets. The tools of interest that I found were Rojo a build tool and Roblox-TS a TypeScript to Lua compiler.1 In the end, for this exercise, I found the “onboarding effort” to be an obstacle - this is however my problem (not theirs) and if I continue to work with this platform, I expect to use these tools.

For this project, I used my resulting place file (after abandoning Rojo and Roblox-TS) to build a random maze. Starting with a “Classic Baseplate” project I constructed a static starting environment, three “prefabs” then a script that cloned and deleted elements until a maze had been built.

Results

The resulting project could be improved with more functionality or minimalism, but, serves the purpose of demonstrating that I can implement stuff in the platform. A lot of “legacy code” is in the final place file - most seem to be Roblox-TS boilerplate. I ran into a peculiar goof where I began to see the files reach O(N!) complexity - an aspect of my diagnosis is that a small delay is present in the script and the maze is spawned as the player watches.

Writing it “as Roblox Corporation intended” was largely a result of being short on time, but, I would argue to anyone learning this tool that’s exactly what they should do first.

I can only compare this to Unity3D, and, the differences in scripting the two platforms are subtly different … and a delight. Roblox’s scripts can pause/resume whereas that’s less of an option for Unity. Scripts in Unity are invoked through “magical reflection” from the engine, something that infuriates new programmers., Roblox’s scripts are normal Lua1 programs with no real “magic” which is interesting. This requires explicitly attaching event handlers, but, means stuff is intentional I guess. This does (however) require scripts to be invoked automatically somehow - something that could need getting used to. I prefer this approach (to Unity) as it feels less weird than the event processing system - though that may be from my neurological compulsion to reverse engineer everything.

Future

This experience has not put me off from doing more work with Roblox.

I really would like to use Rojo. Installation of the tool (aside from a snag related to Windows and ^) was so flawless … it made me want to explore Rust that it was written in. Coordinating the compilers, plugin, and (Roblox Platform) editor … was mildly tedious; the sort of thing that screams 3rd Party. It worked - it’s just an aspect that less intelligent critics will get hung upon.

While TypeScript itself doesn’t impress me (sorry) the chance to use ECMAScript stuff is interesting. CoffeeScript2 is a lovely little language that compiles to JavaScript - so could be used with this. My graduate work focussed on PureScript and Functional Reactive Programming and it’d be interesting to introduce these concepts to a deceptively simple platform.

All of this would require more study and work with the platform. Various forms of data persistence exist for the platform. The instructional materials I followed introduced a leaderboard mechanism that I would like to explore. Likely this will touch on interactions between multiple users - a feature that I have not dealt with. It’s worth remembering that the Roblox Platform is very much geared towards MMOs. I don’t have specific questions per se, rather I have enough experience to know what those questions would be. During this maze project, I regularly “Google’ed It” and quickly progressed; I need practice, not instruction.

Overall, I think the experience has been inspiring enough that it’s worth my time. I realise that CS curriculums are generally bogged down with tedious details, but, would still advocate pushing students to try something like this as a way to broaden their understanding of programming.


  1. In hindsight, this was a bit more silly than I’d realised. Roblox uses LuaU which is a superset of Lua adding gradual type checking to the language. In effect - LuaU is to Lua as TypeScript is to ECMAScript - I gain minimal “real” advantages by using TypeScript.

    [return]
  2. CoffeeScript was declared “DEAD” in 2017 with ES2016 by the shouty Twitter community. Despite this, the project is regularly updated and seems to put out two or so versions a year.

    [return]
comments powered by Disqus
Peter LaValle avatar
Peter LaValle
Any links probably include affiliate ids for that sweet sweet kickback - and some programs require that I tell you. The contents of this blog are likely unrelated - as they include games, paints, and build tools.