Third Recourse, A unit cap.

Discussion in 'Support!' started by maxpowerz, April 27, 2016.

  1. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    @mikeyh @cola_colin, +other good PA modders..

    I want to make a recourse called CPU,
    This CPU resource is a form of "unit cap" that limits the amount of unit's you can build.

    Each player starts with X amount of CPU pre-settable prior to match in lobby,
    Example
    - "1000" CPU.
    - "2000" CPU
    - "3000" CPU
    - "UBER" (Unlimited/No unit cap CPU recourse)

    And each unit cost X amount of CPU to build,
    Example
    - T1 units and defences "1" CPU each unit,
    - T2 untis and defences "10" CPU each unit,
    - Titans "100" CPU each unit.
    (individual units costs could be tuned to make it balanced these are just arbitrary values)

    And when a unit or defensive structure is destroyed or recycled the CPU cost for that unit or defense is returned to the player.

    If you don't have enough CPU to build a unit you can't build it until enough CPU has been freed up from units being destroyed or recycled.

    I think this would greatly change the way people play the game and promote a lot more strategy in the game-play used.
    I think it would also help stop server crashes and overloads by limiting the amount of units the server has to run pathing and AI calls for.
    Last edited: April 27, 2016
  2. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Downside is i have no idea how to implement it into the game yet.

    I know i need a variable "CPU" that i can pass from the lobby to the game.
    Each unit will need a tag for it's "CPU_Cost".
    When a unit is built in the factory i need a check to see if "Unit.CPU_Cost is <= CPU",
    Then if that's true "CPU - Unit.CPU_Cost" and build unit.
    When a unit's destroyed i need to call a function that adds the units CPU Cost back to CPU "CPU + Unit.CPU_Cost".
    Last edited: April 27, 2016
  3. Killerkiwijuice

    Killerkiwijuice Post Master General

    Messages:
    3,882
    Likes Received:
    3,625
    this probably can't be done with js only

    it would require engine implementation unless there's some secret engine api calls
  4. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    Almost certainly impossible.

Share This Page