Latest Posts

Topic: Distance of player starting positions

kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-12-13, 21:42

For a special map ("artifacts race") i want to have the starting player positions nearby so that each player could see the opponent, but couldn't fight (reach) him. This was not possible, because the distance of each player starting position is set to 24. See editor_set_starting_pos_tool.h

The question is: Why is this value set to this amount? Wouldn't it be better to have it something like "tribes/buildings/warehouses/TRIBENAME/headquarters/init.lua: conquers + x" where is "x" is something between 1 and 5?

I have tweaked the starting position by editing the file player_position in the map folder (if maps gets unzipped). This seems to be ok, but is not tested during a play test yet.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-12-13, 22:08

I have no idea when and why that decision was made.

Just having conquers+x might be problematic, because one can change the player tribe after setting the starting position. We could iterate over all headquarters though if we added a property "is_headquarters" to the files.


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-12-13, 22:33

Well, currently all "conquer"-values for each headquarter is set to "9". So for current situation it's for all headquarters the same and changing the tribe would not cause any problems.

Of course the conquer-values for headquarters could may change in future....

Tweaking the value isn't as complicated though face-smile.png


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-12-14, 00:05

I suppose the idea is to have a map like "the gathering" in settlers 2. Problem is, building conquer range works differently here than in s2. In s2, if two buildings were close, a compromise was reached on the border line. In widelands, the first building defines the border line, and that cannot be moved. So our engine does not know how to deal with headquarters starting a less than 19 tiles away


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-12-14, 06:23

Yes, we do need to take that into account. I'd say max(conquer range) + 1 should do it?

kaputtnik wrote:

Of course the conquer-values for headquarters could may change in future....

Exactly. I also like flexible designs, because some people like to mod the init files, for example. As a general coding rule, calculated values are always better than hardcoded ones, and everything should only be defined once. It is a benefit of the One Tribe engine change that we can do this here now face-smile.png

Edited: 2015-12-14, 06:28

Busy indexing nil values

Top Quote
kaputtnik
Avatar
Topic Opener
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-12-14, 07:27

GunChleoc wrote:

Yes, we do need to take that into account. I'd say max(conquer range) + 1 should do it?

If we make it + 2 its maybe more secure? This should be tested....

By the way: Why is there a tribe to chose, when setting a starting position?


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-12-14, 07:38

kaputtnik wrote:

By the way: Why is there a tribe to chose, when setting a starting position?

I don't know - I think somebody once tried to implement a tool to place buildings? We have some commented out code for that somewhere, so I guess it didn't work at the time.

Edited: 2015-12-14, 07:39

Busy indexing nil values

Top Quote
wl-zocker

Joined: 2011-12-30, 17:37
Posts: 495
Ranking
Tribe Member
Location: Germany
Posted at: 2015-12-14, 12:51

By the way: Why is there a tribe to chose, when setting a starting position?

I think this has an influence when one writes scenarios, where the player cannot choose their tribe.

So our engine does not know how to deal with headquarters starting a less than 19 tiles away

I think I have done this test with two fortified villages (castles have a larger conquer range): IIRC, the first player owned the whole territory, while the second player had a "dent".

I guess if the distance between two headquarters is >9, the second headquarters would be completely surrounded by enemy territory (similar to a conquered military building).

The very-long-term fix would be to display the conquer range of the headquarters in the editor (very-long-term because it would be desirable to see the work area/conquer range of all buildings pre-set in the editor, which is not possible at the moment, but which would make scenario design much easier). Then, the player could decide himself/herself at what distance headquarters are placed.

For now, we could set the limit to 19 or 20 to avoid any imbalance.


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

Top Quote
DragonAtma
Avatar
Joined: 2014-09-14, 01:54
Posts: 351
Ranking
Tribe Member
Posted at: 2015-12-14, 12:59

Yes, territory is "first come, first served". It's the same reason why if you conquer a an enemy military military building close to another one (but not so close it burns down) it's completely surrounded by enemy territory.

I tend to call those sprinkles because on the minimap they look like a cupcake's sprinkles.


Top Quote
EgyLynx

Joined: 2010-08-22, 08:51
Posts: 40
Ranking
Pry about Widelands
Posted at: 2015-12-15, 20:35

Isn´t ealier smaler? I think i can´t make same let same distance what it let at 16?

Or i remeber wrong...


Top Quote