.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Sandbot (http://forums.bots-united.com/forumdisplay.php?f=85)
-   -   Sandbot v0.3.1 (http://forums.bots-united.com/showthread.php?t=10047)

tschumann 26-01-2017 05:24

Sandbot v0.3.1
 
Sandbot v0.3.1 has been released!

Mirrors
ModDB: http://www.moddb.com/mods/sandbot/do...s/sandbot-v031
Bots United: http://filebase.bots-united.com/inde...ct=view&id=467

Changelog
- [All] Bots no longer rejoin when the map changes.
- [Half-Life] Bots are now random colours.
- [Half-Life] Bots now automatically join a game.
- [Opposing Force] Bots are now random colours.
- [Opposing Force] Bots now automatically join a game.
- [Day of Defeat] Sandbot will now let you know if you're playing on a map with a flag model that is doesn't understand.
- [Day of Defeat] Bots now automatically join a game.
- [Gunman Chronicles] Bots now use new weapon selection again.
- [Gunman Chronicles] Bots now automatically join a game.
- [Natural Selection] Bots will now consider all enemy structures as enemies.
- [Natural Selection] Marine bots will now build structures in Classic.
- [They Hunger] Bots now automatically join a game.

Unfortunately bots automatially joining Natural Selection games couldn't be implemented in time for this release (if you know a better way let me know: https://github.com/ValveSoftware/halflife/issues/1773) but hopefully it will be in for the next release.

Tagged release is available at https://github.com/tschumann/sandbot...ses/tag/v0.3.1

Persephone 26-01-2017 20:35

Re: Sandbot v0.3.1
 
JOIN AUTOMATICALLY ???

Haha, yes, finally :D

But still haven't supported for metamod yet?

tschumann 27-01-2017 00:02

Re: Sandbot v0.3.1
 
Quote:

Originally Posted by Persephone (Post 66678)
JOIN AUTOMATICALLY ???

Haha, yes, finally :D

But still haven't supported for metamod yet?

Yes, I think the most commonly asked question was how to add bots to a game, so it's good that it's mostly working (thankfully Solokiller has posted what looks like a better solution at GitHub).

No, I tried adding MetaMod support a while ago and it broke things - unless someone can tell me what I'm doing wrong I probably won't bother trying to fix it.

lokkdokk 29-01-2017 10:58

Re: Sandbot v0.3.1
 
Please make autowaypointing. or something.

The Storm 30-01-2017 00:48

Re: Sandbot v0.3.1
 
@tschumann I will look on to fix the Metamod issue you have but it will be around the end of the next week, if you haven't fixed it yourself by then. :)

P.S. Please update the Github documentation with instructions to build the project. Should I use HPB_bot.vcproj for MSVC and the Makefile directly under Linux?

tschumann 30-01-2017 11:36

Re: Sandbot v0.3.1
 
Quote:

Originally Posted by lokkdokk (Post 66680)
Please make autowaypointing. or something.

It's something I'll look at further down the track - I might change some waypointing stuff yet so I don't want to get in too deep.

Quote:

Originally Posted by The Storm (Post 66682)
@tschumann I will look on to fix the Metamod issue you have but it will be around the end of the next week, if you haven't fixed it yourself by then. :)

P.S. Please update the Github documentation with instructions to build the project. Should I use HPB_bot.vcproj for MSVC and the Makefile directly under Linux?

Oh thanks - pretty sure when I tried it last everything was too fast and the bounce pads on bounce in Half-Life were way too bouncy. It was a bit frustrating because I couldn't find any good documentation but it looked like what I'd done was right.
I'll update the docs and see about updating the metamod branch. Many thanks!

edit: build instructions updated, and the metamod branch is up to date with master (clean merge!) - diff is at https://github.com/tschumann/sandbot/compare/metamod

The Storm 01-02-2017 21:55

Re: Sandbot v0.3.1
 
You have massive CRLF line endings which is not recommended for a git repo of portable project.

Anyway perhaps I will do the metamod port from scratch, it will be easier for me to track issues.

tschumann 02-02-2017 11:47

Re: Sandbot v0.3.1
 
Yeah I downloaded the Windows version of the source code but it looked like all the line endings were screwed up. Not sure what's up with that.

I think https://github.com/tschumann/sandbot...d334e946643f37 was the only file that I created/added myself and it seemed right but I don't know.

The Storm 02-02-2017 21:50

Re: Sandbot v0.3.1
 
It is mixed with both Unix and Windows line endings...
The ^M character that you see on some lines is the carriage return that is used under Windows. It will be good if you go and fix all endings. There is tools like dos2unix that will do that for you.

P.S. Also could you give me developer rights to the repo to skip the step of making a fork... My profile is 'TheStormN'.
P.S. 2. I will have to postpone the Metamod port due to HDD change. I will need some time to recover my stuff and setup my environment again. Sorry. :(

tschumann 11-02-2017 13:21

Re: Sandbot v0.3.1
 
All good - I've added you as a collaborator.
I've created a new branch to try again myself. Does what is in https://github.com/tschumann/sandbot...ls/metamod.cpp look right at least?
Also, I might try downgrading back to the stable version of Half-Life. http://steamcommunity.com/games/70/a...55100987797270 probably shouldn't affect things but who knows...

The Storm 11-02-2017 14:23

Re: Sandbot v0.3.1
 
It looks okay, yes. :)

tschumann 11-02-2017 22:10

Re: Sandbot v0.3.1
 
Thanks! Actually, is my problem that all API calls need a RETURN_META or RETURN_META_VALUE? Whatever documentation I read last time didn't mention it but looking http://metamod-p.sourceforge.net/doc/html/coding.html it looks like everything in enginefuncs_t, GetEntityAPI and GetNewDLLFunctions should have a RETURN_META or RETURN_META_VALUE - is that right? Do I need to worry about OVERRIDE or SUPERCEDE?

The Storm 12-02-2017 00:40

Re: Sandbot v0.3.1
 
Yes, you must return meta results and yes you need to worry about OVERRIDE and SUPERCEDE. The Metamod documentation says well how they are used. Please bare in mind that I upgraded the project file to VS 2015, I don't have older VS, so you will have to upgrade also. :P

I created a pull request with my changes. Please compile and test it out before accepting it. The bot can be used with or without Metamod now so everyone should be happy. :)

P.S. I upgraded the FakeClientCommand() function to more modern one used by most of the bots here, now you can use it as the original engine ClientCommand().

EDIT: I just fixed some nasty issue that I missed out. Pull again from the branch using the git pull --rebase command, because I amended the commit.

tschumann 12-02-2017 02:24

Re: Sandbot v0.3.1
 
Thanks so much! I've had a look at the code and it all looks good (and reminds me how much I need to tidy it all up).
I've pushed up a patch to add Visual Studio 2008 support (I've got a bunch of other stuff that I don't want to upgrade yet and the Source SDK only works with Visual Studio 2013 or earlier).

I'll test it out next weekend.

Thanks again!

The Storm 12-02-2017 19:05

Re: Sandbot v0.3.1
 
I made another push with some optimizations. I don't have VS2008 but I think that I updated the VS2008 project files properly.

Also there is no issue to have multiple Visual Studios installed on your box. You can install VS2015 side-by-side with VS2008 and all will be fine.

Also I think that the SourceSDK shouldn't be too hard to port to VS2015. :)

The Storm 13-02-2017 22:41

Re: Sandbot v0.3.1
 
I've pushed several more changes that fixed wrong function calls to the gamedll when the bot is loaded as Metamod plugin. I hope that there will be no more issues.

tschumann 18-02-2017 09:25

Re: Sandbot v0.3.1
 
Thanks, I gave it a go today with Half-Life and it all seemed to work just fine (though the bots seemed a lot more violent - maybe I'm just imagining things). I'll hopefully do some more testing with other games/mods and on Linux next weekend then merge it in.
How do I properly test MetaMod anyway? Everything seemed to work but I don't know what kind of problems I should expect.

And yeah, I might go down the path of multiple Visual Studio installs. Need more time...

The Storm 18-02-2017 12:26

Re: Sandbot v0.3.1
 
Well, there is no some strong path to test if Metamod is working fine. If the bots join fine and play well it should be ok.

Also test it in non-metamod mode, because I made it with dual compatibility. Normal Metamod plugins cannot be loaded without Metamod but I made Sandbot in a way that it should work in both modes.

About the bots been more violent - I have nothing to do with that. :D

tschumann 18-02-2017 13:06

Re: Sandbot v0.3.1
 
Yeah okay - still, the code looks fine so I guess it should work.
I tested it without MetaMod too and it ran fine too.

Many thanks!

The Storm 18-02-2017 13:25

Re: Sandbot v0.3.1
 
You are welcome. :)

tschumann 25-02-2017 04:05

Re: Sandbot v0.3.1
 
I gave it a go today and it didn't work with Gunman Chronicles - there's a late precache of sprites/muzzleflash3.spr which causes the game to exit but this only happens with MetaMod. Any ideas?

The Storm 25-02-2017 21:01

Re: Sandbot v0.3.1
 
Could you give me a link to download working version of Gunman Chronicles for Steam?

Edit: I downloaded http://www.moddb.com/games/gunman-ch...-steam-version and installed Metamod-p 1.21p37 with Sandbot metamod branch and the game is running just fine.
Edit2: Oops, it seems that only the debug version is working. The release version is crashing the game lol.
Edit3: After some debugging I found out that it is a memory corruption issue. I actually located it. It is in the weapon message processing system for Gunman Chronicles - function BotClient_Gunman_WeaponList().
The bug is array overflow in bot_client.cpp:353, when accessing weapon_defs with bot_weapon.iId == 32. The array max index is 31, you are going out of bounds and some other memory gets modified which then causes undefined behavior. This is reproducible in both Metamod and non-metamod mode with the exception that in non-metamod mode the game is not crashing, because it seems that the invalid accessed memory is not critical at this state. As I said - this is undefined behavior.

The easiest fix here will be to increase the weapon_defs[] array from 32 to 33 but I cannot recommend that because 'MAX_WEAPONS' is from the HLSDK and is set to 32. Perhaps there is other way to parse the weapon messages for Gunman Chronicles?
Unfortunately you will have to find a proper fix for that yourself. :)

tschumann 26-02-2017 11:36

Re: Sandbot v0.3.1
 
Hm, the debug version worked for me but I didn't try a release build but I was using the original MetaMod not MetaMod-P.

Thanks for tracking down the issue anyway. I'll try and figure out what's going on next weekend.

tschumann 04-03-2017 06:42

Re: Sandbot v0.3.1
 
So, I updated MAX_WEAPONS to 48 (which seems to be what Gunman Chronicles uses) but that still didn't fix the issue, but updating to MetaMod-P did, so I've made MetaMod-P a requirement.
I try on Linux now and the game freezes when I start it with MetaMod-P - not sure what to do at this point. On Windows I get a nice crash-dump but I'm not too familiar with debugging on Linux and I've never had to use gdb with a dynamically loaded library.

The Storm 04-03-2017 12:21

Re: Sandbot v0.3.1
 
Metamod and Metamod-p should be interchangeable. Tomorrow I will have more time and I will check out what is going on. Also I think you should improve your debugging skills. :P

tschumann 04-03-2017 22:37

Re: Sandbot v0.3.1
 
Yeah I thought it was odd that they would be different.

I probably could have worked it out if there was a crash dump but I couldn't find any crash dump. I tried searching and I saw one place say that crash dumps were in /tmp/dumps but there were no dump files there.

The Storm 05-03-2017 00:36

Re: Sandbot v0.3.1
 
Just attach gdb to the process and wait for the crash directly there. If you really want to have crash dumps you should first enable them. Each distro has it's own way so go check out the reference. :)

Edit: OK, I found the issue with the original Metamod - it does not export all entities that are required for Gunman Chronicles regardless that on the metamod.org site it says that the mod is supported. Some entities are not spawned because of that and so "sprites/muzzleflash3.spr" is not precached on time, the engine tries to use it later when the bots begin to fight but it cannot find it, so it tries to precache it by himself but because of bug in the engine itself you get this error. So basically you will have to make Metamod-p a requirement. I will check later the Linux issues.

tschumann 05-03-2017 06:21

Re: Sandbot v0.3.1
 
Ah that would explain the problem then.

Anyway, I did some more investigation and I got the game to load once in Linux and meta list showed that MetaMod was running. Every other time the game seemed to freeze up, even if I didn't load Sandbot in plugins.ini - hl_linux was still a running process though so I guess it didn't crash. I suspect my under-powered Linux VM is the problem (I have a dual boot to Linux setup but my Linux install corrupted).
Anyway, I've seen it working so I've released a new version with MetaMod support. Many thanks for the help again.

The Storm 05-03-2017 13:54

Re: Sandbot v0.3.1
 
Nice. Great to see that everything is finally in place. :)


All times are GMT +2. The time now is 00:44.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.