Difference between revisions of "Talk:V3 ScratchPad"

From FreeOrionWiki
Jump to: navigation, search
Line 16: Line 16:
 
*First pass when doling out food attempts to feed every pop point on every planet with 1 food (prioritized by production locally or big pop planets first...) If there's not enough food to feed everyone, one of these happens (pick?  probly not both):
 
*First pass when doling out food attempts to feed every pop point on every planet with 1 food (prioritized by production locally or big pop planets first...) If there's not enough food to feed everyone, one of these happens (pick?  probly not both):
 
**The population is capped at the amount of food due to famine.
 
**The population is capped at the amount of food due to famine.
**The health meter is reduced by: 25 * (planet unfed pop points) / (total pop of planet)
+
**The health meter is reduced by: 60 * (planet unfed pop points) / (total pop of planet)
 
*Second pass, the remaining food is dolled out in the same priority to planets again, to feed ever pop point with an additional point of food, up to 2 total.
 
*Second pass, the remaining food is dolled out in the same priority to planets again, to feed ever pop point with an additional point of food, up to 2 total.
** The health meter is increased by: 25 * (planet pop points fed with 2 food) / (total pop of planet)
+
** The health meter is increased by: 60 * (planet pop points fed with 2 food) / (total pop of planet)
 
*Any extra food left is wasted
 
*Any extra food left is wasted
  
I don't like the current set of "feeding statuses" where you jump from one level to the next, with a huge difference on health, based on a small change in available food.  My proposal takes better advantage of the smaller gradations of meters.
+
The constant 60 can be changed without objection from me.
 +
 
 +
I'd avoid reducing the health meter 1 point per population that's not fed, since the rate of growth / starvation is already dependent on population.
 +
 
 +
I don't like the current set of feeding statuses where you jump from one level to the next, with a huge difference on health, based on a small change in available food.  My proposal takes better advantage of the smaller gradations of meters... and models what happens if there's enough food for some, but not all....
  
 
==Homeworld Special==
 
==Homeworld Special==

Revision as of 21:34, 14 July 2004

Comments on New Version

Minor Point

You have: If Max Construction is greater than Current Construction, then Current Construction is reduced to match Max Construction. This test should occur after all Effects have been executed.

Should be if max is less than current, or if current is greater than max

Food / Nutrient Distribution

DREK: Maybe 1 food feeds a population unit just fine, but you need 2 for normal growth. 0 food=Famine 1 food=Starving 2 food=Healthy

Not really sure how food should work yet.

Geoff: For food use, I think two passes is sufficient:

  • First pass when doling out food attempts to feed every pop point on every planet with 1 food (prioritized by production locally or big pop planets first...) If there's not enough food to feed everyone, one of these happens (pick? probly not both):
    • The population is capped at the amount of food due to famine.
    • The health meter is reduced by: 60 * (planet unfed pop points) / (total pop of planet)
  • Second pass, the remaining food is dolled out in the same priority to planets again, to feed ever pop point with an additional point of food, up to 2 total.
    • The health meter is increased by: 60 * (planet pop points fed with 2 food) / (total pop of planet)
  • Any extra food left is wasted

The constant 60 can be changed without objection from me.

I'd avoid reducing the health meter 1 point per population that's not fed, since the rate of growth / starvation is already dependent on population.

I don't like the current set of feeding statuses where you jump from one level to the next, with a huge difference on health, based on a small change in available food. My proposal takes better advantage of the smaller gradations of meters... and models what happens if there's enough food for some, but not all....

Homeworld Special

Old Geoff:

My... this is one versatile special! It currently gives:

  • +30 to Max Construction
  • +30 to Max Farming
  • +20 to Max Mining
  • +20 to Max Industry
  • +10 to Max Trade
  • +20 to Health
  • +10 to Science
  • (anything else I missed?)

If you get all these bonuses, and start with all current meters = max meters them full, then doesn't that remove any need to worry about what the focus of your homeworld is? You'll have no problem feeding other planets while still pumping out industry. The other bonuses are not obviously problematic, but I wonder about the sheer magnitude. Any other planet will suck compared to the homeworld. I'd suggest bonuses on the scale of +5 or +10 at the most.

DREK: Homeworld needs to rock in early game, otherwise the player won't be able to feed his nascent colonies. Maybe the bonuses are too high. You missed +10 to science :P. Maybe it should just be +15 to all meters.

Geoff: Does it really need to rock that much early game? New colonies start at population 1, homeworld at 20 (I think). If you have 4 colonies at 2 pop each + homeworld at 20, you need 28 food, so you need a farming meter of 14 on homeworld to feed all. (14 * 20 / 10 = 28). If you start with balanced/farming, that's 10, so a bonus of +5 for homeworld would be sufficient... and that's ignoring any bonus for planet quality, which would probably make a homeworld bonus unnecessary (by the time you need more food, planets start producing their own). Having a homeworld bonus anyway is fine, but +15 to all meters means you don't have any tradeoffs between production and food for expansions necessary... you can do it all. Edit: Maybe this changes a bit with growth depending on excess food supply.

I'd suggest homeworld reduce mining, as presumably your race took the low hanging fruit before spaceflight was discovered. It also gives an additional impetus to colonize away or develop your home system, as you can spend your PP at home, but need the minerals to back it up.

Resource Meter Growth

Geoff: The current population-like growth encourages minmaxing. You can speed overall development of resource meters by by putting the focus towards one meters, increasing the max meter value and thus increasing the rate of growth until it gets to what will be the final max, then switch to another focus to build up THAT meter, and so on. To get optimal growth, you'd have to fiddle. This is why I previously had a rate that didn't depend on the max meter value.

Construction Meter Growth

Geoff: Having population-like growth for construction is not problematic like resource meters, but it seems a bit redundant when resource meters already do have it... Linear would be better, so you're not quite so stagnated at the start. Remember that it takes a long time for pop-like growth to get up to the middle range where the rate of growth is semi-decent... at first it's horridly slow. Having pop-like growth in the constant for pop-like growth of something else is doublekill... unless you want it this way for some reason...?

Environment Preference Effects

Geoff Old: These are rather severe. At this point, it's impossible to grow food on a terrible world or even an adequate world until you get a lot of tech or building bonuses to the max farming meter. I suggest:

  • +5 for subperb
  • 0 for optimal
  • -5 for adequate
  • -10 for terrible

DREK: Impossible to grow food on a terrible world? For a human, a terrible world would be Barren, Toxic, Inferno, etc. It should be impossible to grow food on a complete hellhole without tech, imho.

Emrys: Agree with Drek on this one, and in fact would go even further by suggesting that the health ratings for poorer environments should be even lower than they are at the moment, such that if you stick humans on some toxic hellhole, the poor blighters die unless you work really hard at it...

Geoff: Ok, I was thinking gaia = superb, terran = optimal, ocean & desert = adquate, tundra & swamp = terrible, others = impossible, but I see now that terrible includes anything below adequate, so nevermind.

(I do wonder why 2 away is no better than 4, but won't argue about it now)

Trade Bonus for Starlanes & Colocated Allies

Geoff Old: Could add a trade bonus for starlanes in a system connected to friendly populated systems. For all planets you own in a system:

  • +2 trade for each starlane connected in one hop to a system with a planet owned by your empire
  • +3 trade for each starlane connected in one hop to a system with a planet owned by an allied empire (does not stack with +3)
  • no bonus for connections to systems with planets owned by enemy empire (stacking optional... could cancel out +3 or +5 bonus for other races' planets in system)

Could also add a trade bonus for planets in systems with planets owned by allied races. For all planets you own in system:

  • +5 for each allied race that owns a planet in this system.

(more than one allied planet could stack, I guess... but I'd prefer not)

DREK: I was actually thinking that certain buildings would give a bonus like this, which is why I included a "by count" parameter in ModifyPlanetMeter.

Geoff: Righto. Probly better than giving it to everyone... more strategies for what to build and such.

Focus Bonuses

Geoff: Why the new values? I know you disliked secondary balanced focus all along, but making it that bad (+1) is kinda ... inbalanced... useless? Might as well actually remove it if you're going to do that. (How many buildings will be increasing secondary balanced focus bonuses anyway?)

Based on a break-even of 25, and your apparent new scale of things, how about this:

  • Primary Specialized gives +30
  • Primary Balanced gives +10
  • Secondary Spec. gives +15
  • Secondary Bal. gives +5

If max growth rate requires 2 food / pop (see above) then this would mean a single double focused farm world at the start of the game could feed 75% of another world at max growth, ignoring any bonuses. This is a good number at the start, imo.

I also like the ratios of bonus size I use... (Same as the +12, +4, +6, +2 I had earlier)

Edit: Above is sorta ok for break-even of 20 as well... maybe could use some tweaking... +24, +8, +12, +4 could work. Or +18, +6, +9, +3

Old Stuff

Focus Effects & General Meter Levels

Principles:

  • Food meter break even at (farming meter) = 10
  • At start of game, balanced primary is not enough to give food self-sufficiency
  • At start of game, balanced Primary and Farming Secondary is self-sufficient
  • At start of game, need lots of food to sustain population, so need large proportion of planets on farming focus. Later, farming gets better with tech, buildings, so proportion of farming planets can drop a bit (as all resource meter maxes get raised), and Balanced Primary with or without balanced secondary might eventually become enough to be self sufficient

Proposed:
(Resource meters have default / initial value of 0 each turn. Various meter modification effects add to them, including focus) At start of game (before techs, buildings change things):

  • Primary Specialized Focus gives + 12 to one resource meter
  • Primary Balanced Focus gives + 4 to all resource meters
  • Secondary Specialized Focus gives +6 to one resource meter
  • Secondary Balanced Focus gives +2 to all resource meters

Techs/buildings can independently add or subtract to the default value, or the effect of any of the 4 focuses on each meter. Eg: WonderFarms gives +5 to farming on farming specialed primary focus, +2 to farming on balanced prim. focus, +2 to spec. sec. focus, and +1 to bal. sec. focus (and +0 to other worlds... ie. some techs could give bonuses to all worlds, regardless of focus)

Farming Emergent Properties: primary/secondary focus, mining as "not farming" example focus

  • farming/farming -> 1.8 times need -> 0.8 more worlds' worth of food
  • farming/balanced -> 1.4 times need -> 0.4 more worlds
  • farming/mining -> 1.2 times need -> 0.2 more worlds
  • balanced/farming -> 1.0 times need -> break even point for world
  • balanced/balanced -> 0.8 times need -> must import 0.2
  • balanced/mining -> 0.4 times need -> must import 0.6
  • mining/farming -> 0.6 times need -> must import 0.4
  • mining/balanced -> 0.2 times need -> must import 0.8
  • mining/mining -> 0 times need -> must import 1.0

Actors & Effects

Effects are changes/modifications to game objects. Actors are lists of Effects that function as a group.

Actors are of particular "types" (or "classes"). When actors are created, their type determines the effects that they contain, and any variable details of how each effect functions. Effects are also of particular types, and the details they need to specify how they function depend on their type. The definition of an actor type contains a list of effect types and anys needed to specify how the effects will work.

All existing actors are iterated through several times while processing a turn. On each iteration, a particular effect may or may not be fired, depending what time during the turn it is set to fire. Effects are also given a chance to fire that is applied individually to each object in the effect's scope/restrictions.

Definition of Actors

Probably done in an XML file. Programmer comment/tweaking encouraged.

Actor definition contains data such as name, duration, number and list of effects.

For Duration:

  • -1 -> infinite duration -> never goes away on its own (may be destroyed by an effect in future versions. Remains forever in v0.3)
  • 0 -> instant -> effects of actor fire immediately at time actor is created, but actor does not continue to exist for rest of turn (ie. if made in pre-movement phase, does not still exist or fire effects in post-movement. if made in post-movement, does not exist in next turn's meter accumulation or pre-movement)
  • 1 or more -> limited lifetime -> disappears after # turns (at end of turn, or start... whichever)

Definition of Effects

Similar to Actor definitions.

Contains data such as the effect type, what phase of the turn processing in which to fire, chance to fire on each object in scope, details of what game objects are in scope, a specific target game object, an "affiliation" restriction on scope that works with target, and various other effect-type-specific details.

  • Turn Phase: Which effects phase of turn in which to fire effect. See Effects System. Meter Modifying effects ignore this parameter
  • Effect Chance: If an object meets all restrictions on the effect's scope, this is the chance that the effect will "fire" on that object
  • Effect Target: Works with Affiliation to determine which objects effect will "fire" on.
  • Effect Scope: Physical location restrictions on what objects will be "fired" on by effect
    • Galaxy -> All objects... no restriction
    • Empire -> All objects in a system with a planet owned by empire of target object
    • Distance -> All objects within Scope Range parameter distance of target object
    • StarLaneJumps -> All objects within Scope Range parameter starlane jumps of target object. Partial starlane jumps count as a full jump (eg. if target is a ship on a starlane, not at a plant)
    • System -> All objects in system of target object (later: or in fleet travelling with target ship)
    • Personal -> Target Object Only
  • Effect Scope Range: How many "lightyears" or starlane jumps for respective scope restrictions
  • Effect Affiliation: Restricts list of objects effect will fire on based on the empire that owns them.
    • TargetEmpireOnly -> objects owned by empire of target object only
    • TargetAllies -> objects owned by empire of target object, or owned by ally of empire that owns target object (meaningless in v0.3)
    • TargetEnemies -> objects owned by empires that are enemies of the empire that owns the target object
    • All -> object owned by any empire (no restriction)

Note: If an effect is included in v0.3 that modifies a property of the empire, rather than one of its planets, then the scope parameter is ignored, and the affilitation parameter determines which empire(s) are affected, based on the empire that owns the target object.

Effects System

The processing of a game turn proceeds in this order:

  • Start of Turn Processing - all meters set to 0
  • Meter Accumulation Phase - All actors iterated through, any effect that modifies a meter is fired
  • Upkeep Phase - Production/resource creation, pop growth/starvation, creation of new ships, etc.
  • Pre-Movement Effect Phase - All Actors are iterated through. Any effect that is marked for this phase in its definition is fired. Any Actors summoned with duration 0 by an Actor effect fire their effects immediately. Any Actors summomed with duration other than 0 do not fire now (but can fire in post-movement phase)
  • Action Phase - Ship movement, battles, etc.
  • Post-Movement Effect Phase - All Actors are iterated through, any effect that is marked for this phase in its definition is fired. Actors created in the Pre-Movement Effect Phase are included in the iteration. 0 duration actors summoned fire effects immediately. non-0 duration Actors created in this phase do not function this turn, but will function starting in the Meter-Accumulation Phase or Pre-Movement Phase of next turn.
  • End of Turn Processing

Specials, Techs, Buildings, Random Events

These are all treated as actors. When a building is constructed, an actor is created by the game. This actor contains a list of effects that impliment the advertised function of the building. Similarly, specials and techs have associated actors.

The game also has a "Random Event Generator" actor that is always exists. During the pre-movement and post-movement phases, various "SpawnActor" effects with low % chances to fire are iterated through and given chances to do so. If the SpawnActor effect fires, an actor is created, which contains several other effects that impliment the function of the random event. The actor may have 0 or non-zero duration, and fires immediately or in the next appropriate phase, as described in effecs system.

Effects for v0.3

Unless stated otherwise, an effect can be set to work in either the pre-movement or post-movement phase.

  • Modify Meter - Adds or subtracts from a planet's meter this turn. Only functions during the meter accumulation phase.
  • Modify Stockpile - Adds or subtracts from one of empire(s) stockpiles.
  • Add Building to Planet - Adds a building to an empty building slot of a planet.
  • Destroy Building - Removes all buildings of a certain type from the slots of a planet.
  • Set Planet Environment - Sets the planet environment.
  • Destroy Planet - Destoys Planet
  • Modify Planet Population - Adds or subtracts from planet's population.
  • Set Research - Sets a tech a researched or not reserached.
  • Set Building Availability - Sets a building type as buildable or not buildable.
  • Set ShipeType Availability - Sets a ship class as buildable or not buildable.
  • SpawnActor - Creates a new actor, which begins to function as described in Effects System.