Gamma - A game mode manager
Hi, last weekend I suddenly started a similar project that I had worked on around 2 years ago (not to mention I called it the exactly same thing). The reason I have for restarting this project is not logical at all, as I haven't played a source game for over a year (but it was surprisingly fun after I got started), anyway I thought I'd release it here. Not exactly sure where I should post this as it's definitely not ready as a new plugin, so I'm assuming this is the best section.
The project is... What's written in the title, Gamma - A game mode manager. What can it do? Well, it can manage game modes written against it's API, putting the work of handling when it's supposed to start and stop in the hands of Gamma. Gamma has a few game mode selection modes and can be chosen as you please, there's 3 ways to select a new game mode:
What's more, is that Gamma can work as a link between game mode and plugins extending the game mode, by having global forwards telling when game modes starts and stops. But even more awesome, must be the Behaviours, which acts as player modifiers. A behaviour is plugin that fiddles with the player, it can be anything from giving buffs or nerfs to the player or it can completely change how a player is playing the game. As an example, if we were to write an VSH/FF2-ish game mode against it, a behaviour could be a boss! Behaviours are limited to game modes it has registered it self to, via Behaviour Types. Behaviour types are created by the game mode when it's initializing and are limited to only that game mode, which means that other game modes can't create behaviour types called the same. Behaviour types can also have function requirements, which are functions the behaviours must implement. As an example of this is MyGameMode creates a behaviour type, MyBehaviourType, and adds the requirement that behaviours must implement MyFunctionRequirement, then when MyBehaviour registers itself as behaviour of type MyBehaviourType it's checked whether or not MyFunctionRequirement is implemented. If not, it will error out and not be created - else it will be created. The only plugin able to give and take behaviours is the currently active game mode, other plugins will receive an error if they attempt. This is because we don't want other plugins to meddle with the game mode logic. There isn't an upper bound for the amount of behaviours a single player can have at any time, other than the limitation placed by the game mode it self, which should be easy to maintain as other plugins can't meddle. A single game mode can have as many Behaviour types it wants, and there can be as many behaviours in a behaviour type you wants, the limitation is memory on the machine and limits of handles created (which I doubt you'll hit, but still, it's there). Now, we can create game modes and behaviours (behaviour types are a part of a game mode plugin), as for limitations there's only a single game mode per plugin and only a single behaviour per game mode per plugin, these restrictions are placed so a single behaviour plugin only represents a single behaviour (but that single behaviour is allowed to be placed onto many game modes, if it's pretty much the same, between those 2 game modes). Now, there's a few changes I'd like to have done to the round start/end primarily, those are:
And a feature I'd like to make, but could take some work to get right:
Gamma is far from finished, the main portion was written last weekend (5th and 6th April) and there hasn't been made any major changes since then, mostly I've renamed the natives and forwards as well as made sure that the templates could run without errors. Not to mention, added debug messages, I didn't have those to start with as I couldn't test that weekend anyway! (only installed and downloaded both TF2 and the TF2 server after the weekend) So, after this wall of text we finally come to the link you've probably all been waiting for, oh well can't blame you. Gamma, game mode and behaviours templates (which doubles as simple print-to-server examples) and compiled versions of those are available from this GitHub repo: https://github.com/CookiesIO/Gamma/ At the moment (April 17th) the rough, simplified feature set is as follows:
The cvar's available are:
Now, to finish off, is this something you'd like to see further improved? If yes, please share your thoughts of improvements and/or additions you'd like to see. Also, feel free to contribute with anything else regarding gamma! |
Re: Gamma - A game mode manager
This sounds awesome, sorry for only skimming through the gist of this, but this caught my eye.
Quote:
Code:
SetCommandFlags("mp_forcewin", GetCommandFlags("mp_forcewin") & ~FCVAR_CHEAT);2, RED wins 3, BLU wins I would also like to know how the whole 'preventing round end' and preventing 'player spawning' works that would help me out in my gamemode too. EDIT: holy hell i just went through the gihub, this is amazing. |
Re: Gamma - A game mode manager
It looks really nice, clean and modular! And I like its name. I'll definitely mess with this :P
|
Re: Gamma - A game mode manager
Quote:
Quote:
Quote:
1. It's not biased towards any particular project, unlike my attempt 2 years ago and 2. Gotten a lot more experience since then, with all kinds of small projects |
Re: Gamma - A game mode manager
Quote:
Code:
|
Re: Gamma - A game mode manager
Quote:
|
Re: Gamma - A game mode manager
Added a new example game mode + behaviour to the repo, also updated the first post with the current state of things... Time to sleep *yawn*
|
| All times are GMT -4. The time now is 18:33. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.