Jump to content
EleTD.com
Sign in to follow this  
Guest cohadar

Bot Development.

Recommended Posts

Guest cohadar

Bot library functions:

// Main function used to send messages to the bot
function Bot_Print takes string missionKey, string key, integer value returns nothing

// Converts player index to string (left padded with zeros)
function Bot_P2S takes player p returns string

// Converts integer to hex string (left padded with zeros)
function Bot_I2HS takes integer id returns string

All data sent to the Bot will be stored to the database, so they need to be in tabelar format.

We will use XML as standard method of specification.

For example we would need one table that will store player names:

We know there is a maximum of 8 players in Eletd, so the table might look something like this:

<Players>
    <Player id="0">PlayerName</Player>
    <Player id="1">PlayerName</Player>
    <Player id="2">PlayerName</Player>
    <Player id="3">PlayerName</Player>
    <Player id="4">PlayerName</Player>
    <Player id="5">PlayerName</Player>
    <Player id="6">PlayerName</Player>
    <Player id="7">PlayerName</Player>
</Players>

We would save this data like this:

local integer i = 0
loop
    exitwhen i>=8
    call Bot_Print("Players", GetPlayerName(p), GetPlayerId(p))
    set i = i + 1
endloop

Seems pretty easy for now.

Now imagine you want to go crazy and record leaks for each player:

<Leaks>
    <Leak id="??" playerId="?">LeakedUnitName</Leak>
    <Leak id="??" playerId="?">LeakedUnitName</Leak>
    <Leak id="??" playerId="?">LeakedUnitName</Leak>
    <Leak id="??" playerId="?">LeakedUnitName</Leak>
</Leaks>

We have 2 problems here:

1. table has no set amount of fields (player can leak random number of units)

2. we need to pass 2 integer values leak-id and player-id

To solve first problem we need to dynamically create leak id.

Increasing counter is the best way for this, we need one for each player so:

globals
    private integer array Counters
endglobals

function GetNextLeakId takes player p returns integer
    local integer i = GetPlayerId(p)
    set Counters[i] = Counters[i] + 1
    return Counters[i]
endfunction

As for second problem we can code player id as part of key string:

   local unit leaked = GetTriggerUnit()
   local player p = GetOwningPlayer(leaked)
   call Bot_Print("Leaks", "Player"+Bot_P2S(p)+" leaked "+GetUnitName(leaked), GetNextLeakId(p))

Alternative would be to have one mission key for each player leak:

   local unit leaked = GetTriggerUnit()
   local player p = GetOwningPlayer(leaked)
   call Bot_Print("Leak"+Bot_P2S(p), GetUnitName(leaked), GetNextLeakId(p))

GetNextLeakId() can also be made to return a combination of counter and game time.

I leave that one for homework.

Share this post


Link to post

I assume you want that we post our suggestions.

I don't think leaks need an ID. (You never have to do something with them except count.)

And I wouldn't save the unit name but the wave number. (Numeric data is always better.)

Share this post


Link to post

ID beeing an ID for the match? But we need that. What about "gamereport missing - possible cheat" error? If there is no way to tell which game wasn't properöy finished, how to find it?

Share this post


Link to post
Guest cohadar

I just posted so people know in general what is going on.

Suggestions and ideas are always welcome.

For example we need a suggestion of a good ranking algorithm for the league.

@Kaini

Saving creep wave level is ofc better than using creep name.

Perhaps we need both of them.

Textual data is good for gametracker output.

Imagine a generated html page about the game that displays game events:

02:25 - cohadar killed level 1 fire boss
02.26 - karawasa builds flesh golem // obviously a cheat at so early time :P
02.32 - cohadar sells basic earth tower
...
17.42 - karawasa leaks shadow wolf
17.43 - karawasa leaks shadow wolf
17.44 - karawasa leaks shadow wolf
17.45 - karawasa leaks shadow wolf
17.46 - cohadar is the last man standing // :D

Share this post


Link to post
Suggestions and ideas are always welcome.

good to hear :)

For example we need a suggestion of a good ranking algorithm for the league.

ouch, I dunno much about that, never worked with ranking systems before.

anyway I had some ideas for how the bot will work in interaction with players and map/lobby/channel (will the bot be polite? :) ), but I didn't find much posted, didn't read the latest word doc yet though. i was about to post the ideas but it'd be too much text and probably 99% is allready figured by you guys working on it :P was hoping to find kara on teh irc when he is not afk, but it doesn't seem to happen :P

Share this post


Link to post

http://en.wikipedia.org/wiki/Elo_rating_system

The Elo system is the method of choice. Afaik it has never or nearly never been applied to ffa situations yet. I'm opposed to using any other data than win or loss, or maybe rank in a game. If we use anything else, we will end up promoting certain modes and preventing others. If for example we give out points for interest, we punish xsm. If we reward ronald, we punish rnd and non-xsm, and so on.

Edit - In an attempt to understand each other or irc, kara reminded me of the wg tour:

http://www.wgtour.com

http://www.wgtour.com/help.php?datab=broodwar&h=1&id=49

http://www.wgtour.com/help.php?datab=broodwar&h=1&id=67

In short: It's an open ladder, not a scheduled league like the nhl. And it basically encourages players to play other players of the same rank.

I strongly suggest that if we use something based on the wgt, we should ask for permission, properly credit them, and change a lot cosmetically (like renaming the ranks, lowering all point values by 1.5).

The WG Tour explained

(The following is quoted from above links.)

On the wgt, players have points (eg. player XY can have 4321 points), a place on the ladder (eg. player XY can be 1234th of the ladder), and additional to that a ladder rank (eg. player XY can be B3):

Ladder Ranks on wg tour:

A - More than 8700 pts

B0 - Between 7700 and 8699 pts

B1 - Between 7000 and 7699 pts

B2 - Between 6300 and 6999 pts

B3 - Between 5600 and 6299 pts

B4 - Between 4900 and 5599 pts

B5 - Between 4200 and 4899 pts

B6 - Between 3500 and 4199 pts

C0 - Between 2800 and 3499 pts

C1 - Between 2300 and 2799 pts

C2 - Between 1800 and 2299 pts

C3 - Between 1300 and 1799 pts

C4 - Between 800 and 1299 pts

C5 - Between 300 and 799 pts

C6 - Between 0 and 299 pts

These ranks are used for two additional rules. One rule forbids replaying the same player too often. It is assumed that a high ranked player (not to be confused with a high ladder place) are less likely to be cheat acocunts for handing out free wins:

You cannot play versus the same player more than:

  • * 3 times a day between ranks C6-C0

* 5 times a day between ranks B6-B4

* 7 times a day between ranks B3-A

* When playing between ranks, the limit is on the lower player

In short, this means if I want to play the same matchup over and over again, after a few games the outcome is not a valid entry for a scoring result. The number of games allowed for repeating grows, as the lower players rank grows (from 3/day to 7/day). So if you were to create a loss account to hand out free wins, you could not give more than 3 wins per day and other player.

The other rule is about winning points:

[pre:l39s7rnk]How many pts do you win/lose for a ladder match (from C6 to C4)

Standing of your opponent If you win If you lose

5 or + ranks above yours 200 pts -0 pts

4 ranks above yours 180 pts -10 pts

3 ranks above yours 160 pts -20 pts

2 ranks above yours 140 pts -30 pts

1 rank above yours 120 pts -40 pts

the same rank as yours 100 pts -50 pts

1 rank below yours 80 pts -60 pts

2 ranks below yours 60 pts -70 pts

How many pts do you win/lose for a ladder match (from C3 to C0)

Standing of your opponent If you win If you lose

5 or + ranks above yours 200 pts -30 pts

4 ranks above yours 180 pts -40pts

3 ranks above yours 160 pts -50 pts

2 ranks above yours 140 pts -60pts

1 rank above yours 120 pts -70 pts

the same rank as yours 100 pts -80 pts

1 rank below yours 80 pts -90 pts

2 ranks below yours 60 pts -100pts

3 ranks below yours 40 pts -110 pts

4 ranks below yours 20 pts -120 pts

5 or + ranks below yours 5 pts -130 pts

How many pts do you win/lose for a ladder match (from B6 to B4)

Standing of your opponent If you win If you lose

5 or + ranks above yours 200 pts -5 pts

4 ranks above yours 180 pts -20 pts

3 ranks above yours 160 pts -40 pts

2 ranks above yours 140 pts -60 pts

1 rank above yours 120 pts -80pts

the same rank as yours 100 pts -100pts

1 rank below yours 80 pts -120 pts

2 ranks below yours 60 pts -140pts

3 ranks below yours 40 pts -160pts

4 ranks below yours 20 pts -180 pts

5 or + ranks below yours 5 pts -200 pts

How many pts do you win/lose for a ladder match (from B3 to A)

Standing of your opponent If you win If you lose

4 ranks above yours 180 pts -40 pts

3 ranks above yours 160 pts -60 pts

2 ranks above yours 140 pts -80 pts

1 rank above yours 120 pts -100pts

the same rank as yours 100 pts -120 pts

1 rank below yours 80 pts -140 pts

2 ranks below yours 60 pts -260 pts

3 ranks below yours 40 pts -280 pts

4 ranks below yours 20 pts -200 pts

5 or + ranks below yours 5 pts -220 pts[/pre:l39s7rnk]

This second mass of numbers cam be explained in pretty simple words too:

- If you win vs a stronger player, you get more points than for winning vs a weaker player.

- If you loose agains a weaker opponent, you loose more points than for loosing against a stronger opponent.

- If you have a low rank (C6-C4; not to be confused with ladder place), you will gain points fast even if the opponent is weaker, and you will lose points very slow. You can't drop under 0 points.

- If you have a medium rank (C3-C0), you will still gain points fast, but only if the opponent is not much weaker than you, and you will lose points slow.

- If on a higher rank (B6-B4), you will gain and loose points fast.

- If on a top rank (B3-A), you will gain points slow, and loose points very fast.

I come to the following conclusion regarding the wgt system:

-Low level players (C6-B4) will rise fast.

-Over a long time period most players will arrive at least at medium level.

-High level players (B3-A) will have a hard time staying on top if and only if they play each other. Top ranks will be contested only if top players play each other.

-Games vs weaker players won't give much gain for high ranked players.

-Overall the total of points in the system will be increased if low level players play each other (positive net point change) and decreased if high level players play each other (negative net point change).

-In the case of a C6-C4 vs B3-A (maximum rank difference), with the expected result of the better player winning, the total ladder points go up by 5 points. (We could ofc set the point gain for this to 0.)

-Players can grind for points by hunting lower level players (as long as they don't play the same one too ofter per day), and reach infinite points in infinity time, while never playing players of their skill level ("skill level" is not to be confused with "ladder rank"). If enough players do this, the net points of the ladder will rise slowly into infinity.

-The given nubers of the wgt do a bad job at preventing this. As long as points are created by low level player playing amongst themselves (positive net point gain), those gained points can be farmed by top players. They focus on the lowest level players that still will give them points, and if those are not skilled enough to provide a slight risk of failure, grinding works.

-A better point game table would not award any points to top players for playing low level opponets without a chance to fight back. The tricky bit is to decide what constitutes a slight chance of the lower ranked player to score a surprising win.

-To prevent this abuse, the wgt usually resets the ladder from time to time. This results in the ladder beeing devided into seasons, and each season is a hunt for top ranks, points and placings. With the season ending ahead, there is no time to grind up fast enough. The best players will allways peak faster than grinders by playing high ranked opponents.

Share this post


Link to post

Additional thoughts:

For the top ranks in wgt the table looks like this:

[pre:ryocu1s6]How many pts do you win/lose for a ladder match (from B3 to A)

Standing of your opponent If you win If you lose

4 ranks above yours 180 pts -40 pts

3 ranks above yours 160 pts -60 pts

2 ranks above yours 140 pts -80 pts

1 rank above yours 120 pts -100pts

the same rank as yours 100 pts -120 pts

1 rank below yours 80 pts -140 pts

2 ranks below yours 60 pts -260 pts

3 ranks below yours 40 pts -280 pts

4 ranks below yours 20 pts -200 pts

5 or + ranks below yours 5 pts -220 pts[/pre:ryocu1s6]

For every possible matchup a top ranked player can get, the point loss by loosing is greater than the gain of winning. Playing players of your own rank (with a 50/50 chance of a win or loss) will be bad for you in the long run, as there is a negative net point difference of 20 points in an equal match. And playing players of different level is bad for one of them, as the net point gain again is negative. If the gain properly represents winning chances, the match again is bad for both of them.

So where is your motivation to play at all?

There needs to be an extra rule to keep the top players playing.

Edit

TfT Ladder

The frozen throne ladder uses two tricks: The players can't choose their opponents, they only get ladder points if they take a player selected by the amm (automated match making system), which is as close to the players rank as the system manages. And if you don't play a lot of games, you lose points.

http://www.battle.net/war3/ladder/war3- ... ron#chart1

In that chart there is a number of games per week that you have to play (via the amm) to not loose points. The number of games grows linear with the level, you have to play 1 game per week more if you want to keep 1666 xp more on your account. As a result there is a point where more games simply cannot be played within a week, so there is a limit on the level.

I dislike this method, as it encourages the players to mass play games. Currently the top ranked player on lordaeron has to play 10 games per week not to loose points.

Conclusion about tft ladder:

The amm is a cool concept, maybe we can use that too. It ofc is just a workaround, as it can't force a decent player on you if there is none present online. We still should keep record if a player meets only low level opponents, and ofc there still needs to be a weighting based on your opponents level. Maybe players find a way to abuse an amm, like only playing at night, or join a server where all players suck.

Can the amm system be improved? At least each player should get some sort of stats about what level his opponents are, so it can be easily seen if they actually meet their own skill level in a game sometimes.

The point decay system is interesting, but I have doubts about enforcing 10 games per week. Again, this does not make sense without some influence upon who they play. It's not enough to beat up 3 beginners per week not to loose your top 10 rank imo. Again, it's hard to enforce "has to play a player of similiar rank" if they just are not online. It may very well happen that top 10 players hop online for 10 secs per day, check, no valid opponents are there, they go off again and claim to "never have had the chance to play". They could even arrange a schedule to avoid each other. :P Maybe 4 games per week and an amm?

Edit: the tft ladder stores only games with at least one strong player:

http://www.battle.net/war3/ladder/war3- ... =Lordaeron

How do I get full game reports on my profile?

Only Warcraft III games with at least one level-10 player have their information saved for use on the Warcraft III ladder Web site.

So something like "only top 20 replays are stored" along with "if you are a top 20 player, only games that are succesfully reported with a replay (to be saved by the bot) count towards your rank" and ofc with "manipulating the bot/ladder in a way that prevents a replay to be saved is cheating".

And "top 20" can be anything we want it to be. Best ranked 100 replays each day? Anything with a player with at least 20 played ladder games in it? We can pick what we like.

Share this post


Link to post

Your basic idea is perfect. But I don't really like you numbers Cisz.

Ladder Rank

Make more letters and make numbers to a sight that indicates the rank in the rank.

There is one more rank but that shouldn't hurt.

From 10000 and up A* (the star is a special award for group A people)

Between 8700 and 9999 B+

Between 7700 and 8699 pts B~

Between 7000 and 7699 pts B-

Between 6300 and 6999 pts C+

Between 5600 and 6299 pts C~

Between 4900 and 5599 pts C-

Between 4200 and 4899 pts D+

Between 3500 and 4199 pts D~

Between 2800 and 3499 pts D-

Between 2300 and 2799 pts E+

Between 1800 and 2299 pts E~

Between 1300 and 1799 pts E-

Between 800 and 1299 pts F+

Between 300 and 799 pts F~

Between 0 and 299 pts F-

We could give them names too. But I really like the letters. Whats about [F~] Beginner and [A*] Master

im for words instead of those labes

"adept"

"master"

"novice"

:)

anyway, ahve to leave for food

beginner^^

"hopeless" :P

there is another way.... class A standing for adept

ya

be - beginner

c - clown

hahha

d - dragon?^^

d dogfood

Cisz' point system

I didn't study it yet but we can leave it as it is at the moment.

But I suggest to make it a bit smoother (as in for every group own numbers.)

Simply rename it a bit:

How many pts do you win/lose for a ladder match (from C6 to C4 for F)

How many pts do you win/lose for a ladder match (from C3 to C0 for E)

How many pts do you win/lose for a ladder match (from B6 to B4 for D and C)

How many pts do you win/lose for a ladder match (from B3 to A for B and A)

Edit: now as image too :P

Edit2: Point system will follow

x.png

Share this post


Link to post

We dont have to use 15 ranks. We could use 3. Or 17000?

It's up to us.

And it's not my point system, it's the one of the wgt. And we can completely change that one too.

Share this post


Link to post

Kaini's point system

Win-Table

Shows the points that will be added if a player with rank column wins against a player of rank row.

Loose-Table

Shows the points that will be added (if you add a negative number the value decreases) if a player with rank column wins against a player of rank row.

Off(set)-Table

These values will be added to every game to correct the sub-rank (*/+/~/-) differences. If a negative worth gets positive it is set to 0. If a positive worth gets negative it is set to 0.

Examples:

Alice [C+] wins against Bob [C-]

Alice gets +20 -10 = +10 points.

Bob gets -20 +10 = -10 points.

Alice [F-] wins against Bob [A*] (cheater :P)

Alice gets +120 +10 = +130 points.

Bob gets -120 -10 = -130 points.

Alice [D+] wins agains Bob [b-]

Alice gets +60 -10 = +50 points.

Bob gets -60 +10 = -50 points.

Alice [C~] wins agains Bob [C~]

Alice gets +20 +0 = +20 points.

Bob gets -20 +0 = -20 points.

Now in multiplayer action

Alice [F+], Bob [D~], Carol [C-], Dave [D+] and the pro Mecury [A*] plays a game.

They die in the following order: Carol - Bob - Alice - Mecury - Dave

Carol lost against everybody (poor dog)

loose: Bob (-40+5=-35) Alice (-80+10=-70) Mecury (-5+10=0) Dave (-40+10=-30)

win: -

total: -135 the good medium player lost lots of points 'cause he died like a worse player

Bob

loose: Alice (-60+5=-55) Mecury (-2+5=0) Dave (-20+5=-15)

win: Carol (+35)

total: -35 the medium player lost some points 'cause he died like a bad medium player

Alice

loose: Mecury (0+0=0) Dave (-5+0=-5)

win: Carol (+70) Bob (+55)

total: +120 the worst player got lots of points 'cause he surviced like a medium player

Mecury

loose: Dave (-80+0=-80)

win: Carol (0) Bob (0) Alice (0)

total: -80 it is hard to be the best ;)

Dave the best player this game

loose: -

win: Carol (30) Bob (15) Alice (5) Mecury (80)

total: +130 the is an average player but won agains pros - thats lots of points

I can't see numbers anymore xD

x.png

Share this post


Link to post

i don't really get what the +/- system is for, it's better to have them all work as different ranks instead of "+/- off". if A- beats F+ he gains 0+10=10 pts ? but if A- beats E- he only gains 2 pts?

else I'm not sure.. perhaps it's good to have neutral net's (ie, if you beat someone at your own lvl you gain the same that you'd lose if you lost to that guy). unlike the wgt table Cisz showed.

first I was worried that beginners aat lvl 1 will get bored if they don't receive any points, but it struck me that only the worst of the beginners, only those that start with no skill at all, will stay at 0 score. but it's fun for players to grow a bit though :/

Share this post


Link to post

FFA games are on a completely different level of complexity. You have yet to demonstrate the correctness of this method in a FFA setting.

Afaik it has never or nearly never been applied to ffa situations yet.

Share this post


Link to post

@ Jolin - if the net point change of a normal game is 0, the total points of the ladder will grow. That is because players not dropping under 0 points, so each game that would bring a player under 0 raises the point total. There is also a loss due to good players stopping to play ofc. Experience with existing ladders show, that ladders total points tend to grow annoyingly fast. As a result in badly adjusted ladders, top players cant be caught anymore, because they have like 1000 points more than you and keep growing the same speed than you do.

@ echinodermata - I expect that too. Do you have any knowledge on elo ratings? Or any solid reasoning why we might be right with that expectation?

Share this post


Link to post
i don't really get what the +/- system is for, it's better to have them all work as different ranks instead of "+/- off". if A- beats F+ he gains 0+10=10 pts ? but if A- beats E- he only gains 2 pts?

Um no. First there isn't a A- (only A* that acts like A+ but is a special reward, A are the experts. Read my post before)

But you are right. My offset values are wrong. (They are too high :/)

Share this post


Link to post

Okay, I see how kaini set it up for FFA. You're considering a multiplayer game as a set of 1v1 pairs. That makes sense.

There is a problem with taking this too simplistically. If we just consider a multiplayer game as a set of 1v1 pairs, then playing one 8-player game is like playing seven 2-player games. For one, this means that you're never going to get anywhere playing 2-player games.

Also, I think you'll agree that beating 7 rank X players in one game is not 7 times more impressive than beating just 1 rank X player in one game. We need to make that adjustment.

We don't have to bother to split rank numbers into rank categories. Just work directly with the numbers. It's only the difference in rankings that matters.

Example:

(Your rank) - (Opponent's rank) | 20 10 0 -10 -20 | d

Points gained if you win | 2 4 8 16 32 | 2^((-d/10)+3)

Points lost if you lose | 32 16 8 4 2 | 2^((d/10)+3)

(By the way, I'm pretty sure that exponential growth is not the correct model here.)

Don't get stuck with WGT's model. I suggest we just build from scratch.

I don't think making the system nonneutral is the best way to prevent inflation. As cisz pointed out, it discourages high-ranked players from playing, and for the WGT, it didn't succeed in stopping inflation.

Edit 21 Apr 2009: formatting issues due to move from old forum fixed, deleted some statements

Share this post


Link to post
Guest serdelus

I don't think that point ranking should in any way depend on wins / loses, especially when almost no elements of the gameplay depend on who you play against. The more important matter is your interest / level when you finished the game and number of leaks depending on level. Pro player will loose to the other pro and loos points, while newbie player will win to another newbie, subsequently gaining points. It really has no relevance who do you beat. ELO systems is introduced becouse there is no way to rate some players gaming skills in chess other than against different players. It is not the case in EleTD.

Share this post


Link to post

I disagree on two sides. Imo winning is highly related to skill. Getting a high networth is not. ;)

Share this post


Link to post
Guest serdelus
I disagree on two sides. Imo winning is highly related to skill. Getting a high networth is not.

But the thing is, person could get high rank simply becouse he/she doesn't play with pros, while a good player (muche better) could get much worse score becouse of playing with pros. Unfair. Point system should be scaled to the players gaming skills, not choices of opponents, especially when it is easy to decided sensible ranking without ELO-like system.

Share this post


Link to post

interesting that this thread got bumped.

since then i've re-evaluated my position, and i agree that win/loss/rank in game is not the whole picture. unlike chess and melee starcraft/warcraft games, Element TD isn't just played against other players - it's played against the computer too.

Share this post


Link to post

I think that player rankings matter more than how far you get. If you're playing same random, which is the standard competitive mode, the game difficulty could vary a lot, from randOOms to easy wins. Also, pros tend to rush the other players, so when you play against them, even if you're pretty good yourself, you may lose early because of that.

Serdelus seems to be thinking of EleTD in a single player manner. Single player EleTD is much, much different than multiplayer. I guess at lower levels, players only think about surviving themselves and not pay attention to the other players, so how far you get in the game is a decent measurement of skill, but at higher levels, adjusting to your opponents' play is key.

In multiplayer, you play to win, not play to see how many ronalds you can kill. If burning all your cash to rush your opponents wins you the game, then it doesn't matter that you die after 2 more waves because you don't have the interest saved up.

Share this post


Link to post

serdelus - Trust MagicalHacker to design the first point system to properly avoid that. ;)

Share this post


Link to post
Guest Sancdar

At higher levels of play, the competitive difficulty is significantly greater than the game's base difficulty. In the public beta, I played against many players who could beat the game on their own but died by level 25 in VHSRSMCM against strong players. Maybe the game time of the loss could be considered as well?

Share this post


Link to post
Guest serdelus
Maybe the game time of the loss could be considered as well?

I agree. The only way the opponent influences you is the time you lose on levels. It could be simply by adding points for how fast you deal with level. IE the less interests you gather on level the more points you get.

Share this post


Link to post

So I get more poins in games without interest picks? And without gold towers? :)

Share this post


Link to post
Sign in to follow this  

×
×
  • Create New...