Postęp game

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Lachu
Elite
Posts: 313
Joined: Sat May 04, 2013 2:19 pm

Re: Postęp game

Postby Lachu » Sat Apr 21, 2018 7:44 pm

I've ended effects iterators feature today. I will make source code and flatpak packages tomorrow.
First of all I remind you, that Progress is game to play humans against humans, without AI. I'm not an AI expert and I decided to provide changes making writing good AI very expensive. If you be AI expert and will join to Progress team, don't scare - maybe we can find best solution.

What is effects iterators?
Imagine we will replace Great Wall wonder with Walls improvement. So defense of each city depends on how many walls user was built (in each city). So we got:

Code: Select all

[effect_great_wall]
name = "Defense_Bonus1"
value = 10
reqs =
{
"type", "name", "range"
"IterationOfCities", "City", "Player"
"Building", "Walls", "City"
}


Code above will makes Progress sum each city with Walls as defense bonus of each city. If we would like to restrict this to only one player, we could:

Code: Select all

[effect_great_wall]
name = "Defense_Bonus1"
value = 10
reqs =
{
"type", "name", "range"
"IterationOfCities", "City", "Player"
"Building", "Great Wall", "Player"
"Building", "Walls", "City"
}

So only player with Great Walls World Wonder will have this bonus. I didn't test my solution yet. Maybe examples doesn't show this idea helpful, but there will be many use cases in future, like iterating adjacent tiles to find medic unit or to provide bonus in nearby cities if some city have wonder/building. I know this can be probably be done in lua, but I think humans prefer effects iterators syntax.

In future I will add triggers effect type. Triggers will be checked on each turn start and export symbols from effects. This could be also helpful.

Lachu
Elite
Posts: 313
Joined: Sat May 04, 2013 2:19 pm

Re: Postęp game

Postby Lachu » Fri May 25, 2018 6:28 pm

I now try to implement triggers in effects.ruleset. Probably the last part is new requirement type to comparing imported object with range. I will explain. Current implementation of triggers exports each variable gained from iterators, like IterationOfPlayers. Another effect could have import table. Example is showed bellow:

Code: Select all

[effect_masonry_research_1]
remember_target_city = TRUE
force_maximum_turn = 3
type = "Output_Bonus"
value= 100
reqs =
{
  "type", "name", "range"
  "city_built(X)", "", "lua_event"
  "ExactlyObject", "", "OBJ(X)"
  #put there correct solution
}
imports =
{
  "case", "type", "name"
  "mr", "", ""
}

[effect_masonry_activator]
type = "Trigger"
force_maximum_turn = 12
triger_id = "mr"
reqs =
{
  "type", "name", "range"
  "IterationOfPlayers", "A", "Global"
  "Tech", "Masonry", "A"
}

Above example makes each A's city built for 12 turns after researching masonry have output bonus for three turns. There's one feature missing. Comparing between objects. We must be sure player, which is testing is the same trigger was launched.ExactlyObject doesn't makes sense, because it test lua type of expression and change object passed to ruleset calculate function by object from expression. Changed object is the same type expression is. I create three syntax. Choose one or suggest your own.

Code: Select all

"type", "name", "range"
#first option
"Exactly", "ObjA", "ObjB"
#second option
"Equal", "func(ObjA, ObjB)", "Compare"
#third option
"Objects", "Equal(ObjA, ObjB)", "EffectsFunc"

Which one make most sense?

User avatar
vodot
Veteran
Posts: 79
Joined: Thu May 17, 2018 4:54 pm

Re: Postęp game

Postby vodot » Fri Jul 13, 2018 12:35 pm

I'm not a software writer, Lachu, so some of this is going over my head, but I really like the capabilities you're describing!

Lachu
Elite
Posts: 313
Joined: Sat May 04, 2013 2:19 pm

Re: Postęp game

Postby Lachu » Wed Aug 15, 2018 8:36 pm

I have uploaded newest version of Progress today.

It introduces experimental and basic support for restrictions.
Currently only multiplier restrictions are supported, but I will expand it to new mechanism in future.

Restrictions are definition of correct values. Multipliers restrictions should restrict children of restriction, like multiplier or other restriction. In fact, I split start/stop/step/etc. fields from multipliers and move it into restrictions.

Possibilities are many for multipliers, but even bigger for rest of Progress mechanism, like battle. Of course, currently we support only multipliers.

For example, progress1 ruleset contains tax rates restrictions and multipliers. Yes - I removed tax rates code from game and move it into restrictions.

I must reminder, that Progress don't allow to play with AI, so I can introduce new features quicker.
Now I need testers for restrictions mechanism. I didn't test many thinks yet, so the mechanism is experimental. I didn't test requirements for restrictions for example. There's many bugs also. Test, if you can, please.
https://sourceforge.net/projects/progre ... 0Linux%29/

Currently we have only 6 restrictions in progress1 ruleset: tax, science, luxury, military, propaganda, all_tax. First five restrict some multiplier to bound between 0 and 10. all_tax restricts previous five to value from 10 to 10.