It is currently Mon Jun 17, 2019 11:17 am

All times are UTC + 9:30 hours

Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Scope of cw2 engine Model
PostPosted: Tue Dec 30, 2008 5:21 am 
Main Coder

Joined: Fri Apr 04, 2008 10:50 pm
Posts: 169
What is expected behavior of the cw2 engine model
Offers basic TurnBased game much like aw, highly customizable to be able to reuse the model for multiple different aw like turn based games.
This is done by not hard coding values, only behavior that talks to interfaces instead of the real imp. Adding game specific functionality should be done by adjusting config, data files or writing new behavior or sub classing but not by changing the model!

We can separate concerns by putting similar behavior into systems, all turnBased games have these systems in common they do 1 thing and do it well.

The systems:
  • Move System
    • Hides the implementation of a move within a map.
    • PathFinder creates best path from tile A to tile B. based on terrain heuristics.
    • MoveStrategy, each Mover has a way of moving around, it may have move limitations.

      - Normal MovementStrategy:
      Movement value -> uses the terrain moveCost

      - HoverCraftMovementStrategy:
      Normal MovementStrategy +
      moving from water -> only allow movement onto water, shoals, or ports
      moving into water -> only allow movement from water, shoals, or ports

    • Weathers affect global moving costs ie
      Snow: All movers have -1 mobility.
    • Making a move
      Pre Move conditions:
      enough supplies left to move?

      Actually move:
      One step at a time, can't just loop over the tiles because that's at cpu speed, instead in the controller a timer will call move after x ms.
      Look 1Tile ahead
      has unit on nextTile is it allied else -> destinationReached(trapper)
      change unit orientation so that it always faces to the next tile
      change location each step

      Post Move
      subtracts the movecost from unit supplies
      at last tile -> destinationReached()
    • Events

  • Turn system: Current turn, turn limit, convert to day

  • Battle/Fight system
    Attacker can attack Defender
    Fight takes information from attacker, defender, terrain and calculates a result
    After the Fight a counterattack can be performed

    Custom behavior
    Example when a unit it out of supplies:
    and it is a ground unit it stops moving(normal behavior, no need to add code)
    and it is a naval unit it sinks
    and it is a air unit it drops out of the sky,
    basically the last 2 make a unit die this needs to be added but how?

Problem domain:
  • can fire, attack and be destroyed
  • name
  • health of which is deducted upon being fired on by other units
  • has movement restricted by a certain number of tiles
  • has an amount of commands that are active when conditions are met.
  • has a unitState this is the action is it currently performing. a unit can only perform 1 action at a time. can't capture and move at the same time :P
  • some can transport other units of a given ArmyBranch
  • holds ammo count, maxammo, range
  • does not hold the damage it can inflict! why not?
  • id,name,description,defenceBonus,height,moveCosts for each Mover
  • is immutable(no setters)
Property is a Terrain
  • vision Amount of tiles this terrain can 'see' in each direction
  • location The location this Property is on, owner Player owning this Property.
City is a Property
  • Cities are properties that have an income.
  • can heal damageables of a specific armyBranch
  • can supply supplyables of a specific armybranch
  • can be captured by a Capturer, when captured gives funds to the player that owns it
    is within the default map
  • Unit/Properties are not drawn when tile is Fogged.
  • Hidden: Allows terrains/units to remain fogged until Mover is adjacent, even if it is not fogged, it is still not drawn.
    stealth? detected? == setHidden
  • There are 2 type of players:
    mapPlayer: a player in the map: has a startLocation, can be neutral, has a defaultColor. These will be in a map file.
    gamePlayer: a player in the game is a mapPlayer + has a name, budget, army,list of properties
    it can update itself on the start and end of a turn
  • A player has 1 HQ Property
  • properties like MAP_NAME, MAX_NUM_PLAYERS, AUTHOR, ETC...
  • handles looping through tiles from a centerTile in different ways (circle, square, adjacent)
  • can lookup Directions between 2 tiles.

What is not included:
Mist, co, Triggers, campaigns, hidden and submerged damage

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 9:30 hours

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Blue Moon by Trent © 2007
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group