Games/Productive

From OLPC
Jump to navigation Jump to search

Productive

This is a straw-man proposal for a simplified real-time strategy game, tentatively named "Productive". We may attempt to implement the game during the upcoming OLPC Toronto Game Sprint (Nov 16-18, 2007).

Simplifications from "normal" real-time strategy games:

  • Just two unit-types
  • Single-tech tech-tree (military units of varying grades)
  • Just two commands (territory-create-unit, unit-move)
  • No battle system (no battles per-se, just shifts of allegiance to controlling powers)
  • Single resource type
  • Constrained map structures

Those changes put Productive somewhere between chess or checkers and traditional computerized RTS games. All of the complexity of game-play is emergent from the simple rules, but the style-of-play is real-time.

Game-play

These rules should create a fairly broad range of possible strategies, defending, farming, raiding, road-building and city-building. The parameters and rules will likely need tweaking to keep the game-play fast and fun.

Board Setup

  • Grid playing "field" of a given size
    • To start with, a simple grid
    • Might allow for adding "dead areas" to the grid eventually
    • To start with, regular territories within the grid
  • Each player gets X starting units and places them on the board one after another until the units are all placed
    • All players must join before start-of-play
    • Loss of a player stops play (game can be stored and restored by any participant at any time, potentially with other users)

Resource Production

  • Resource production is proportional to the number of productive units with adjacent empty land (regardless of whether the land is within the territory the unit is in or how many units are "farming" it).
  • Productive units begin producing when they are adjacent to empty land
    • They retain their production counter internally until it is used
    • Usage of resources is done evenly across all units in all controlled territories
  • If a unit converts allegiance or moves to a new territory then they take their collected resources with them
  • A player's current wealth is the sum of the wealth of their productive units in those territories that they control. They may dispense this wealth as they see fit (given constraints on unit maintenance)

Unit Production/Maintenance

  • Unit survival requires resources
    • Each existing unit requires a certain amount of resources to survive
      • this value is comparatively low for productive units (say 1/10 of a unit's production)
      • this value is comparatively high for military units (say 2/10 of a productive unit's production)
  • All units must be fed (starvation)
    • No unit production possible if starvation (insufficient food for all units) occurs
    • In process unit production is canceled, 50% of resources are lost, 50% recovered to feed units, oldest production is stopped first, until all units are fed or all in-process production is canceled
    • If no units in-production, non-productive units are lost
      • Non-productive productive units (most dense area first)
      • Military units (those without empty squares in their area first (random), then any (random))
      • Maybe start off with simple random kill-off (easy to program)
      • (Note: I'd rather have the units switch allegiance that are in the other-player-controlled territories, but that's probably too involved for now)
  • Controlled territories can produce new units
    • If there is no controlled territory, no new units are possible
    • New unit production requires significant resources
      • Setting for each unit-type, along with other requirements (e.g. city status, control of territory)
      • Maybe 500% of unit's production for a productive unit
    • Wealth remains with the productive unit until a controlled territory begins producing a unit
      • if you do not create units your productive units become targets for takeover
    • If a territory is taken over (control shifts to another player) while it is producing a unit, the unit becomes the unit of the controlling player (the unit is assigned to the controlling player at the moment the unit is created, but the cost is borne at the moment the unit is ordered)

Cities/Technology

  • Very dense population centres, (i.e. those which occupy every point in a territory), will produce more mobile units which do not produce resources when occupying, but which contribute to controlling/occupying territories (military versus productive units)
  • Larger cities will produce ever more mobile units (i.e. two adjacent city territories)
    • e.g. one-territory city, 2-unit military, two-territory city, 3-unit military
  • Military units require exponentially more resources to produce for each level (e.g. a unit that can move 2 squares at once would cost 4 times as many resources as a farmer, those moving 3 squares, 9 times).

Territoriality

  • Territories are controlled by having the largest population in a territory (equal population results in no-one controlling the territory)
    • Military units have a multiple of the weight of productive units when determining control, i.e. a level-2 military unit counts as productive unit, a level-3 as 3 productive units.
  • Territories provide access to the controlling player to the resources of that player's units in the territory
    • Players use resources of all of their controlled territories to start production of units and to feed their population
  • Territories are YxY grid fragments, marked visually, so that users can see the territory "boundaries" (it would be nice to allow overlapping, shifting boundaries, but not likely to be feasible)

Conversion

  • Each territory has a balance of power represented by a simple count of the total number of units within it, with the maximum count being the power in control (equal counts == no controlling balance)
    • Each unit retains an internal counter of "allegiances" (one for each player)
    • Time within a territory controlled by another player increases the unit's allegiance to that power (without upper bounds, so a very old farmer is going to be far harder to sway than a young one)
      • Military units are less affected, but still affected
    • Units start with reasonably high allegiance to the player that created them, enough to withstand 2 minutes or so in a foreign-controlled territory (enough time to "mount a defense", but not enough time to build new units to mount it)
    • Units belong to (respond to the commands of, provide resources for) the player to whom they have the greatest allegiance
    • Unit conversions will be reported to the user, individual unit's allegiances can be viewed one-by-one by hovering over the unit
  • Player with balance of power for a territory can use the resources of their units in that territory to produce new units in any of their controlled territories

Motion

  • Movement is instantaneous, that is, it occurs at a discrete time
    • All units can move across un-occupied spaces in response to commands by user
    • Productive units can only move slowly through un-occupied space (e.g. 1 square at a time, every 15 or 20 seconds)
    • "Military" units can move farther/faster through un-occupied space (e.g. 2 squares at a time, on the same period)
  • Controlled square motion
    • Units can travel instantly through a chain of their own units
    • Productive units cannot move through opposing units' occupied squares
    • Military units can move across opposing unit's squares if there is an empty square within their movement range (i.e. a 3-square military unit can jump two opposing player's squares, but a 2-square unit can only jump one)
    • Military units can combine a move through a chain of their own units and a jump over an adjacent opponent.
  • Player can move as many units as they want as often as the units are allowed to move (real time operation)
  • New units appear at the closest un-occupied square to the center of their creating territory

Goals

  • Report "success" at any point in time along various measures:
    • Territoriality (Conquest, number of territories occupied/controlled)
    • Resource Base (Money, total income over time)
    • Technology (Maximum "tech" level (military distance), number of cities)
    • Population (Simple count)
    • Loyalty (Average allegiance of population)
      • Conversions (Ratio of conversions to/from player)

Open Questions

We'd like to minimise "safe" configurations in the game to prevent static situations. Defensive rings of a given width can be used to protect an internal productive area (similar to Go). The defensive rings do not currently have a method which would breach them other than producing a higher technological level, which can be quite expensive. In a corner, 8 pieces can produce a defensive ring that produces ~ 30 pieces worth of food, on an edge 14 produce a defensive ring that produces ~50 pieces worth of resources, in open space, 25 pieces can produce a ring which produces ~90 pieces worth of food.

We could address this, for instance, by having production from a piece of land drop as more people farm it, so that the cluster's productivity would drop below sustaining itself. Something as simple as 1/x production would work reasonably well, with each adjacent square granting 1/x to each of its neighbouring producers. With that only the corner configuration would be worthwhile, all others would require more food than they produce to defend against a military-level-2 unit. It would also make invasions easier (by opening out the farm-land), and thus reversals much more frequent.

Implementation Ideas

Since we'll be implementing the game quickly, it's probably a good idea to have the general plan of attack thought out. We'll want to get a sub-set of the game working quickly and then add the various elaborations as we move forward over the weekend.

UI/Design

  • Screen Layout
    • Orthogonal grid playing field (easy to program quickly in PyGame)
      • Wide bars on edge for scrolling window
    • Statistics side-bar/bottom-bar (portrait layout below, landscape beside)
      • Overall map (clickable to move to another area)
      • Hover information display
    • Notifications (click to zoom to the unit/territory)
      • Territories being invaded (entry of foreign unit into player-controlled territory)
      • Territories lost (conversion of territory to another player's control)
      • Units being converted (units who are allied to the player which are becoming more allied with another player)
      • Units converted (units whose allegiance has switched to another player)
      • Units created (local-player creation only)
    • Statistics/readouts
    • Resource Meter (three part, background production, two overlays of usage, highlight on danger and more so on crises)
      • Current resource production (rate)
      • Current maintenance resource usage (rate)
      • Current unit-production resource usage (rate)
  • Interactivity
    • Unit-selection (single-only)
      • Hover to see unit details (including timers) in HUD
        • Unit should display it's planned route (to the player who controls them) as a path on the screen
      • Click and click empty square to issue movement command
      • Click on unit, or another unit (of any player), to cancel movement command (or escape key on keyboard), on the first click planned motion is stopped, so clicking on a moving unit then clicking on them again stops their motion
      • Movement blockage will be reported back as flashes or the like highlighting a blocked move
    • Territory Icon (single-selection-only)
      • Hover to see territory details including unit production progress
      • Click to create new unit, if the territory hasn't begun production yet, click again to abort production and retain all resources
    • Tablet Operation
      • Gamepad/arrows to move cursor, accelerate on long hold-down, auto-scroll to follow selection
      • Navigation rocker-down to "click"
      • Navigation rocker-up to switch to side-bar and back
      • "Hover" by not moving
      • Other rocker directions for e.g. bringing up save or option overlays
  • Miscellaneous UI Features
    • Store/restore UI (later)
    • Initial setup screens (later)
    • History viewer? (later)
    • Observer view? (later)

Code/Organisation

  • Simulation code as a separate engine (i.e. not directly connected to the display code, so that we can replace the display should we need to)
    • Provide the simulation engine as a DBUS service using RPC-style calls for UI actions and events for updates
    • Speed control (new users wanting to play slow, to learn, experienced to play fast, very experience to play slowly and chess-like)
  • Host will run the simulation (for now we won't worry about "cheats")
    • Use whole-board-updates from the server to the clients (reduce synchronization problems)
    • Allow anyone to save off the board at any time (and potentially resume it later with different players, share it with others, etceteras)
    • Updates should be first-come-first served, but keep in mind that many updates will be constrained by the unit/territories counters regarding e.g. frequency of movement and/or production
    • We may want to introduce an arbitrary delay into the host child's updates (to prevent them having an edge)
  • Keep the various simulation parameters as controllable parameters so that we can tweak game-play through development, a few of these might be exposed to the player
    • Board size (e.g. start with 30x30 for 2-player)
    • Territory size (e.g. start with 3x3 for 2-player)
    • All periods/rates
      • Resource-collection rate per productive unit
      • Production rate per unit/distance
      • Period before auto-placement
      • Cost per unit
      • etc.
    • Will need some basic path-finding algorithm for the units

Stages

First stage of development will likely be to get a simple engine up on the back-end that can be called into (via DBUS) and which can produce notification updates to the clients. Starting as simple as possible, so e.g. we just provide a UI that tells the back-end "make this square my colour" and the back-end updates all of the clients via a DBUS message/event.

Second stage would be largely decoupled. Backend can add timers and the like to make the pieces move at maximum rates. Front-end can add the UI controls for movement, territories, etc. Graphics can work on the various states and transition graphics. Infrastructure can work on networking and resource loading.

Art Required

We'll need quite a few art pieces to polish the game. Likely need at least one graphic and one auditory artist to participate.

Graphics

  • Territory Icons
    • Uncontrolled Territory
    • Controlled Territory
    • Territory Lost
    • Territory Threatened (other player moves into your territory)
  • Unit Icons
    • Productive
    • Military (multiple levels, likely composed from a base icon)
    • "Moving" versions of each
    • "Moving Blocked" versions of each
  • Movement Icon
    • Conflict Icon (Move Blocked)
  • Resource Icon
  • Allegiance Icon
  • Unit-Allegiance
    • Each player gets their XO colours assigned to their icons
    • Need to look into colour-reliance issues, may need to provide different icon sets so that black-and-white mode is playable, alternately, use player "badges" added to the base icon-set
  • Resource Meter

Sounds

  • Action sounds
  • Event/notification sounds