Latest Posts

Topic: New experimental tribe: Europeans

hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2741
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-01-24, 20:37

As said i understand the problem as the AI Coide to upgrade buildings is very rudimentary. So this is a problem especuially with tribes with lots of upgrades. So if iot works for you I am fine. However we went away from hardcoding stuff like this for good reason.


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 341
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-01-24, 20:40

hessenfarmer wrote:

As said i understand the problem as the AI Coide to upgrade buildings is very rudimentary. So this is a problem especuially with tribes with lots of upgrades. So if iot works for you I am fine. However we went away from hardcoding stuff like this for good reason.

I'll experiment with starting conditions that don't make any specifications and try out what minimum amount of building material the AI needs in order not to get stuck (on all maps).


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 341
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-01-24, 21:15

I changed my conditions and only deactivate and activate trainingssites and associated smithy_upgrades.

-- =======================================================================
--              Headquarters Starting Conditions for Europeans
-- =======================================================================

include "scripting/infrastructure.lua"
include "scripting/debug.lua"

push_textdomain("tribes")

init = {
   -- TRANSLATORS: This is the name of a starting condition
   descname = _ "Headquarters",
   -- TRANSLATORS: This is the tooltip for the "Headquarters" starting condition
   tooltip = _"Start the game with your headquarters only",
   func =  function(plr, shared_in_start)

   local sf = wl.Game().map.player_slots[plr.number].starting_field
   if shared_in_start then
      sf = shared_in_start
   else
      plr:allow_workers("all")
   end

   plr:forbid_buildings{"europeans_recruitement_center_advanced", "europeans_recruitement_center_normal"}
   plr:forbid_buildings{"europeans_shipyard_advanced", "europeans_shipyard_normal"}
   plr:forbid_buildings{"europeans_ferry_yard_advanced", "europeans_ferry_yard_normal"}
   plr:forbid_buildings{"europeans_scouts_house_advanced", "europeans_scouts_house_normal"}
   plr:forbid_buildings{"europeans_smithy_level_3", "europeans_trainingscamp_basic", "europeans_labyrinth"}
   plr:forbid_buildings{"europeans_smithy_level_4", "europeans_smithy_level_5", "europeans_smithy_level_6", "europeans_guardhall", "europeans_trainingscamp_normal", "europeans_arena"}
   plr:forbid_buildings{"europeans_smithy_level_7", "europeans_smithy_level_8", "europeans_smithy_level_9", "europeans_dungeon", "europeans_trainingscamp_advanced", "europeans_colosseum"}
   
   prefilled_buildings(plr, { "europeans_headquarters", sf.x, sf.y,
        wares = {
            water = 256,
            log = 128,
            planks = 128,
            granite = 64,
            coal = 64,
            reed = 64,
            cloth = 48,
            marble = 48,
            quartz = 48,
            iron = 32,
            corn = 32,
            grout = 32,
            brick = 32,
            spider_silk = 16,
            spidercloth = 16,
            diamond = 16,
        },
        workers = {
            europeans_carrier = 32,
            europeans_farmer_basic = 24,
            europeans_builder = 12,
            europeans_miner_basic = 12,
            europeans_trainer = 6,
            europeans_lumberjack_basic = 6,
            europeans_forester_basic = 4,
            europeans_carpenter_basic = 2,
            europeans_stonecutter_basic = 2,
            europeans_stonemason_basic = 2,
            europeans_charcoal_burner_basic = 2,
            europeans_hunter_basic = 2,
            europeans_fisher_basic = 2,
            europeans_fishbreeder = 2,
            europeans_miller_basic = 2,
            europeans_baker_basic = 2,
            europeans_smoker_basic = 2,
            europeans_brewer_basic = 2,
            europeans_breeder_normal = 2,
            europeans_weaver_basic = 2,
            europeans_smelter_basic = 2,
            europeans_smith_basic = 2,
            europeans_shipwright = 2,
            europeans_beekeeper = 1,
            europeans_gamekeeper = 1,
            europeans_geologist = 1
      },
        soldiers = {
            [{0,0,0,0}] = 32,
      }
   })
    for i = 1, 48 do
        -- Delay of 15 min between actions
        sleep(900000)
        
        -- Ware-dependent activation
        if plr:get_wares("iron") > 15 and plr:get_wares("coal") > 15 and plr:get_wares("planks") > 15 then
           plr:allow_buildings{"europeans_smithy_level_3"}
        end
        if plr:get_wares("iron") > 15 and plr:get_wares("coal") > 15 and plr:get_wares("planks") > 15 and plr:get_wares("armor") > 7 then
           plr:allow_buildings{"europeans_smithy_level_4", "europeans_smithy_level_5", "europeans_smithy_level_6"}
        end
        if plr:get_wares("iron") > 15 and plr:get_wares("coal") > 15 and plr:get_wares("planks") > 15 and plr:get_wares("gold") > 7 then
           plr:allow_buildings{"europeans_smithy_level_7", "europeans_smithy_level_8", "europeans_smithy_level_9"}
        end
        if plr:get_wares("ration") > 15 and plr:get_wares("beer") > 15 and plr:get_wares("mead") > 7 then
           plr:allow_buildings{"europeans_labyrinth"}
        end
        if plr:get_wares("snack") > 15 and plr:get_wares("beer_strong") > 15 and plr:get_wares("shield_steel") > 0 then
           plr:allow_buildings{"europeans_arena"}
        end
        if plr:get_wares("meal") > 15 and plr:get_wares("wine") > 15 and plr:get_wares("shield_advanced") > 0 then
           plr:allow_buildings{"europeans_colosseum"}
        end
        if plr:get_wares("ration") > 15 and plr:get_wares("armor_chain") > 0 then
           plr:allow_buildings{"europeans_guardhall"}
        end
        if plr:get_wares("snack") > 15 and plr:get_wares("armor_gilded") > 0 then
           plr:allow_buildings{"europeans_dungeon"}
        end
        if plr:get_wares("ration") > 15 and plr:get_wares("spear_advanced") > 0 then
           plr:allow_buildings{"europeans_trainingscamp_basic"}
        end
        if plr:get_wares("snack") > 15 and plr:get_wares("sword_broad") > 0 then
           plr:allow_buildings{"europeans_trainingscamp_normal"}
        end
        if plr:get_wares("meal") > 15 and plr:get_wares("ax_warriors") > 0 then
           plr:allow_buildings{"europeans_trainingscamp_advanced"}
        end
        if i > 45 then
           plr:allow_buildings("all")
        end 
    end
end
}
pop_textdomain()
return init

My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2741
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-01-24, 22:31

well, I would have kept with 5 minutes or less of evaluation time.
Furthermore the part with the decisioons based on times could and should probably be implemented with prohibited _till. Although this could be overriden in special occasions it normally prevents to early upgrades. As upgrade code still needs improvement this could ease the problems a bit. especially if the upgraded buildings are not producing anything different then the basic one (sorry hadn't the time to check your tribe in detail)


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 341
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-06-22, 11:56

Can you please move this topic to the addons subforum. Thx.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2550
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2021-06-22, 18:44

Done face-smile.png


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2741
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-06-27, 22:36

Hi, during translation i just saw you inclued a copy of the helpscripts for our in game encyclopedia in the Addon. did you change something there? if not it should work without this copy anyhow and it would reduce the translation effort.


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 341
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-06-29, 19:03

I dont modified it. So I will remove it with next update.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2741
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2021-06-29, 21:05

Perhaps you might check whether thre are other redundant files in the addon which might be removed. This would reduce any effort may it be up-/downloadtimes, translation, maintenance and so on.


Top Quote
MarkMcWire
Avatar
Topic Opener
Joined: 2017-02-08, 21:06
Posts: 341
Ranking
Tribe Member
Location: Eisenach, Germany
Posted at: 2021-06-30, 05:33

I reduced my soldiers to max 4 levels (0-3) each, so the gui and performance issues are gone.


My widelands addons: https://drive.google.com/file/d/1jopANlODo41T2reHJ0zaCOMYxq_rxXP-/view?usp=sharing

Top Quote