Rogen

Coming from Rojo

Move a Rojo project to Rogen, then sort it by feature

Updated

Use Rogen when you want each feature's server, client and shared code in one folder. If your folders already match Roblox's services and you don't mind writing the tree by hand, Rojo alone does the job. Rogen runs Rojo underneath, so Rojo's keys and flags keep their meaning.

Run rogen init

In the folder that holds default.project.json, run rogen init. It moves no files, and turns your project file into default.rogen.json. For the project rojo init makes, that looks like this:

default.rogen.json
{
	"name": "my-game",
	"sourcePaths": ["src"],
	"routes": {
		"shared": "ReplicatedStorage/Shared",
		"server": "ServerScriptService",
		"client": "StarterPlayer/StarterPlayerScripts",
		"*": "ReplicatedStorage/Shared"
	},
	"tree": {
		"$className": "DataModel",
		"ReplicatedStorage": {},
		"ServerScriptService": {
			"Server": { "$path": "src/server" }
		},
		"StarterPlayer": {
			"StarterPlayerScripts": {
				"Client": { "$path": "src/client" }
			}
		}
	}
}

src/shared becomes a route, each key spelled as its folder is, and every file lands where Rojo put it, so your requires keep working. From now on you edit default.rogen.json, and Rogen writes default.project.json from it, so stop tracking the written file:

echo '*.project.json' >> .gitignore
git rm --cached default.project.json

Sort by Feature

Then move code into feature folders, one feature at a time, since old folders keep working beside them. A move changes the file's path in the game, so update the requires that reach it; rogen where <file> prints the new one:

git mv src/server/Services/InventoryService.luau src/Inventory/server/
git mv src/client/Controllers/InventoryController.luau src/Inventory/client/
git mv src/shared/Types/InventoryTypes.luau src/Inventory/shared/

On this page