Author Topic: New bot  (Read 3570 times)

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
New bot
« on: March 17, 2016, 04:39:56 am »
Hey,

I just started developing a new bot, its compatible with our current OHSystem system.
The basic point why im calling this is that i've started working more dynamic on a lot parts.

The source can be found here:
https://github.com/Grief-Code/OHBot

I hated all the time on that ghost that it used static configs from files. This does require boost and is ugly to maintain, not to mention that it can become slow, since the usage of memcached/indexed queries, file reading got worser as option. In order to make it userfriendly, i have moved the whole config (except 3 ghost dependent and mysql cfg) to the mysql database.
Also whole mapcfgs are stored in database now. The whole default.cfg looks only like this:
https://github.com/Grief-Code/OHBot/blob/master/default.cfg

Additionally, I've created a stats template system. I have one command for all required and asked stats:
https://github.com/Grief-Code/OHBot/blob/master/ghost/game.cpp#L1416-L1449
We had ever the idea to define alias types for different stats, that does mean using commands like !lod !dota !imba !tree !legion !green !hlw does map to specific stats. Well that is what I have made there. Since we have dynamic declarations for our stats database, we can simple use a mapping from rows:
https://github.com/Grief-Code/OHBot/blob/master/ghost/ghostdbmysql.cpp#L1607-L1629
And replace them on stats strings:
https://github.com/Grief-Code/OHBot/blob/master/ghost/game.cpp#L150

Wondering how a stats template looks like? A few examples:
My current '!stats' template:
Code: [Select]
[{NAME}@{REALM}] has played {VALUE_01} games with this bot. Average stay: {STAYPERCENTAGE}%. Playing time {PLAYTIME} hours. Current best streak: {STREAK}My current '!dota' template:
Code: [Select]
{NAME} has played {VALUE_01} dota games here. Score: {VALUE_02} W/L/D: {VALUE_03}/{VALUE_04}/{VALUE_05} K/D/A: {VALUE_06}/{VALUE_07}/{VALUE_08} C/D/N: {VALUE_09}/{VALUE_10}/{VALUE_11} T/R: {VALUE_12}/{VALUE_13}Even w3mmd templates are easy:
Code: [Select]
{NAME} has played {VALUE_01} Tree Tag games here. Score: {VALUE_02} W/L/D: {VALUE_03}/{VALUE_04}/{VALUE_05} K/D/S: {VALUE_06}/{VALUE_07}/{VALUE_08} E/I: {VALUE_09}/{VALUE_10}
Additionally the best thing, there is no modify required adding a new game now. Simple add the alias, define the template. The bot automatically refreshes these datas. And after a while, you can use these commands also on bots that run since days.
This whole thing is only possible because OHSystem uses a deamon background process that updates these datas.

Following planned patches, that will be still open source:
- Dynamic languages, user defined translations and language picking, all from database. Yes I do read database translations already, but they are not added yet.
- Live editing. A panel that allows live changes on ghost configurations / bnet configurations / map configurations without restarting. Automatically reconnects to new defined bnets, automatically switches the map config on next created autohost game, no longer required to stop hosting and start later again.
- And some more ideas that come soon.

Q/A:
You have mentioned "Following planned patches, that will be still open source", does that mean there is a closed source version?
Yes, there is, I did not started yet with it, but soon. The reason keeping a version closed is a whole integration and bridge between our website and the bot. This is some kind of dedicated work belong only to us then. Additionally I have started working on a project that does not allow open sources for legal terms.

I don't have OHSystem, but that sounds cool, how can I add that to my bot?
I will create soon patching files. For the default ghost, over to sources from populair bots like ent-ghost.

Is that all your work?
Yes, except the score calculation. Since someone wanted the '!scores' command I added it, but that is probably from ent-ghost.

Any questions? Feel free to ask or suggest.
« Last Edit: March 17, 2016, 04:42:08 am by Grief-Code »

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: New bot
« Reply #1 on: March 20, 2016, 03:05:29 am »
Add input support level Garena.

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
Re: New bot
« Reply #2 on: March 21, 2016, 02:32:11 am »
Add input support level Garena.

Yup that will be added also :P

ghostdlr

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: New bot
« Reply #3 on: March 22, 2016, 05:57:40 am »
Is it finished ?  If not, when do you expect everything to be ready ? 

I'm interested only in the bot , not the admin panel .

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
Re: New bot
« Reply #4 on: March 22, 2016, 06:55:37 am »
Is it finished ?  If not, when do you expect everything to be ready ? 

I'm interested only in the bot , not the admin panel .

The bot can be already used to host.

ghostdlr

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: New bot
« Reply #5 on: March 28, 2016, 06:58:57 am »
I see the project is for Visual Studio 2008 . 

I have 2015 installed and I get a lot of errors . Is there any way to make it work on visual studio 2015, without changing the source code ?

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
Re: New bot
« Reply #6 on: March 29, 2016, 02:24:54 am »
I see the project is for Visual Studio 2008 . 

I have 2015 installed and I get a lot of errors . Is there any way to make it work on visual studio 2015, without changing the source code ?

Of course there is. Maybe when im bored I will update that. But I mainly do not program related to windows.

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: New bot
« Reply #7 on: April 12, 2016, 05:23:15 am »
database structure?

ghostdlr

  • Newbie
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: New bot
« Reply #8 on: April 18, 2016, 10:50:46 am »
I see the project is for Visual Studio 2008 . 

I have 2015 installed and I get a lot of errors . Is there any way to make it work on visual studio 2015, without changing the source code ?

Of course there is. Maybe when im bored I will update that. But I mainly do not program related to windows.

What IDE do you use on linux ? 
I want to make some changes to the source code to match the bots I currently have.  I was planning on moving to linux anyway :D .

Grief-Code

  • Average Member
  • ***
  • Posts: 149
  • Karma: +25/-8
    • View Profile
Re: New bot
« Reply #9 on: April 20, 2016, 05:07:57 am »
I do not work on linux. I'm working remotly with Qt.

Artyom91

  • Advanced Member
  • ****
  • Posts: 257
  • Karma: +2/-43
    • View Profile
Re: New bot
« Reply #10 on: April 23, 2016, 06:09:46 am »
?