Difference between revisions of "Talk:V3 ScratchPad"

From FreeOrionWiki
Jump to: navigation, search
Line 41: Line 41:
 
Not really sure how food should work yet.
 
Not really sure how food should work yet.
  
Geoff: How's this,
+
Geoff: 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):
 
*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):
Line 53: Line 53:
  
 
25 * (planet pop points fed with 2 food) / (total pop of planet)
 
25 * (planet pop points fed with 2 food) / (total pop of planet)
 +
 +
*Any extra food left is wasted
  
 
==Homeworld Special==
 
==Homeworld Special==

Revision as of 17:54, 14 July 2004

Comments on New Version

Hmm... I guess you didn't like most of my suggestions... Ah well.

Here's a few specifics to reconsider though:

Use of Nutrients?

The DD should probably mention that each population point needs 1 food / turn to not die

DREK: Yes it should. In the population growth/food eating part of the document.

Break Even Point?

It'd be best, imo, if the "break even point" for different meters is consitent. You have the health meter break-even at 25, but (presumably) the food meter break-even for a signle world is still at 10. These should be at the same value, imo.

DREK: That might be a good point. 25 seems like a good break-even point to me, since there's plenty of room above and below it.

Geoff:

Growth

Should probly throw in a formula...

If 25 is the break-even point, I suggest something like this for the growth meter's effect:

If (Growth) > 25:
(Pop Change) = (Pop) * ( (Planet Pop Limit) - (Pop) ) / (Planet Pop Limit) * ((Growth Meter) - 25) * (0.002)
If (Growth) = 25:
(Pop Change) = 0
If (Growth) < 25:
(Pop Change) = - (Pop) * ((Growth Meter) - 25) * (0.002)

For all:
(New Pop) = Min( (Pop) + (Pop Change), (Max Pop), (Food Available) )

But again, I'd like to see standardized break-even points... at 10 if 1 pop uses 1 food for a standard race.

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: 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:

25 * (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:

25 * (planet pop points fed with 2 food) / (total pop of planet)

  • Any extra food left is wasted

Homeworld Special

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
  • (anything 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 [i]that much[/i] early game? New colonies start at population 1, homeworld at 20. If you have 4 colonies at 2 pop each, you need 28 food, so you need a farming meter of 14. (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.


Construction Meter

10% growth every turn is quite a lot. Is there any thought behind this number?

Is there any thought behind 30 as the default construction meter max?

DREK: Not really. It's only 10% growth to the construction meter, but perhaps it should be lower, and make the default 25 (so that it has parity with the breakeven point.)

Geoff: +1 / turn is plenty, imho. A % of max growth is a hard cap on the turns to full capacity, and if that's ~10 turns, then it may as well not be growing at all... 25 breakeven is good.

Resource Meter Growth

Old Geoff: Why linear growth at ~3 points / turn? Wanted to avoid penalizing specialized focus with slow growth rate?

DREK: Just wanted to keep it simple, easy to understand.

Old Geoff: If you're going to have a basically constant growth rate like this (after 10 turns), why not make the growth rate +1 / turn, and get rid of the construction meter? (It's not [i]essential[/i] to have it for general infrastructure purposes).

DREK: a) the construction meter can be reduced/raised through other factors, b) 10 turns is a long ass time in a turn-based game.

Geoff: I dunno... compared to population growth from 1 pop, 10 turns is neglidible. I'm still for +1 / turn or eliminating construction, as below.

Old Geoff: At this point, I don't see what having it (the construction meter) really adds to the system. The nascent colony special limiting max meters would work fine, and sum-of-resource meters works for determining which Infrastructure Label to use. Altnernatively, you could just use population. Right now, the labels are rather shallow, and pretty much based only on the set of bonuses to max construction that a planet has (since it takes 10 turns or less to get to the max).

Environment Preference Effects

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.

Trade Bonus for Starlanes & Colocated Allies

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.

Infrastructure Label Ranges

You've got some redundancies in the ranges... overlaps. Eg:

  • 11-30: Developing World
  • 30-60: Established World

What is the label at 30? Same for 60 and 90.

DREK: An error on my part.

Focus Bonuses

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

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.