Latest Posts

Topic: Improving the AI

GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-01-03, 13:15

Run utils/fix_formatting.py. You will need to have clang-format installed for that to work. Let us know if it's a problem on your system and we'll loosen the requirement in the CI pipeline.


Busy indexing nil values

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-07, 08:45

Hi, I just realized in the code that we don't use the attribute kLogRefiner anymore i the AI code. This got obsolete perhaps by the basic economy concept anyway. So I think we could savely remove this property from the code, as we don't necessarily have it in the new tribes and faked something there.


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-02-07, 08:48

If the attribute is not used, no need to have it defined...


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-07, 08:57

Tibor wrote:

If the attribute is not used, no need to have it defined...

Although I am pretty sure about my analysis I'd like you to confirm this is not needed. I could take care of the change then if you want.


Top Quote
Tibor

Joined: 2009-03-23, 22:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2020-02-07, 09:13

hessenfarmer wrote:

Tibor wrote:

If the attribute is not used, no need to have it defined...

Although I am pretty sure about my analysis I'd like you to confirm this is not needed. I could take care of the change then if you want.

From my head I'am not able to say it, but if you dont see it in the code, then for sure it will be OK to delete from enum


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

kLogRefiner is not used any more, we can get rid of it. Good catch face-smile.png

Delete TribeDescr::refinedlog_ + related functions too, and the Lua table entries.

Edited: 2020-02-07, 09:32

Busy indexing nil values

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-07, 09:49

GunChleoc wrote:

Delete TribeDescr::refinedlog_ + related functions too, and the Lua table entries.

that is not that easy as it is still used in some parts of the code So this needs to be analyzed first.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-02-07, 09:52

I know the code well and can take care of it.


Busy indexing nil values

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 14:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-02-07, 09:56

Actually, tribe_->refinedlog() is still being used, so it has to stay. For example:

if (!(temp_buildcosts.first == tribe_->rawlog() ||
    temp_buildcosts.first == tribe_->refinedlog() ||
    temp_buildcosts.first == tribe_->granite())) {
        bo.critical_building_material.push_back(temp_buildcosts.first);
}

Busy indexing nil values

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 22:16
Posts: 2648
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-07, 16:53

Found another probably unused property.
It seems as if kIronMine isn't used as well.


Top Quote