Page 1 of 1

Handling level command 0 5 0

PostPosted: 09 Apr 2005, 21:36
by peterhughes
level 0 5 0

As far as I understand it, this command is interpretted as:

Play all moves in 5 mintes, with no extra time increment per move.

1) Since you have no idea how many moves it will take to win, how do you decide how much time to allocate to each move?

2) What happens when the 5 mintues run out?

Re: Handling level command 0 5 0

PostPosted: 09 Apr 2005, 22:17
by Pallav Nawani
Hello,

1. Every time I have to make a move, I assume that there are 30 moves left. So I allocate time like this:
time_for_this_move = time_left/30;

2. When time runs out, the engine loses the game.

Pallav

Re: Handling level command 0 5 0

PostPosted: 09 Apr 2005, 22:32
by Volker Annuss
Hello Peter,

the problem is the same that a human player has with that level.

1.) Allocate on average 1/30 of the remaining time for the next move. Of course, you can do much more to get a better timing. For an example look at the arena news ticker from March 23 for an article about timing with neural networks.

2.) The game is lost on time. This is something that happens in levels with sudden death.

Greetings,
Volker

Edit: Pallav, you were faster :wink:

Re: Handling level command 0 5 0

PostPosted: 09 Apr 2005, 23:10
by peterhughes
Right, cheers. I'll do the time/30 thing also.

So... I now have 4 different time modes that I'm supporting:

1) st x: Fixed "x" time per move.

2) level m t 0: A repeating time period of "m" moves in "t" minutes. Here I use time_remaining / ("m" - number_of_moves_made). Once "m" moves has passed, I add an extra "m" moves and "t" time on again.

3) level 0 t i: Here, I calculate "i" time per move, plus "t" base time added on and spread equally over the first 40 moves.

4) level 0 t 0: Finally, fixed game time. I'm now using the "time_remaining / 30" method that you suggested.

Would you say that pretty much covers it?

Re: Handling level command 0 5 0

PostPosted: 10 Apr 2005, 10:49
by Volker Annuss
Hello Peter,

that should work, but imagine level 0 t i with a large t and a small i. For such cases it would be better to use the base time as in 0 t 0.

Greetings,
Volker