Latest Posts

Topic: new tribe: amazons

hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-09-05, 22:23

It seems we need some changes in the Ai code for amzons. At least we haven't a hunter and a fisher. I faked this for now, to get a step further. It starts now in debug build but crashes after a while with even less output on Stdout.txt. I will be AFAK until sunday so perhaps someone could test it in linux to see what is going on.

Edit: release build delivers still the vector range check error.

Edited: 2019-09-05, 22:33

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-09-05, 22:55

AI will probably able to live without hunters and fishers - but review of code would be useful, but we need a way how to assure correctness check.

Currently all tribes have just one of those. I would hate to hardcode it like:

if 'amazons': hunters == 0
else: hunters == 1

because it is not general enough (for future changes and tribes). Could we put it into LUA files? for example

use_hunter = False

and AI would deduct if the target number is 0 or 1.


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2019-09-05, 23:02

i was just thinking of having an assert like <=1. Hunters are only essential for barbarians. Alternatively we could allow multiple BuildingAttributes for one building. I haven't made my mind yet about this. First we need to not crash in Ai mode. Afterwards we could teach Ai code to handle amazon specifics like we did with frisians.
I totally agree on not hardcoding any tribe name into C++. I prefer to use lua and generic c++ checks instead. thanks for your quick contribution.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-09-05, 23:23

Well, I dont agree with "<=", because hunter MUST BE identified as hunters, and non hunters MUST NO BE identified as hunters.

Hunters (as example) is category of its own with own codepath and logic. We dont want situation when a hunter is treated as ranger, or bakery as hunter. It might not crash, but would do nonsensical things under the hood.

So identification of hunters (and other single-building categories) must be 100% reliable, no tolerance here. No temporary "no-crash" duck tape solution, please...

Edited: 2019-09-05, 23:24

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-09-05, 23:41

Our current problem is not that non hunters MUST NO BE identified as hunters, but that we HAVE TO HAVE a hunter. So, if tribe has building type hunter, build x amount of them, if not, build none.


Busy indexing nil values

Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2019-09-06, 00:15

I just say that the asserts must be exact. Either ==0 or ==1. And not loose <=1. It can be done in separate branch, but the result should be that current behavior toward current tribes will not be changed, so assert will for those tribes remain ==1 as it is now.

Proposed <=1 can be used for temporary testing as a workaround.

I am bit nervous about "improvements" in the game that break actual presumptions, f.e. one day we will have farms that as a side activity mine gold and bake bread and somebody will ask to "fix AI"

Making sure that AI survives without hunters and so on is separate task, and I can review the AI code for this.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-09-06, 09:31

I am getting lonts of merge conflict from trunk now due to the automatic clang-format. @Nordfriese Can C++ in the amazons branch simply be overwritten by what's in trunk now? This will make testing easier.


Busy indexing nil values

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2019-09-06, 10:31

I have created a merge request for the AI change: https://code.launchpad.net/~widelands-dev/widelands/relax-ai-asserts/+merge/372400

I have double-checked the code, and if there is no hunter building type, the hunter part of the code will be skipped in the AI.


Busy indexing nil values

Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-09-06, 11:27

I am getting lonts of merge conflict from trunk now due to the automatic clang-format. @Nordfriese Can C++ in the amazons branch simply be overwritten by what's in trunk now? This will make testing easier.

Yes, just overwrite everything. The C++ changes in the amazons branch are only an earlier version of the amazons-coding-changes changes.


Top Quote
Nordfriese
Avatar
Joined: 2017-01-17, 18:07
Posts: 1929
OS: Debian Testing
Version: Latest master
Ranking
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-09-06, 12:51

Never mind, I pushed a trunk merge and took care of the merge conflicts


Top Quote