Printable Version of Topic

Click here to view this topic in its original format

RCBot Forums _ Svencoop 5 Angelscript _ Download

Posted by: Cheeseh Oct 28 2018, 09:55 PM

RCBot for Svencoop 5 (Angelscript)

This version of RCBot has been created from scratch with some code converted from RCBot1 and inspired by RCBot2 code. It uses the built in plugin system "AngelScript" that comes with Svencoop 5.

instructions and download here:

https://github.com/rcbotCheeseh/RCBotSven5

Usage
just download all files (Download/Clone as zip) extract into the BotManager directory in scripts/plugins. (overwrite) The files will overwrite the current "Bot" scripts as it was based on the sample.

Features
Bots can run around / shoot enemies, pick up ammo/health/weapons/armor, use health/HEV chargers, use teleports, take cover, press buttons (at objective points -- not tested), shoot breakables (not tested). (i.e. its a work in progress).
Bots CAN'T use ladders yet, or secondary fire, or use grapple etc yet or other fancy stuff.

Commands:

CODE

addbot            Adds a new bot
waypoint_off        Display waypoints off
waypoint_on        Displays waypoints on
waypoint_add        Adds a new waypoint
waypoint_delete        Adds a new waypoint
waypoint_load        Loads waypoints
waypoint_save        Saves waypoints
pathwaypoint_create1     Adds a new path from
pathwaypoint_create2     Adds a new path to
pathwaypoint_remove1
pathwaypoint_remove2
waypoint_clear
waypoint_info        (print waypoint types on current waypoint)
waypoint_givetype     give waypoint type
waypoint_removetype     remove waypoint type
waypoint_toggletype
waypoint_convert_type (from) (to).    Convert waypoint types
debug                  debug messages toggle
godmode         god mode
noclip             noclip
notarget            (no target mode)
killbots         kills all bots

<to add - notouch (needed for waypointing)>



all commands accessible via command "as_command rcbot.<command>" e.g. "as_command rcbot.addbot"

DEBUGGING

if you run into trouble (usually becuase of a nightly build) find the problem by first using the commands

CODE

developer 1
as_log_level 2
as_reloadplugins


note down any errors and report them

I'm needing waypoints redone These are now "rcwa" files in a different format. I made a program to convert rcbot1 waypoints to these. Downloadable here:


Attached File  RCBotWPTConverter.zip ( 502.51k ) Number of downloads: 4293

Posted by: madmax2 Oct 30 2018, 05:46 AM

QUOTE
the WP converter keeps all types.
no trouble to make it net 4 I don't think.
just fixed bad bot aiming, at least they are getting frags now. Theyre pretty hardcore now

Sounds good
QUOTE
TBH I think most waypoints need fixing / redone anyway.

Yeah I agree, many of the old maps have broken or incomplete wpts. We should focus on the stock maps first.

You may want to put all the untested wpts into a seperate pack, at some point? So people know they may not
work well. We could add them back in as we test/fix them, which would take forever without more help...

I'll work on converting the wpts I've uploaded first, so you can know which ones I'll be working on. Most
of them are stock maps...

Request/question : Would it be difficult to change the givetype/removetype commands to a "toggle givetype"
command. This would cut the needed binds in half. I don't see a big need for having the multiple givetype
option on each bind in this game, if removing that would make it easier to implement? Isn't that the way
givetypes work with rcbot2, as a toggle? Maybe copy the code from rcbot2?

I just received my new 24inch monitor/tv for my new/old PC, I'm feel like a kid in a candy store, weeee... tongue.gif

Posted by: Cheeseh Oct 30 2018, 08:41 AM

QUOTE(madmax2 @ Oct 30 2018, 05:46 AM) *

Sounds good

Yeah I agree, many of the old maps have broken or incomplete wpts. We should focus on the stock maps first.

You may want to put all the untested wpts into a seperate pack, at some point? So people know they may not
work well. We could add them back in as we test/fix them, which would take forever without more help...

I'll work on converting the wpts I've uploaded first, so you can know which ones I'll be working on. Most
of them are stock maps...

Request/question : Would it be difficult to change the givetype/removetype commands to a "toggle givetype"
command. This would cut the needed binds in half. I don't see a big need for having the multiple givetype
option on each bind in this game, if removing that would make it easier to implement? Isn't that the way
givetypes work with rcbot2, as a toggle? Maybe copy the code from rcbot2?

I just received my new 24inch monitor/tv for my new/old PC, I'm feel like a kid in a candy store, weeee... tongue.gif


Great -- will need to,as you say, identify broken waypoints. I re-did sandstone cos they were totally off - but the git still contains loads of waypoints that might be of no use. The HL1 campaign in Svencoop has changed and doesn't use the default maps any more so they might need redone somehow

I added a new command "waypoint_toggletype" blindly -- see if it works.

Posted by: madmax2 Oct 30 2018, 08:25 PM

QUOTE(Cheeseh @ Oct 30 2018, 12:41 AM) *

I added a new command "waypoint_toggletype" blindly -- see if it works.

Will test that but, Latest Git build not starting:

CODE
Angelscript log opened
Server started logging Angelscript on map 'sc_another' at: 2018-10-30 12:56:50
ERROR: c:/program files/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/BotManager/BotManager.as (174, 23) : 'flag_to_check' is not declared
ERROR: Plugin script compilation failed
1 Plugin(s) failed compilation
Reloading plugins
Removed 1 plugins
Loading plugins from file 'default_plugins.txt'
2 plugins
Beginning plugin compilation
Included script 'StringUtils'
Included script '../../Cfg'
Beginning plugin 'PlayerManagement' compilation
Starting compilation: 3 scripts
Plugin script compilation succeeded
Registering hook: module 'PlayerManagement', hook 'ClientSay', function 'PlayerManagement::ClientSay'
Adding console command 'plrmgr.admin_slap'
Adding console command 'plrmgr.admin_slay'
Adding console command 'plrmgr.admin_kick'
Adding console command 'plrmgr.admin_ban'
Adding console command 'plrmgr.admin_teleport'
Adding console command 'plrmgr.admin_teleportto'
Adding console command 'plrmgr.admin_sethealth'
Adding console command 'plrmgr.admin_setarmor'
Included script 'UtilFuncs'
Included script 'BotProfile'
Included script 'BotManagerInterface'
Included script 'FileBuffer'
Included script 'CBotBits'
Included script 'BotWaypoint'
Included script 'CBotTasks'
Included script 'BotWeapons'
Beginning plugin 'RCBot' compilation
Starting compilation: 9 scripts
c:/program files/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/BotManager/BotManager.as (152, 1) : Compiling void WaypointToggleType(const CCommand@)
ERROR: c:/program files/steam/steamapps/common/sven co-op/svencoop/scripts/plugins/BotManager/BotManager.as (174, 23) : 'flag_to_check' is not declared
ERROR: Plugin script compilation failed
1 Plugin(s) successfully compiled
1 Plugin(s) failed compilation
Server stopped logging Angelscript at: 2018-10-30 12:58:52
Angelscript log opened
Server started logging Angelscript on map 'sc_another' at: 2018-10-30 12:58:52
Clearing temporary directory './scripts/maps/temp'
Removed 1 plugins
Clearing temporary directory './scripts/plugins/temp'
Clearing temporary directory './scripts/maps/temp'
Server stopped logging Angelscript at: 2018-10-30 12:58:52


Posted by: Cheeseh Oct 31 2018, 07:04 PM

should work now madmax ,, just me being silly since I was coding blind at the time

Posted by: Cheeseh Oct 31 2018, 08:55 PM

QUOTE(Cheeseh @ Oct 31 2018, 07:04 PM) *

should work now madmax ,, just me being silly since I was coding blind at the time

Hey madmax, I updated my waypoint converter on the first post , its now .NET 4.0 compatible... or at least should be..

By the way, they waypoints may be the same and so are the flags, but they bot behaviour may be different. For Example the "end" (previously end level waypoints) should only be 1 per map, and there may be several "important (objective) waypoints. At important waypoints, they will look around for buttons to press, or they might look around for breakables to shoot.

Posted by: madmax2 Nov 1 2018, 03:02 AM

Cool, that will help me, as I don't have sven set up yet on my win7 Pc. I did use several objective wpts in
most of my rcws, so thats good to know. I'll need to change all but the last one to an "important" wpt.
Been busy today, I'm going to spend a couple hours on this tonight, see what I can get done...

Think i'll start with desertcircle, I checked it for fit a long time ago. I don't think it uses any
unsupported givetypes, so should be easy...

I posted this a couple years ago, I think most of that is still good info, but I think survival mode was
added to many maps after that. I'll be working from that list to start with... I believe the sven
developers made the Halflife campaign playable in single player, so it may not need to be done any time
soon?

http://rcbot.bots-united.com/forums/index.php?s=&showtopic=2057&view=findpost&p=14193

One other thing, I made some notes on toonrun series that I didn't post, As I recall, on 2 of the maps it mainly looked like the origin of the map was shifted, an just realigning the wpts to the map would fix most the issues, is there a way to do that?

Also, the last I checked, it is still possible to waypoint with the old MM version of rcbot, if needed, then the wpts could be converted to rcwa...

Posted by: madmax2 Nov 1 2018, 06:04 PM

The new wpt converter didn't work for me, same error message. So I converted a few on my win7 PC. I double checked in installed programs, I have framework 4 Client Profile and Extended v4.0.30319 installed. Also have 3.5, 3.0, 2.0 & 1.1.

The toggletype works perfect, thanks. got my binds set now, notarget & godmode set, think I'm ready... But ran into problems with desertcircle, it might be my XP PC, not sure yet. I did add a couple bots & they did run in the direction they should, but I'm having serious lag on this map, all the wpts refresh every few seconds. I can't see most paths, and the deeper I go into the map even the wpts vanish, but wpt info says they are still there. Think i'll check this map in sc4.8 for lag, but I don't remember having paths and wpts disappear?

Quarter was the opposite, it is a perfect match, the bots are working in it, just didn't have time to fully test it. I changed all the objective/EOL (End) flags except the last one to "important" flags. I may need to tweak the important flags, may not need as many. I was using objective flags in many of my rcw's sorta like a navigation flag, to get bots to patrol an area or take an alternate route, is it ok to use important flags that way (ie. no button nearby)?

There are some unimplemented wpts in this map (crouchjump), but i'm going to leave them in for now, I assume they will just ignor them. I put the crouchjumps at some spawn room doors the old bots had wierd behavior at, slowing them way down. It will be interesting to see if that behavior is gone now, maybe the crouchjumps won't be needed?

Quarter should be ready for upload once I run the bots thru it once or twice, I hope...

I noticed on Jumpers, they are missing jumps more, i think? I need to take a close look and see how they are jumping. Many of the more complex maps have some difficult jumping spots that were extremely difficult to waypoint with the old bots. I spent days working on that first area in sc_Persia. I ended up doing non-standard ways to get bots to make those complex jumps (& human towers). Anyways, most of that can wait for latter after you implement more givetypes. I'll try to give you better feedback on that stuff latter...

For now I'll focus on converting the easier maps and checking wpts for proper fit to the sc5 maps, etc.





Posted by: Cheeseh Nov 2 2018, 07:39 AM

The .net issue night have something to do with the fact that it's using WPF but i thought that was supported in .net 3.0. I can have another look to check it is targeting the correct framework

Not sure about the lag. Don't know how the plugin system handles it. It might cause those issues you re experiencing but i haven't tested with many waypoints yet.

Its fine to use the important waypoint as a milestone. If they don't find any button etc they will just look for the next objective .

Will need to implement crouchjump. I can't remember or not if there was a long jump type , which I'll also need to do.

For maps like quarter, i think there was a defend waypoint type. If not i can add it.

Posted by: Ryusho Nov 2 2018, 01:33 PM

It's wonderful to see that RCbot is back in action basically, even if it's having to be remade on angelscript because of how things have gone, I have actually started to try to waypoint a bit with what is currently available, and well because I find it fun, I -think- I might have the bots able to get to the security key in "Survive" ..maybe, though I am making just a rough initial attempt at making a working waypoint path..., Considering trying another map some too though, since I'm just having to be no-targeted and godmode to while they fight through the map.

Posted by: Cheeseh Nov 2 2018, 08:14 PM

Hi madmax, fixed the waypoint diplay bug -- I think if it draws too many beams it cant draw any more, had to limit the distance.

Posted by: madmax2 Nov 2 2018, 08:47 PM

QUOTE(Cheeseh @ Nov 2 2018, 12:14 PM) *

Hi madmax, fixed the waypoint diplay bug -- I think if it draws too many beams it cant draw any more, had to limit the distance.

Great, yeah there are a lot of wpts in that map, I believe I auto-waypointed parts of it.
QUOTE
For maps like quarter, i think there was a defend waypoint type. If not i can add it.

Defend wpts were for Team Fortress only, I believe that is what you told me... When I tried to add them to
sven, they caused strange behavior for the bots, random freezing I believe. I guess there could be some use
for them in SC5, but I don't think it needs to be high on the priorities...
QUOTE
Will need to implement crouchjump. I can't remember or not if there was a long jump type , which I'll also need to do.

I checked for you, there was just a Jump & crouch-jump in the menus, but for crouch-jump the effect &
console says "Bot will do a LONG JUMP/CROUCH JUMP here". I also combined regular crouch then jump wpts to get a different effect... I used both, for different situations...

--------------------------------------------------------------------------------------------------------------------------
Hey Ryusho, Nice to see you back... Let us know which maps you are working on, I'll be testing/fixing all
my waypoints first. Let us know if you see anything that looks buggy...

Posted by: Cheeseh Nov 2 2018, 09:07 PM

QUOTE(madmax2 @ Nov 2 2018, 08:47 PM) *

Great, yeah there are a lot of wpts in that map, I believe I auto-waypointed parts of it.

Defend wpts were for Team Fortress only, I believe that is what you told me... When I tried to add them to
sven, they caused strange behavior for the bots, random freezing I believe. I guess there could be some use
for them in SC5, but I don't think it needs to be high on the priorities...

I checked for you, there was just a Jump & crouch-jump in the menus, but for crouch-jump the effect &
console says "Bot will do a LONG JUMP/CROUCH JUMP here". I also combined regular crouch then jump wpts to get a different effect... I used both, for different situations...

--------------------------------------------------------------------------------------------------------------------------
Hey Ryusho, Nice to see you back... Let us know which maps you are working on, I'll be testing/fixing all
my waypoints first. Let us know if you see anything that looks buggy...


Okay will make the crouch ump just like long jump (i.e. duck and jump together)

There is "defend" waypoint that I can now use for these maps. not implemented though , but you can still add the types on to the waypoints...

Also just added auto waypoint typing -- if you can think of other situations to auto waypoint type. let me know (i.e. if healthkit nearby it sets added waypoint to health type)

Posted by: Cheeseh Nov 2 2018, 10:52 PM

BTW also just updated the converter to make it more reliable -- it works with more waypoints now too

Posted by: madmax2 Nov 3 2018, 08:18 AM

Thanks, but the converter still won't install on XP... Here is the log, maybe that can be some use?
[edit] Again, I can work around this issue, just FYI...

Dialog Box Error:

CODE
Prerequisite check for system component Microsoft .NET Framework 4.5 (x86 and x64) failed with the

following error message:
"Installation of the Microsoft .NET Framework 4.5 is not supported on this operating system. Contact your

application vendor."


See the setup log file located at 'C:\DOCUME~1\Owner\LOCALS~1\Temp\VSD2.tmp\install.log' for more

information.


Install Log:

CODE
The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [NTProductType] = 1 {int}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 5.1.3 {version}
Running checks for package 'Microsoft .NET Framework 4.5 (x86 and x64)', phase BuildList
Reading value 'Version' of registry key 'HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full'
Read string value '4.0.30319'
Setting value '4.0.30319 {string}' for property 'DotNet45Full_TargetVersion'
The following properties have been set for package 'Microsoft .NET Framework 4.5 (x86 and x64)':
Property: [DotNet45Full_TargetVersion] = 4.0.30319 {string}
Running checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe'
Result of running operator 'ValueEqualTo' on property 'InstallMode' and value 'HomeSite': true
Result of checks for command 'DotNetFX45\dotNetFx45_Full_x86_x64.exe' is 'Bypass'
Running checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe'
Result of running operator 'ValueNotEqualTo' on property 'InstallMode' and value 'HomeSite': false
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'DotNet45Full_TargetVersion' and

value '4.5.50709': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '6.0.0': true
Result of checks for command 'DotNetFX45\dotNetFx45_Full_setup.exe' is 'Fail'
'Microsoft .NET Framework 4.5 (x86 and x64)' RunCheck result: Fail
A prerequisite failed for Package "Microsoft .NET Framework 4.5 (x86 and x64)"
Package failed with message "Installation of the Microsoft .NET Framework 4.5 is not supported on this

operating system. Contact your application vendor."


I think with last build the openslater flags may no longer work. They are trying to run through every door on quarter that has an openslater behind it (1 OL per door).

Been experimenting with important flags on the spawn room door buttons in this map, they were not opening the doors at all without them, but it is still a big problem (they were kinda wonky at these doors with the old rcbot_MM too). Will you have them see the buttons like before? I know they had problems seeing the door button entities on some maps (all tetris maps, 1st button in sc_doc...).

Either way, some kind of door wpt is probably a good idea, maybe create a USE wpt that helps the bots locate where to press E key, a wpt that doesn't depend on them seeing the entity? You could still have them auto detect (see) door buttons, which is nice when it works... I assume with the important wpt the are looking for the entities?

QUOTE
Also just added auto waypoint typing -- if you can think of other situations to auto waypoint type. let
me know (i.e. if healthkit nearby it sets added waypoint to health type)

Ok, I will keep that in mind... It's late now... Time to snooze... keep up the good work, seems like you are making good progress... smile.gif

Posted by: Gordon9999 Nov 4 2018, 11:20 AM

Will you make the random choose of models and colors for the bots like an old RCBot? Or its impossible for AS?

Posted by: Cheeseh Nov 4 2018, 04:27 PM

Looks like its still looking for .net framework 4.5 , thought i fixed it... maybe an easy fix. Will check later...

Yeah . For openslater i was worried bots wouldn't go through doors that were unlocked but closed ... so changed the check, but notified that also. Updated in the latest version. Don't know if that fixes it though.

Am thinking of adding a task to find a door button if it's locked by a button and their next path is through a door without the need of special waypoint types.

Bot models are done per profile. Pongo (ducky) has added a version with reading. .ini files just like the previous bot. Maybe can add a random model tour but in angel script u can't check all existing models. Just maybe random from a selection of models . Perhaps from a text file

Posted by: madmax2 Nov 5 2018, 07:45 AM

QUOTE
Hi madmax, fixed the waypoint diplay bug -- I think if it draws too many beams it cant draw any more, had to limit the distance.


Yes, that fixed it, Thanks smile.gif

The openslater bug is still present in the Nov 4 build... sad.gif

Didn't get much time with this today, hopefully more time in the next couple days, so I can upload some converted WIP wpts... I've attached quarter rcwa in case you want to look for yourself. I'll move it to the wpts forum in the next few days... wink.gif

[edit] rcwa added to git

Posted by: Cheeseh Nov 5 2018, 09:04 AM

QUOTE(madmax2 @ Nov 5 2018, 07:45 AM) *

Yes, that fixed it, Thanks smile.gif

The openslater bug is still present in the Nov 4 build... sad.gif

Didn't get much time with this today, hopefully more time in the next couple days, so I can upload some converted WIP wpts... I've attached quarter rcwa in case you want to look for yourself. I'll move it to the wpts forum in the next few days... wink.gif


cool , on the cusp of fixing the openslater stuff - will be doing that tonight.

Posted by: Cheeseh Nov 5 2018, 08:10 PM

QUOTE(Cheeseh @ Nov 5 2018, 09:04 AM) *

cool , on the cusp of fixing the openslater stuff - will be doing that tonight.

opens later should be fixed now .. also buttons dont need to be visible at important waypoints... still to add bots pressing buttons when needing to get through doors


ps. added your desertcircle and quarter waypoint to the git

Posted by: Cheeseh Nov 7 2018, 06:48 AM

QUOTE(Cheeseh @ Nov 5 2018, 08:10 PM) *

opens later should be fixed now .. also buttons dont need to be visible at important waypoints... still to add bots pressing buttons when needing to get through doors
ps. added your waypoint to the git


Hey madmax . I added a new command

Rcbot.waypoint_convert_type (from) (to)

E.g.

Rcbot.waypoint_convert_type end important

Will change all end waypoints to important waypoints

Needed for this version

Posted by: madmax2 Nov 7 2018, 06:43 PM

Sorry for late reply, having a mechanical problem with my car I must tend to immediately. sad.gif

I did test openslater, and that is working good now... smile.gif

Rcbot.waypoint_convert_type (from) (to) sounds good. So I could convert all crouch-jump wpts to jump wpts? Or any wpt type to any other wpt type?

I had begun working on converting desertcircle again, changed all objectives to important. I'll check out what you did later today, thanks. So with this new command I could use that to change all objective to important wpts?

FYI, Quarter still had some buggyness with the doors in the spawn rooms and the ammo rack in 3rd area spawn (defend computer area?). So I didn't consider it done yet. And desertcircle has some unimplemented/untested ladders. I assume you will update the git as I post updated/fixed wpts?

I was going to start a WIP topic for converted rcwa's in the waypoints forum, and put all my conversions in one topic, and one zip, where you could just copy the whole zip over to the git each time i update it with new conversions/fixes, etc... Just haven't got enough done to do that yet...

I'm hoping to get more done this week, now that i'm back home now. Hopefully the car problem won't be a huge drain on my time?

Posted by: Cheeseh Nov 7 2018, 06:50 PM

QUOTE(madmax2 @ Nov 7 2018, 06:43 PM) *

Sorry for late reply, having a mechanical problem with my car I must tend to immediately. sad.gif

I did test openslater, and that is working good now... smile.gif

Rcbot.waypoint_convert_type (from) (to) sounds good. So I could convert all crouch-jump wpts to jump wpts? Or any wpt type to any other wpt type?

I had begun working on converting desertcircle again, changed all objectives to important. I'll check out what you did later today, thanks. So with this new command I could use that to change all objective to important wpts?

FYI, Quarter still had some buggyness with the doors in the spawn rooms and the ammo rack in 3rd area spawn (defend computer area?). So I didn't consider it done yet. And desertcircle has some unimplemented/untested ladders. I assume you will update the git as I post updated/fixed wpts?

I was going to start a WIP topic for converted rcwa's in the waypoints forum, and put all my conversions in one topic, and one zip, where you could just copy the whole zip over to the git each time i update it with new conversions/fixes, etc... Just haven't got enough done to do that yet...

I'm hoping to get more done this week, now that i'm back home now. Hopefully the car problem won't be a huge drain on my time?


change all end waypoints to"important", add one end waypoint at the last hurdle of the map.

the bots will 'jump and crouch' anyway with normal jump waypoints, so maybe need to change the crouch jump name to 'long jump'. so yeah maybe for now best also changing crouch jump to normal jump.



Posted by: madmax2 Nov 9 2018, 06:41 PM

You seem to be making good progress, been following your git changes, nice work... smile.gif

I should have more time today to work on wpts... I worked on & tested intruder last night, tested one of 2 routes. Bots were able to get to the end of the map after a few tweaks. Began work on sc_doc too. I'll probably have a few questions, need to work with the bots a bit more, first...

Should receive my car part today, will only take an hour to replace it... Then I can focus my time on this... smile.gif

Posted by: Poka Nov 10 2018, 07:11 AM

Cool to see RCBot active again cool.gif

I tested it on Windows and seemed to work just fine but on linux the bots crash the server almost immediately. I ran with developer 2 and got this:

CODE

SUB_Remove called on entity with health > 0
L 10/11/2018 - 08:14:02: FATAL ERROR (shutting down): NUM_FOR_EDICT: bad pointer
FATAL ERROR (shutting down): NUM_FOR_EDICT: bad pointer


Any idea what could be causing this?

Posted by: Cheeseh Nov 10 2018, 08:52 AM

QUOTE(Poka @ Nov 10 2018, 07:11 AM) *

Cool to see RCBot active again cool.gif

I tested it on Windows and seemed to work just fine but on linux the bots crash the server almost immediately. I ran with developer 2 and got this:

CODE

SUB_Remove called on entity with health > 0
L 10/11/2018 - 08:14:02: FATAL ERROR (shutting down): NUM_FOR_EDICT: bad pointer
FATAL ERROR (shutting down): NUM_FOR_EDICT: bad pointer


Any idea what could be causing this?


Try to run with "as_log_level 3" and developer 2 then if it happens again check the latest log in svencoop/logs

Posted by: Poka Nov 10 2018, 12:43 PM

QUOTE(Cheeseh @ Nov 10 2018, 10:52 AM) *

Try to run with "as_log_level 3" and developer 2 then if it happens again check the latest log in svencoop/logs


Cant get anything but the bad pointer error in the logs. Nothing in angelscript logs either. Also seems like the SUB_removed line was a one time thing only and not the problem.

Posted by: RoboCop Nov 10 2018, 01:55 PM

QUOTE(Poka @ Nov 10 2018, 12:43 PM) *

Cant get anything but the bad pointer error in the logs. Nothing in angelscript logs either. Also seems like the SUB_removed line was a one time thing only and not the problem.

Well those BAD POINTER crashes appear to occur a lot in Osprey map, but some other maps maybe affected by that crash.

Posted by: Poka Nov 10 2018, 02:41 PM

QUOTE(RoboCop @ Nov 10 2018, 03:55 PM) *

Well those BAD POINTER crashes appear to occur a lot in Osprey map, but some other maps maybe affected by that crash.

Tried hplanet, sc_another and osprey. I get bad pointers in all of them in under a minute.

Posted by: Solokiller Nov 12 2018, 01:46 PM

The Bot Manager script was a sample that i made, it was never tested much so it probably has some issues. At a glance i think the issue is that bot entity handles are retained between map changes, which can result in the edict handle becoming invalid.

This puts the address for it outside the range of entities (sv.edicts <= handle < sv.edicts + sv.num_edicts * sizeof( edict_t ) ) which causes this error to occur when an engine function tries to get the index for an entity.

To fix this, always destroy all bots on map change and recreate them when a new map is started. The hooks for both events should already be available.

If that isn't the cause i'll take a closer look and see what i can find out. If it's happening on Linux then it should be possible to produce a stack trace, which should narrow things down. Using GDB it may be possible to get some more information.

Posted by: Cheeseh Nov 12 2018, 08:00 PM

QUOTE(Solokiller @ Nov 12 2018, 01:46 PM) *

The Bot Manager script was a sample that i made, it was never tested much so it probably has some issues. At a glance i think the issue is that bot entity handles are retained between map changes, which can result in the edict handle becoming invalid.

This puts the address for it outside the range of entities (sv.edicts <= handle < sv.edicts + sv.num_edicts * sizeof( edict_t ) ) which causes this error to occur when an engine function tries to get the index for an entity.

To fix this, always destroy all bots on map change and recreate them when a new map is started. The hooks for both events should already be available.

If that isn't the cause i'll take a closer look and see what i can find out. If it's happening on Linux then it should be possible to produce a stack trace, which should narrow things down. Using GDB it may be possible to get some more information.


This error appears to happen whilst not changing map though, maybe even on the first map. I actually would have thought that it wouldn't matter to clear the bots per map change as it appears, correct me if I'm wrong, that the plugins are reloaded at map change -- and all memory would be flushed ? and /or do you mean here:

CODE


        HookReturnCode MapChange()
        {
// <--- put something in here?
            m_Bots.resize( 0 );

Posted by: Solokiller Nov 12 2018, 08:06 PM

Unless they've changed it plugins are not reloaded on map change.

Bots are dropped on changelevel so a handle to its CBasePlayer instance will become invalid. You should clear the handles out to avoid problems.

If the problem isn't related to this then you should run it with GDB to get a stack trace by putting a breakpoint in the NUM_FOR_EDICT function in its error condition code.

Posted by: Cheeseh Nov 14 2018, 06:41 PM

QUOTE(Solokiller @ Nov 12 2018, 08:06 PM) *

Unless they've changed it plugins are not reloaded on map change.

Bots are dropped on changelevel so a handle to its CBasePlayer instance will become invalid. You should clear the handles out to avoid problems.

If the problem isn't related to this then you should run it with GDB to get a stack trace by putting a breakpoint in the NUM_FOR_EDICT function in its error condition code.


Hi solokiller , just to confirm --- which handle to CBasePlayer and when ? When bot is "disconnected" is that good enough? Also you mean the m_pPlayer handle ? Just set to null? Or do something more complicated? Thanks.

@Poka

Also if you connect to a server thinking you can use "as_command rcbot.addbot" , this might cause the same error. you must use rcon so you are executing the command on the server, not the client.

Posted by: Solokiller Nov 14 2018, 06:49 PM

QUOTE(Cheeseh @ Nov 14 2018, 07:41 PM) *

Hi solokiller , just to confirm --- which handle to CBasePlayer and when ? When bot is "disconnected" is that good enough? Also you mean the m_pPlayer handle ? Just set to null? Or do something more complicated? Thanks.

@Poka

Also if you connect to a server thinking you can use "as_command rcbot.addbot" , this might cause the same error. you must use rcon so you are executing the command on the server, not the client.


Yeah the CBasePlayer handle. When a player is dropped the entity instance is also freed, whether it's a real or fake client doesn't matter.

Posted by: w00tguy123 Nov 16 2018, 09:11 PM

Someone ran the osprey map with some bots and a debugger and saw this after the crash:

QUOTE
#3 0xe3616dbf in UTIL_FindEntityByClassname (pStartEntity=0x86c0b38, szName=0x8348ac0 "*") at [redacted]

Probably a corrupted reference passed to that at some point:
https://github.com/rcbotCheeseh/RCBotSven5/search?q=FindEntityByClassname&unscoped_q=FindEntityByClassname

Posted by: Solokiller Nov 16 2018, 09:16 PM

Yeah the problem is probably that the entity that the handle in BotVisibles.as points to is removed between frames. Use an EHANDLE and it should be good, just make sure your code accounts for handle invalidation correctly.

If passing null is acceptable for your use case then it should work once it's an EHANDLE.

If you're wondering why the entity can be removed, it's because the type is registered with reference counting disabled so Angelscript handles to it don't keep it alive.

Posted by: Cheeseh Nov 17 2018, 11:40 AM

QUOTE(Solokiller @ Nov 16 2018, 09:16 PM) *

Yeah the problem is probably that the entity that the handle in BotVisibles.as points to is removed between frames. Use an EHANDLE and it should be good, just make sure your code accounts for handle invalidation correctly.

If passing null is acceptable for your use case then it should work once it's an EHANDLE.

If you're wondering why the entity can be removed, it's because the type is registered with reference counting disabled so Angelscript handles to it don't keep it alive.


Hmm so what would be a quicker way to iterate through all entities on map without doing the maxEntities thing (too many loops of nothing) and avoiding this issue?? I remember w00tguy did some experiments . Though I'd rather not iterate too much pretty frame otherwise there'd be too much slow down of there are many bots

Posted by: Solokiller Nov 17 2018, 11:42 AM

Just store entities in an EHANDLE if you intend to keep it around for more than a frame. In other words, if you're just doing a while (FindEntitiesXXX) type loop you can use the entity handle directly, if you store it in a member or global or whatnot store it as an EHANDLE.

Posted by: Poka Nov 17 2018, 03:51 PM

Seems like the crash issues have mostly gone after the latest updates. Good work cool.gif

Posted by: Ryusho Dec 6 2018, 11:14 PM

QUOTE(madmax2 @ Nov 2 2018, 03:47 PM) *


--------------------------------------------------------------------------------------------------------------------------
Hey Ryusho, Nice to see you back... Let us know which maps you are working on, I'll be testing/fixing all
my waypoints first. Let us know if you see anything that looks buggy...



Heh, well at the moment I am manually Waypointing SC Tetris 1, ...Apparently I had some waypoints on my system that lead to the spawn area, and it was buggy there, since it had 'tank' waypoints at the buttons to open the spawn gate, but I fixed that and got them to open it.. *well i had to poke one button as they were all clustering on the same button..back and forth* but now I'm working on getting the pathing through it, and it's definitely interesting to do since I don't actually know the map that well myself, so I am learning it as I go.

*Edit* ..and akwardly I am having to look up a walkthrough for it because I got lost XD

Posted by: madmax2 Dec 7 2018, 12:55 AM

QUOTE(Ryusho @ Dec 6 2018, 03:14 PM) *

Heh, well at the moment I am manually Waypointing SC Tetris 1, ...Apparently I had some waypoints on my system that lead to the spawn area, and it was buggy there, since it had 'tank' waypoints at the buttons to open the spawn gate, but I fixed that and got them to open it.. *well i had to poke one button as they were all clustering on the same button..back and forth* but now I'm working on getting the pathing through it, and it's definitely interesting to do since I don't actually know the map that well myself, so I am learning it as I go.

*Edit* ..and akwardly I am having to look up a walkthrough for it because I got lost XD

Heh Heh, yeah go for it, tetris maps were like the last ones I would attempt wink.gif ... I remember those buttons would not work for the old bots, and was curious if they would now... unsure.gif

Posted by: RoboCop Dec 15 2018, 07:38 PM

A guy was asking me how to install RCBot AS for Sven Co-op and I've noticed the Github readme didn't had a installation guide for him to know how to install RCBot AS. Maybe wise to type that up.

Posted by: Cheeseh Dec 17 2018, 07:05 PM

QUOTE(RoboCop @ Dec 15 2018, 07:38 PM) *

A guy was asking me how to install RCBot AS for Sven Co-op and I've noticed the Github readme didn't had a installation guide for him to know how to install RCBot AS. Maybe wise to type that up.


I had a crappy installation guide before, I've updated it now --- sort of --- let me know if it is easy to follow or not (see README.MD in GitHub)


https://github.com/rcbotCheeseh/RCBotSven5

Posted by: RoboCop Dec 18 2018, 09:28 PM

Well its hard for me to see from their point of view as those guys don't understand English and Google Translate isn't 100% reliable.

Posted by: Ryusho Dec 22 2018, 03:43 AM

QUOTE(madmax2 @ Dec 6 2018, 06:55 PM) *

Heh Heh, yeah go for it, tetris maps were like the last ones I would attempt wink.gif ... I remember those buttons would not work for the old bots, and was curious if they would now... unsure.gif


The buttons work with the new bots, THough sometimes it can be a bit odd to get them to trigger them together, So sometimes you need to give them a hand, but they should get them eventually....I hit a stall where I got completely lost on how to finish a spot and had to take a break from it though as I was getting very annoyed at hearing an enemy I couldn't find, that would -not shut up- XD

Posted by: danylopez123 Sep 14 2019, 02:54 PM

QUOTE(Ryusho @ Dec 22 2018, 05:43 AM) *

The buttons work with the new bots, THough sometimes it can be a bit odd to get them to trigger them together, So sometimes you need to give them a hand, but they should get them eventually....I hit a stall where I got completely lost on how to finish a spot and had to take a break from it though as I was getting very annoyed at hearing an enemy I couldn't find, that would -not shut up- XD


Hello, i saw you were trying to work with the new RCBot waypoints for the Tetris maps, at least for the 1st one.
Im just saying if you made now some progress... after almost 9 months without saying anything here, just saying.

Posted by: danylopez123 Nov 9 2019, 03:18 PM

No offence but...
No one is answering so... the Forums might be dead now.
If anyone is still alive, contact me in my Discord bellow.

Posted by: RoboCop Nov 10 2019, 01:55 AM

QUOTE(danylopez123 @ Nov 9 2019, 04:18 PM) *

No offence but...
No one is answering so... the Forums might be dead now.
If anyone is still alive, contact me in my Discord bellow.

Join Bots United's Discord

https://discordapp.com/invite/zCSvyyC

Posted by: danylopez123 Nov 13 2019, 07:04 PM

QUOTE(RoboCop @ Nov 10 2019, 02:55 AM) *

Join Bots United's Discord

https://discordapp.com/invite/zCSvyyC

Oh... a Discord server... sure i will join but... i don't talk alot in Discord servers, that is why i mentioned to add me in Discord.

Posted by: madmax2 Jul 16 2020, 07:26 PM

Cheeseh, I see there have been a number of additions/improvements in the git recently, nice... smile.gif

https://github.com/rcbotCheeseh/RCBotSven5/commits/68e6026d7a6b2051c4e1860f116bcbf00af5a378

Find Cover Util and the Enemies List/listening look interesting. I actually missed a lot of the commits over the last year...

Posted by: Cheeseh Jul 16 2020, 08:50 PM

QUOTE(madmax2 @ Jul 16 2020, 08:26 PM) *

Cheeseh, I see there have been a number of additions/improvements in the git recently, nice... smile.gif

https://github.com/rcbotCheeseh/RCBotSven5/commits/68e6026d7a6b2051c4e1860f116bcbf00af5a378

Find Cover Util and the Enemies List/listening look interesting. I actually missed a lot of the commits over the last year...


Yep finally getting some time to do some coding again . Like to improve the angelscript bot. Trying to find waypoints at the moment for sc_mako, looks like they're incomplete.

The enemy list thing was added to prevent bots from listening to noises when there were loads of enemies in front of them, so they shouldn't turn around any more looking at players/bots shooting from behind them. Also comes inn useful for adding new utilities, such as find cover and some other things' although they will probably hardly every use the 'find cover' utility as they already do that when hurt, but its there anyway in case.

Posted by: madmax2 Jul 17 2020, 04:52 AM

Cool, I wanted to try latest build (68e6026d7a6b2051c4e1860f116bcbf00af5a378), bots join, but leave instantly...
They join if I go back to an earlier build... (I'm using addbot)

CODE
Sven Co-op 5.22
Server Engine: 5.0.1.4 (build 8458)
Server Number: 1

L 16/07/2020 - 19:32:22: "MadMax<1><STEAM_ID_LAN><players>" has entered the game
- MadMax has joined the game.
- [m00]m1lk has joined the game.
L 16/07/2020 - 19:32:49: "[m00]m1lk<2><BOT><players>" has entered the game
[m00]m1lk has joined the game.
banid 25.0 BOT
L 16/07/2020 - 19:32:49: Kick: "[m00]m1lk<2><STEAM_ID_LAN><>" was kicked by "MadMax"
L 16/07/2020 - 19:32:49: "[m00]m1lk<2><BOT><players>" disconnected
- [m00]m1lk has left the game.
L 16/07/2020 - 19:33:26: "[m00]h3n<3><BOT><players>" connected
- [m00]h3n has joined the game.
banid 25.0 BOT
L 16/07/2020 - 19:33:26: Kick: "[m00]h3n<3><STEAM_ID_LAN><>" was kicked by "MadMax"
L 16/07/2020 - 19:33:26: "[m00]h3n<3><BOT><players>" disconnected
- [m00]h3n has left the game.

Posted by: Cheeseh Jul 17 2020, 04:57 AM

QUOTE(madmax2 @ Jul 17 2020, 05:52 AM) *

Cool, I wanted to try latest build (68e6026d7a6b2051c4e1860f116bcbf00af5a378), bots join, but leave instantly...
They join if I go back to an earlier build... (I'm using addbot)

CODE
Sven Co-op 5.22
Server Engine: 5.0.1.4 (build 8458)
Server Number: 1

L 16/07/2020 - 19:32:22: "MadMax<1><STEAM_ID_LAN><players>" has entered the game
- MadMax has joined the game.
- [m00]m1lk has joined the game.
L 16/07/2020 - 19:32:49: "[m00]m1lk<2><BOT><players>" has entered the game
[m00]m1lk has joined the game.
banid 25.0 BOT
L 16/07/2020 - 19:32:49: Kick: "[m00]m1lk<2><STEAM_ID_LAN><>" was kicked by "MadMax"
L 16/07/2020 - 19:32:49: "[m00]m1lk<2><BOT><players>" disconnected
- [m00]m1lk has left the game.
L 16/07/2020 - 19:33:26: "[m00]h3n<3><BOT><players>" connected
- [m00]h3n has joined the game.
banid 25.0 BOT
L 16/07/2020 - 19:33:26: Kick: "[m00]h3n<3><STEAM_ID_LAN><>" was kicked by "MadMax"
L 16/07/2020 - 19:33:26: "[m00]h3n<3><BOT><players>" disconnected
- [m00]h3n has left the game.



For now use rcbot.quota command to add bots. I will need to fix addbot command

Posted by: Cheeseh Jul 17 2020, 09:50 PM

QUOTE(Cheeseh @ Jul 17 2020, 05:57 AM) *

For now use rcbot.quota command to add bots. I will need to fix addbot command

should be fixed now. also added removebot command

Posted by: madmax2 Jul 18 2020, 03:41 AM

QUOTE(Cheeseh @ Jul 17 2020, 02:50 PM) *

should be fixed now. also added removebot command

Okay, thanks smile.gif ... Tried the bot quota and that works good too smile.gif ... I just downloaded the new build...

Posted by: RoboCop Jul 18 2020, 10:03 PM

Nice work!

Posted by: madmax2 Jul 24 2020, 09:28 PM

Build: de6598ea0a98e8efdc679bed8e110187a60b0bf3

I see that bots are now waiting at the bottom of ladders for other bots/players, excellent work Cheeseh, I like it... smile.gif

It seems at some point over the last year the coding changes has effected the performance of some of the waypoints in my pack/git. I'm not saying this is a bug, or anything needs changing in the code to correct it. I'm just notifying everyone that some difficult to navigate areas may not work as well as they once did. Some rcwa's may need some adjustments?

I was playing last series with rcbot_as latest build de6598e, last was ok, have not checked last3 yet, last4 has some minor issues unrelated to code changes (stuck bot in a bsp hole, & door issues), and most of last2 seemed to be working good except at the cables in the elevator shaft, and the long grapple. I compared the latest build to the march 20, 2019 build and could see bots were not doing as well with latest build.

Last2: At the elevator cables bots are falling much more in both directions, they were near perfect with the older build. I can solve the down direction by raising up the top ladder wpt so it is more straight across from the ledge, it was angled down with the git rcwa. The up direction is difficult, bots rarely can make the jump from the cable to the ledge now. I've got them doing a little better by moving the path from where it was to the nearest ledge wpt, and removing the SN (Stay Near) flag from the top ladder/jump wpt. It might be acceptable this way, but I will try to get it working better.

Last2: At the long grapple, bots are failing much more with the current git wpt, but it's not a grapple wpt problem. The problem is at the launch wpt, which is currently a wait/SN wpt. With the latest build, I can solve the problem by removing the SN flag. Bots would not pull up close enough to the wait/SN wpt, without SN they get closer now. Before, with the old builds I needed a SN flag on the wait wpt so bots would pull up to the wait wpt. SN wpts seem to behave different now?

So, this brings up a question, about the build changes over the last year (since march 2019)...

1. Has the bots run up speed to certain types of wpts been changed (SN, wait, jump, or ladder)?

It looks like i'll need to remove SN flags in some locations on some maps and do a new waypoints pack perhaps? At my last check on the Dec 2019 build, sc_persia peg jumps were still working ok, as well as the jumps in sc_doc and sc_royals2.

I also began to rework crystal rcwa, I don't think it is fully functional (bots fail at HT into vent, and other issues). I played through both maps with old rcbot on sc4.8 so I could remember how everything works on those maps tongue.gif .

[edit] Looks like I'm 2 builds behind, I'll check out the HT improvements, sounds great... biggrin.gif

Posted by: Cheeseh Jul 25 2020, 11:50 AM

Hi madmax. I haven't made any changes to bots run up speed or anything other than the HT and ladder change. So not sure what might be causing the issues. I am actually going to remove the 'auto wait no player' feature at ladders since they can be added manually anyway by the waypointer and may cause issues if it cannot be removed - I noticed this in sc_doc in ladders in the vent - cause more issues - let me know what you think. I've made some changes to some waypoints such as sc_doc at the HT point . I'll upload them perhaps you can work on those versions

Posted by: madmax2 Jul 25 2020, 06:33 PM

Okay, yeah it might be best to remove the auto_wait at ladders. I played last3, and everything was working ok including the HT, but inside those vents there, I think the bots were having some extra difficulty climbing the ladders. They eventually (2 bots) sorted out and made it through both directions, but it took many attempts. I will go back and check the vents again and look at the wpts, once you make the change...

I have fixed the problems in last2, I don't think those problems were caused by the auto_wait? It should be easy to retest that area once the change is done...

I'm still working on some improvements to last4, been having problems at the doors, mainly the front door to the base. They get through the doors, but a bot will sometimes stop and stand at the the door for a while as other bots try to go around. I'm not sure if they are looking up at the sky all the time or not, I need to recheck that.

Anyways, I think i have the spawnroom door working good now (no door button), but the front door with a button is still a small problem... they tend to turn around at that door and go up the ladder, either to get the RPG or go up into the tower. Initially bots go through the door good, there are 3 or 4 important wpts outside, but after a while bots stop at the front door, most turn around & go up the ladder. There has been more ammo/health/armor/weapon wpts inside the base/tower vs outside. So I'm not sure if it is a door issue, or there are just not enough special wpts to keep them going outside consistently? I've added some fake ammo/health/armor wpts outside to see if that helps. I tried A oneway path at the door to keep bots outside, which helps, but I'm not sure I want to do that?

I kinda rambled on there, lol... Can you give me a few tips on waypointing doors, such as positioning the waypoints? I found by moving the wpt just inside the spawn room, close to the door (no button) and crouch tagging it seemed to of fixed bots getting stuck at the door. The front door might just be a buggy door, I moved the door wpts/path closer to the button and the button has an important wpt on it. I think it is better, but an occasional bot will stop at the door & not press the button (they might be looking up at the sky, if so, is that a separate issue?)

Thanks for any suggestions/info... smile.gif

[Edit] Build: 1b3a79fb1b1279324b585dcd54d7f68bc6c61b0d

Last4: Bots are not looking up at sky when stopped at the front door, its from jumping/falling down from level above and they just haven't locked on to a waypoint yet. It's not that bad, I'll upload it soon once I'm done tweaking it. Adding some fake ammo/health/armor outside did help draw the bots out, but I think I may make the front door oneway. Bots still go up into the tower before going outside, frequently.

Last2: It's still working good with the new build and the wpt changes ... should be releasing it soon...

Last3: With the new build and auto_wait removed from the ladder wpt, the bots are doing much better at all the vent ladders, as they are waypointed now (including the last ladder into a vent, they were having problems there too, but it is all better now). Bots really get through this map fast now, opening all the shortcut doors quicker than the older builds, it seems. The big rotating gear is probably the only place they are slowed down, I might try tweaking the wpts there?

Posted by: Cheeseh Jul 28 2020, 07:52 PM

Hi madmax.

I think for doors its best to put one waypoint on each side, not in the middle if you know what i mean. Make sure there is only one path through the door. The bots use the path to detect the door.

Ladder waypoints work best if there is a slight angle between th top and bottom, actually the smaller the angle the better. so short ladders work best , long ladders are a pain.

ive updated the bot again, only botcam stuff if youve ever used it , i just use it to watch the bots. you mayhave noticed my keyoard is borked so no coding till i get a new one, tongue.gif


Posted by: madmax2 Jul 28 2020, 09:02 PM

Hey Cheeseh,

I think for last4 front door, I think I may go with oneway path, one direction, bots forced to stay outside. bots go up into the tower often before going outside as it is. I was concerned they would run out of ammo if forced to stay outside, but it seems ok that way, I think?

This is the way I normally do doors with door buttons, with a button on each side & a bidirectional path. I think this is what you are saying... But for last4 door, I'm testing something different, I don't think I can draw it with the keyboard, lol?

CODE
         |
         |
-----x---|---x-----
      \  |  /
       b | b

-----main path -----
x door wpts on each side
b button wpts, I add these if they have trouble seeing buttons or pressing them, sometimes I don't add them

Doe's it make any difference how close the door wpts are to the door? Usually I try to put them near the door and the button. I haven't tried moving them way back from the door or the button. I usually have the path centered through the door, but on a wide problem door (last4) I've slid the path over closer to the button side, but can't put it too close or they can jam the door mechanism. They actually work ok most of the time, but frequently a bot will stop at the door for a while, like it can't decide which way to go (might be able to debug it)? Bots that do this usually either back away from the door and go the other way into the tower, or if another bot or player/npc opens the door for them they might go outside? It doe's seem less frequent since I made the door path oneway, I think?

Thanks for the tips, and yes I have used the botcam to find lost bots (old rcbots), thanks. To be honest, thats the way I type with a good keyboard, constantly correcting my typos, biggrin.gif.

Posted by: Cheeseh Jul 29 2020, 07:54 AM

I think the way you're doing the door is fine. I think it's best if the last waypoint the bot touches before it goes through the door also has visibility to the button, which i think is what you're doing. I'm on my phone now rather than keyboard. Will have a look tomorrow when i get my new keyboard biggrin.gif