Talk:V3 ScratchPad

From FreeOrionWiki
Revision as of 03:10, 15 July 2004 by 130.15.30.162 (Talk)

Jump to: navigation, search

Comments on New Version

Population Growth / Health Meter Level

As you have it now, I think population grows too fast. If the homeworld has max pop 30, starts with 22.5 and has Health of 60 (50 for optimal + 10 for homeworld), the pop goes like so:

Turn -> Pop 1 -> 22.50 2 -> 24.75 3 -> 26.48 4 -> 27.72 5 -> 28.57 6 -> 29.11 7 -> 29.46 8 -> 29.67 9 -> 29.80 10 -> 29.88 11 -> 29.93 12 -> 29.96 13 -> 29.97 14 -> 29.98 15 -> 29.99 16 -> 29.99 17 -> 30.00

I think it should take more than ~10 turns to effectively max your population on the homeworld, or you should start with max population on the homeworld.

My suggestion is to reduce the constant in the growth rate by half from (0.01) to (0.005). At this rate, a new colony with 20 max pop and 50 health doubles in population in about 6 turns for the first 20 turns or so.

Alternatively, adjust down the health bonuses for optimal worlds.

Food / Nutrient Distribution

Old 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....

DREK2: I think food's going to be stockpiled. Don't remember if there was a definite decision on that oor not. You might want to repost your idea on forums, so that Aq and others might bump into it.

Geoff: What difference does stockpiling food make? The above was about how to determine growth bonus/penalty based on extra/insufficient food... whether it comes from stockpiles or what was just produced. The "extra food wasted" wasn't the important part... I'm fine with it being stockpiled instead.

Homeworld Special

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.

Old 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.

DREK2: Bonuses have been reduced. I was thinking planets only export when food is 2*population, so the HW would need +20. What wrong with the homeworld rocking, since all players start off on equal footing? Mid game tech advances should close the gap, except for Farming.

Geoff: Homeworld will have focus bonuses and too, remember, so +20 is overkill. You wanted to maintain the choice between focusing on farming to support growing colonies, and focusing on industry to pump out stuff at home, right? With +20 farming (and a slew of others), you could do both.

There's nothing wrong with the homeworld being great, but it shouldn't be far and away better than any other planet, or be able to produce more of everything than you need simultaneously.

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.

DREK: You're orginal formula has some wonky results on the spreadsheet (my simpler replacements turned out to be even worse.) Eager for alternatives.

Geoff: Wonky how? I'll work at it... (got lots of time to kill at work today). What characteristics would you like it to have or not have, in particular?

Ok, how about: (change) = (1 + construction) / (1 + current meter value)

For homeworld: max construction = 45, start = 0.75*45, Pop = 20, max meter = 40

For a colony: max construction = 20, start = 0, pop = 4, max meter = 30 (doesn't get there anyway)

Using your construction growth formula (dissed below)

________Homeworld_______________________Colony
turn____meter___change__const___change__meter___change__const___change
1_______30.0____1.1_____33.8____6.1_____0.0_____1.0_____0.0_____0.5
2_______31.1____1.3_____39.8____3.3_____1.0_____0.8_____0.5_____0.8
3_______32.4____1.3_____43.1____1.3_____1.8_____0.8_____1.3_____1.2
4_______33.7____1.3_____44.4____0.4_____2.6_____1.0_____2.5_____1.7
5_______35.0____1.3_____44.8____0.1_____3.6_____1.1_____4.2_____2.2
6_______36.3____1.2_____45.0____0.0_____4.7_____1.3_____6.4_____2.7
7_______37.5____1.2_____45.0____0.0_____6.0_____1.4_____9.1_____3.0
8_______38.7____1.2_____45.0____0.0_____7.5_____1.5_____12.1____2.8
9_______39.9____1.1_____45.0____0.0_____9.0_____1.6_____14.9____2.2
10______40.0____1.1_____45.0____0.0_____10.6____1.6_____17.1____1.4
11______40.0____1.1_____45.0____0.0_____12.2____1.5_____18.5____0.8
12______40.0____1.1_____45.0____0.0_____13.6____1.4_____19.3____0.4
13______40.0____1.1_____45.0____0.0_____15.0____1.3_____19.7____0.2
14______40.0____1.1_____45.0____0.0_____16.3____1.2_____19.9____0.1
15______40.0____1.1_____45.0____0.0_____17.5____1.1_____19.9____0.0
16______40.0____1.1_____45.0____0.0_____18.7____1.1_____20.0____0.0
17______40.0____1.1_____45.0____0.0_____19.7____1.0_____20.0____0.0
18______40.0____1.1_____45.0____0.0_____20.7____1.0_____20.0____0.0
19______40.0____1.1_____45.0____0.0_____21.7____0.9_____20.0____0.0
20______40.0____1.1_____45.0____0.0_____22.6____0.9_____20.0____0.0
21______40.0____1.1_____45.0____0.0_____23.5____0.9_____20.0____0.0
22______40.0____1.1_____45.0____0.0_____24.4____0.8_____20.0____0.0
23______40.0____1.1_____45.0____0.0_____25.2____0.8_____20.0____0.0
24______40.0____1.1_____45.0____0.0_____26.0____0.8_____20.0____0.0
25______40.0____1.1_____45.0____0.0_____26.8____0.8_____20.0____0.0
26______40.0____1.1_____45.0____0.0_____27.5____0.7_____20.0____0.0
27______40.0____1.1_____45.0____0.0_____28.3____0.7_____20.0____0.0


Could also remove the top 1 +, so it's just:

(change) = construction / (1 + current meter value)

but it'd take longer to get growing

How long should it take a fresh colony to get to a meter level of 20 (the break even point), assuming it has the max meter levels high enough to let it?

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...?

Addendum: I've spreadsheeted the construction growth formula you gave.

Construction Change = (Current Construction + 1) * ((Max Construction - Current Construction) / Max Construction) * (Current Population + 50) * (0.01)

For homeworld: max construction = 45, start = 0.75*45, Pop = 20, assuming I didn't mess up:

construction____change
33.75___________6.08125
39.83125________3.28294592
43.11419592_____1.294078032
44.40827395_____0.417966243
44.8262402______0.123865133
44.95010533_____0.035663684
44.98576901_____0.010179912
44.99594892_____0.002898514
44.99884744_____0.000824701

... Hardly any point to having max and current values for a homeworld...

For a colony: max construction = 20, start = 0, pop = 4

construction____change
0_______________0.54
0.54____________0.8091468
1.3491468_______1.182966987
2.532113787_____1.665861167
4.197974954_____2.217740321
6.415715275_____2.719904069
9.135619343_____2.973165122
12.10878447_____2.792994578
14.90177904_____2.188911146
17.09069019_____1.421048406
18.51173859_____0.784041322
19.29577992_____0.385902787
19.6816827______0.177750107
19.85943281_____0.079168099
19.93860091_____0.034711498
19.97331241_____0.015112634

... I don't see much advantage to this over just using simply +constant / turn... The population (which I didn't bother growing) has minimal effect, even if it looks good in the formula...

I suggest + 0.5 / turn. Thus it takes 40 turns to max construction on a new colony. The delay is enough to be meaningful, and the calculation is simple to understand.

If you want to add some other factors to the rate, I suggest making them additions or multiplications, and not to consider the max construction in the equation.

Focus Bonuses

DREK: Imho, early game primary should be below breakeven, so when the player achieves those first few tech advances the difference is night and day. Empire is no longer just scrapping by--it's thriving. IN my head Secondary focus doesn't improve (or at least not as often as Primary focus is improved), so Secdonary Bal * 5 should equal Secondary Spec. Er, maybe. Obviously numbers here are open to balancing, but in the meantime we do need numbers.

Geoff: Early game farming shouldn't produce enough to feel the population, or early game focused should be less effecting than balanced in terms of total production? The latter is already the case with my suggestions, as the balanced bonuses are 1/3 those of the specialized bonus. 5*1 = 5 > 1*3 = 1

Here's a few options:

If max growth rate requires 2 food / pop (see above) at 20 pop world needs 40 food / turn for full growth.

(1)

  • Primary Specialized -> +18
  • Primary Balanced -> +6
  • Secondary Spec. -> +9
  • Secondary Bal. -> +3

Farming/Farming gives +27 farming. If other bonuses give +15 typically, you end up with +42 farming, meaning 84 food / turn at a 20 pop world. This is enough to fully feed 42 pop points, 22 more than those on the world.

(2)

  • Primary Specialized -> +24
  • Primary Balanced -> +8
  • Secondary Spec. -> +12
  • Secondary Bal. -> +4

Farming/Farming gives +36 farming. If other bonuses give +15 typically, you end up with +51 farming, meaning 102 food / turn at a 20 pop world. This is enough to fully feed 51 pop points, 31 more than those on the world

(3)

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

Farming/Farming gives +45 farming. If other bonuses give +15 typically, you end up with +60 farming, meaning 120 food / turn at a 20 pop world. This is enough to fully feed 60 pop points, 40 more than those on the world

(4) (Old faithful)

  • Primary Specialized -> +12
  • Primary Balanced -> +4
  • Secondary Spec. -> +6
  • Secondary Bal. -> +2

Farming/Farming gives +18 farming. If other bonuses give +15 typically, you end up with +33 farming, meaning 66 food / turn at a 20 pop world. This is enough to fully feed 33 pop points, 13 more than those on the world

I like that ratios of bonus sizes for different focii. (Same as the +12, +4, +6, +2 I had earlier)

Alternatively:
(5) (What you have now)

  • Primary Specialized -> +15
  • Primary Balanced -> +5
  • Secondary Spec. -> +5
  • Secondary Bal. -> +1

Farming/Farming gives +20 farming. If other bonuses give +15 typically, you end up with +35 farming, meaning 70 food / turn at a 20 pop world. This is enough to fully feed 35 pop points, 15 more than those on the world

(6) (Constant 5:1 ratios)

  • Primary Specialized -> +25
  • Primary Balanced -> +5
  • Secondary Spec. -> +5
  • Secondary Bal. -> +1

Farming/Farming gives +30 farming. If other bonuses give +15 typically, you end up with +45 farming, meaning 90 food / turn at a 20 pop world. This is enough to fully feed 45 pop points, 25 more than those on the world

What other basis guides your decisions?

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.