Latest Posts

Topic: Completion of a map by symmetry

gnarfk
Avatar
Topic Opener
Joined: 2015-01-05, 16:18
Posts: 70
Ranking
Likes to be here
Location: France
Posted at: 2015-01-23, 19:46

LAZA wrote:

+1 for that option.

especially while playing the map "Desert Tournament" (in the tournament) this map is regard to this point a bit unfair:

  • Gold is only found on the northern sides on both of the mountains in the middle
  • Coal and Ore are only found south on these mountains

So the player(s) sitting in the south has to circle around and therefore needs an important (extensive) furthermore wider expansion than the other player(s).

That is one of the reasons making me think of that idea face-smile.png


Top Quote
gnarfk
Avatar
Topic Opener
Joined: 2015-01-05, 16:18
Posts: 70
Ranking
Likes to be here
Location: France
Posted at: 2015-01-26, 08:26

I've searched for a description of the wrmf file format, but i could'nt find it. Could someone help me find it ? i can try to implement these symmetries or rotations, to see what could be the results.


Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2015-01-26, 17:34

With symmetries one has too keep in mind, that there is an up/down intrinsic asymmetry, and also to some extent a left-right asymmetry. Also I have the feeling, that mining north facing slopes of a symmetric mountain would be more difficult than mining its south-facing slope. I have not checked the last one, though.

On some perfectly symmetric maps this leads to remarkable disadvantage to the player that has to expand south.

Rotational / mirror symmetry does not guarantee a fair play. Having an easy way to make symmetric maps would, of course, still be wonderful.

It would be fun to make a way to run full-AI games en masse, and determine fairness from the distribution of those outcomes. Unfortunately, I cannot invest enough time in the near future.

Edited: 2015-01-26, 17:35

Top Quote
wl-zocker

Joined: 2011-12-30, 17:37
Posts: 495
Ranking
Tribe Member
Location: Germany
Posted at: 2015-01-26, 18:46

I've searched for a description of the wrmf file format, but i could'nt find it. Could someone help me find it ? i can try to implement these symmetries or rotations, to see what could be the results.

Do you mean "wmf"? Those are Widelands map files, which in fact are only zipped folders. You can rename them to .zip and then extract them. I doubt they will be useful though because most information is written as binary data.

Also I have the feeling, that mining north facing slopes of a symmetric mountain would be more difficult than mining its south-facing slope. I have not checked the last one, though.

I do not think so. Widelands mountains cannot be so steep that visibility could be a problem.

On some perfectly symmetric maps this leads to remarkable disadvantage to the player that has to expand south.

That is what I already mentioned in my first post

Rotational / mirror symmetry does not guarantee a fair play. Having an easy way to make symmetric maps would, of course, still be wonderful.

gnarfk suggested to mirror on the northwest-southeast axis, which produces fair two-player maps (the flag of buldings is the only asymmetry I know of). Other maps might need small adjustments (e.g. moving the starting position a bit) to compensate the asymmetry.


"Only few people know how much one has to know in order to know how little one knows." - Werner Heisenberg

Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2015-01-26, 21:12

Drive by comment: In debug mode one can use Lua scripting to quickly prototype a useful tool - just make a lua script and use "dofile" to run it over your map.


Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-01-27, 00:51

I've created a work about the rotations on Widelands' map. It is on my webpage about Widelands: http://student.agh.edu.pl/~rak/widelands/ . Also available on direct link to pdf: http://student.agh.edu.pl/~rak/widelands/files/RotationsOfMap/Rotations_1.00.pdf .

My idea works perfectly with 60*n (n-natural) degrees rotation. With another degrees it needs some interpolation (not too many).

The file contains my look into the problem. Pure solutions for small steps and some coding tips. You can use and test, as you want.

If there is any mistake, please tell me- I will try to fix it. Also I need some feedback, so if anything is not understandable, please tell me.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
gnarfk
Avatar
Topic Opener
Joined: 2015-01-05, 16:18
Posts: 70
Ranking
Likes to be here
Location: France
Posted at: 2015-01-27, 10:51

teppo wrote:

With symmetries one has too keep in mind, that there is an up/down intrinsic asymmetry, and also to some extent a left-right asymmetry. Also I have the feeling, that mining north facing slopes of a symmetric mountain would be more difficult than mining its south-facing slope. I have not checked the last one, though.

There is at least one symmetry that keeps things perfectly fair : the axle following the same direction that between a building and its flag.


Top Quote
gnarfk
Avatar
Topic Opener
Joined: 2015-01-05, 16:18
Posts: 70
Ranking
Likes to be here
Location: France
Posted at: 2015-01-27, 11:08

einstein13 wrote:

I've created a work about the rotations on Widelands' map. It is on my webpage about Widelands: http://student.agh.edu.pl/~rak/widelands/ . Also available on direct link to pdf: http://student.agh.edu.pl/~rak/widelands/files/RotationsOfMap/Rotations_1.00.pdf .

My idea works perfectly with 60*n (n-natural) degrees rotation. With another degrees it needs some interpolation (not too many).

The file contains my look into the problem. Pure solutions for small steps and some coding tips. You can use and test, as you want.

If there is any mistake, please tell me- I will try to fix it. Also I need some feedback, so if anything is not understandable, please tell me.

I just read your file. It looks like a good job.

I have just some questions :

1)when your computer computes the cosine and sine, does it make some approximations ? (if it keeps 10 floating number i think it is enough)

2) you talk about zigzagvector , squarevector , cartesianvector . do squarevector and cartesianvector are the same thing ? i don't get the point of using 3 types of vectors

and i have some idea of optimisation:

in this code , you give the angle as parameter , and the function calculates the matrix for each vector. maybe it should be better to calculate the matrix , and then give the matrix as a parameter. (it should also help using the same code for symmetries )

And a last thing : could you show me the code that lead to the "failing triangle rotation of 90°" ? maybe i can help you fix this

Edited: 2015-01-27, 11:08

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-01-28, 03:48

gnarfk wrote:

I just read your file. It looks like a good job.

Thanks face-smile.png I'm trying to do good job face-wink.png

I have just some questions :

1)when your computer computes the cosine and sine, does it make some approximations ? (if it keeps 10 floating number i think it is enough)

Default, machine precision means 15 floating number. I can make more- it is optional.

2) you talk about zigzagvector , squarevector , cartesianvector . do squarevector and cartesianvector are the same thing ? i don't get the point of using 3 types of vectors

It is the same, and not the same. Maybe you're right that I shouldn't complicate that, but there were: 2 vectors (discrete Cartesian, discrete Zigzag) and their representation on Cartesian plane. I used 3 vectors to do that. Discrete Cartesian can be extrapolated into continuous plane, as you want face-smile.png

maybe it should be better to calculate the matrix , and then give the matrix as a parameter. (it should also help using the same code for symmetries )

Yes, I thought that I mensioned about that in the text. If not- sorry for that. That is a great optimalization, but to be specific I used most exstensive form I know.

And a last thing : could you show me the code that lead to the "failing triangle rotation of 90°" ? maybe i can help you fix this

All code is in .nb file. I used Wolfram Mathematica to check the algorithm and all the calculations. I know that formulas are in Polish- If I have some time, I will translate it into English and put in one place.

http://student.agh.edu.pl/~rak/widelands/files/RotationsOfMap/rotationsMathematica_1.00.pdf

There are all definitions like a compilation of math and programmistic formulas. I didn't make any specific language code. Only Mathematica.

To fix the rotation of 90° we can think about better idea how to rotate. I have one, but it is so complex that I can do it only manualy face-tongue.png That contains shape- analysis, some statistics and differential forms. It shouldn't be like that face-wink.png

EDIT:

The problem with rotation exists when we have to look for nearest discrete point. You can think about formula that will find nearest discrete zigzag point and be shape-safe. My idea didn't save any information about the shape.

Edited: 2015-01-28, 03:55

einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
gnarfk
Avatar
Topic Opener
Joined: 2015-01-05, 16:18
Posts: 70
Ranking
Likes to be here
Location: France
Posted at: 2015-01-28, 08:55

I just want to point out that personally, i prefer rotations of multiples of 60°, which are easy and efficient (for the objective we had first). But we can try to have a "good enough" method for other ones .

einstein13 wrote: To fix the rotation of 90° we can think about better idea how to rotate. I have one, but it is so complex that I can do it only manualy face-tongue.png That contains shape- analysis, some statistics and differential forms. It shouldn't be like that face-wink.png

The problem with rotation exists when we have to look for nearest discrete point. You can think about formula that will find nearest discrete zigzag point and be shape-safe. My idea didn't save any information about the shape.

We have to think about widelands structure. Different types of informations have to be interpolated differently

1) In a edge , we have some algebrical informations : for instance the altitude . so , the altitude of a point can be literally an interpolation of the altitude of the points near to him . Things could be computed in another way. For ressource type and ressource amount and bobs, things could be complicated if the edge is between edges which have different ressource types ...

2) The fields , we have the terrain type. you have to think the image of a field with your rotation. we have to find a way to keep neighbour fields neighbour ....

i don't see any easy way to solve these "non alebric" things without this "nearest point" strategy, but this strategy isn't good . (2 edges could fall on the same one after the rotation ....)

But : if we find a solution for the 90° rotation (which may be particular enough to find a trick) , we will have solutions for any multiple of 30° .


Top Quote