Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ladder #2

Open
clux opened this issue Nov 18, 2012 · 4 comments
Open

Ladder #2

clux opened this issue Nov 18, 2012 · 4 comments
Labels

Comments

@clux
Copy link
Collaborator

clux commented Nov 18, 2012

Should we include a ladder type? I have little knowledge on how to do these well or what the controversies are with this more static tournament type so several questions have to be researched and argued clearly for and against. In particular:

  • Do we need a limit on size?
  • What's a good scoring system?
  • Should there be decay?
  • How to store a 'potential' match?
  • Can a player challenge anyone or just someone within his own range?
  • How does a persistent tournament type mix with my abstractions?
  • Should it even be completely persistent or seasonal?
@llafuente
Copy link

  • Should we include a ladder type?

Yes!

  • Do we need a limit on size?

Yes (I'll call this static mode), if you are going to decide the matches since the begining
For example in soccer 20 teams -> 38 macthes

No (dynamic mode), If you support random matches and even manual challenges.
like www.clanbase.com

  • What's a good scoring system?

I dont thinks you need any logic, unscorable dont apply in ladder. Everybody starts with 0 and is adding.
Other way of seen this is just report win/draw/lose and a static points for each (3 points winner, 1 draw, 0 loser)

  • How to store a 'potential' match?
    Static mode, same as now, prepolutate matches.

Dynamic mode: let the user decide with two functions.
create_random_match(team, algorithm)
create_challenge_match(team, team2)
This lead to a problem of, wich round this match belong to?

  • Can a player challenge anyone or just someone within his own range?
    just send the algorithm to create_random_match

The last two. I don't know...

I will need the ladder soon, maybe i can help :)

@clux
Copy link
Collaborator Author

clux commented Sep 22, 2013

Having statically sized ladder is essentially a league, and you can already do that by doing a group stage with group size === numPlayers. Though, it could possibly be wrapped nicely into a separate file.

The dynamic clanbase model is harder as it doesn't really work with my abstraction:

  • The id property becomes silly: only really use id.m
  • Can't pre-make matches - .isDone(), upcoming() make no sense
  • results() have no guarantees (atm results[i].pos are meant to be the minimal guaranteed position that player will receive)
  • A dynamic ladder is not final (upcoming, isDone etc make no sense)

That said, it is possible to impose a artificial limit on it (maybe a date limit) and then:

  • not touch the results[i].pos until it's done
  • keep this.matches = [] initially (and add them somehow via an interface similar to what you suggested)
  • challenge and range may need to be logic that needs to be there, but you will need a metric for how well a player/team is doing in the ladder before we can determine how many points you'll get. Maybe there's already a module for this..

/first thoughts

@llafuente
Copy link

Well... Dynamic ladder is complicated with the current "round" abstraction.

maybe this interface fit

/**
* options
* matchesPerRound: <number>
* rounds: <number>
* searchArgo: <function>
*/
Ladder (numPlayers, options)


- createRandomMatch(pId, searchAlgo)
- challenge(pId, pId2)
- nextRound() //advance the round
- mirror() // get all matches and change the player order.

Now an example

var l = new Ladder(4, {matchesPerRound: 1, rounds: 2})
l.createRandomMatch(1);
// { id: { s: 1, r: 1, m: 1 }, p: [ 1, 2 ]}
l.createRandomMatch(3);
// { id: { s: 1, r: 1, m: 2 }, p: [ 3, 4 ]} 
l.score({ s: 1, r: 1, m: 1}, [1,0])
// true
l.score({ s: 1, r: 1, m: 2}, [1,0])
// true

l.isRoundDone
// true
l.nextRound()
// { s: 1, r: 2}
l.createRandomMatch(2);
// { id: { s: 1, r: 2, m: 1 }, p: [ 2, 3 ]} 
l.createRandomMatch(2); // maybe throw
// null
l.score({ s: 1, r: 2, m: 1}, [0,1])

l.isRoundDone
// false
l.nextRound() // player 1 and 4 didn't play, no problem
// null
l.isDone() // matchesPerRound
// true

// now the mirror
l.options.rounds = 4;
l.isDone() // we had extended the ladder...
// false

l.mirror();

l.upcoming(1)
// { id: { s: 1, r: 3, m: 1 }, p: [ 2, 1 ]}
l.upcoming(3)
// { id: { s: 1, r: 3, m: 2 }, p: [ 4, 3 ]}
l.nextRound()
// { id: { s: 1, r: 4, m: 1 }
l.upcoming(3)
// { id: { s: 1, r: 4, m: 1 }, p: [ 3, 2 ]}
l.upcoming(4)
// null
l.nextRound()
// null
l.isDone() // matchesPerRound
// true

@clux
Copy link
Collaborator Author

clux commented Nov 17, 2013

Dynamic tournaments are under way now - linking issue #14 so that it's thought about.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants