cultural victory option : the majority of world's culture

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
fomalhaut
Posts: 36
Joined: Thu Feb 13, 2014 8:24 am
Location: Japan

cultural victory option : the majority of world's culture

Post by fomalhaut »

We can set options about cultural victory in game.ruleset. ('victory_min_points' and 'victory_lead_pct' )
But simply thinking, as the number of players increases, the market share of top player will decrease.

example
1st:1000/2nd:300/3rd:250/4th:200 (world's culture:1750/1st player's share:57%)

1st:1000/2nd:300/3rd:250/4th-9th:200 (world's culture:3350/1st player's share:30%)
Is it possible to regard 30% as "cultural domination" ?

So I think 1st player needs to have more than half of world' culture to win.
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: cultural victory option : the majority of world's culture

Post by Ignatus »

Support. I also don't know how victory_min_points interacts with MinCulture setting in Victory effect, isn't it an overhead setting? Probably we should move the lead_pct setting also into effects, like MinCulturePct requirement with various ranges.

I have played a game in Experimental (2.6 beta2) which was won by culture earlier then my explorer landed from my first caravel to another shore, just because I have built libraries and other players haven't; that was, like, too fast. Probably you also should not be allowed to win by culture until you have met all existing civilizations, or how can you impress them otherwise? (This is doable with effects). Or there should be some combination of cultural, military and happiness relative strengthes to make cultural overcoming more sensible. I also suppose that culture mechanics might be just included into rebel costs - if they fall to negative, you just assimilate the cities even without doing anything, and if a player has negative rebel cost in his capital to any other player, he loses.
cazfi
Elite
Posts: 3077
Joined: Tue Jan 29, 2013 6:54 pm

Re: cultural victory option : the majority of world's culture

Post by cazfi »

Ignatus wrote:I have played a game in Experimental (2.6 beta2) which was won by culture earlier then my explorer landed from my first caravel to another shore, just because I have built libraries and other players haven't; that was, like, too fast.
Sounds like victory_min_points is WAY too low... and checking the experimental ruleset it really is only 1000. For comparison, variant2 uses 1000000.
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: cultural victory option : the majority of world's culture

Post by JTN »

cazfi wrote:Sounds like victory_min_points is WAY too low... and checking the experimental ruleset it really is only 1000. For comparison, variant2 uses 1000000.
=> hrm bug #766716
fomalhaut
Posts: 36
Joined: Thu Feb 13, 2014 8:24 am
Location: Japan

Re: cultural victory option : the majority of world's culture

Post by fomalhaut »

"To win cultural victory, 1st rank player needs to have more than half of total world's culture points."
Is it possible to set this condition by lua script?
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: cultural victory option : the majority of world's culture

Post by JTN »

I think you could disable the built-in cultural victory and implement your own criteria with Lua (Player):victory() -- players' culture is available to Lua with (Player):culture(), checked on the turn_started signal. (Haven't tried it.)
User avatar
Alien Valkyrie
Elite
Posts: 513
Joined: Sun Feb 10, 2013 10:21 pm
Location: Stuttgart, Germany

Re: cultural victory option : the majority of world's culture

Post by Alien Valkyrie »

Does AI strive for lots of culture, even when regular culture victory is turned off? Because otherwise, doing it via lua script could lead to inefficient AI behavior.
~ AVL
User avatar
JTN
Elite
Posts: 473
Joined: Wed Jan 30, 2013 12:15 am

Re: cultural victory option : the majority of world's culture

Post by JTN »

Good question. AI does not currently seek culture points, even if regular culture victory is enabled.
fomalhaut
Posts: 36
Joined: Thu Feb 13, 2014 8:24 am
Location: Japan

Re: cultural victory option : the majority of world's culture

Post by fomalhaut »

JTN wrote:I think you could disable the built-in cultural victory and implement your own criteria with Lua (Player):victory() -- players' culture is available to Lua with (Player):culture(), checked on the turn_started signal. (Haven't tried it.)
Completed! my first lua script :D
(Messages are added for test play.)

Code: Select all

-- Cultural Domination Victory
function cultural_victory_callback()
 min_to_win = 500  -- Minimum culture points for cultural domination victory
 world_culture = 0
  for player in players_iterate() do
    if player.is_alive then
      local each_culture = player:culture()
      world_culture = world_culture + each_culture
    end
  end
  notify.event(nil, nil, E.CHAT_MSG,"world culture points : %d",world_culture)
  for player in players_iterate() do
    if player.is_alive then
      local each_culture2 = player:culture()
       if each_culture2 > world_culture * 0.5 then  -- required market share
        if each_culture2 > min_to_win then
         local winner = player
         edit.player_victory(winner)
        else
        notify.event(player, nil, E.CHAT_MSG,"your culture points : %d (more than 50 percent share)",each_culture2)
        end
       else
       notify.event(player, nil, E.CHAT_MSG,"your culture points : %d (less than 50 percent share)",each_culture2)
       end
    end
  end
end

signal.connect('turn_started', 'cultural_victory_callback')
But I noticed that there is 1 turn left to end.
The winner needs to survive last turn.
"turn_started" is wrong?
Post Reply