induktio / thinker

AI improvement patch for SMACX.
https://discord.gg/XdFuwWzzku
GNU General Public License v2.0
70 stars 10 forks source link

Questionable social AI evaluation #35

Closed tnevolin closed 2 years ago

tnevolin commented 2 years ago

https://github.com/induktio/thinker/blob/dd260b7dc3f8e4469db006063a4b1793ba4a9e2b/src/main.cpp#L376

This block adds bias for soc_priority_model within soc_priority_category and subtract bias for all other models in this category except default one.


https://github.com/induktio/thinker/blob/dd260b7dc3f8e4469db006063a4b1793ba4a9e2b/src/main.cpp#L382

What this one does? As I understand it adds bias to currently tested model if faction current SE choice is soc_priority_model within soc_priority_category and subtracts bias for all other choices in soc_priority_category category except default one. This logic does not take currently tested category and model into account. Meaning all models in all categories besides the soc_priority_category will get the same bonus/penalty. Is this an intended logic?

induktio commented 2 years ago

I'm not sure what you're trying to report here or with the other issue, or whether the issue relates to actual Thinker version or forked code. But I haven't noted any issues with the variable presented here. It's a very simple and I'd say elegant solution for the AI's SE preferences. Works like this:

Values like 10...20 are "moderate" priority, the AI may sometimes switch out of preferred choice for pop booming, but that's about it.

tnevolin commented 2 years ago

Apologies. I copied wrong line number from the other issue. Updated and also added more details in the description.

induktio commented 2 years ago

That scoring function evaluates a new social choice given by sf and sm parameters (social field, social model). You need to account for the case that those parameters represent a social field that does not contain the faction's preferred choice. It can't just check if sf/sm match the preferred model, because it might be selected anyway in the faction's actual SE settings and the new choice would not change it.