joe91 / fun-bots Goto Github PK
View Code? Open in Web Editor NEWA highly customizable and configurable bot mod for your Venice Unleashed Battlefield 3 server.
Home Page: https://discord.gg/zNk3qCzk6x
A highly customizable and configurable bot mod for your Venice Unleashed Battlefield 3 server.
Home Page: https://discord.gg/zNk3qCzk6x
From time to time this happens. Only solution is to respawn.
No Idea what happens there...
Bots aren't given a grenade so when a player picks up their kit they can no longer throw grenades.
provided is a quick workaround, but doesn't take advantage of the dynamic weapon system:
diff --git "a/ext/Server/BotSpawner.lua" "b/ext/Server/BotSpawner.lua"
index 043c2fa..9292c06 100644
--- "a/ext/Server/BotSpawner.lua"
+++ "b/ext/Server/BotSpawner.lua"
@@ -370,6 +370,7 @@ function BotSpawner:getKitApperanceCustomization(team, kit, color, primary, pist
local pistolWeapon = ResourceManager:SearchForDataContainer(pistol:getResourcePath())
local knifeWeapon = ResourceManager:SearchForDataContainer(knife:getResourcePath())
+ local grenadeWeapon = ResourceManager:SearchForDataContainer('Weapons/M67/U_M67')
soldierCustomization.activeSlot = WeaponSlot.WeaponSlot_0
soldierCustomization.removeAllExistingWeapons = true
@@ -391,6 +392,10 @@ function BotSpawner:getKitApperanceCustomization(team, kit, color, primary, pist
secondaryWeapon.weapon = SoldierWeaponUnlockAsset(pistolWeapon)
secondaryWeapon.slot = WeaponSlot.WeaponSlot_1
+ local thrownWeapon = UnlockWeaponAndSlot()
+ thrownWeapon.weapon = SoldierWeaponUnlockAsset(grenadeWeapon)
+ thrownWeapon.slot = WeaponSlot.WeaponSlot_6
+
local meleeWeapon = UnlockWeaponAndSlot()
meleeWeapon.weapon = SoldierWeaponUnlockAsset(knifeWeapon)
meleeWeapon.slot = WeaponSlot.WeaponSlot_7
@@ -448,6 +453,7 @@ function BotSpawner:getKitApperanceCustomization(team, kit, color, primary, pist
soldierCustomization.weapons:add(secondaryWeapon)
soldierCustomization.weapons:add(gadget01)
soldierCustomization.weapons:add(gadget02)
+ soldierCustomization.weapons:add(thrownWeapon)
soldierCustomization.weapons:add(meleeWeapon)
return soldierKit, appearance, soldierCustomization
Edit: new chapters aim performance on 2.6.2021:
bot performance fov efficiency aim mapping
further bot performance options
restructured performance
The spawnmode keep_player count seems to cause crash when players fill 1 team completely.
Please update keep_playercount
if you can reproduce the issue or see fit
a if possible disable botspawn and teambalancing on us team at some point.
b kick bots on the full side when one or both teams overflow with real players.
c limit (real) players
Request; I find it fit to ask to prioritize conquest players for more casual players in vu and the server after all its battlefield.
Option b looked natural, but i cant judge the difficulty. in my eyes it allows real Player Overflow stabilize for servers with auto spawnmode keep_playercount opened towards high player numbers
hotfix kick bots who dont find a spawn after 10 seconds. Check to add bots time limit 20 seconds
Encompassing any of the following "the chosen team overflow status script" when override for spawnmmode is implemented and activated by running parts of the test for space on the teams to reactivate spawnmode from manual every now and then.
reset spawnmode = keep_playercount
On the start of the script add player count, kick the full team and changing to manual asap, "easy" or "full", and a live_override test and set mode to manual and balancing back on if low enough
On the < easy > way & effective player-count-keeping runs until spawnplayerlimit can be reached /2 -1, here the number of real players on the server is measured to potentially disrupt the game.
here players from 1 team would keep playing players and bots asymmetrically always.
The trigger for stabilizing to manual could look like this
if ( real_players_count << player_count(( spawnmode_players_limit / 2 ) -1 )
&& (real_players_count << player_count( spawnmode_players_limit) )
== false
spawnmode(manual)
On the teams are monitored closely by the mod. With < full > there is a spawnmode on the teams until both have to be deactivated. The teams bots get kicked one after the other but only if they are full of players.
until spawnplayerlimit -2 only disruptions to the server - full teams are recognised and compensated.
-- Implementation constructions of some steps in order of appearance and no relation to eachother other than the apparent.
$$ counting teamlimits for bots on each team
[...]
[...]
count_real_players(int)
##set
int teamlimit
##to
teamlimit =spawmode_player_limit / 2
when new real_player joins
{
$$So both teams run a real player count based trigger
boolean playerslimitreached
int 123
123= 1
for 123 << 2
{
newplayer_ID() player_joins() or real_player_teamchanges() --- trigger
if (team_count_ID(123) == teamlimit -1
{
{
kick_bots_team_ID(123)
123=123+1
}
$$count real players in team
if ( real_players_sum() >> 10 )
{
keep_playercount_switch()
{
team_ID()
spawnmode_manual()
kick_bots()
count_real_players()
int i
int real_players_sum
}
i = 0
for ( i << 2 ) ---- kick full teams
{
team(i),
i=int
for team_ID(i)
{
if real_players_sum(i) >> spawnmode_limit()/2 ----lock changes in spawnmode
{
{
team_real = true
spawnmode = spawnmode_manual()
run kick_bots_teamID(i)
}
}
i = i +1
}#if
}#for
}#if
}#if
}#for
activate two step tracing with lower res trace print and call
for distance over 30 or fixed to max attack distance zone2 40 -80, or vehicles and snipers.
locking fov with larger spots to aspect fov zones on bots in vehicles and snipers
bot attack mode aspect fov alignment with longer range.
triggered by a fake fire on a teammate got hit/ spotted him.
method: raytracing activates a blind carbon copy shot with 100% accuracy to all others or direct damage so the bots go into fov aspect aiming.
function random(0.4)
random() 0.5 function group prediction
ai script moves
fov efficiency mapping
activate two step tracing with lower res trace print and call
for distance over 30 or fixed to max attack distance zone2 40 -80, or vehicles and snipers.
locking fov with larger spots to aspect fov zones on bots in vehicles and snipers
bot attack mode aspect fov alignment with longer range.
triggered by a fake fire on a teammate got hit/ spotted him.
method: raytracing activates a blind carbon copy shot with 100% accuracy to all others or direct damage so the bots go into fov aspect aiming.
function random(0.4)
height differences and strategic map points for vehicles present challenges for servers in terrain especially with vehicles
examples: helicopters, jeeps, quads, bikes
to make bots an alert level based on hard targets map or less focussed in general while and air target is zoning them.
Such possibly a hard targets map could be a set of fixed speed and hightmap values actualised for vehicles every 20 seconds. this would give pilots a break too.
add limited attention aspects
Add aiming filters that will ignore hard targets by smart raytracing or Reducing bot behavior-distance globally for the 2 seconds of veehicle encounter
Options for possible factors
a based heightdelta or better hightvalue map on temporarily setting attack distance to 30 for the bot who detected vertical offset, i.e. straight number bots
b based on disabling attack mode
c making air vehicles armoured
d making it invisible on raytracing because moves fast?
Alertlevel idea A
Add 2d rays filtering after starting fire with horizontal rays with 70m thickness for recognition filtering
optional
canceling raytracing too
force another ray thickness for another class
force verctical 2d raytracing for vehicles
Alertlevel idea B
based on adding a speedvalue test of the target,
idea 2
based on target type add speed based or hight based randomness to raytracing result to lower cpu
ignore target.
randomized to 0.4
idea 2 B
add measure height (ideally from terrain heightmap)
add detect_vehcile()
create unfocus()
*set attack distance to 30
refreshing time for 10 seconds
either
randomized to 0.4
or set
increasing limitinr_vertical_aiming_bots until set_vertical_aim_limiter
idea 1
add exception for tracing process
for (raytrace() == 1 ) --- sucessful raytracing
[]
if
{(heightmap_player_aiming 2 > heightmap_player_1 + 30)
create focus set attack distance 30 time ally for 20 seconds
{
[]
else continue
...
random() > 0-.4
Im afraid that "record traces" have the same problem...and im not sure if it is the system permission problem(since everything "have to" run as the fxxking Administrator hh)
for example I change this function to '2' and click "save"(yes,save,not"temp... save"):
theoretically this line should be :
maxReconBots = 2, -- maximum number of Bots with Recon Kit
howerver when i open the config.lua :
maxReconBots = -1, -- maximum number of Bots with Recon Kit
Never changed...
Rush - Kharg Island, at the defenders deploy point when you are at the last MComs
Infantry spawn points
The infantry spawns near the containers which makes them extremely easy to spawn kill.
The spawn points should be moved further away from the containers in an area where the attackers cannot access the defenders point, also have them hidden so they cannot be spawned killed.
If I add BOTs to the same team as me they will still decide to shoot at me sometimes. Some of the time they ignore me but then all of a sudden they start attacking me as if I am an enemy.
Once they start attacking me they continue to do so.
With friendly fire turned off their bullets don't do any damage but if I get close enough and they melee me then that does do damage, even with friendly fire turned off.
32 v 32 bots on Karkand and other maps, Only about 20% of bots on each team shoot other bots or players. The rest just move around and do not react to enemy players or bots at all.
I have setup a bot slaughter server with 16 bots on the enemy team. sometimes i will aggro one bot and then suddenly every bot in the server is now facing me and spraying wildly. I have attempted to kick and respawn, kill and respawn, but they continue. It seems once they enter this state, they no longer aggro on any other players.
Already mentioned this to Joe and he does want to look at it when he has more time.
The BOTs are joining Squads but the Squads are locked so nobody else can join. Also now when you join (a player) you are no longer put into a Squad at all.
Would it be possible to add varied BOT settings for:
botAimWorsening
BotSniperAimWorsening
fovForShooting
botAttackMode
aimForHead
botFirstShotDelay
You could do it in the config.lua like this:
-- BOT Settings 1
First lot of settings here.
-- BOT Settings 2
Second lot of settings here.
-- BOT Settings 3
Third lot of settings here.
-- BOT Settings 4
Fourth lot of settings here.
Then have the BOTs use them like this:
BOT 1 - Uses BOT Settings 1
BOT 2 - Uses BOT Settings 2
BOT 3 - Uses BOT Settings 3
BOT 4 - Uses BOT Settings 4
BOT 5 - Uses BOT Settings 1
BOT 6 - Uses BOT Settings 2
BOT 7 - Uses BOT Settings 3
BOT 8 - Uses BOT Settings 4
...and so on.
This way we can introduce a varied level of expertise rather than all of the BOTs having to be the same level. This would make them feel more natural/human.
I am using the vanilla 1.7.15
Images that are currently in the documentation/traces.md
files should be uploaded using the Github CDN so we can remove them out of the documentation/images
folder. These images should not been in the project as they are only used for documentation.
When try to running at 30 or 60hz, the server crash
Your BOTs are base camping! ;-)
They are attacking enemy players even when the players are still inside the deployment area.
This is using the latest smart-nodes build.
Hello.
On any conquest game, bots respawn directly around any deploy-point (Eg. point A, point B). However, whenever this point is being taken over, they spawn on that point. This allows the enemies to spawn-kill these bots.
When a player spawns on a deploy point which is being taken over, they do not spawn in the sight of the enemy but instead further away from the spawn point.
It'd be extremely nice to see bots respawn outside the sight of enemy players for deploy points when respawning.
Raycasts around any respawning bot will cause performance issues.
This issue will be updated once I've gathered new elements.
I'm not sure on the exact requirements for this to happen yet but I can say that sometimes the BOTs are definitely not attacking enemy BOTs.
I think it may be to do with how the BOTs were spawned but I need to test this.
Normally an unspotted enemy player is pinged with the red triangle on the mini-map when they fire a non-suppressed weapon. The BOTs don't.
Can this be made to work the same as with players?
When you start a Trace, will these delete the previous Trace before?
What is the index param on Trace-Command?
If you save the Trace, will be override the previous data?
Just a suggestion for the future - maybe have the BOTs turn and check behind them at random intervals (say every 10-25 meters?) before carrying on the path.
At the moment it is far too easy to follow them from behind if you have their FOV set lower.
Noticed that the time it takes the bots to switch to the smaw/rpg and fire is extremely fast and doesn't emulate an aimed shot.
Most players equips the weapons then takes a short time to aim before firing, whereas the bot seems to fire the microsecond the weapon is selected.
Allow a delay (maybe make it a separate value) to emulate an aimed shot.
Is there any chance you could add an option to have another [x] amount of BOTs spawn when a player joins the server? up to the MAX_NUMBER_OF_BOTS?
You'd need an option to enable it and a setting for how many to spawn when a player joins.
A question whilst I am thinking about it - once the server is full do the BOTs take up slots that will stop more players joining? ...or do they get kicked?
every time when map reset / changes the mod fails to load the db and shows 0 paths loaded, after few restarts it manage to load them and shows 6 paths loaded,
have to mess with it every time the round start...
also settings are not parament saved
A good QoL enhancement would be to allow server owners to customize the button to open the bot-editor in the configuration file. Sometimes the F12 keybind may be used for something.
Example:
Instead of opening the fun-bots settings using F12
, I can open the same menu using PG DOWN
because I modified the Config.lua
and set a key from F12 to PGDOWN.
In Noshahr Canals TDM bots simply dosen't sprint, and some of then spawn in water.
Am using smart nodes branch.
The bots won't spawn etc bcs theres no traces. If I try to record trace it will says "Recording trace 0".
This doesnt happen with master branch.
Hey, I think it would be nice if servers can use hashed passwords for the Bot Editor password. So if the hosting is compromised by pesky hackers, they can't know the password of the Bot Editor menu.
Would it be possible to add teams 3 & 4? Maybe a 'Squad Teams' spawn mode? If not does anyone here know how to change the UI for SDM to TDM? Also, I have attached paths recorded for all maps if anyone is interested. Thanks.
mod.zip
Instead of having one random release cycle, 3 release cycles are needed:
To do:
STABLE
, RC
or DEV
)STABLE
is selected, make a request to https://api.github.com/repos/Joe91/fun-bots/releases/latest?per_page=1
RC
is selected. Make a request to https://api.github.com/repos/Joe91/fun-bots/releases?per_page=1
. This end-point shows the latest STABLE
or RC
version.DEV
is selected, make a request to https://api.github.com/repos/Joe91/fun-bots/tags?per_page=1
If possible, bots should identify vehicle type, and if type = (APC or Tank), then only fire at it with rockets or grenades.
Maybe GreatApo's suggestions here can be used to identify vehicle type/name:
https://community.veniceunleashed.net/t/vehicle-information/2803/2
bug
When removing a waypoint, there are still black dots left on the ground, this is purely a visual bug and does not affect tracing at all. Saving the trace and loading it again will remove them.
This is a visual bug (confirmed by @Joe91 )
At the end of the match, after the countdown timer goes to 0, the client will load for a while and then the load will fail. Turns out the server crashed.
Don't know if there is anything that can be done but the bots are currently attacking anyone they can see within their viewing angle and distance, even if the player is behind objects/buildings.
For example, on Noshahr Canals they will fire at you from the opposite side of the containers even though there is no way they can hit you.
This happened since the earlier 1.5 build but I just noticed this behaviour a few days ago. Sometimes you can change all other accuracy stuff/spawn whatever but if you touch the FOV setttings even just decrease by 10 only 2/16 enemy bots will attack you and none at all from friendly faction. The 1.6 build starts at 160 FOV and only a few bots do attack. When changed to 200, it does work again.
I am going off the presumption that the config option spawnInBothTeams = true is meant to distribute the BOTs spawned by default into both teams. If this is the case then it doesn't.
If I set the config to spawn 30 BOTs by default then all but 1 will spawn on the enemy team and only the 1 BOT on my team. I would expect 15 to spawn on each team.
Is there any chance you could add an option in the config.lua to disable the in game GUI?
For my needs I don't need to use the GUI, I can set up what I want from the config.lua file. Being able to disable the GUI would then remove any possible access to changes by other players.
Hello.
Started to experience a lot of problems with your bots.
First of all it started spueing erros in the console:
Error: stack index 3, expected number, received nil: stack traceback:[C]: in method 'CreatePlayer'[string "BotManager.lua"]:272: in method 'createBot'[string "BotSpawner.lua"]:104: in method 'onLevelLoaded'[string "__init__.lua"]:90
And then bots sometimes dont spawn at all.
Changing settings in Config.lua
doesnt work... fully.
When it started showing erros i re-downloaded this mod and uploaded it to server folder expecting to see that erros would be gone but no.. they are still here.
Another thing that i noticed is that once i moved Config.lua
from old folder to a newly re-downloaded folder, the bot difficulty changed to what i set it to.
If i try to save changes while in-game with F12
some changes persist, some dont...
Hello, and thanks for making such an amazing plugin for Battlefield 3.
Currently, bots only use grenades and RPG (or MSAW) against vehicles and vehicles.
It'd be nice to see that each engineer either spawns with a RPG-like weapon, a JAVELIN-like weapon or a Stinger-like weapon and they can use it on vehicles like players are able to do.
For RPG-like weapons, no change is requested as the way they work is good.
For the locked-on missile launchers, when a bot has an armored vehicle or other object that can be locked on using the missile launchers, they use their weapon against that vehicle by initially locking on the vehicle and firing when the lock on is completed.
I'll be updating this issue whenever a new change comes in mind related to this.
Thanks,
Firjen
Bots are now extremely passive when it comes to shooting at the chopper, for example:
Coming in at low altitude and low speed in the Viper, no bots are shooting except for the engineer that fires rockets at you.
You can literally land right in front of a bot and he won't shoot at you and will only attack when he is so close he will try to knife the chopper.
Regular firearms can do plenty of damage to the chopper due to the low protection of pilot and passanger.
A good sniper will regularly shoot the pilot out of a low flying chopper which I have had a bot emulate - this sadly doesn't seem to happen any more.
strengthen the bots presence on conquest and rush per player recounting bot spawn on respective teams
2 solutions
from current players team, remove 2 to make space for endless players, too
from side not declared bot team default. remove 2
optionally under fixed spawn, bots per player.
Since I know that every setting(maybe include trace data?) is written into mod.db(best thanks Joe91!)
Example like:
Player record Norshal TDM trace 1 ->Save trace data into %funbotfolder%/traces/MP_018/TDM/trace1.db
Record Norshal TDM CQ trace 2 ->Save trace data into %funbotfolder%/traces/MP_018/TDM_CQ/trace2.db
Record Norshal Conquest trace 3 ->Save trace data into %funbotfolder%/traces/MP_018/Conquest/trace3.db
.../trace15.db(15 traces in total)
I dont know if it is a good idea or not(increase your working time on reconstructing code...),but I think we can share our trace file ,perfect the botroad and reduce your workload😊
I noticed in Conquest that the BOTs are firing their standard weapons at enemy players in the air vehicles.
I would suggest that a check needs putting in place that if the enemy player is in a Jet or Attack Helicopter then don't bother firing at them unless the BOT has a stinger. If the BOT does have a stinger then switch to that and fire that at the enemy.
Already spoke to Joe about this but I'm registering it on here so others know that it is already being looked at.
When BOTs kill players their kill count does not go up on the scoreboard and there is no entry for the kill in the kill feed.
Joe says that it looks like it may not be possible to do but he's not giving up.
Noticed this on Karkand vs 2 bots playing Conquest Asault: having control of all points (A-E), I had a bot (without any other bots nearby) spawn on D; killed the bot and immediately having the second bot spawn where the first one had appeared.
Expected:
Bots will follow spawn rules of "spawn on controlled point, squad mate/leader"
Ran a game vs. bots on Gulf of Oman and noticed the console for the VU server was filled with an error from Funbots:
[string "Bot.lua"]:422: Attempted to access a destroyed player object.stack traceback:[C]: in metamethod 'index'[string "Bot.lua"]:422: in method '_updateAiming'[string "Bot.lua"]: ...
(sorry, that's all I can see in my console and I don't have a log with more details - see attached screenshot),
The No-PreRound mod issue is back in v.1.7.0.13, i.e bots remains inactive and when killed, they do not respawn.
Apparently the BOTs take a normal player slot - so if I have a 32 man server and there are 10 BOTs spawned then only 22 players can join the server before it is full and nobody else can join.
I would like to suggest that a feature be added to get around this:
When a player joins the server a check should be made to see if the server has reached capacity, if it has and there are BOTs spawned then a BOT should be kicked.
This would then make sure that the full capacity of the server can be filled by players and the BOTs could still be available whilst the server is populating.
Maybe add an option to enable/disable the feature as some might not want it?
The bots just run into the redzone instead of waiting until the zone gets unlocked.
add a tweak/function to update settings to n sector markers n=1,2,3,4 for 2 diffiulties and 2 gametypes (large and small). and return to 0 if unconfigured at the restart of the bots from idle.
access "soft setting" bot configs automatically or by listening to chat vote
add a function to define sector condititions gametype, difficulty
1 and 2 =n for gametype difficulty small specific A and specify vote command for difficulty 1 or 2 (large 3 and 4)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.