Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/amazons-coding-changes into lp:widelands

2019-09-05 Thread hessenfarmer
Hm I still get the following error in a release build.

Unexpected error during the game
vector::_M_range_check: __n (which is 255) >= this->size() (which is 131)

will install a debug build now
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/amazons-coding-changes.

___
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/amazons-coding-changes into lp:widelands

2019-09-05 Thread GunChleoc
Review: Approve

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

___
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/amazons-coding-changes into lp:widelands

2019-09-05 Thread GunChleoc
Review: Approve

Looks like the crash has been identified: 
https://www.widelands.org/forum/topic/2897/?page=11#post-29630

So, this is a data issue unrelated to this branch.

I'll revert the tribes and merge.
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/amazons-coding-changes.

___
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/amazons-coding-changes into lp:widelands

2019-09-05 Thread TiborB
try with gdb if you can
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/amazons-coding-changes.

___
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/amazons-coding-changes into lp:widelands

2019-09-05 Thread hessenfarmer
While running an Ai only local multiplayer with 4 amazon tribes I get a crash 
with not very much information logged. Currently I don't know where this is 
coming from.
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/amazons-coding-changes.

___
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/amazons-coding-changes into lp:widelands

2019-09-03 Thread Benedikt Straub
Fixed the fieldaction bug and split off FindNodeTerraform.
New terraform syntax:
 "findspace=size:any radius:6 terraform",
 "walk=coords",
 "terraform",
 "return"

There´s no real reason why we need a World or EGBase in Tool parameters, is 
there? I removed it, as it can be fetched directly from the provided EIA.

I would prefer to keep the EGBase parameter in FindNode::accept. For now World 
and Map would suffice, but if we want to write some other new worker program 
for a new tribe someday (e.g. a forester that plants trees only in the 
territory of enemy players?) there´s no way around an EGBase param, no need to 
do the whole rework again then IMHO.
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/amazons-coding-changes.

___
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/amazons-coding-changes into lp:widelands

2019-08-30 Thread hessenfarmer
Review: Needs Fixing playtest

I confirmed the critical behaviour (not having the build menu with buildcaps 
already have a flg build) is not in trunk so this needs fixing
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/amazons-coding-changes.

___
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/amazons-coding-changes into lp:widelands

2019-08-28 Thread hessenfarmer
I just tested it with my first loadable(playable?) amazons data dir. However I 
didn't get a building menu when clicking on buildcap that already had a flg 
built. I got a view only menu instead.
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/amazons-coding-changes 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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/amazons-coding-changes into lp:widelands

2019-08-28 Thread GunChleoc
I have done a first round of code review, no testing yet.

Diff comments:

> 
> === modified file 'src/editor/tools/delete_critter_tool.cc'
> --- src/editor/tools/delete_critter_tool.cc   2019-02-23 11:00:49 +
> +++ src/editor/tools/delete_critter_tool.cc   2019-08-23 14:48:43 +
> @@ -41,7 +40,7 @@
>   do
>   if (Widelands::Bob* const bob = 
> mr.location().field->get_first_bob()) {
>   args->old_bob_type.push_back(>descr());
> - bob->remove(egbase);
> + bob->remove(eia.egbase());

We have egbase as a function parameter, so no need to get it from eia

>   } else {
>   args->old_bob_type.push_back(nullptr);
>   }
> 
> === modified file 'src/editor/tools/delete_immovable_tool.cc'
> --- src/editor/tools/delete_immovable_tool.cc 2019-02-23 11:00:49 +
> +++ src/editor/tools/delete_immovable_tool.cc 2019-08-23 14:48:43 +
> @@ -28,18 +28,17 @@
>  /**
>   * Deletes the immovable at the given location
>   */
> -int32_t EditorDeleteImmovableTool::handle_click_impl(const Widelands::World&,
> +int32_t EditorDeleteImmovableTool::handle_click_impl(const 
> Widelands::EditorGameBase&,
>   const 
> Widelands::NodeAndTriangle<>& center,
> - EditorInteractive& 
> parent,
> + EditorInteractive& eia,
>   EditorActionArgs* args,
>   Widelands::Map* map) {
> - Widelands::EditorGameBase& egbase = parent.egbase();
>   Widelands::MapRegion> mr(
>  *map, 
> Widelands::Area(map->get_fcoords(center.node), 
> args->sel_radius));
>   do
>   if (upcast(Widelands::Immovable, immovable, 
> mr.location().field->get_immovable())) {
>   
> args->old_immovable_types.push_back(immovable->descr().name());
> - immovable->remove(egbase);  //  Delete no buildings or 
> stuff.
> + immovable->remove(eia.egbase());  //  Delete no 
> buildings or stuff.

We have egbase as a function parameter, so no need to get it from eia

>   } else {
>   args->old_immovable_types.push_back("");
>   }
> 
> === modified file 'src/editor/tools/resize_tool.cc'
> --- src/editor/tools/resize_tool.cc   2019-04-24 07:09:29 +
> +++ src/editor/tools/resize_tool.cc   2019-08-23 14:48:43 +
> @@ -43,18 +42,17 @@
>   args->resized.deleted_fields =
>  map->resize(egbase, center.node, args->new_map_size.w, 
> args->new_map_size.h);
>  
> - map->recalc_whole_map(world);
> + map->recalc_whole_map(egbase);
>   return 0;
>  }
>  
>  int32_t
> -EditorResizeTool::handle_undo_impl(const Widelands::World& world,
> +EditorResizeTool::handle_undo_impl(const Widelands::EditorGameBase&,
> const 
> Widelands::NodeAndTriangle& center,
> -   EditorInteractive& parent,
> +   EditorInteractive& eia,
> EditorActionArgs* args,
> Widelands::Map* map) {
> - Widelands::EditorGameBase& egbase = parent.egbase();
> -
> + Widelands::EditorGameBase& egbase = eia.egbase();

Delete this line - we are already passing in EditorGameBase as a function 
argument; use that. Please check all editor tools to see that the code is 
cleaned up for the new function parameter.

>   map->resize(egbase, center.node, args->resized.old_map_size.w, 
> args->resized.old_map_size.h);
>  
>   for (const auto& it : args->resized.deleted_fields) {
> 
> === modified file 'src/logic/map.cc'
> --- src/logic/map.cc  2019-06-25 08:03:30 +
> +++ src/logic/map.cc  2019-08-23 14:48:43 +
> @@ -168,18 +168,19 @@
>   check_neighbour_heights(f, radius);
>   recalc_brightness(f);
>   recalc_border(f);
> - recalc_nodecaps_pass1(world, f);
> + recalc_nodecaps_pass1(egbase, f);
>   }
>  
>   for (int16_t y = 0; y < height_; ++y)
>   for (int16_t x = 0; x < width_; ++x) {
>   f = get_fcoords(Coords(x, y));
> - recalc_nodecaps_pass2(world, f);
> + recalc_nodecaps_pass2(egbase, f);
>   }
>   recalculate_allows_seafaring();
>  }
>  
> -void Map::recalc_default_resources(const World& world) {
> +void Map::recalc_default_resources(const EditorGameBase& egbase) {

We only need the world in this function, so this change can be reverted.

> + const World& world = egbase.world();
>   for (int16_t y = 0; y < height_; ++y)
>   for (int16_t x = 0; x < width_; ++x) {
>   

Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/amazons-coding-changes into lp:widelands

2019-08-23 Thread Benedikt Straub
For more information about the concepts, see the discussion at 
https://www.widelands.org/forum/post/29315/ onwards…
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/amazons-coding-changes 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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/amazons-coding-changes into lp:widelands

2019-08-23 Thread Benedikt Straub
The barbarian sites modified in this branch are only testcases, not intended 
for merging. 
The new amazons tribe (under development in another branch) will have a 
"Gardening Center" whose only purpose is that the worker walks around and turns 
the terrain nearby into a different, more fertile terrain type.

The sentry idea is that this "Treetop Sentry" is a platform in the branches of 
a tree. Internally, I have created a value "built_over_immovable" in addition 
to the Size value – a building with this value set can be built only on a 
player-owned node where the max nodecaps is >= the building´s size and an 
immovable with the required attribute (in this case: big tree) stands on the 
node. The immovable is then removed when placing the building, but I hacked the 
animations so it looks as if it were still there.

The AI is currently unable to build this sentry, and it won´t build a gardening 
center either, but otherwise it should be unaffected.
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/amazons-coding-changes 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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/amazons-coding-changes into lp:widelands

2019-08-23 Thread TiborB
"treetop" means - in the branches of the mature tree, or does the building 
replace a tree?
-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/amazons-coding-changes 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


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/amazons-coding-changes into lp:widelands

2019-08-23 Thread TiborB
So some sites (barbarian well and forester) will also "upgrade" land types as a 
side effect of cutting wood or mining water? Anyway this does not seem 
dangerous to me.
What I dont understand is capability to build a sentry over a tree. Did you 
create another buildable field type, because this can not be handled by SMALL 
buildcaps... (I know that I can look into code, but the diff is too long.
My basic question is - does this affect AI on current 4 tribes?

-- 
https://code.launchpad.net/~widelands-dev/widelands/amazons-coding-changes/+merge/371725
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/amazons-coding-changes 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