X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fbot%2Fdefault%2Fbot.qc;h=3b9dd7c60ccd8a5b878bb9a01a5e3e2b4a91442c;hb=5444bd39fcdcc064f706f3dea516dbc29e3b06a0;hp=bcdc32e8d5e274154590f33cc290c859c7d1adab;hpb=5f12d827aec80b869ab1f213b14bfaff7dc7d6b5;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/bot/default/bot.qc b/qcsrc/server/bot/default/bot.qc index bcdc32e8d..3b9dd7c60 100644 --- a/qcsrc/server/bot/default/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -533,18 +533,18 @@ void autoskill(float factor) bestbot = max(bestbot, it.totalfrags - it.totalfrags_lastcheck); )); - LOG_TRACE("autoskill: best player got ", ftos(bestplayer), ", "); - LOG_TRACE("best bot got ", ftos(bestbot), "; "); + LOG_DEBUG("autoskill: best player got ", ftos(bestplayer), ", "); + LOG_DEBUG("best bot got ", ftos(bestbot), "; "); if(bestbot < 0 || bestplayer < 0) { - LOG_TRACE("not doing anything"); + LOG_DEBUG("not doing anything"); // don't return, let it reset all counters below } else if(bestbot <= bestplayer * factor - 2) { if(autocvar_skill < 17) { - LOG_TRACE("2 frags difference, increasing skill"); + LOG_DEBUG("2 frags difference, increasing skill"); cvar_set("skill", ftos(autocvar_skill + 1)); bprint("^2SKILL UP!^7 Now at level ", ftos(autocvar_skill), "\n"); } @@ -553,14 +553,14 @@ void autoskill(float factor) { if(autocvar_skill > 0) { - LOG_TRACE("2 frags difference, decreasing skill"); + LOG_DEBUG("2 frags difference, decreasing skill"); cvar_set("skill", ftos(autocvar_skill - 1)); bprint("^1SKILL DOWN!^7 Now at level ", ftos(autocvar_skill), "\n"); } } else { - LOG_TRACE("not doing anything"); + LOG_DEBUG("not doing anything"); return; // don't reset counters, wait for them to accumulate } @@ -571,9 +571,8 @@ void autoskill(float factor) void bot_calculate_stepheightvec() { stepheightvec = autocvar_sv_stepheight * '0 0 1'; - jumpstepheightvec = stepheightvec + - ((autocvar_sv_jumpvelocity * autocvar_sv_jumpvelocity) / (2 * autocvar_sv_gravity)) * '0 0 0.85'; - // 0.75 factor is for safety to make the jumps easy + jumpheight_vec = (autocvar_sv_jumpvelocity ** 2) / (2 * autocvar_sv_gravity) * '0 0 1'; + jumpstepheightvec = stepheightvec + jumpheight_vec * 0.85; // reduce it a bit to make the jumps easy } float bot_fixcount() @@ -679,6 +678,19 @@ void bot_serverframe() if (time < 2) return; + if(autocvar_skill != skill) + { + float wpcost_update = false; + if(skill >= autocvar_bot_ai_bunnyhop_skilloffset && autocvar_skill < autocvar_bot_ai_bunnyhop_skilloffset) + wpcost_update = true; + if(skill < autocvar_bot_ai_bunnyhop_skilloffset && autocvar_skill >= autocvar_bot_ai_bunnyhop_skilloffset) + wpcost_update = true; + + skill = autocvar_skill; + if (wpcost_update) + waypoint_updatecost_foralllinks(); + } + bot_calculate_stepheightvec(); bot_navigation_movemode = ((autocvar_bot_navigation_ignoreplayers) ? MOVE_NOMONSTERS : MOVE_NORMAL); @@ -728,7 +740,7 @@ void bot_serverframe() botframe_spawnedwaypoints = true; waypoint_loadall(); if(!waypoint_load_links()) - waypoint_schedulerelinkall(); + waypoint_schedulerelinkall(); // link all the autogenerated waypoints (teleporters) } if (bot_list)