Skip to main content
Reading time: ~3 minutes
CORP (Component-Oriented Replicated Programming) is a game development framework for Roblox built with roblox-ts. It provides a Unity-like ECS (Entity Component System) architecture with GameObjects and Components, along with a built-in networking system inspired by Unityโ€™s Netcode for GameObjects.

What is CORP?

CORP brings modern game development patterns to Roblox, making it easier to build complex, multiplayer games with a clean, component-based architecture.

Key Features

  • ๐ŸŽฎ Unity-Style Architecture: Familiar GameObject and Component patterns
  • ๐ŸŒ Built-in Networking: Automatic replication with NetworkObjects
  • ๐Ÿ“ก Type-Safe RPCs: Remote Procedure Calls with flexible configuration
  • ๐Ÿ”„ State Synchronization: NetworkedVariables, Lists, Maps, and Sets
  • ๐ŸŽฌ Scene Management: Declarative scene definitions with serialization
  • ๐ŸŽฏ Component Lifecycle: Predictable initialization and cleanup
  • ๐Ÿ”ง TypeScript Support: Full type safety with roblox-ts

Documentation

Explore the complete documentation:

Quick Example

import { NetworkBehavior } from "CORP/shared/networking/network-behavior";
import { NetworkedVariable } from "CORP/shared/observables/networked-observables/networked-variable";
import { RPC } from "CORP/shared/networking/RPC";
import RequiresComponent from "CORP/shared/componentization/decorators/requires-component";
import { NetworkObject } from "CORP/shared/networking/network-object";

@RequiresComponent(NetworkObject)
export class PlayerController extends NetworkBehavior {
    public readonly health = new NetworkedVariable<number>(100);

    public onStart(): void {
        if (RunService.IsServer()) {
            print("Player spawned on server");
        }
    }

    @RPC.Method({
        endpoints: [RPC.Endpoint.CLIENT_TO_SERVER],
        accessPolicy: RPC.AccessPolicy.OWNER
    })
    public takeDamage(amount: number): void {
        if (RunService.IsServer()) {
            const newHealth = this.health.getValue() - amount;
            this.health.setValue(math.max(0, newHealth));
        }
    }

    public willRemove(): void {
        print("Player removed");
    }

    protected getSourceScript(): ModuleScript {
        return script as ModuleScript;
    }
}

Getting Help

Repository

CORP is developed by MonoliskSoftware.
Build amazing games with CORP! ๐Ÿš€