Help with testing Fred - Freelands MP Custom AI v0.14.11

Discussion of all aspects of multiplayer development: unit balancing, map development, server development, and so forth.

Moderators: Forum Moderators, Developers

Post Reply
mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Help with testing Fred - Freelands MP Custom AI v0.14.9

Post by mattsc » March 5th, 2018, 8:27 pm

singalen wrote:
March 5th, 2018, 6:32 am
Sorry, it broke again on 1.13.12 - dev version 8(
attempt to call a nil value (filed 'maxn')
ca_zone_control.lua:2636: in field 'execution'
[string "local self, params, data = ..."]:2:in main chunk
Huh, that's strange. The message complains about Lua function table.maxn() not existing. That function was indeed deprecated in Lua 5.2 and removed in 5.3 (I think), but I don't understand why this starts producing errors now. I don't see anything in the Wesnoth changelog since the update to 5.3.4 in Wesnoth 1.13.10. Also, I didn't get that error in my own tests. I'm traveling and don't have access to a compiled version of current master right now though (will have one by the end of the week), so I've been testing with 1.13.11, so maybe something's changed since then that I am not aware of.

Well, whatever the cause, the fix is simple and has been committed. Thanks for reporting.
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Help with testing Fred - Freelands MP Custom AI v0.14.10

Post by mattsc » May 9th, 2018, 2:38 am

So ....

I took a while off from working on Fred because RL was crazy, because I wanted to concentrate on getting my SP campaigns ported to 1.14 and, well, mostly because I wanted some time off. I've been re-familiarizing myself with the status of the code over the last few days and am back at it now.

First thing I did was committing all the previous changes and releasing this as a new version to both the 1.12 and 1.14 add-ons servers. This means that:

Fred / AI-demos v0.14.10 is now available on the Wesnoth 1.12 and 1.14 add-ons servers

A couple important comments: If you've played against Fred before, there's no need to bother with this version. It's a lot of partial fixes to existing problems, some of which are probably making some aspects temporarily worse. The next thing that needs to happen is some serious work on the operations layer which, I hope, will in the end actually make a real difference.

First, however, I am going to remove all the conditionals and duplicate code that makes AI-demos work in both 1.12 and 1.14 and properly port everything to work correctly and without deprecation warnings in 1.14, and 1.14 only. Thus, starting from AI-demos v0.14.11, support for Wesnoth 1.12 will be discontinued. That part isn't all that much work, I think (hope), so I should have that version out within a week or two, after which I'll be back to working on the AI behavior itself.

Anyway, tl;dr. There remains just this:
v0.14.10 complete changelog

Code: Select all

----- 0.14.10, 8 May 2018 -----

- Fred (Freelands AI for Northerners, Side 1):
  - Operations layer:
    - Calculate fronts from in-zone influence only
    - New full-move versions of influence maps
    - Add individual unit influence maps
    - Change to leader_distance metric
    - Fix bug in base_power calculation
    - New menu options to display behavior instructions
  - Attacking:
    - Fix bug which caused Fred to prefer attacking full-health units over easy
      kills
    - Allow using the leader in attacks when there is a small chance of the
      leader to die in the counter attack.
      - This is configurable and can be (re)set to zero CTD if desired
  - Holding:
    - Do not push too far ahead of main front with few units
    - Do not do normal hold if it is too wasteful
    - Keep already protected hexes in protect_locs
  - Advancing:
    - Discourage advancing behind enemy lines without sufficient support
    - Set advance direction to forward or backward depending on enemy threat
      and own-unit support
    - Full reworking of advancement rating (roughly gold-based now)
  - Functionality and misc. other changes:
    - Also turn shroud off at scenario start (shroud can get the AI to crash)
    - fred_utils: new functions linear_regression(), behind_enemy_map(),
      support_maps(), approx_value_loss()
    - Many changes/additions to rating functions, game state maps, supporting
      code and debugging information to support the changes above
    - Add warning that development will be discontinued on Wesnoth 1.12
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

name
Posts: 336
Joined: January 6th, 2008, 3:32 am

Re: Help with testing Fred - Freelands MP Custom AI v0.14.10

Post by name » May 10th, 2018, 4:52 am

mattsc wrote:
May 9th, 2018, 2:38 am
If you've played against Fred before, there's no need to bother with this version.
The changelog looks pretty enticing so I might have to bother just the same.
mattsc wrote:
May 9th, 2018, 2:38 am
The next thing that needs to happen is some serious work on the operations layer
Huzzah!

mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Help with testing Fred - Freelands MP Custom AI v0.14.10

Post by mattsc » May 10th, 2018, 2:19 pm

Cold Steel wrote:
May 10th, 2018, 4:52 am
The changelog looks pretty enticing so I might have to bother just the same.
Well, I won't tell you not to, of course, any input is great, but ... The problem is that some of these new changes aren't balanced right yet. Things like "discourage advancing behind enemy lines without sufficient support" do what they say, but they also cause Fred to be (yet again) too hesitant in some situations. Essentially, it comes down to what you comment on next:
Cold Steel wrote:
May 10th, 2018, 4:52 am
mattsc wrote:
May 9th, 2018, 2:38 am
The next thing that needs to happen is some serious work on the operations layer
Huzzah!
I know I have been saying that I'd do this for several releases now, and then I've always gotten side-tracked by problems I found in the tactical layer. This last round of changes really made it obvious though that I am at a dead end here unless I do actually put in the work on the operations layer. So that's next — until I find something else to distract me. :P

[There's also a not super long, but noticeable delay before every single move now, but that's a comparatively minor issue that I will take care of once the functionality is there.]
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

name
Posts: 336
Joined: January 6th, 2008, 3:32 am

Re: Help with testing Fred - Freelands MP Custom AI v0.14.10

Post by name » May 11th, 2018, 6:36 am

Yeah, the operations layer is the holy grail for wesnoth AI.

Very excited. ^_^

name
Posts: 336
Joined: January 6th, 2008, 3:32 am

Re: Help with testing Fred - Freelands MP Custom AI v0.14.10

Post by name » May 12th, 2018, 3:47 pm

Just a bit of fun with v14.10:

knalgans_vs_14.10_income+6.gz
(33.61 KiB) Downloaded 35 times
undead_vs_14.10_income+6.gz
(41.52 KiB) Downloaded 37 times

It could be that I am rusty, but I did not notice any new or severe issues from the tactical layer. The utility weightings seemed about right.

mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Help with testing Fred - Freelands MP Custom AI v0.14.11

Post by mattsc » May 17th, 2018, 4:32 am

Thanks, Cold Steel, for continuously doing all that play testing (those are some long games!) and posting the replays! Looks like maybe I did not make things significantly worse in 1.14.10 after all. ;) And I'll get a couple nice new test cases out of this.

In the meantime, I just released v0.14.11 with the announced move to Wesnoth 1.14 only. This release consists almost entirely of internal changes and clean-up (well, and the removal of some outdated or broken code or things that are now in Wesnoth mainline). None of Fred's behavior has been changed.

I will now move on to working on the operations layer. I have no idea how long it is going to take until I have progress that will actually make a difference. I am sure that it will take some time, but I am hoping that it is a question of when, not if.
v0.14.10 complete changelog

Code: Select all

----- 0.14.11, 16 May 2018 (drop support for BfW 1.12 and code clean-up) -----

- Remove all the version checks and only keep Wesnoth 1.14 compatible code
  - This means that AI-demos will not work in Wesnoth 1.12 any more starting
    from this version
  - Replace deprecated functions and macros
- Fred (Freelands AI for Northerners, Side 1):
  - Set up the scenario events, menu items, CA debugging tools etc. so that they
    are only present in scenarios actually using Fred.
  - Fred quitting because he does not know how to play the map, faction or side
    should count as player victory, not defeat
- Other misc. changes and clean-up
  - Remove local ai_helper.lua and battle_calcs.lua and use mainline versions
  - Remove prune cart scenario
  - Remove machine learning recruiter code
  - Remove 'Default + Extra Targets' test AI
  - Lots of internal changes and clean-up of Lua code and scenarios
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

name
Posts: 336
Joined: January 6th, 2008, 3:32 am

Re: Help with testing Fred - Freelands MP Custom AI v0.14.11

Post by name » May 18th, 2018, 4:36 pm

mattsc wrote:
May 17th, 2018, 4:32 am
doing all that play testing (those are some long games!)
The funny thing is, they are so long because I tried to make them shorter with more aggressive play early on. Fred did a good job of punishing that recklessness as I should by now have expected.
mattsc wrote:
May 17th, 2018, 4:32 am
I will now move on to working on the operations layer. I have no idea how long it is going to take until I have progress that will actually make a difference. I am sure that it will take some time, but I am hoping that it is a question of when, not if.
Looking at your formidable task list for the operations feature, I wonder if it could be broken up over a number of versions? I imagine many of those sub features will heavily influence each other to the point they may be inseparable. But breaking it up allows you to better evaluate the effects and appreciate the progress you are making so that you do not lose your mind in the middle of it. :)

mattsc
Posts: 1062
Joined: October 13th, 2010, 6:14 pm
Location: Wandering, mostly aimlessly

Re: Help with testing Fred - Freelands MP Custom AI v0.14.11

Post by mattsc » May 19th, 2018, 2:18 pm

Cold Steel wrote:
May 18th, 2018, 4:36 pm
The funny thing is, they are so long because I tried to make them shorter with more aggressive play early on. Fred did a good job of punishing that recklessness as I should by now have expected.
Well, that's good to know. :)
Cold Steel wrote:
May 18th, 2018, 4:36 pm
Looking at your formidable task list for the operations feature, I wonder if it could be broken up over a number of versions? I imagine many of those sub features will heavily influence each other to the point they may be inseparable. But breaking it up allows you to better evaluate the effects and appreciate the progress you are making so that you do not lose your mind in the middle of it. :)
Yeah, I agree, and that's certainly the plan. I am not entirely sure yet what is needed for that and what steps might make sense for intermediate release, but they always seem to present themselves as I go along. I'll keep you posted. It's too late for my mind though! ;)
SP campaigns: Galuldur's First Journey (1.12 & 1.14) & Grnk the Mighty (1.10 & 1.12)
AI experiments: Micro AIs (wiki, forum thread, known/fixed bugs), Fred, AI-demos add-on

#wesnoth-dev.2018-??-??.log:< c?????> mattsc, I think you broke Vultraz.

Post Reply