void CTeamFortress2Mod :: mapInit ()
{
(...)
if (std::strncmp(szmapname, "ctf_", 4) == 0 || std::strncmp(szmapname, "quake_turbine", 13) == 0 ||
std::strncmp(szmapname, "pass_", 5) == 0 || std::strncmp(szmapname, "pd_", 3) == 0 ||
std::strncmp(szmapname, "od_", 3) == 0 ||
(std::strncmp(szmapname, "slendytubbies", 13) == 0 &&
!(std::strncmp(szmapname, "ctf_chouhen", 11) == 0 || std::strncmp(szmapname, "ctf_haarp", 9) == 0)))
// Quake Turbine is CTF. - RussiaTails
m_MapType = TF_MAP_CTF; // capture the flag
else if (std::strncmp(szmapname, "cp_", 3) == 0 || std::strncmp(szmapname, "cqt_", 4) == 0 ||
std::strncmp(szmapname, "conquest_", 9) == 0 || std::strncmp(szmapname, "dom_", 4) == 0 ||
std::strncmp(szmapname, "2koth_", 6) == 0 || std::strncmp(szmapname, "ctf_chouhen", 11) == 0 ||
std::strncmp(szmapname, "ctf_haarp", 9) == 0 || std::strncmp(szmapname, "falling_cp", 10) == 0 ||
std::strncmp(szmapname, "stt_", 4) == 0 || std::strncmp(szmapname, "koth_lifesnatcher", 17) == 0 ||
(std::strncmp(szmapname, "vip_", 4) == 0 &&
std::strncmp(szmapname, "cp_helmsdeep_v2", 15) != 0))
// Conquest, 2koth and DOM works fine as CP_. Moved stt to cp to make bots attack a tank - RussiaTails
m_MapType = TF_MAP_CP; // control point
else if (std::strncmp(szmapname, "tc_", 3) == 0)
m_MapType = TF_MAP_TC; // territory control
else if (std::strncmp(szmapname, "pl_", 3) == 0 ||
(std::strncmp(szmapname, "kotc_", 5) == 0 &&
(!(std::strncmp(szmapname, "pl_fountain", 11) == 0 ||
std::strncmp(szmapname, "pl_divulgence", 13) == 0))))
// Tug of War works fine as Payload - RussiaTails
m_MapType = TF_MAP_CART; // pipeline
else if (std::strncmp(szmapname, "plr_", 4) == 0 || std::strncmp(szmapname, "tow_", 4) == 0 ||
std::strncmp(szmapname, "arena_tinyrock", 14) == 0 || std::strncmp(szmapname, "tow_impasse", 11) == 0 ||
std::strncmp(szmapname, "arena_hailstone", 15) == 0) // to make bots push payloads on these maps. - RussiaTails
m_MapType = TF_MAP_CARTRACE; // pipeline racing
else if (std::strncmp(szmapname, "arena_", 6) == 0 || std::strncmp(szmapname, "ft_", 3) == 0) // pongo1321
m_MapType = TF_MAP_ARENA; // arena mode
else if (std::strncmp(szmapname, "vsh_", 4) == 0)
m_MapType = TF_MAP_SAXTON; // arena mode
else if (std::strncmp(szmapname, "pipeball_", 9) == 0)
m_MapType = TF_MAP_PIPEBALL; // arena mode
else if (std::strncmp(szmapname, "koth_", 5) == 0 || std::strncmp(szmapname, "ctk_", 4) == 0)
// Control the Keep works almost the same as KOTH. - RussiaTails
m_MapType = TF_MAP_KOTH; // king of the hill
else if (std::strncmp(szmapname, "sd_", 3) == 0 || std::strncmp(szmapname, "sdr_", 4) == 0)
// Object Destruction and Special Delivery Race (I dunno why it's named like this when it works as a usual sd_) works the same as SD_. - RussiaTails
m_MapType = TF_MAP_SD; // special delivery
else if (std::strncmp(szmapname, "tr_", 3) == 0)
m_MapType = TF_MAP_TR; // training mode
else if (std::strncmp(szmapname, "cppl_", 5) == 0 || std::strncmp(szmapname, "pl_fountain", 11) == 0 ||
std::strncmp(szmapname, "pl_divulgence", 13) == 0 || std::strncmp(szmapname, "cp_helmsdeep_v2", 15) == 0 ||
std::strncmp(szmapname, "cw_", 3) == 0) // Hybrid - RussiaTails
m_MapType = TF_MAP_CPPL; // CP+PL maps
else if (std::strncmp(szmapname, "gg_", 3) == 0 || std::strncmp(szmapname, "dm_hydro_v20", 12) == 0 ||
std::strncmp(szmapname, "dm_powerdown_v20", 16) == 0 || std::strncmp(szmapname, "dm_forgecall_v20", 16) == 0 ||
std::strncmp(szmapname, "dm_poolparty_v20", 16) == 0 || std::strncmp(szmapname, "dm_badworks_v20", 15) == 0 ||
std::strncmp(szmapname, "dm_razorpoint_v20", 17) == 0 || std::strncmp(szmapname, "dm_deadlock_v20", 15) == 0)
// GunGame (and non-team deathmatch) - RussiaTails
m_MapType = TF_MAP_GG; // GunGame maps
else if (std::strncmp(szmapname, "mvm_", 4) == 0 || std::strncmp(szmapname, "gd_", 3) == 0)
// gd is MvM Guardian, for now there are only two maps exist with this prefix. - RussiaTails
m_MapType = TF_MAP_MVM; // mann vs machine
else if (std::strncmp(szmapname, "rd_", 3) == 0)
m_MapType = TF_MAP_RD; // robot destruction
else if (std::strncmp(szmapname, "zi_", 3) == 0)
m_MapType = TF_MAP_ZI; // Zombie Infection //TODO: add support for those gamemodes [APG]RoboCop[CL]
else
m_MapType = TF_MAP_DM; // deathmatch //TODO: to prevent bots from idling in their spawns by giving them basic tasks [APG]RoboCop[CL]
(...)
}
Whenever it comes to gamemode detection, the plugin checks for map names/prefixes; but what if a gamemode was running despite using an unconventional prefix or map name?
Let's take these maps for example:
No, we shouldn't have to wait until more maps get hardcoded.
Examples
CTeamFortress2Mod::mapInit()CBotFortress::startGame()The Problem
Whenever it comes to gamemode detection, the plugin checks for map names/prefixes; but what if a gamemode was running despite using an unconventional prefix or map name?
Let's take these maps for example:
dm_powerdown_v20dm_forgecall_v20dm_poolparty_v20dm_badworks_v20dm_razorpoint_v20dm_deadlock_v20What if Lizard Of Oz's DeathMatch maps receive an update? What if even more maps of that gamemode are being made?
Do we wait for another RCBot2 update?
No, we shouldn't have to wait until more maps get hardcoded.
Solution Proposal
addons/rcbot2/config/<modname>/bot_gamemodes.cfgExample with Team Fortress 2: