Unhardcode space program (palace as side-effect)
Posted: Sat Jun 22, 2019 9:42 am
Among the ideas of imitating Civ>=3 gameplay: these games have different space program conditions, e.g. Civ3 has 10 SS parts to build one of each type and the game is won as soon as you just launch full assembly (you need a lot of rare resources to do so). Other games have Mars colonization that needs to perform a sequence of three projects, and SS parts built in one city may need to be transported to another with cosmodrome.
We could introduce a conception of national projects that convert certain game actions in visual screens and potentially points and victory. The types of SS parts should be unhardcoded, instead of three "SS_*" building on/off effects we could have one that gives the number of part group to build. Each part group consists of one or more types of parts each of which can occupy certain places of the construction that are selected manually or by a sequence (like fc3.1 SS parts). Occupying a place will put a sprite on visual screen (and potentially turn off or replace some other sprites by an effect). For movable parts, we should define unit types that can do the action "Convert to project part" with the same result as special buildings do. And if we allow also placing parts in projects (without influence on score or victory) by scripts that check achieving certain score, we can easily get commercial Civ-games palace for ones who like it. Places may require connection to project start (as we have now with SS structures) to enable the parts' effects.
The projects may have or not "Launch" button; if they do, each combination of parts defines ending time (if launched now) and probability of success, if not, the outer parameters are only score and victory effects. Each project shall have one or two ticks in game settings - wether it is enabled at all and if its victory effect (if defined by the ruleset) is on.
We can define score for each part type built and part type delivered to the prouject ending condition, as well as total project ending points. Project may be marked dependent on the capital or not. Also, several projects may include completion of each other in their requirements (we just define the type of requirement "ProjectComplete" and instead of "EnableSpace" effect define generic "EnableProject" one).
The completion time and success probability of launched projects should be calculated by scripts since the formulation can be rather complex. Parts have unhardcoded set of numeric properties ("food", "propulsion" etc.) that are on input as sum by the connected parts (they are also visualized), the time is on the output of a callback. Maybe the score may also be calculated by script. This requires advising to the AI what should be done now to complete the project with best time-score result. Maybe it could be estimated by a callback with parameters (score_amortisation, start_production, end_production, max_time) that returns a set of parts that are best to build (assuming all building requirements are fulfilled and production available for the project in maximal affordable time is supposed to change lineary between specified values) to get the best success_prob*finish_score*(1-score_amortisation)^project_time. Or a bit more complicated formula that also counts production-to-score rate outside of the project.
We could introduce a conception of national projects that convert certain game actions in visual screens and potentially points and victory. The types of SS parts should be unhardcoded, instead of three "SS_*" building on/off effects we could have one that gives the number of part group to build. Each part group consists of one or more types of parts each of which can occupy certain places of the construction that are selected manually or by a sequence (like fc3.1 SS parts). Occupying a place will put a sprite on visual screen (and potentially turn off or replace some other sprites by an effect). For movable parts, we should define unit types that can do the action "Convert to project part" with the same result as special buildings do. And if we allow also placing parts in projects (without influence on score or victory) by scripts that check achieving certain score, we can easily get commercial Civ-games palace for ones who like it. Places may require connection to project start (as we have now with SS structures) to enable the parts' effects.
The projects may have or not "Launch" button; if they do, each combination of parts defines ending time (if launched now) and probability of success, if not, the outer parameters are only score and victory effects. Each project shall have one or two ticks in game settings - wether it is enabled at all and if its victory effect (if defined by the ruleset) is on.
We can define score for each part type built and part type delivered to the prouject ending condition, as well as total project ending points. Project may be marked dependent on the capital or not. Also, several projects may include completion of each other in their requirements (we just define the type of requirement "ProjectComplete" and instead of "EnableSpace" effect define generic "EnableProject" one).
The completion time and success probability of launched projects should be calculated by scripts since the formulation can be rather complex. Parts have unhardcoded set of numeric properties ("food", "propulsion" etc.) that are on input as sum by the connected parts (they are also visualized), the time is on the output of a callback. Maybe the score may also be calculated by script. This requires advising to the AI what should be done now to complete the project with best time-score result. Maybe it could be estimated by a callback with parameters (score_amortisation, start_production, end_production, max_time) that returns a set of parts that are best to build (assuming all building requirements are fulfilled and production available for the project in maximal affordable time is supposed to change lineary between specified values) to get the best success_prob*finish_score*(1-score_amortisation)^project_time. Or a bit more complicated formula that also counts production-to-score rate outside of the project.