Danmaku Fortress
An almost-TC Bullet Hell mode for TF2 (and may be ported elsewhere)
Not for the faint of heart...
Video Demonstration
Files
df_sourcemod.zip - Attached at the bottom of this post. Configs, sources, includes, and compiled plugins. To install, drag and drop this sourcemod dir onto your server's sourcemod dir. danmaku_fortress_resources.zip - Materials, models, sounds for the core and the pack-in bosses. Also contains a map that DF will play on. These MUST exist on the server side. I would recommend installing these under custom/danmaku_fortress instead of download, as many of the models are likely to be updated with better animation if this game mode finds an audience. (and update means "new models added, old models removed", since client asset overwrite is impossible) danmaku_fortress_fastdl.zip - OPTIONAL FastDL files, put these on your FastDL server.
tf2items - It's a long story...and frankly it makes my sanity hurt. Read the Known Issues for more information.
Recommended Plugins
ThirdPerson (non-cheats version) - Giving the player the option to swap between first and third person is great. If this is missing, the df_tp and df_fp commands are available, but your players won't instinctively know to look for them.
Interacts Badly With
Instant respawn (absolutely will screw up this plugin), however TF2's not-so-instant respawn should be fine, since it's actually a 4 or so second delay.
Any aggressive auto-balance plugin which also targets the living (will cause players to forfeit), TF2's autobalance is already disabled in code for this reason.
Class limit plugins could be a problem, since all combatants are forced pyro.
Any plugin that prevents OnMapStart() from executing. (i.e. a quarantine system -- not needed for this plugin, it auto-quarantines)
Freak Fortress 2 needs to be quarantined as it can interfere with the spawn/team assignment code and stop matches before they can start.
What is Danmaku Fortress?
Danmaku Fortress is a unique game mode based on Bullet Hell, with obvious heavy inspiration from Touhou. It's intended to be danmaku in a 3D arena, which really hasn't been attempted much.
All battles are 1 on 1. One player is the "hero", which is the typical danmaku protaganist. (i.e. Reimu Hakurei) The hero has a tiny hitbox that is really just a point in 3D space. The hero typically has only two abilities, standard fire and a desperation ability. The hero can have more abilities and even cooldown on said abilities, but as of v1.0.0 none of the pack-in heroes use this feature. Standard fire is "shoot forward, stuff dies". Each projectile does damage to the boss. The desperation ability is like a bomb in danmaku games. What the bomb does varies widely, but it always makes the hero invincible for a short time. The hero has a limited number of lives, and they lose if they die at 0 lives. Depending on the hero's difficulty setting, the hero will automatically use bombs when hit, or always lose a life when hit.
The other player is the "boss", antagonists like Flandre Scarlet and Koishi Komeiji. The boss has a larger hitbox than the hero, and has a life bar instead of a lives/bombs system. Some bosses even have phases, which determines what abilities can be used based on the boss' health. Boss abilities are far less direct than hero abilities, and are meant to turn the arena into an everchanging minefield that the hero must navigate. Bosses are also slower than heroes, necessary for balance reasons.
The plugin supports 5 sub-arenas, in other words 5 games with 2 players going on at once, for a maximum of 10 players at a time not sitting bored. If you plan on making a dedicated server for this mod, 16 slots could easily be enough.
Danmaku Fortress is built from the ground up, and one of the best features for server operators is that it only runs on maps which are specifically made for the mod. Maps without the prefixes df_, danmaku_, or touhou_ will cause the plugin to temporarily quarantine itself. It should not cause other plugins to malfunction -- let me know if this isn't the case! Another interesting feature is its use of reflection instead of natives and forwards, which remove load order concerns which prompt other modular mods to quarantine its subplugins. (i.e. FF2 with the .ff2 extension)
It features a lot of customization options, more than I could explain in this blurb. There are tons of cvars for aesthetics and gameplay balancing. It includes a music player which I wrote specifically for game music, and this can be customized as well. It has a modular design which allows for hero, boss, and ability creation. I built it from the ground up but took inspiration from the good features of FF2, like similar config file designs and the modular concept, while focusing on the framework early on with a set code structure in mind. The code is neat, readable, and categorized, while the "one game frame" design philosophy along with its time synchronization ensures stability.
Controls
The controls are as follows. They're not so great, but given the limitations of the engine (i.e. pitch clamped to [-89.0..89.0]) it's the least awkward I could come up with. 6dof would be great, but it's just not possible -- and I figured the control scheme would fit best with the precision of danmaku games, versus Valve's fly/noclip controls.
WASD - Move around, but it's limited to the x/y axis. Jump - Move up Secondary Fire - Move down Primary Fire - Use ability (if autofire is enabled for heroes, this key stops firing) Reload - Change ability Use - Change ability in reverse. Hidden feature since use isn't bound in TF2 by default. Special or Crouch - Precision mode, move at half speed. (note: Special defaults to middle mouse) Call for Medic - Use bomb (hero only, Hard difficulty or higher)
Main Menu and Commands Main Menu
Spoiler
Main menu accessed via /df:
Prints a help message to the user.
Swaps between never be player, prefer hero, prefer boss, and no preference.
Toggle hero autofire
Select a hero (this is stored forever until the user changes it)
Select a boss (this is stored forever until user changes it)
Change difficulty (last menu option since it's not recommended for new players) Difficulty affects your final score, along with your opponent's.
Normal difficulty is the default. Bombs save your life.
Hard difficulty is where "balance" is meant to be centered. Bombs must be activated manually. Get hit and you lose a life.
Lunatic difficulty is like Hard, but you don't get more bombs on lose life.
Player Commands
Spoiler
df_queue - View queue points
df_music - View music chooser. Danmaku Fortress has a custom coded music player made especially for game music. I'm thinking of someday making a standalone plugin with just this.
df_tp and df_fp - Thirdperson and firstperson commands. These are only usable if the Thirdperson plugin is not loaded.
df_tutorial - An unadvertised command (borderline debug) that prints all tutorial messages.
df_never, df_wanthero, df_wantboss, df_wantany, df_boss, df_hero, df_difficulty, and df_autofire are all the commands invoked by the main menu.
df_help, danmaku, and touhou are all aliases for the df command.
Admin Commands
Spoiler
df_cvars - Reloads all cvars from file.
df_botlogic - Enables rudimentary bot logic, for both puppet and standard bots.
df_addpoints (partialName) (points) - Adds (or subtracts) queue points from a user. Negative points will prevent a player from participating, which can be used as an admin punishment.
df_forcehero (partialClientName) (partialHeroName) - Forces a player to be a specific hero. Also provides temporarily override for permissions. Note that it does not force them to be a hero next round, nor does it change their hero/boss/never preference.
df_forceboss (partialClientName) (partialBossName) - Forces a player to be a specific boss. Also provides temporarily override for permissions. Note that it does not force them to be a boss next round, nor does it change their hero/boss/never preference.
df_amianadmin - Not meant to be invoked. It's used in a workaround since a couple expected methods for detecting if someone is admin failed. Will be removed once someone sets me straight. :p This is used in connection with having characters that only admins can access. ("debugboss" is one of these characters)
Debug Commands
Spoiler
These commands are compiled out of the plugin by default. You must set DEBUG_MODE_ENABLED to true for them to be usable. They can be disruptive to gameplay, and should not be used on a live server.
df_forceenemyfire - Forces the enemy to fire once. Best used for testing boss abilities with a puppet bot.
df_forceiterate - Forces the enemy to iterate ahead one ability. Best used for testing boss abilities with a puppet bot.
Cvars
Spoiler
The public version cvar is: danmaku_fortress_version
All of the others are set to FCVAR_PLUGIN.
df_tutorial_interval (default 60.0) - Interval between tutorial messages.
df_start_delay (default 10.0) - Delay before game actually begins, after two people are brought into said game.
df_new_life_invincibility_duration (default 5.0) - Duration of invincibility when hero uses a life.
df_bomb_invincibility_duration (default 3.0) - Duration of invincibility when bomb is used.
df_vertical_multiplier (default 0.35) - Vertical speed multiplier. Vertical speed is recommended slower than horizontal speed, mainly for balance reasons.
df_postgame_delay (default 10.0) - Delay before someone can enter one game after leaving another. Also the duration of win/lose sounds, before other sounds start playing.
df_max_games (default 5) - Admin-set limit for number of max games. (5 is the hard maximum, but you can set it lower)
df_queue_point_grace_time (default 25.0) - Grace period before queue points are lost if someone forfeits against you.
df_queue_points_wait (default 10) - Queue points for people waiting in line.
df_queue_points_win (default 9) - Queue points for winner of a match.
df_queue_points_lose (default - Queue points for loser of a match.
df_queue_points_stalemate (default 300) - Queue points for a stalemate. Keep in mind that unless admins go around slaying everyone, this is an incredibly rare event. You'll probably never see one occur naturally.
df_queue_points_early_forfeit_mult (default 0.0) - Early forfeit multiplier for the forfeitter. (intended as a penalty, the victim loses no points) [0.0 to 1.0]
df_queue_points_forfetted_against_mult (default 0.5) - If someone is forfeitted against after the grace period, they lose this amount of their queue points instead of all of them. [0.0 to 1.0]
df_hero_normal_max_score (default 25.0) - Max scoreboard points for the hero, if the hero is on normal difficulty.
df_hero_hard_max_score (default 50.0) - Max scoreboard points for the hero, if the hero is on hard difficulty.
df_hero_lunatic_max_score (default 100.0) - Max scoreboard points for the hero, if the hero is on lunatic difficulty.
df_boss_normal_max_score (default 100.0) - Max scoreboard points for the boss, if the hero is on normal difficulty.
df_boss_hard_max_score (default 50.0) - Max scoreboard points for the boss, if the hero is on hard difficulty.
df_boss_lunatic_max_score (default 25.0) - Max scoreboard points for the boss, if the hero is on lunatic difficulty.
df_hero_ability_terminology (default "Desperation Ability") - Aesthetic name for hero bomb ability. You might change it to Spell Card if you're running a Touhou themed server.
df_boss_ability_terminology - (default "Boss Ability") - Aesthetic name for boss ability. You might change it to Spell Card if you're running a Touhou themed server.
df_hero_projectile_resize - (default 0.7) - Projectile resize for hero. Hit area is unaffected, but making the projectiles smaller makes it easy for the hero to see.
Lesser Known Features
There is some basic support for restricting characters to donators. Since there's probably many different donator/payment management systems out there, I've included a donator interface include df_donator_interface. Simply include that and call DFP_ClientIsDonator(clientIdx) once your donator is validated, and they should have access to donator characters. This probably needs to be redone on map change.
Even version 1.0.0 of this plugin stores players' cumulative score. What will actually become of this remains to be seen.
I had some second thoughts to the use of just music.cfg, and also added support for adding songs in boss configs. debugboss.cfg has an example of how this is done.
Bosses or heroes deemed easier than others can have their points adjusted with the point_adjust argument. Flandre's config file has this commented out -- I originally had her get a point nerf, and then found it easier to play against her than Cirno when my opponent was human.
Q&A
Q: Is this plugin limited to Touhou?
A: Nope. Even though the first characters included are Touhou characters, I plan on including Epic Scout as a hero and SHADoW may include Blitzkrieg as a boss. Characters from any domain are welcome.
Q: Can I create my own characters?
A: Yep. There are 18 default abilities to work with and coders can make even more. There a bunch of pre-programmed behaviors for rockets and spawners, with more planned in the future, which makes it pretty easy to code even complex patterns. You can also choose to manage the behavior of rockets and spawners, though this is more involved.
Credits Core Credits
Code and concept by sarysa
Heavily influenced by SHADoW and his Blitzkrieg FF2 boss, plus I got the idea for this while we "dueled" flying around in noclip.
Also influenced to a small degree by Freak Fortress 2, most notably with the config file designs, Kv code, and some of my stocks.
Rocket spawning code derived from Asherkin's from his Dodgeball plugin, with contributions from voogru
Beam spawning code derived from JasonFrog's IonAttack for FF2. (at least I think it was JasonFrog's, specific parts of Phat Rages are unsigned)
Chdata for help with the Waiting For Players fix.
Obviously also heavily influenced by Touhou Project by ZUN
Asset Credits
Reimu model by Nya
Cirno model also by Nya
Flandre model by Ciel
All models so far were ported to GMod by 1337gamer15 (I grabbed them from Kenji-kun's collection)
sarysa made Reimu's crappy gohei which looks more like a staff with a pennant at the end.
sarysa also added basic animated poses to Cirno and Reimu, and fixed some of the seam and bad texture param issues. (those not directly caused by UV mapping)
Music by ZUN and various remixers of his work.
The pack in map's skybox texture is by VelvetFistIronGlove, it's called "Skylab". Seriously, without this awesome texture, people would see my map for how awful it really is.
Special Thanks
BBG Theory for allowing me use of his development server for playtesting.
SHADoW NiNE TR3S provided a ton of feedback and even a little assistance throughout development.
BBG community members (and others) for testing. Those who I can remember include: SHADoW, Deathreus, GimpYTron, Cheese, and Cirno.
Known Issues
People have reported frame drops with the beams. I don't get them, and it seems to be with people running highest or near highest settings. This one will definitely take community feedback to overcome.
Players need to have outlines enabled to be able to enjoy this mod. (or at least, to enjoy it while playing boss) Out of necessity, the hero becomes a dot with an outline of their model's body when they go into third person. Otherwise, the hero would be unable to see.
The plugin is hardcoded in English. I get that this a problem. I went out of my way to make the interface as descriptive as possible, but it's also going to make adding localization support an utter nightmare. Plus this is the type of plugin where minimum CPU usage is the top priority, and until I better understand the impact grabbing strings from a localization file will have on load, this issue is going to be put off for a long time.
Players get stuck under the map during the pre-round. Due to maps needing to have a transparent "yes projectiles no players" boundary all around, it's unlikely this will ever be fully fixable. (Dart Mann tried, but that fix only works on the first player to show up)
People with a sharp eye might notice the hero's projectiles have a larger hitbox than they should. This is by design, to make it easier for the hero to see. It's managed with a cvar.
DO NOT ADD TF2 MUSIC to the music player unless you rip it and give it a new path. Some TF2 songs and sfx are hardcoded to automatically loop on their own, which will cause songs to quickly stack.
tf2items is a requirement because I get the error below if it's not included. I have no idea why I get this error. When it happens, the line number it fails on is wrong and the plugin completely ceases to function. (no more events received either) Removing this method entirely appears to fix the problem, but hitboxes aren't read in. If anyone knows what the hell this is and why having tf2items fixes the problem, please let me know:
Spoiler
Code:
L 07/07/2015 - 23:03:21: [SM] Plugin encountered error 16: Instruction contained invalid parameter
L 07/07/2015 - 23:03:21: [SM] Displaying call stack trace for plugin "danmaku_fortress.smx":
L 07/07/2015 - 23:03:21: [SM] [0] Line 6222, danmaku_fortress.sp::ParseHull()
L 07/07/2015 - 23:03:21: [SM] [1] Line 5987, danmaku_fortress.sp::KV_ReadRectangle()
L 07/07/2015 - 23:03:21: [SM] [2] Line 3547, danmaku_fortress.sp::DG_TryStartGame()
L 07/07/2015 - 23:03:21: [SM] [3] Line 4120, danmaku_fortress.sp::DG_Tick()
L 07/07/2015 - 23:03:21: [SM] [4] Line 6175, danmaku_fortress.sp::OnGameFrame()
The following two replies will contain hero/boss descriptions and instructions for subplugin coding, creating heroes/bosses, etc.