View Single Post
Cookies.net
Senior Member
Join Date: Jan 2011
Old 02-16-2016 , 12:36   Boss Fight Fortress, a possible replacement for FF2/VSH
Reply With Quote

This post is geared towards Developers, there are working plugins, but they're possibly unstable, bug infested and/or feature incomplete, not to mention things may still change, a lot.
Opinions are welcome on the approach this project takes.


Hey guys

So, I've not really been on these forums for a long time, nor have I played TF2 or any other source engine-based games. So I guess it makes sense that I haven't been on here.

However, last week I got bored, got an itch to code and was haunted with thoughts of even more improvements to a plugin structure for my old FF2/VSH replacement, Boss Fight Fortress. Which has now resulted in this.

I've written all this from scratch in roughly 5 days, so on top of not really knowing what's going on in TF2 and progressions, or maybe lack of(?), in these game modes, do expect them to be largely feature lacking.

Roughly 2 years ago I was working on a game mode manager I called Gamma, and my first game mode for it was Boss Fight Fortress. These were meant to replace VSH/FF2 on the servers that I was affiliated with. However, I grew bored of TF2, had other things I rather wanted to do and thus they got shelved.

Anyways, during these 2 years I've constantly been getting ideas for improvements, and as I wrote earlier, last week those ideas started to get written in code.

So, what was the aim I had with this? Extensibility. I wanted it to be easily extensible, and in a way that promoted writing plugins instead of rewriting existing ones to add features, to aid maintenance work for server owners.

This project is split into 3 parts so far, the 2 main components being Definitions and Boss Fight Fortress, whilst the 3rd Gamma could become a convenience for multi-mod servers. A rough overview follows:

Definitions
Definitions is a plugin which manages, well, definitions from other plugins. Definitions are immutable data structures that can derive from other definitions, specializing them. Dynamic behavior in definitions are done through functions, which can be bound to them.

A sample of how a game mode definition could be made:
PHP Code:
creator = new DefinitionCreator("GameMode");
creator.SetFunction("CanStart"CanStart);
creator.DefineFunction("Start");
creator.DefineFunction("Ended");
g_hGameModeDefinition creator.Finalize();

... 
somewhere else ...
public 
bool CanStart()
{
    return 
true;

As you can see in the above code, we do the following:
  1. We instantiate a DefinitionCreator for a Definition called "GameMode"
  2. Set a function "CanStart" to a basic implementation that always return true (game mode can always start)
  3. Define "Start" and "Ended" as functions, which means we don't fill them with data, but definitions deriving from the "GameMode" definition will have to have those functions set, before their definitions are of use.
  4. The creation is finalized, and returns a definition, ready for use. The returned definition is immutable, it cannot be edited.

Something that happens behind the scenes when then definition is finalized, is that since we have some properties that aren't set, the definition is "abstract", not sure if template is a better word though. Just needed something quick, so went with my initial thoughts. Anyway, abstract definitions can be filtered when you attempt the get the child definitions, and they can also be reported as not valid when checking for Definition validity.
This allows to create definitions that provide functionality, but not necessarily complete usable functionality. This is useful when you have some very similar things, that could share a lot like multiple Boss game modes. Or when you have some somewhat similar things that could use the same bootstrapping, such as game modes.

Gamma
Gamma is, well, a Game Mode Manager. Nothing fancy here, it just does what it can to manage game modes, while keeping them from interfering with each other.
Gamma also needs something known as a "Round Manager", it's a plugin that tells Gamma when new rounds start and stop, without one Gamma will not function. The reason for this, is to easily provide support for other games, or create improved round management.
I prefer hooking "RoundRespawn" and "PreviousRoundEnd" for round start/stop respectively in TF2, but didn't add it at this time yet.

And lastly, the things that is most interesting on this sub-forum...
Boss Fight Fortress
Boss Fight Fortress is meant to be a highly extensible Boss game mode, and so far I think it does it very well.
It is implemented as a Gamma game mode, and relies heavily on Definitions it self.

Boss Fight Fortress is currently split up, as I said it relies heavily on Definitions, in that there's a base boss game mode definition, which does not provide a working game mode in itself, but instead provides the necessary tools to make a custom Boss game mode. The first being the well-known Boss versus All.
There are plans for a Bosses versus Bosses game mode as well, as I had that back in the days as well.

The base plugin also provides the Boss definition, in fact 2 of them. In order to lessen compatibility issues with other boss game modes, there's a Base Boss definition, as well as a Generic Boss definition. The Base Boss definition is meant to provide an entry point for making a definitions for specialized bosses for a specific game mode, while the Generic Boss definition is meant for bosses compatible all-across the board. Of course, whether the game mode creates it's own specialized definition, or ignores the Generic Boss definition is completely up to itself.

Final words
It's getting a bit late where I am now and I'm starving, so I'll stop writing now and say that you can ask me to any questions you have about this.

More over:
I'd like to know if this is something that you would be interested in as a possible replacement of FF2/VSH. It should be possible to make a Freak Fortress 2 compatibility plugin, once the features are refined a bit more. However, this'll definitely allow for more creativity in bosses than previously seen, if effort is put into it.

I'll be available for information on how all this works, helping with bug fixes and design/implementation of essential features, as well guidance for what I'd consider to be the right way to do things, at least until it has matured enough, but probably "always" to a certain extent.

An example for "right way to do things" is weapon restrictions, which should be a 3rd party plugin that listens to when Boss Fight Fortress starts, and then applies it's restrictions. Even better, it could be config based and work with any game mode that runs through Gamma.


The repositories, for those interested, can be found here:
https://bitbucket.org/CookiesIO/definitions
https://bitbucket.org/CookiesIO/gamma
https://bitbucket.org/CookiesIO/boss-fight-fortress

They're in the order of dependency, there are downloads for SMXs in the downloads section. For external dependencies there's the TF2Items extension and to compile properly you need the compiler shipped with the development builds of SourceMod (1.8).

Last edited by Cookies.net; 02-17-2016 at 15:41.
Cookies.net is offline