Roblox Deviations
Gargatuan aims to bring a balance of Roblox familiarity while cleansing technical debt and poor API decisions. Most games written using modern Roblox APIs will run fine.
For Roblox developers looking to port their games into Gargantuan, this is a non-exhaustive list of all deviations from Roblox done in Gargantuan.
Roblox Compatibility Mode
Section titled “Roblox Compatibility Mode”Gargantuan provides a Roblox compatibility mode which alters several APIs to match Roblox, eliminating all API deviations.
Enable it in your project.config.json:
{ "name": "My Gargantuan Game", "compatibility": { "roblox": { "enabled": true } }}Or, enable it in the player CLI using the compat-roblox flag:
gargantuan --compat-roblox --script=src/Main.luauAPI Deviations
Section titled “API Deviations”-
The typenames for
RBXScriptSignalandRBXScriptConnectionare renamed toSignalandSignalConnection:local connection = game.Destroying:Connect(function() end);-- with roblox compatibility disabled:print(typeof(game.Destroying)) --> "Signal"print(typeof(connection)) --> "SignalConnection"-- with roblox compatibility enabled:print(typeof(game.Destroying)) --> "RBXScriptSignal"print(typeof(connection)) --> "RBXScriptConnection"-- note that the Signal runtime global stays constant regardless if-- roblox compatibility is enabledlocal signal = Signal.new<<string>>()It is possible to write code that is compatible with both Gargantuan and Roblox, regardless of the ROblox compatibility mode being enabled:
-- typenames will return "Signal" and "SignalConnection" in Gargantuan, but-- "RBXScriptSignal" and "RBXScriptConnection" in Robloxlocal signalTypeName = typeof(game.Destroying)local connection = game.Destroying:Connect(function() end);local connectionTypeName = typeof(signal)connection:Disconnect()-- now you can use them!-- you can choose to use Roblox or Gargantuan's signal type definitionlocal function validate(x: SignalConnection)if typeof(x) == connectionTypeName then-- ...endend
Design Deviations
Section titled “Design Deviations”-
There is no
workspaceglobal. Importgame:GetService("Workspace")yourself. -
Likewise, there is no
pluginglobal. Importscript:FindFirstAncestorOfClass("Plugin")yourself. -
Many Roblox deprecated APIs, such as
Instance:isA, has been unimplemented in Gargantuan. You may find old Roblox codebases being harder to port. -
Roblox-based asset paths such as
rbxassetid://will not work inside Gargantuan. Include assets yourself inside the project’s directory, then refer to it usingproject://paths.- The
rbx-to-gargantuantoolchain will attempt to fetch Roblox assets, as well provide new builtin assets for your game to use. - Tools like Asphalt and Tungsten are redundant as Gargantuan synchronizes assets directly from your project via the filesystem.
- The
-
Packages are unimplemented. Use
DirectoryLinkto synchronize your packages. -
task.cancelandcoroutine.closecannot be interspersed withtasklibrary threads and Lua coroutines. This restriction may be lifted by the 0.1 release. -
BaseScript,LocalScript, andEnum.RunContext.Legacyhave been unimplemented due to redundancy:local script = Instance.new("Script")print(script:IsA("BaseScript")) --> falseprint(script:IsA("Script")) --> trueprint(script:IsA("LuaSourceContainer")) --> trueprint(Enum.RunContext:GetEnumItems()) --> { Enum.RunContext.Client, Enum.RunContext.Server }-- this will now error, as Gargantuan does not use LocalScriptsInstance.new("LocalScript") -
Several Roblox features are unimplemented from Gargantuan, including the player controller, gears, CoreGui, et al. so games can implement their own systems such as chat and avatars as deemed fit. Gargantuan provides preset models for you to use as a baseline. You may also reimplement features from scratch using the
InstanceClassdata type:-- TODO: gotta design this to support C++ and Luau classeslocal Humanoid = InstanceClass.new("Humanoid")Humanoid.Properties = { ... }Humanoid.Methods = { ... }Humanoid:Register()local humanoid = Instance.new("Humanoid")humanoid.Parent = Players.LocalPlayerIt’s recommended to write a type definition file for your declared classes:
declare extern type Humanoid: InstanceHealth: number-- ...end