zaterdag 29 januari 2011

Shitting up the ladder

Ehm... setting up the ladder I mean. Basically, the ladder is what makes the system tick at some point. Its an overal table that shows the progress over whats happening during the complete season.

Overal, it comes down to positions inside the ladder. Since this drives the ladder. And as far as I discussed it previously it comes down to that a team inside the ladder has a few states:

- position (rank)
- invulnerable
- protected

Position is the place where the team is at inside the complete ladder. This position will eventually determine which teams he can challenge. In basic terms it comes down to that you can only challenge the teams above you, not below you.

When a challenge has occured, this leads to a match (which is defined by the match system which is implemented).

After the match has taken place there are a few states which are the results:

Option 1. Team 1 wins - Team 2 loses
Option 2.Team 1 loses - Team 2 Wins
Option 3. Both teams rejected the match

The last part is database wise implemented (Since there is a handshake inplace where both teams can decide to reject the match or reschedule). Still... there needs to be a place where this can be entered. But we'll get to that one later.

However, the point where I want to focus on first is the whole ladder (since rescheduling a match has nothing to do with the ladder eventually, since its just a matter of checking a box, and setting up a new match).

So this leads me with option 1 and option 2.
With option 1, Team 1 will get the status of protected, team 2 will get the status of invulnerable
With option 2, Team 1 will get the status of invulnerable, team 2 will get the status of protected

With option 2 however, something different will occur. Team 2 takes the place in the ladder of Team 1, and Team 1 moves one spot down in the ladder.

The states of invulnerable and protected isn't that hard to implement, since it is a matter of setting a flag next to the teams and say if they are invulnerable or protected... nothing special about that part.

Its the positioning that troubles me at this point. A basic ladder could be defined by a simple table where it just says:

Ladder
Team, Position, Status

Thats it basically... However, what if... something goes terribly wrong with the Database system? Is there a way we are able to 're-calculate' what the ladder would look like. I mean, a database is a file... and things are being saved into the file. And a file can... when things go really wrong get corrupt at some point.

Sure, this can happen at some other points aswell, but thats damage which can be restored at some point. But with the ladder as I just described as above, there is no backup on how the ladder is being calculated and so on.

There is however one backup plan that sticks in the back of my mind: The Matches!
The matches contain all the info on who won etc. So using that as a backend for the complete ladder to be rebuild (when needed) I could eventually rebuild the complete ladder from the ground up.

Even better yet, I could even say: Show me what the ladder looked like on 20 december 2010. Ok, show me what the ladder looked like on 11 Januari 2011.

So eventually, using the matches as a reference point, I could use this as a "tracking" mechanism to show a ladder from that given point.

I eventually want to take it THAT far. However, this requires some tinkering and thought process on how to calculate the whole ladder. Since this is the part which requires a lot of testing and simulations to mimic this effect.

I will give it some thought, and work out the details somewhere tomorrow. Since I think (at the current state I am at right now) this is the ideal method to make it work... its a safety net more or less... Just in case things go really wrong.

Geen opmerkingen:

Een reactie posten