[Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_fields_update into lp:widelands

2018-01-16 Thread bunnybot
Refusing to merge, since Travis is not green. Use @bunnybot merge force for 
merging anyways.

Travis build 3016. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/322659579.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_fields_update/+merge/335589
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_fields_update.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_fields_update into lp:widelands

2018-01-16 Thread GunChleoc
Tested.

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_fields_update/+merge/335589
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_fields_update.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/irc_users into lp:widelands

2018-01-16 Thread Notabilis
Was already done. ;)
Thanks!

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/irc_users/+merge/335898
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/irc_users.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
ad 1) OK, I will consider better one

ad 2) I did not know it, I will be more careful next time
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread GunChleoc
If you can't think of a better variable name, we can leave it, although it 
sounds a bit strange.

bunnybot will also run clang-format on each merge to trunk, so there will be 
differences.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
as for clang-format: if I run clang-format over defaultai.cc and merge to 
trunk, and re-run it 2 months later, there should not be such differences I 
believe. Both clang-formats are run on the same machine...
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
as for unowned_portspace_vicinity_nearby: some fields are restricted, listed in 
ports_vicinity, but here we dont talk about this, but about normal (allowed) 
buildable fields, and this is count of such "vicinity fields", so this is 
something like second / outer circle of fields around ports...

-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread GunChleoc
clang-format results are somewhat system-dependent, so results can differ from 
what bunnybot will produce. So, you will probably get the same differences the 
next time.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-tutorial1 into lp:widelands

2018-01-16 Thread GunChleoc
The Ctrl hint was already there, but not in the objective. So, I have made it 
more apparent with an arrow bullet point and added it there too.

Thanks for the review!

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-tutorial1/+merge/336054
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-tutorial1.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-tutorial4 into lp:widelands

2018-01-16 Thread GunChleoc
The proposal to merge lp:~widelands-dev/widelands/fh1-tutorial4 into 
lp:widelands has been updated.

Commit Message changed to:

Converted Tutorial 4 to new font renderer. Added new function 
"join_sentences(sentence1, sentence2)" to richtext.lua

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fh1-tutorial4/+merge/336171
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-tutorial4 into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-tutorial4 into lp:widelands

2018-01-16 Thread GunChleoc
GunChleoc has proposed merging lp:~widelands-dev/widelands/fh1-tutorial4 into 
lp:widelands.

Commit message:
Converted Tutorial 4 to new font renderer.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fh1-tutorial4/+merge/336171
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/fh1-tutorial4 into lp:widelands.
=== modified file 'data/campaigns/tutorial04_economy.wmf/scripting/texts.lua'
--- data/campaigns/tutorial04_economy.wmf/scripting/texts.lua	2017-12-16 10:48:12 +
+++ data/campaigns/tutorial04_economy.wmf/scripting/texts.lua	2018-01-16 20:07:29 +
@@ -6,8 +6,7 @@
 -- Some formating functions
 -- =
 
-include "scripting/formatting.lua"
-include "scripting/format_scenario.lua"
+include "scripting/richtext_scenarios.lua"
 
 
 -- =
@@ -16,7 +15,7 @@
 
 intro1 = {
title = _"Your Economy and its Settings",
-   body = rt(
+   body = (
   h1(_[[Economy]]) ..
   p(_[[Welcome back. In this tutorial, I’ll tell you what you can do to check how well your economy works.]]) ..
   p(_[[Building your economy up and making it work well and grow is the main part of Widelands. But you can’t control the workers directly – they will follow the general conditions you set.]]) ..
@@ -29,7 +28,7 @@
position = "topright",
field = field_near_border,
title = _"A Peaceful Land",
-   body = rt(
+   body = (
   p(_[[Now about the map: you have settled in a nice valley between two mountains, rich in marble, iron ore and coal. All were hoping for a peaceful life.]]) ..
   p(_[[But one day, you discovered a barren wasteland with abandoned buildings in the east. A strange aura came from there, and no one wanted to set foot there. But the border could not be left undefended, and so you constructed three castles.]]) ..
   p(_[[You had not been prepared for war, and you have to hurry now to build up an army.]])
@@ -40,7 +39,7 @@
 tavern_burnt_down = {
position = "topright",
title = _"The Tavern is Burning!",
-   body = rt(
+   body = (
   h1(_[[An accident]]) ..
   p(_[[Oh no, look at this: our tavern is burning! In all the hurry, our innkeeper accidentally dropped a torch. She is fine, but we could not extinguish the fire in time.]])
),
@@ -51,59 +50,51 @@
 building_stat = {
position = "topright",
title = _"Building statistics",
-   body = rt(
+   body = (
   h1(_[[Check out your taverns]]) ..
-  p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]])
-   ) ..
-   rt("image=images/wui/menus/menu_toggle_menu.png",p(_[[First, you will have to open the statistics menu (you can find the corresponding button at the bottom). We will need this menu several times.]])) ..
-   rt("image=images/wui/menus/menu_building_stats.png",p(_[[Afterwards, choose the ‘Building statistics’.]]) ..
-  paragraphdivider() ..
-  listitem_bullet(_[[Open the building statistics window.]]) ..
-  listitem_arrow(_[[You can also use the hotkey ‘b’.]])
+  p(_[[At first, we should find out how many taverns we currently have. Widelands offers you a window where you can easily check this.]]) ..
+  li_image("images/wui/menus/menu_toggle_menu.png", _[[First, you will have to open the statistics menu (you can find the corresponding button at the bottom). We will need this menu several times.]]) ..
+  li_image("images/wui/menus/menu_building_stats.png", _[[Afterwards, choose the ‘Building statistics’.]]) ..
+  li(_[[Open the building statistics window.]]) ..
+  li_arrow(_[[You can also use the hotkey ‘b’.]])
),
h = 350,
obj_name = "open_building_stat",
obj_title = _"Open the building statistics window.",
obj_body =
-  rt("image=images/wui/menus/menu_building_stats.png", p(_[[The building statistics window gives you an overview over the buildings you have.]])) ..
-   rt(
-  paragraphdivider() ..
+  li_image("images/wui/menus/menu_building_stats.png", _[[The building statistics window gives you an overview over the buildings you have.]]) ..
   -- TRANSLATORS: "it" refers to the building statistics window
-  listitem_bullet(_[[Open it. You can access it from the statistics menu.]]) ..
-  listitem_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]])
-   )
+  li(_[[Open it. You can access it from the statistics menu.]]) ..
+  li_arrow(_[[The statistics menu is accessed via the second button at the bottom. It provides several windows that give you information about the game.]])
 }
 
 explain_building_stat = {
title = _"Building Statistics",
-   body = rt(
+   body = (
   p(_[[This is the building statistics window. It shows you all buildings you can own, 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-tutorial2 into lp:widelands

2018-01-16 Thread GunChleoc
Thanks for the review :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-tutorial2/+merge/336055
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-tutorial2.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-tutorial1 into lp:widelands

2018-01-16 Thread kaputtnik
Review: Approve testing

LGTM

What i miss is a hint pressing CTRL while connecting two flags. Could addressed 
later or in a different tutorial.

Anything against merging this?
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-tutorial1/+merge/336054
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-tutorial1.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread TiborB
Those differences came to exist due to clang-format, and I dont understand why 
they are there Does rules for clang-format changes over time? but at least 
next time I will run clang-format there should not be such differences anymore.
-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-tutorial2 into lp:widelands

2018-01-16 Thread kaputtnik
Review: Approve testing

LGTM :-)

Anything against merging this?
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1-tutorial2/+merge/336055
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/fh1-tutorial2.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/fh1-tutorial1 into lp:widelands

2018-01-16 Thread GunChleoc
Thanks for the review, I'll take on board some of your suggestions :)

As to the objectives, I wholeheartdly agree - I filed a bug for that already:

https://bugs.launchpad.net/widelands/+bug/1406299

Diff comments:

> === modified file 
> 'data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua'
> --- data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua   
> 2017-12-16 10:48:12 +
> +++ data/campaigns/tutorial01_basic_control.wmf/scripting/texts.lua   
> 2018-01-12 19:03:59 +
> @@ -308,7 +288,7 @@
> position = "topright",
> field = road_building_field,
> title = _"Road Building",
> -   body = rt(p(_[[Or, you can directly click the flag where the road should 
> end, like so:]])),
> +   body = p(_[[Or, you can directly click the flag where the road should 
> end, like so:]]),

I did that to keep the diff small.

> h = 200,
> w = 250
>  }
> @@ -396,27 +370,23 @@
> popup = true,
> title = _"Messages",
> heading = _"Introducing Messages",
> -   body = rt(
> +   body = (
>p(_[[Hi, it’s me again! This time, I have sent you a message. Messages 
> are sent to you by Widelands to inform you about important events: empty 
> mines, attacks on your tribe, won or lost military buildings, resources 
> found…]]) ..
>p(_[[The message window can be toggled by the second button from the 
> right at the bottom of the screen. This button will also change appearance 
> whenever new messages are available, but there is also a bell sound played 
> whenever you receive a new message.]]) ..

Good idea. This one is not as trivial as it sounds though, because the message 
icon can change appearance. So, that would probably include a string change too.

> -  p(_[[You have two messages at the moment. This one, which you are 
> currently reading, and the one that informed you that a new headquarters was 
> added to your economy. Let’s learn how to archive messages: first, select the 
> message that you wish to archive by clicking on it in the list. Then, click 
> the]])
> -   ) ..
> -   rt("image=images/wui/messages/message_archive.png", p(_[[‘Archive 
> selected message’ button to move it into your archive.]])) ..
> -   rt(
> +  p(_[[You have two messages at the moment. This one, which you are 
> currently reading, and the one that informed you that a new headquarters was 
> added to your economy. Let’s learn how to archive messages: first, select the 
> message that you wish to archive by clicking on it in the list. Then, click 
> the]]) ..
> +  li_image("images/wui/messages/message_archive.png", _[[‘Archive 
> selected message’ button to move it into your archive.]]) ..
>p(_[[Once you have archived a message, another message will be 
> selected automatically from the list.]]) ..
> -  paragraphdivider() ..
> -  listitem_arrow(_[[You can also hold down the Ctrl or Shift key to 
> select multiple messages, or press Ctrl + A to select them all.]]) ..
> -  listitem_bullet(_[[Archive all messages that you currently have in 
> your inbox, including this one.]])
> +  li_arrow(_[[You can also hold down the Ctrl or Shift key to select 
> multiple messages, or press Ctrl + A to select them all.]]) ..
> +  li(_[[Archive all messages that you currently have in your inbox, 
> including this one.]])
> ),
> obj_name = "archive_all_messages",
> obj_title = _"Archive all messages in your inbox",
> -   obj_body = rt(
> +   obj_body = (
>h1(_"Archive Your Inbox Messages") ..
>p(_[[The message window is central to fully controlling your tribe’s 
> fortune. However, you will get a lot of messages in a real game. To keep your 
> head straight, you should try to keep the inbox empty.]]) ..
> -  paragraphdivider() ..
> -  listitem_bullet(_[[Archive all your messages in your inbox now.]]) ..
> -  listitem_arrow(_[[To do so, open the message window by pressing ‘n’ or 
> clicking the second button from the right at the very bottom of the screen. 
> The newest message will be marked for you automatically. Keep clicking the 
> ‘Archive selected message’ button until all messages have been archived and 
> the list is empty.]]) ..
> -  listitem_arrow(_[[You can also hold down the Ctrl or Shift key to 
> select multiple messages, or press Ctrl + A to select them all.]])
> +  li(_[[Archive all your messages in your inbox now.]]) ..
> +  li_arrow(_[[To do so, open the message window by pressing ‘n’ or 
> clicking the second button from the right at the very bottom of the screen. 
> The newest message will be marked for you automatically. Keep clicking the 
> ‘Archive selected message’ button until all messages have been archived and 
> the list is empty.]]) ..
> +  li_arrow(_[[You can also hold down the Ctrl or Shift key to select 
> multiple messages, or press Ctrl + A to select them all.]])
> )
>  }
>  
> @@ -455,49 +423,45 @@
>  destroy_quarries_message = {
> position = "topright",
> 

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/irc_users into lp:widelands

2018-01-16 Thread GunChleoc
Code still LGTM, 1 nit.

Diff comments:

> === modified file 'src/network/internet_gaming.cc'
> --- src/network/internet_gaming.cc2017-11-30 20:45:41 +
> +++ src/network/internet_gaming.cc2018-01-10 19:08:53 +
> @@ -800,8 +805,18 @@
>  _("Message could not be sent: Was this supposed to 
> be a private message?"));
>   return;
>   }
> + std::string recipient = msg.substr(1, space - 1);
> + for (const InternetClient& client : clientlist_) {
> + if (recipient == client.name && client.build_id == 
> "IRC") {
> + format_and_add_chat(
> +"", "", true,
> +_("Private message to IRC users are not 
> supported."));

Private message -> Private messages

> + return;
> + }
> + }
> +
>   s.string(trimmed);   // message
> - s.string(msg.substr(1, space - 1));  // recipient
> + s.string(recipient);  // recipient
>  
>   format_and_add_chat(clientname_, msg.substr(1, space - 1), 
> false, msg.substr(space + 1));
>  


-- 
https://code.launchpad.net/~widelands-dev/widelands/irc_users/+merge/335898
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/irc_users.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~trimardio/widelands-website/module_scheduling into lp:widelands-website

2018-01-16 Thread GunChleoc
Thanks for the screenshots!

Can you use a sans serif font (e.g. Arial) for the Latin numbers rather than 
the serif font that you have like now? his will greatly increase legibility.

As a rule of thumb, use serif for printed publications and sans serif for 
computer screens.
-- 
https://code.launchpad.net/~trimardio/widelands-website/module_scheduling/+merge/335570
Your team Widelands Developers is requested to review the proposed merge of 
lp:~trimardio/widelands-website/module_scheduling into lp:widelands-website.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1574379-forester-wit into lp:widelands

2018-01-16 Thread Klaus Halfmann
> return forester_cache[mi] = correct_val;
< forester_cache[mi] = correct_val;"
< return correct_val;

Well any compiler with some omptimization should optimize this away.
Maybe som bad habit from the old days of C programming :-)


> The comparison (cache_entry > kInvalidForesterEntry) looks weird. 

Yes I thought about this, too. It its more robust, in case one of the
calculactions later returns some negative value this might fix it?

Feel freee to change these aspects as you wish.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1574379-forester-wit/+merge/336068
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1574379-forester-wit.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/ai_portspaces into lp:widelands

2018-01-16 Thread GunChleoc
Review: Approve

Code LGTM, just a few tiny nits. Not tested.

There were a lot of entries in the diff that don't contain any code changes at 
all - please use a merge tool like Meld to compare to trunk the next time this 
happens. This will save the reviewer a lot of time.

Diff comments:

> === modified file 'src/ai/ai_help_structs.cc'
> --- src/ai/ai_help_structs.cc 2017-11-24 09:19:52 +
> +++ src/ai/ai_help_structs.cc 2018-01-06 19:40:55 +
> @@ -236,6 +236,7 @@
>   unowned_land_nearby(0),
>   enemy_owned_land_nearby(0U),
>   unowned_buildable_spots_nearby(0U),
> + unowned_portspace_vicinity_nearby(0U),

"vicinity" means the same as "nearby", so you can just drop it from the 
variable name.

>   nearest_buildable_spot_nearby(0U),
>   near_border(false),
>   unowned_mines_spots_nearby(0),
> 
> === modified file 'src/ai/defaultai.cc'
> --- src/ai/defaultai.cc   2017-12-10 21:19:02 +
> +++ src/ai/defaultai.cc   2018-01-06 19:40:55 +
> @@ -997,6 +979,19 @@
>   }
>   }
>  
> + // getting list of all fields nearby port space
> + // TODO it seems port spaces can change over time so ports_vicinity 
> needs to be refreshed from

TODO(tiborb):

> + // time to time
> + for (const Coords& c : map.get_port_spaces()) {
> + MapRegion mr(map, 
> Area(map.get_fcoords(c), 3));
> + do {
> + const uint32_t hash = mr.location().hash();
> + if (!ports_vicinity.count(hash)) {
> + ports_vicinity.insert(hash);
> + }
> + } while (mr.advance(map));
> + }
> +
>   // printing identified basic buildings if we are in the basic economy 
> mode
>   basic_economy_established = 
> persistent_data->remaining_basic_buildings.empty();
>   if (!basic_economy_established) {
> @@ -2454,10 +2436,21 @@
>  
>   int32_t prio = 0;  // score of a bulding on a field
>  
> + // testing for reserved ports
> + if (!bo.is(BuildingAttribute::kPort)) {
> + if (bf->portspace_nearby == 
> ExtendedBool::kTrue) {
> + if (num_ports == 0) {
> + continue;
> + }
> + // If we have at least on port, we can 
> perhaps build here something

on -> one  build something here

> + // but decreasing the score to 
> discourage it
> + prio -= 5 * 
> std::abs(management_data.get_military_number_at(52));
> + }
> + }
> +
>   if (bo.type == BuildingObserver::Type::kProductionsite) 
> {
>  
> - prio = 
> management_data.neuron_pool[44].get_result_safe(bf->military_score_ / 20) / 5;
> - assert(prio >= -20 && prio <= 20);
> + prio += 
> management_data.neuron_pool[44].get_result_safe(bf->military_score_ / 20) / 5;
>  
>   // this can be only a well (as by now)
>   if (bo.is(BuildingAttribute::kWell)) {


-- 
https://code.launchpad.net/~widelands-dev/widelands/ai_portspaces/+merge/335785
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/ai_portspaces.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~weedfreak/widelands/recycling_centre into lp:widelands

2018-01-16 Thread room101
Thanks for the feedback. I had been thinking about upgrades for workers, 
your suggestions for building variety is great, it seemed odd to me they 
all worked the same way. I have some ideas to work on.


If this looks like it might be acceptable as an idea then I will work on 
some buildings to go with it, it did not seem useful to spend hours on 
graphics if the basic idea was rejected. I have some ideas about getting 
the AI players to use the buildings better.



On 13/01/18 20:48, Klaus Halfmann wrote:

I played this now on a simple map playing barbarians.
The basic idea works fine and is not totally unrealistic.
Later in the game you "suddenly" have more metal (but then again lack the coal, 
well).

I'd suggest to have some variations perhaps:

e.g. Atlanters can enhance a smelting works to add recyling.
The imperials could have recycling as an enhancement of the metal works.

The icon for the scrap metal is already fine for me, we need some
more building pictures of course.

Gun: perhaps a nice idea for R21 while we start to freeze a R20?

Thanks for your nice work.


--
___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp