[Deprecated] Round-Based module

Hello!

So I decided to make an open-source round based game module that will be updated frequently with new functions (If you would like a certain function, reply to this thread or message me and I will add it for you [changes may not be published to the model, if I feel like it is a personal preference I will just send you the file.]). If you cannot reply to this, contact me on discord: Tom_atoes#5465

Where can I get this module?

This module is only available as a Roblox free model. You can find it under this link: https://www.roblox.com/library/2400671152/Round-Based-Module

You may also use require(2400671152), but I don’t recommend it as updates can break your code and there are some remote events / remote functions that the module needs to function.

I recommend putting the module in Replicated Storage.

Why should I use this module?

You should use this module because everything is provided to you for free. As I said before, I will add functions if you need them and I’ll do it asap. This module is really easy to use and it is efficient with only a certain amount of your own code required.

Function Information

:PreparePlayer(obj) - Run this function on player added, it will give the player the needed values.

:ReadyPlayers() - This function gets the amount of players which have the “Ready” value set to true.

:AlivePlayers() - This function gets the amount of players which have the “Alive” value set to true.

:Countdown(string, int, bool) - This function counts down from the int value (2nd argument). The first argument is the status (example: “Intermission”, “Team Deathmatch”). The third argument is toggling if the round should end if only one player is left. You can get this from the client with the value called “Timer”, which is a child of the module.

Module:GiveGear(table) - This function gives all players who have the alive value set to true, up to three gears of your choice. It should look like this:

Module:GiveGear({Rep.Sword, Rep.Bow, Rep.Pickaxe})

Simply just put the location of where the item is.

:EndGame(table) - This function will be used for showing a results GUI. The table should look something like this:

Module:EndGame({Plr, 50, 5, 2})

The winning player should always be the first argument, the rest are optional. In my case I’ve used it like this:

Module:EndGame({
Plr, -- // Winner.
50, -- // Amount of coins.
5, -- // Amount of gems.
2, -- // Amount of K.Os.
})

This information is sent in a remote event called Results found as a child in the module.

These are all the current functions as of now, I will be updating this tomorrow with your suggestions. This is extremely basic but I thought it would help many people who are trying to make their first game!

Please also reply with bugs!

37 Likes

Definitely an interesting concept. I actually had something planned for November that was similar to this, but be a lot more complex. Mainly, it would be designed for concurrent rounds. My idea does require a lot more for the developer, and definitely wouldn’t be optimal for something like a minimum viable product test.

2 Likes

Defiantly link me to that when it’s done. I made this just so that new developers could easily make a basic game without having to spend robux on a scripter.

1 Like

I made a round module for my game, except that it was object-oriented (metatables) and can accept game modes such as CTF, TDM, and something called Warzone.

1 Like

I plan on adding gamemodes tomorrow, I made this for people who struggle with code yet would like to make a simple game.

1 Like

Just a small typo.

Corrected, thanks!

This is so helpful! I know in the past I’ve needed something like this but couldn’t find a scripter that would work at my rates at the time. Thank you!

1 Like

Working on gamemodes right now :wink: Should be done by today or tomorrow. Also map selecting.

This is a nice little trinket. Though I don’t see myself using the module entirely (I’ll either edit it, reference it for code or not use it at all), it’s a good resource for getting started with round-based games. You can learn with it and eventually create your own system without the use of the module to facilitate the game’s core.

Out of curiosity, with regard to the way the module is coded, why use colons for the methods? As far as I can tell, there isn’t any OOP or usage of the self argument.

I also have some requests. They aren’t really personal requests but I anticipate that some people may want to have or explore these functionalities for future use. Most of them are based on current functionality, don’t have the time right now to suggest anything wholly new.


:PreparePlayer(obj) - Run this function on player added, it will give the player the needed values.

This function here gives players the Ready and Alive values, as far as I know. This feels incomplete though - the module contains no set or get methods for the created values. The use case here would be preventing the player from participating if they haven’t loaded up or if they want to skip rounds. Not allowing a player to sit out of rounds due to personal preference or a need to be AFK/BRB, depending on the game, is pretty bad for UX, especially if round history is logged or there’s data related to rounds played and won.

The methods can also be used to shortcut and force set a player’s alive state instead of having the developer write that out. Having Alive be set to false on death is bad because not every round-based game may expect a player to physically die for them to be counted as dead or ineligible to win.


:ReadyPlayers() - This function gets the amount of players which have the “Ready” value set to true.

This only gets a number. In the instance that a developer needs a table of Player objects to act on, they have to do it manually. I personally don’t see a use case for getting the number of players ready over getting all players and including their player instances and Ready values.

The naming of this method is also pretty awful; without documentation or reading the source code, I’d just assume this function gets everyone ready and sets their Ready values to true rather than getting the number of people Ready.


:AlivePlayers() - This function gets the amount of players which have the “Alive” value set to true.

Essentially the same criticism as Ready players, except the naming here doesn’t make sense or relate to the method’s intended function at all.


:Countdown(string, int, bool) - This function counts down from the int value (2nd argument). The first argument is the status (example: “Intermission”, “Team Deathmatch”). The third argument is toggling if the round should end if only one player is left. You can get this from the client with the value called “Timer”, which is a child of the module.

This countdown method looks more built to support actual rounds than using it for a non-round sequence, such as intermission. I assume that’s where you set the third argument EndAtOneAlive (?) to false. If it’s not already a thing, this book should be defaulted to false if the third argument isn’t included when the method is called. That way, it may feel more like a real countdown function that can be bent depending on it’s use case.

I’ve also noticed that throughout this thread, there’s been mention of remotes several times, including this module. Nowhere in the module or this thread is it specified what remotes are needed from the developer to work nor is there documentation on those remotes. Considering this seems to be a big part of the module itself, missing mention of those can be detrimental to a programmer, especially a less experienced one. Touching up on those remotes would be much appreciated.

As far as I personally know, the Timer remote mentioned in this method is used to get the time left in a round. I think that it’s inefficient to have clients constantly requesting for the time left in the match. Since the module relies on a IntValue object, you can shorten this all to a callback method Module::GetTime. When either the server or client require the module, they can quickly call this function at almost no networking cost. This works since the content returned on require is different on the server and client.

Last thing. I haven’t read the module’s code since last night so I don’t know how specifically the counting down works, but no method has been provided to allow developers to force stop a countdown aside from setting the value to zero, which is uncomfortable in practice. There is also no way to determine if a countdown is already active, so the developer could end up accidentally starting two conflicting Countdowns. These kinds of seemingly small issues are the ultimate gateway to larger issues.

I think that the Countdown method overall is worth in depth exploration on your behalf, OP, as it’s developer and maintainer. It feels like the method that needs the most attention right now, since it’s essentially the core of the game overall.


EndGame(table) - This function will be used for showing a results GUI.

I don’t think that developers are only looking to show results UIs when calling a EndGame function. Some developers may not even need this UI. EndGame should be the method that stops an active countdown and allows developers to determine what is supposed to happen when a round concludes. For primitive learning purposes this is alright, but for people who are also using this for advanced purposes this may not seem like the greatest thing.

Regardless of the round results, the method demands that only one player should be the winner of a round. This furthermore disallows any other player to be listed as a winner. No complaints about the varargs (variable arguments for those curious), that’s up to the developer to handle. I haven’t experimented with your module in depth yet, but I personally would use the varargs to pass in a function of my own that runs when the round ends to do post-round stuff.

Just like Countdown, there’s a remote involved with no explanation regarding it. This function is also worth further exploration and development in general.


While I understand that a couple of things I provided may be more suited for more experienced scripters, it’s also good to be inclusive of less experienced ones and devise methods to help them along the process of learning or integrating your resources into their projects.

I spent about 2 hours writing that between breaks in my classes, on mobile. Excuse any mistakes or whatever.

Cheers.

2 Likes

I made this in around 3 hours. It’s not intended for professional scripters, just the newer ones. I completely agree with everything you have listed and (depending on the outcome of this module) I will improve it massively. Thanks for the feedback.

EDIT: This definitely isn’t my best work.

1 Like

Implementing OOP and murder gamemode + some monetisation methods! (Suggested by @alvinbloxx)

1 Like