[REFERENCE] Per unit area build tweakables

Discussion in 'Mod Discussions' started by linike860, January 17, 2014.

  1. linike860

    linike860 Uber Alumni

    Messages:
    42
    Likes Received:
    243
    Hi Modders,

    I'm the dev behind area commands and I've added a few new values to unit blueprints that some of you may want to take advantage of for area build. These work with building all units except those with feature requirements (i.e. Metal Extractors).

    "area_build_type"
    - possible values: "Sphere", "Line"
    - meaning: a line type defaults to build a line, sphere defaults to circular builds.
    - defaults to: Line
    - feature requirement: Sphere

    "area_build_separation"
    - possible values: numbers
    - meaning: the distance to buffer between individual units
    - defaults to: 2
    - feature requirement: N/A --- as long as there is a feature and the unit can be built, it will place it.

    "area_build_pattern"
    - possible values: array of array of bools
    - meaning: the pattern to use when placing individual units in an area build, each line is wrapped individually so mismatched array sizes will work properly
    - defaults to: empty, no pattern, full fill
    - feature requirement: N/A --- ignores this value completely.
    - example for sphere type:
    "area_build_pattern":
    [
    [0]
    [0,1,1,1,0,0],
    [0,1,1,1,0,0],
    [0,1,1,1,0,0],
    [0],
    [0],
    ]
    - example for line type:
    "area_build_pattern":
    [ [0,1,1,1,0,0] ]

    The area build patterns are fun to mess around with and help automate base building.

    Cheers!
    Gorbles, LavaSnake, Arachnis and 5 others like this.
  2. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    So snazzy!
    Does the area_build_separation accept integers or floating point? I.e. 1.6?
  3. linike860

    linike860 Uber Alumni

    Messages:
    42
    Likes Received:
    243
    Both integers and floats. json uses javascript number types which are all doubles as far as I understand.
  4. Clopse

    Clopse Post Master General

    Messages:
    2,535
    Likes Received:
    2,865
    Cool, so does this mean we can possibly make templates with walls etc?

    Edit: No Worries, re read, great :D
  5. linike860

    linike860 Uber Alumni

    Messages:
    42
    Likes Received:
    243
    Yes, as long as it's for a single unit type.
    Clopse likes this.
  6. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Hmm.
    First thing that comes to mind is some sort of text patterns to mess around xD

    awesome stuff.
    can we somehow change them from javascript while the game is running?
  7. linike860

    linike860 Uber Alumni

    Messages:
    42
    Likes Received:
    243
    Not as of yet, sorry. There will be ways to mess with them during a live game eventually.
    proeleert and cola_colin like this.
  8. stormingkiwi

    stormingkiwi Post Master General

    Messages:
    3,266
    Likes Received:
    1,355
    In the future, will it be possible to create templates for multiple unit types?
  9. linike860

    linike860 Uber Alumni

    Messages:
    42
    Likes Received:
    243
    I believe it is possible right now through the use of base specs. You could have an intermediate spec that derives from the current base spec and just change what you want, then have each templated unit use that as a base spec.
  10. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Err wait. I think you are missunderstanding. Or I do.
    What kiwi wants is to set up templates like a turret with walls around it, right?
    Either I don't understand your proposal or I don't understand kiwi.
  11. linike860

    linike860 Uber Alumni

    Messages:
    42
    Likes Received:
    243
    Oh, I misunderstood. I'm not sure if we currently plan on having base templates like that.
  12. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    I think what linike's saying is that you could create a unit that is just a copy of the 'game unit, but with different area build parameters. You could control how those template units would be displayed in the UI, which would be almost as good.

    But I'm not sure if that would work as a client-side mod. My first thought is that the server would need the same jsons as the client, otherwise you'd send a build order for an 'air_defense_widegrid' unit to the server, and the server would laugh at you and reject the order.
  13. stormingkiwi

    stormingkiwi Post Master General

    Messages:
    3,266
    Likes Received:
    1,355
    Correct, yeah.

    That's ok. Hopefully mod support in the future.
  14. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    I'm trying to get my turrets to build in well-spaced pairs, but...
    Code:
    "area_build_type":"Line",
    "area_build_separation":8,
    "area_build_pattern":[[1,1,0]]
    is just filling the entire line. I'm doing it wrong, aren't I?
    linike860 and stormingkiwi like this.
  15. stormingkiwi

    stormingkiwi Post Master General

    Messages:
    3,266
    Likes Received:
    1,355
    That's ok.


    My changes to a particular file did nothing, then crashed the game, then prevented the building from being built at all.

    @linike860
    Err.. it appears that the largest possible value is for sphere separation is 67. 68 Radius fails to build the sphere, it skips the first structure and goes directly to the second.

    And 67 radius sphere builds only 9 structures.

    I.e. maximum diameter of the sphere is 134 or so.

    Quite disappointing.
    Last edited: January 20, 2014
  16. linike860

    linike860 Uber Alumni

    Messages:
    42
    Likes Received:
    243
    @Dementiurge
    This will be fixed in the next build, thanks for letting me know.

    @StormingKiwi
    Next build will be better, the max radius will be based on the separation value so you can place the same number of buildings regardless of separation.
    stormingkiwi likes this.
  17. stormingkiwi

    stormingkiwi Post Master General

    Messages:
    3,266
    Likes Received:
    1,355
    So it will be possible to change the separation to 150 and fill an entire planet with radar?

    Excellent!
    PeggleFrank, zaphodx and linike860 like this.
  18. stormingkiwi

    stormingkiwi Post Master General

    Messages:
    3,266
    Likes Received:
    1,355
    I would like to add that building the maximum number of walls permitted in a sphere causes some severe performance issues with the command lagging.
  19. taii

    taii Member

    Messages:
    37
    Likes Received:
    7
    Hi linike860,

    don´t kill me for what I am about to ask but I am quite new to theese kind of modifications. Now as I am quite fed up with the line based patterns I would like to learn about adapting theese things. Now yesterday happily enough someone guided me to this thread but I am still unable to see where to find the necessary file...
    Now where do I have to adapt these lines? Is there a special program needed? Where do I find the code for the lines in the programme?

    I would be glad for any further hint.

    C ya


    Daniel
  20. trialq

    trialq Post Master General

    Messages:
    1,295
    Likes Received:
    917

    Each unit has a blueprint file, in JSON format. JSON is a simple text format, you can use notepad or similar to edit them. The files are hard to read unless you format them properly, you could use a website for formatting (like this one: http://jsonformatter.curiousconcept.com/ ), or there is a formatter in the link below.

    The root of the blueprints can be found at:
    For example, the energy plant blueprint is found at:
    This thread may help you figure out what does what: https://forums.uberent.com/threads/pa-modding-reference-guides-applications-tools.48136/
    linike860 and taii like this.

Share This Page