The time of the day at the start should be random.

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderator: Forum Moderators

Terpor
Posts: 22
Joined: March 3rd, 2005, 3:17 pm

The time of the day at the start should be random.

Post by Terpor »

The subject says it all. Particularly in games in small maps, undeads are always in disadvantage because the first critical turns are daylight.
The question is, ¿could the time of the day be random at the start of multiplayer games instead of dawn?
I think that would make the games more balanced and even would help to change the strategies in some well known maps like charge.
Yogibear
Retired Developer
Posts: 1086
Joined: September 16th, 2005, 5:44 am
Location: Hamburg, Germany

Post by Yogibear »

If i am not mistaken, the time of day is controlled by WML and it should be possible to make that random. It would look a bit ugly though (in the scenario config file).
Smart persons learn out of their mistakes, wise persons learn out of others mistakes!
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

[time] can't be set within an event.

Variables are only set within an event, as are if-then structures.

Impasse on the WML end. Since time of day is purely a WML construct, you're SOL without changing WML.

EDIT:
What you CAN do is pick a random number from 1-6 and force all sides to sit out that many turns. Then you can all start on the next day, which will have been chosen randomly. You can do this by surrounding all keeps with shroud until the magic turn and then changing them to castle. The players wouldn't even know which turn it would be until their castles appear.
Hope springs eternal.
Wesnoth acronym guide.
wisdomless
Posts: 193
Joined: September 20th, 2005, 8:17 pm
Location: A galaxy far far away...

Post by wisdomless »

How do you pull that off?
If stupidity got me into this, it should get me out.

Most pointless statement of the year award goes to me!
"People are lazy unless they care."
I'd like to thank unsung for this award... and all the people who helped make this possible...
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

[event]
name=prestart

{VARIABLE_OP start_turn random 1..6}

[/event]

[event]
name=new turn
first_time_only=no

[if]
[variable]
name=start_turn
numerical_equals=$turn_number
[/variable]
[then]

[store_locations]
x=1-99
y=1-99
terrain=W # <- whatever the cavewall terrain letter is
variable=cavewall_locations
[/store_locations]

{FOREACH cavewall_locations i}

{VARIABLE_OP cave_x format $cavewall_locations[$i].x}
{VARIABLE_OP cave_y format $cavewall_locations[$i].y}

[terrain]
x=$cave_x
y=$cave_y
letter=C
[/terrain]

{NEXT i}

[/then]
[/if]
[/event]

I haven't tested it out, but if it doesn't work post back. Surround the keeps with cavewall on the map. Shroud or fog might be better, but I don't know how well shroud would work (since it's a space). Fog (~) has some graphical problems but it might work better since you don't have to dump all of your cavewall.
Hope springs eternal.
Wesnoth acronym guide.
pigandforks
Posts: 48
Joined: October 22nd, 2005, 7:23 am
Location: australia

Post by pigandforks »

that is a good idea let us know how it goes.
wisdomless
Posts: 193
Joined: September 20th, 2005, 8:17 pm
Location: A galaxy far far away...

Post by wisdomless »

I'm not so sure I did it right... I'll let you know when I've got it working.

edit: This goes in the senario config file, yes?
If stupidity got me into this, it should get me out.

Most pointless statement of the year award goes to me!
"People are lazy unless they care."
I'd like to thank unsung for this award... and all the people who helped make this possible...
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

yes
Hope springs eternal.
Wesnoth acronym guide.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Here is working WML. You can make it into a macro, like {RANDOMIZE_TURNS}, and it should work.

Edit: the problem is that it turns all castle tiles into regular castles, but I'm not going to worry about it.

Code: Select all

[event]
name=prestart
	{VARIABLE_OP start_turn random 1..6}
	[store_locations]
	x=1-99
	y=1-99
	radius=1000
	terrain=C,n,N,o
	variable=block_locations
	[/store_locations]
	{FOREACH block_locations i}
		{VARIABLE_OP block_x format $block_locations[$i].x}
		{VARIABLE_OP block_y format $block_locations[$i].y}
		[terrain]
		x=$block_x
		y=$block_y
		letter=~
		[/terrain]
	{NEXT i}
[/event]

#define UNBLOCK_CASTLES
	[if]
	[variable]
	name=start_turn
	numerical_equals=$turn_number
	[/variable]
	[then]
		{FOREACH block_locations i}
			{VARIABLE_OP block_x format $block_locations[$i].x}
			{VARIABLE_OP block_y format $block_locations[$i].y}
			[terrain]
			x=$block_x
			y=$block_y
			letter=C
			[/terrain]
		{NEXT i}
		[/then]
		[/if]
#enddef

[event]
name=start
	{VARIABLE turn_number 1}
	{UNBLOCK_CASTLES}
[/event]

[event]
name=new turn
first_time_only=no
	{UNBLOCK_CASTLES}
[/event]
Hope springs eternal.
Wesnoth acronym guide.
telly
Posts: 260
Joined: January 12th, 2004, 5:07 am

Post by telly »

It'd actually be more difficult for undead I think. It depends on lots of thing but commonly by the turn your forces initially engage its night. I don't see that making it random wouldn't make anything more fair anyway, just random as to who had that unfair advantage.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

telly wrote:I don't see that making it random wouldn't make anything more fair anyway
So does that mean you think it would make it more fair? Canceling out the negatives = I see that making it random would make anything more fair anyway.

Regardless, I thought that was the point. Every non-neutral faction has an equal chance of engaging at its preferred time, whereas before the probability was skewed in favor of chaotics.

To say that still constitutes an unfair advantage is to complain about the time of day system. Unless you have only dawn or dusk, first contact must happen sometime (and if it's dawn or dusk then a preferred time is imminent).
Hope springs eternal.
Wesnoth acronym guide.
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

Scott: You should also reset gold when you unblock them, and set the leaders' moves to -1 in the meantime, because castles are not always surrounding...
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
scott
Posts: 5248
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

I hadn't thought of that. Cool.
Hope springs eternal.
Wesnoth acronym guide.
Terpor
Posts: 22
Joined: March 3rd, 2005, 3:17 pm

Post by Terpor »

Thanks a lot for dedicating your time to this problem. I really think many maps will be more interesting if you don't now what time of the day it will be before choosing your faction (for those who choose it, anyway).
ott
Inactive Developer
Posts: 838
Joined: September 28th, 2004, 10:20 am

Post by ott »

This quote is not attributable to Antoine de Saint-Exupéry.
Post Reply