Turn time limit patch

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

mtx
Posts: 23
Joined: August 21st, 2005, 5:11 pm

Turn time limit patch

Post by mtx »

Some time ago, I was about to propose the implementation of a configurable turn time limit in order to avoid those eternal multiplayer games where users take ages to move (me included).

But instead of asking for it, I decided to try to implement it myself as it was more fun.

Here is my attempt if someone wants to try it:

There are three new wml attributes that can be setup in the scenario file:

glob_timeout_turns -> Number of turns where the global time limit is applied
glob_timeout -> Number of seconds for global timeout
turn_timeout -> per turn timeout (seconds)

It works like this:
The player has to finish the number of turns defined in glob_timeout_turns in less time than glob_timeout seconds.
Otherwise the turn_timeout is enabled and when the turn timeout is finished the player's turn automatically ends.
When the player finishes the turns defined in glob_timeout_turns the countdown clock is setup again with glob_timeout seconds and the whole cycle begins again.

if the glob_* variables are not defined, the turn_timeout is applied directly for all turns.

Anyway is easier to test it than to explain... :wink:


Apart from the patch I've included two sample scenarios (single and multiplayer) with time limits implemented, and an awful icon image for the GUI representation (needs to be placed in ./images/misc)
Attachments
time_limit.zip
(6.3 KiB) Downloaded 500 times
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

OK...

first I'm not sure the setings should be WML variables... you probably want to add them to the map settings that are set by the host...

second, I think your agorithm for turn limit is too complicated. I read your description and still didn't get it :oops:


ok, now for the good sides...

it's a great idea, and will probably get included once the patch is ready... let's not rush it and take the time to find something that fits perfectly ;)
Fight key loggers: write some perl using vim
mtx
Posts: 23
Joined: August 21st, 2005, 5:11 pm

Post by mtx »

Well, my explaination was not very good, better to try it in game.

The main idea is that you have an amount of time to make x moves (lets say 15 minutes to make 10 turns). You can take more time in the difficult turns and recover during other less busy turns. However if the 15 minute period has ended and you still haven't done the 10 turns (lets say you have only completed 8 turns) then a per turn timeout is setup for the 2 remaining turns where you have to complete each turn within lets say 40 seconds or the turn will be ended automatically by the program.

In my point of view this schema encourages faster gameplay but allows room to do some planing in difficult situations. Anyway I'm open to other solutions.

About the settings, I agree with you that map settings seems a good place to set them up, however I'm not yet very familiar with wesnoth code and found wml an easy way to test it.

If there is interest in this patch for future game inclusion I don't mind modifying it to whatever fits better to the game.
I'll begin trying to integrate it with MP map settings.
Quensul
Art Contributor
Posts: 303
Joined: January 2nd, 2005, 1:06 am
Location: Pittsburgh, PA

Post by Quensul »

So as I understand it, the timing system is just like playing clocked chess, except you get a new clock every N turns? (And you don't lose if you run out of time :-))
Author of Wercator
mtx
Posts: 23
Joined: August 21st, 2005, 5:11 pm

Post by mtx »

Yes.
I think that making someone directly lose because of beeing slow is too hard. (Being myself quite slow player)
Its just to avoid somebody to take ages every single turn and encourage faster gameplay, but not to completely change the gameplay.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

OK, I got it now.... the names were probably ill choosen... maybe someone has a better idea

if you put it in the game config screen, we can also have tooltips to help understanding.
Fight key loggers: write some perl using vim
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

I think a time limit T for every N turns is a good idea. Just add the time taken in the past (N-1) turns and start counting down for the current turn... if it reaches T their turn will end and they are on "probation" for the next (N-1) turns. While on probation you get (T/N) time or your turn automatically ends (but it won't lengthen your probation). Now when probation ends it resumes counting as normal.
Last edited by Sapient on December 9th, 2005, 3:06 pm, edited 1 time in total.
Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Post by Yogibear »

Great idea, mtx :D .

I don't have enough time to look at it in detail but if our "Patch Monkey" cares, it is in good hands :) .

Now got to go back to make the replays work better :wink: .
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
Darth Fool
Retired Developer
Posts: 2633
Joined: March 22nd, 2004, 11:22 pm
Location: An Earl's Roadstead

Post by Darth Fool »

It seems to me that a "fischer clock" would be a better model. You have some total time for all moves. At the beginning of each turn, your total time is incremented by a fixed amount. This guarantees that you have a minimum amount of time per turn to move, but any excess that you use can be saved for later.

edit: fixed spelling
Last edited by Darth Fool on December 12th, 2005, 12:16 pm, edited 1 time in total.
mtx
Posts: 23
Joined: August 21st, 2005, 5:11 pm

Post by mtx »

Yes, certainly I agree that fisher clock its a better solution (and easier to explain also). Next version of the patch will be based on it.
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

Another suggestion that may be a little harder to implement :
Would it be possible to have a idle timeout too ?
If the played is idle too long the turn would automagically end.
Perharps add a 'pause' command that would suspend/reactivate the all the timeouts.
Do you think it would be a good idea ?
ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

A Fischer clock would work well, and the patent expired some time back.
This quote is not attributable to Antoine de Saint-Exupéry.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Post by Sapient »

I like the fisher clock idea. Even better, would be a micro-fisher clock. You start with a set amount of time each turn, and it increments your turn-clock every time you perform an action that cannot be undone (an attack, a recruitment, etc). That would allow for longer turns depending on the number of units under your control. This would be escpecially useful in 2v1 or 3v1 scenarios, where one player will need more time than the others.

Another idea I had is: when your time expires, you may allow the Artificial Intelligence to complete the move.
mtx
Posts: 23
Joined: August 21st, 2005, 5:11 pm

Post by mtx »

I finally managed to finish the patch.
It ended being much more complex than the initial one, but it's better integrated into the game.
It's based in Fischer clock, values can be defined from the multiplayer create screen, and
it works with MP savegames.

If someone wants to test it, the patch is in
https://gna.org/patch/index.php?func=de ... tem_id=492

Hope you like it !
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

thx, I'll have a look at it ASAP... which won't be before nex week end unfortunately
Fight key loggers: write some perl using vim
Post Reply