Feedback on Dungeon Game Module?

Hello, slight introduction and explanation behind the entire thing. I have been working on this Module(s)
for the past day. It is supposed to be something that myself, and anyone who wishes to can use. It will:

  • Save, Store, Manage Data.
    • Automatic Saving (on leave), or force saving ( :savePlayersData )
  • Create “Classes” (ex: Archer, Mage, etc.)
    • Classes will store base Health, and Multipliers (Class bonus of 1.2x Health, etc.)
  • Manage the physical dungeon rooms
    • Detects when a room has been cleared/completed
    • Detects when a player enters a specific room (with usage of :Connect for customization)
    • Detects when a player left a specific room (with usage of :Connect for customization)
  • Customizable methods for players (ex: player.playerLoaded:Connect() )
    • Additionally, players each have their own objects stored, containing .Data (Customizable to any extent, for example: Data.Inventory = {})

Although, for now, I’m requesting all feedback possible, such as “Hey, you should add this”, or, “Why is this even something someone would use?”

Currently, this is the sum of the usage:

GameManager Usage:

--REQUIRING:

local GameManager = require(ReplicatedStorage.GameManager) -- implied ReplicatedStorage is defined

--SETUP:

GameManager.setup("MMO_Game") -- Takes a String for DataStore name.

--METHODS:

--Player Related:

GameManager:addPlayer(player) -- Takes a Player. 

GameManager:getPlayer(player) -- Takes a Player, Returns Player Object

GameManager:getPlayerData(player) -- Takes a player, Returns all relevent Data.

GameManager:savePlayerData(player) -- Takes a Player. 

GameManager:setPlayerClass(player, "ClassName") -- Takes a Player aswell as String for the Classes Name

--Gameplay Related:

GameManager:createClass("ClassName", {Base Stats}, {Class Multipliers}) -- Self a String for the Classes name, aswell as two tables, one which is the Classes Base Stats, and one which is the Classes Base Multipliers.

GameManager:createDungeon("DungeonName", Vector3, CFrame) -- Takes a String for the Dungeons Name, aswell as a Vector3 for the size, and a CFrame for the position.

Player Object based usage:

player = { -- The Player Object.
   User = The Players User,
   Data = Any Desired Data to be stored,
   Class = The Set/Chosen Class,
}
-- ALL Following Methods are DEPENDENT on: local player = ClassManager:getPlayer(player) -- player is a player that joined the experience.

player.playerLoaded -- This will automatically send a signal when the player has initially loaded.
--EXAMPLE USAGE:
player.playerLoaded:Connect(function(player)
    GameManager:setPlayerClass("Tank", player)
end)

--Let me know of any other useful methods.

Dungeon Based:

Dungeon = { -- The Dungeon Object
  Name = The Dungeons Name,
  EntryRequirement = The Dungeons Entry Level Requirement,
  Rooms = {} -- Table of Created/To-Be Created Rooms.
}

-- ALL Following Methods are DEPENDENT on: local Dungeon = ClassManager:createDungeon("DungeonName")

Dungeon:addRoom("RoomName", Vector3, CFrame) -- Takes a String for the Rooms Name (Dungeon.Rooms[RoomName], Vector3 for Size, and CFrame for position

Dungeon:getPlayersInRoom("RoomName") -- Returns a Table of Players Inside a Room of a Dungeon.

Dungeon:getRoom("RoomName") -- Returns Room Object

Dungeon:roomCompleted("RoomName") -- Sets RoomName[Completed] to true

Room Based:

--ALL Followng Methods are DEPENDENT on: local Room = Dungeon:getRoom("RoomName")

Room = {
  Zone = A Region3 Object (this was created when the room was added),
  InZone = {} A Table of Players that are inside that room.
  Completed = false A Bool that determines if the room has been completed.
}

Room.playerEntered -- Signal goes off when a player has entered the defined Zone.

Room.playerExited -- Signal goes off when a player has left the defined Zone.

To sum up, currently this is how it can be implemented:

  1. A Hub Experience , where players can go to interact with one another between Dungeons/Matches:

(loads players data, creates all classes relevant to the game {for this example, “Tank”}, nothing extra)

--ServerScriptService.MainServer:
local GameManager = require(game:GetService("ReplicatedStorage"):FindFirstChild("ClassManager")).setup("MMO_Game")
GameManager:createClass("Tank", {Health = 200}, {Health = 1.2})

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        GameManager:addPlayer(Player)
        local player = GameManager:getPlayer(Player)
        player.playerloaded:Connect(function(player)
            print(player.User .. " Loaded")
        end)
    end)
    game.Players.PlayerRemoving:Connect(function(player)
        GameManager:savePlayersData(Player)
    end)
end)
  1. For a GamePlay environment:

Detects when a player enters/exits a Dungeon Room and prints their Username. This can be easily customized to make anything happen.

local GameManager = require(game:GetService("ReplicatedStorage"):FindFirstChild("ClassManager")).setup("MMO_Game")
GameManager:createClass("Tank", {Health = 200}, {Health = 1.2})

GameManager:createDungeon("Snowy", 10)
local SnowyDungeon = GameManager:getDungeon("Snowy")
SnowyDungeon:addRoom("Entrance", Vector3.new(10,10,10), CFrame.new(0,0,0))
local Entrance = SnowyDungeon:getRoom("Entrance")

game.Players.PlayerAdded:Connect(function(Player)
    Player.CharacterAdded:Connect(function(Character)
        GameManager:addPlayer(Player)
        local player = GameManager:getPlayer(Player)
        player.playerloaded:Connect(function(player)
            print(player.User .. " Loaded")
        end)
        
        Entrance.playerEntered:Connect(function(player)
            print(player.Name, " Entered The Entrance Room!")
        end)
        Entrance.playerExited:Connect(function(player)
            print(player.Name, " Exited The Entrance Room!")
        end)

    end)
    game.Players.PlayerRemoving:Connect(function(player)
        GameManager:savePlayersData(Player)
    end)
end)

Please, reply with any and all feedback, this will be made public once all desired/suggested things are added, and yes, this will allow local scripts to retrieve desired data.

Also, I haven’t listed ALL of the usages this contains, since I’ve only been working on it for a day, but yeah.

Additionally, let me know of any improvements to be made. I’m all ears. cheers!

(basically a way to manage players interacting with the game, data, stats, all of it but in one module) {created in a day, please dont blow me up for mistakes, this is also my first post :smiley: }

I like the dungeon module,pretty neat.

1 Like