Difference between revisions of "Talk:FOCS Scripting Details"

From FreeOrionWiki
Jump to: navigation, search
Line 1: Line 1:
=Suggested Changes (Sept. 17)=
+
=Suggested Changes (Sept. 17/18)=
  
 
==Stacking==
 
==Stacking==
Line 53: Line 53:
 
Should perhaps say that effect groups may only have effects that alter meters or that do not alter meters, not a mix...
 
Should perhaps say that effect groups may only have effects that alter meters or that do not alter meters, not a mix...
  
==(more to come...)==
+
==Non-Effects Game Object Info==
 +
 
 +
Yoghurt was going to work up some stuff about coding objects in Python... don't know what's happening with that...
 +
 
 +
Game object descriptions will need some non effects info.  For v0.3, this could be:
 +
*Buildings require a prerequisite tech, a cost per turn, a construction time in turns, a name, and all the effects stuff.
 +
*"Specials" can be randomly assigned at the start of the game to planets. They require just a name and a list of effects.
 +
*Planets, ships, systems, empires, etc. all are treated effectively like they are in v0.2, except that they can be in the scope of an effect and have a few properties that can be modified by effects. 
 +
 
 +
There is no player ship desgin in v0.3, so ships could be coded as a temporary class of scripted object (object class = MarkIV or somesuch).  In future, presumably the ship design component will make internally self-scripted object classes (or something similar), which ship game objects will use as their object class.

Revision as of 04:42, 18 September 2004

Suggested Changes (Sept. 17/18)

Stacking

Should change stacking to not involve object class. Stacking number should be the only consideration. If an two effects could fire on an object and they both have the same stacking number, only one can fire. How to decide which in cases of conflict isn't clear... For numerical effects, the larger could apply, but we haven't explicitly outlawed preventing stacking of non-numerical effects (with numericals or non-numericals).

Scope Conditions

Should remove inclusive / exclusive conditions. Should say that ideally all conditions could be used in either capacity, but programmers are free to put limits on this if they feel it is necessary / beneficial / easier to do so. Could suggest not using "expensive" to calculate conditions for inclusion (eg. distance from source).

Random Parameter Values

Remove!

Turn Processing Order

  • Set all max meters to 0. Current meter values remain unchanged from previous turn's values.
  • Fire all meter altering effects:
    • Max meter values are added to to by primarily effects that consistently fire every turn, establishing a consistent max meter value
    • Current meter values may be modified by effects as well, but rarely compared to current meter values, and primarily by one-shot effects, rather than effects that consistently fire every turn, as this would cause the current meter value to grow very much each turn.
  • Apply current meter growth formula (not based on effects)
  • Cap current meters by max meter values as applicable
  • Fire all non-meter-altering effects
  • Do rest of turn

Note that meter altering effects fire before ship movement, or anything else, so ship move orders given in turn N do not affect meter values in turn N+1, but do affect meter values in turn N+2.

In future there may be seveal times during a turn when a non-meter-altering effect can fire. This will occur before, after and between thing like ship movement, production/popgrowth/research and combat. Effects-altering meters will always happen at the very start of a turn, however, before anything else, effects or otherwise.

Technology as Game Object?

When a technology is researched / gained, it might be implimented as a game-created 0 duration game object that has effects which unlock other classes of game object for the player. A separate infinite-duration game object could simultaneously be created to give persistant benefits of the technology as well. Alternatively, a persistant actor labelled as a special could be attached to an empire, bestowing some benefits.

Technology could also not be treated as a game object at all, but rather as a special internal system unrelated to game objects, and having a separate content description scheme. Presumably it would be easier, efficient and faster to use the same system as much as possible though. In practice, construction of game objects like "buildings" through non-effects based planet production is probably quite similar to researching a technology treated as a game object through non-effects based research.

Effect Group Activation Conditions

Need to add a variety of conditions, similar to scope conditions, but dependent on properties of the source object (and dependencies via hierarchy), and which determine whether the effects group is "on" for a given turn. Should include conditions for:

  • properties of owner empire / presence of special attached to owner empire (for empire-wide special resources perhaps)
  • focus setting
  • stockpiles
  • co-located with object of type/class/category
  • within X distance/jumps

Actually... most of the scope conditions should be usable, though there'll be a few extras that only apply to source objects

Maintainance fees (or resource requirements and consumption while active) would also be nice to have as an acitvation condtion, as would some sort of player controlled turning on / off. How to do this is a bit unclear however, since effects fire at the very start of a turn, before the game would have a chance to deduct maintainance fees (or collect taxes with which to pay them). We could perhaps determine if fees will / can be paid before firing effects, or we could have have things deactivate at the end of a turn if their maintainance is unpaid, rather than deactivating the effect during the turn when the shortfall would occur.

Any effect group that includes an effect that modifies meter(s) cannot use meter value as an activation condition. As such, it seems that it will be necessary to not have meter values as an activation condition for effects groups.

Side Note: Effect Group Exclusivity

Should perhaps say that effect groups may only have effects that alter meters or that do not alter meters, not a mix...

Non-Effects Game Object Info

Yoghurt was going to work up some stuff about coding objects in Python... don't know what's happening with that...

Game object descriptions will need some non effects info. For v0.3, this could be:

  • Buildings require a prerequisite tech, a cost per turn, a construction time in turns, a name, and all the effects stuff.
  • "Specials" can be randomly assigned at the start of the game to planets. They require just a name and a list of effects.
  • Planets, ships, systems, empires, etc. all are treated effectively like they are in v0.2, except that they can be in the scope of an effect and have a few properties that can be modified by effects.

There is no player ship desgin in v0.3, so ships could be coded as a temporary class of scripted object (object class = MarkIV or somesuch). In future, presumably the ship design component will make internally self-scripted object classes (or something similar), which ship game objects will use as their object class.