Help - Search - Members - Calendar
Full Version: Download
RCBot Forums > RCBot > Svencoop 5 Angelscript
Cheeseh
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:


Click to view attachment
madmax2
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
Cheeseh
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.
madmax2
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

Cheeseh
should work now madmax ,, just me being silly since I was coding blind at the time
Cheeseh
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.
madmax2
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....ost&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...
madmax2
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.




Cheeseh
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.
Ryusho
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.
Cheeseh
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.
madmax2
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...
Cheeseh
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)
Cheeseh
BTW also just updated the converter to make it more reliable -- it works with more waypoints now too
madmax2
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
Gordon9999
Will you make the random choose of models and colors for the bots like an old RCBot? Or its impossible for AS?
Cheeseh
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
madmax2
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
Cheeseh
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.
Cheeseh
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
Cheeseh
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
madmax2
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?
Cheeseh
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.


madmax2
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
Poka
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?
Cheeseh
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
Poka
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.
RoboCop
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.
Poka
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.
Solokiller
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.
Cheeseh
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 );
Solokiller
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.
Cheeseh
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.
Solokiller
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.
w00tguy123
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/...tityByClassname
Solokiller
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.
Cheeseh
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
Solokiller
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.
Poka
Seems like the crash issues have mostly gone after the latest updates. Good work cool.gif
Ryusho
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
madmax2
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
RoboCop
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.
Cheeseh
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
RoboCop
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.
Ryusho
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.