1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Master of Orion 2 unofficial patch

Discussion in 'Other Civ-Related Games' started by Rocco.40, Feb 7, 2016.

  1. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    The "desc" field is very nice and I'll attempt to read it whenever is available before using alternatives like "name" or "code" as comments. You should consider adding it to all fields (especially table columns) that have unclear names. For example, I have no idea what are the "strat_*" columns from the "hull" table.
     
  2. Rocco.40

    Rocco.40 Chieftain

    Joined:
    Mar 2, 2015
    Messages:
    596
    The strat_* columns are used in strategic games, so with ship design functionality turned off.
     
  3. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    Found some errors in JSON: the "tech_name" table has all its items set to "enum" with values of "group1..3" instead of "string". Same problem for all other names (tech fields, buildings, weapons etc), except there the type is "integer" instead of "string". If they are enums, the user can only choose from a list, and if they are integers, only numbers can be entered, so they should be strings to allow text input.
     
  4. Alex/150

    Alex/150 Chieftain

    Joined:
    Mar 20, 2017
    Messages:
    31
    Gender:
    Male
    That's a bug. Uploaded corrected json.
     

    Attached Files:

  5. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    Thanks, got it!

    I'm working on some hard-coded modules (which depend on exact keywords from your script) and I realized the program could become useless if you upload a new version that is incompatible, so I should embed the current patch version into the current executable. This way a user who wants to use this version would be able to deploy the associated patch and start using it right away.

    But I'm worried the size may grow too much, should I include just a light version? What are the essential files outside orion150.exe and what about the license, the patch doesn't seem to have a license, is it alright for me to embed it?
     
  6. Alex/150

    Alex/150 Chieftain

    Joined:
    Mar 20, 2017
    Messages:
    31
    Gender:
    Male
    Could you give an example of such hardcoded keywords and corresponding functionality? I am not sure why you expect it to become useless, your program should always read latest json from moo2 dir and it should correspond to the current patch version. Please elaborate.
     
  7. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    What you've seen so far was just the Free Editor, where all fields can be edited using the JSON (can work abstractly without it too), but there will be other modules that work with specific keywords.

    For example, the Race Editor uses internally all race-related keywords like "number_of_race_picks", "race_pick", "stock_race", "ai_race_variant_table", "ai_race_variants" and all their rows and columns, see the picture bellow. Obviously, if any of these fields change, it will not work anymore.

    race-editor.jpg

    I'm working on the Race Variants now and I also plan to add editors for important stuff like the Tech Tree and possibly an AI Ship Designer. This is a serious project, which will provide very easy modding like I've promised, I hope you didn't think it's just some lame editor :D
     
  8. Alex/150

    Alex/150 Chieftain

    Joined:
    Mar 20, 2017
    Messages:
    31
    Gender:
    Male
    I see. Absolute majority of parameter names change very rarely, the development of the patch has slowed down lately. To keep your tool fool-proof I suggest:

    1. Hardcoding into it supported patch versions. Say for now it's 1.50.14. For 1.50.15 free editor can still work, while specialized editors can refuse to work or issue a warning.

    2. On each release of the patch we notify you, and you add support for an upcoming version. In most cases it'll be just adding single string like 1.50.15 into the list of supported versions.

    You're already investing significant effort into creating this tool, IMO adding 1 line twice a year is a small price to keep it up to date.

    Regarding bundling patch with your tool, I think doing that is inviting confusion. It'll require syncing patch and tool releases, or otherwise people will have conflicting versions in our bundle vs yours. Then if we DO sync releases, why not just do step 2 above. I'd rather suggest to bundle your tool with a patch, when it's ready/mature enough. That'll make sure the patch and the tool are in sync.
     
    Last edited: Apr 19, 2019
  9. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    Alright then, I'll skip the patch and just put a link to your website instead, I see the links to older versions are available so this should work.
     
  10. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    Techs are a mess, I need some help so I'll be asking lots of questions :D

    How do I put a tech field in the right "box", for example what should I do if I want to put Construction where Force Fields is? Is it related to AI_group? What is AI_group?

    What's the purpose of starting_techfield? Isn't enough that a tech_field has prev_field_id set to 0? If I set a starting_techfield to advf_power does it mean the tech tree will be completely researched on that branch? I read the PDF manual, but it's still confusing...

    Also, what's the point of prewarp_techfield and postwarp_tech, aren't known techs implicit from the tech_field list?
     
  11. Rocco.40

    Rocco.40 Chieftain

    Joined:
    Mar 2, 2015
    Messages:
    596
    There are 8 branches of technology and each first tech field of a branch has prev_field_id set to 0, so from this information alone, the game cannot know which branch is which.
    This is where starting_techfield comes in, to mark the start of a specific technology branch.

    example:
    tech_field advanced_magnetism = 7 0 36 250 4;
    prev_field_id is 0, indicating that this is the first field of a branch, but which one?

    starting_techfield force_fields_field1 = advanced_magnetism;
    sets this field as the start of the force fields branch.​

    If you set a starting_techfield to advf_power it means that there is nothing in that branch. In-game such branch will show up empty. Individual technologies do not become known that way.

    example:
    tech_field advf_fields = 79 0 0 25000 18;
    note both prev_field_id and next_field_id are set to 0

    starting_techfield force_fields_field1 = advf_fields;
    the force fields branch now technically starts with hypertech field, but in-game there is just an empty branch.​

    You can place any tech field in any branch, but a broken chain of techfields within a branch, can have weird effects on how the tech tree looks in-game and at worst can cause a game crash.
    When modding the tech tree, empty tech fields need to be prevented, otherwise the game will crash too (or rather: freeze with a black screen after mapgen).
    An easily overlooked culprit here is that the game removes certain techs for certain races and for strategic games.

    example:
    If hydroponic farm is the only tech in a tech field and you start the game with a Lithovore race, the farm is removed from the game, that tech field will become empty, breaking the tech tree.

    example:
    If battle pods is the only tech in a tech field and you start the game with tactical combat off, battle pods is removed from the game, again causing a black screen of failure. :)

    AI_group, or 'tech level' sets the value / desirability of a tech field for the AI, the higher this value the more AI will prioritize it (affecting its research pathing but also tech exchange for example)
    By default values are set according a fields research points value, a 50 RP field is AI_group 1, 80 RP field is group 2, etc.

    prewarp_techfield is used to define the group of tech fields that are known at an average technology start.
    This is used in modding to make a field researchable from an average tech start, and can be done by replacing the entry with 'starting_tech'

    Post-warp essentially is an average-tech start plus some extra technologies already known.
    postwarp_tech defines which techs are known. The first 7 entries of this list are excluded from strategic mode.

    example:
    postwarp_tech postwarp_tech_1 = 56;
    Reinforced hull is given at a post-warp start, but is not part of strategic mode.​
     
  12. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    Thanks Rocco! This has cleared up some stuff, but I still have some questions...

    1. So if I write:

    starting_techfield construction_field1 = starting_tech;

    will use the tech field with the id 29 as the first one of the Construction branch?

    2. Most tech fields have 3 techs, but there are some with 4 techs, can I assume that all tech fields can have 4 techs?

    3. The prewarp_techfield table may be confusing, so let me rename it a bit to see if I got it right:
    known_techfield prewarp = engineering;
    known_techfield average1 = nuclear_fission; (engineering included as well)
    known_techfield average2 = chemistry;
    known_techfield average3 = physics;
    known_techfield average4 = electronics;
    known_techfield average5 = cold_fusion;

    Would this be correct?

    4. I still don't understand the postwarp_tech, why is it separate from the prewarp_techfield? I mean when comparing the fields between the two levels, it is obvious that postwarp skips entire fields and not just specific techs... The manual says that moving techs around can break the postwarp tree, how so?

    5. The average and advanced tech levels are clearly different, the prewarp_techfield takes care of the average level, but why aren't/where are the known fields for the advanced level defined?

    6. Shouldn't the prewarp_techfield contain all stuff together like this:
    known_techfield prewarp = engineering;

    known_techfield average1 = nuclear_fission;
    known_techfield average2 = chemistry;
    known_techfield average3 = physics;
    known_techfield average4 = electronics;
    known_techfield average5 = cold_fusion;

    known_techfield postwarp1 = advanced_engineering;
    known_techfield postwarp2 = advanced_metallurgy;
    known_techfield postwarp3 = fusion_physics;
    known_techfield postwarp4 = optronics;
    known_techfield postwarp5 = advanced_fusion;
    known_techfield postwarp6 = military_tactics;
    known_techfield postwarp7 = astro_biology;
    known_techfield postwarp8 = advanced_magnetism;

    known_techfield advanced1 = astro_engineering;
    known_techfield advanced2 = advanced_chemistry;
    known_techfield advanced3 = artificial_intelligence;
    known_techfield advanced4 = xeno_relations;
    known_techfield advanced5 = advanced_biology;
    known_techfield advanced6 = gravitic_fields;


    Sorry if I'm being annoying, but I need to understand things well to avoid making a bad design :)
     
  13. Rocco.40

    Rocco.40 Chieftain

    Joined:
    Mar 2, 2015
    Messages:
    596
    np, not annoying at all, here are some answers back:...

    1. starting_techfield construction_field1 = starting_tech;

    If you write this, you are setting the starting tech field of a branch to 0, which is incorrect, there needs to be an actual tech field assigned.

    2. Any tech field can have 1-4 techs assigned.

    3. It could be written like this, yes.

    4. Post-Warp is defined by giving technologies, not tech fields. It just happens to be done in such way that the techs that are given nicely complete tech fields (so the fields are also given in result).
    When you start modding the tech tree, you can for example: swap reinforced hull with zortium armor.
    In that case in post-warp, the field advanced engineering is no longer completed (it now has zortium, which is not listed as a post warp tech) and the field is therefore not given and needs to be researched, while in the field of nano technology you will see microlite construction and nano disassemblers but not reinforced hull since the latter is listed as post-warp tech.

    5. Advanced tech levels are done by a function, not by a fixed table. So each time you start an advanced game, the tech fields given can vary somewhat.

    6. Ref. 4: This wouldn't work since post-warp is defined by technologies ('tech apps'), not tech fields.
     
    Last edited: Apr 19, 2019
  14. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    This is very clear, thanks again!
     
  15. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    Hey Alex, the "default" field is very useful, thanks for adding it, now I can even generate default script lines when needed, but could you output it row by row or even all in one line? Or at least place it at the beginning or at the end of a JSON object. If you list it vertically like that it ruins the document readability, when I need to look at some table I have to scroll like 20-30 pages to get from "columns" to "rows" because "default" is in the middle of the table :D Not a big deal and it doesn't affect the processing at all, but it can be annoying...
     
  16. Alex/150

    Alex/150 Chieftain

    Joined:
    Mar 20, 2017
    Messages:
    31
    Gender:
    Male
    Names are sorted alphabetically by standard json module I use, I'd rather not mess with it. For reference you could create separate json, by deleting all defaults pragmatically and saving the result.

    Btw if you're using visual studio, it should be able to jump between matching brackets via some shortcut, no need to scroll.
     
  17. Ponkyo

    Ponkyo Chieftain

    Joined:
    Mar 18, 2019
    Messages:
    24
    A few more questions:
    1. Can all tech fields be moved around or some of them must have fixed positions?
    2. Is the first Construction tech field always known, whatever that may be?
    3. Must the "engineering" tech field always be the first Construction tech field?
    4. Why do the first 7 entries from the "postwarp_tech" table have to be excluded from strategic? Isn't obvious what techs are excluded from the strategic mode from their definition (they have strategic=0)? What's with the 7 number, is this a scripting limitation? What if the user puts 8 non-strategic techs instead of 7 there?
    5. Can I reset the "postwarp_tech" table entries to 0 to make Postwarp same as Average?
     
    Last edited: Apr 22, 2019 at 12:34 PM
  18. Rocco.40

    Rocco.40 Chieftain

    Joined:
    Mar 2, 2015
    Messages:
    596
    A few more quick answers :)
    1. yes.
    2. yes
    3. no
    4. post-warp was added in the 1.40 fan patch. post-warp doesn't look at a techs 0 or 1 value in tech table. the first 7 entries of the post-warp table (that was added in the 1.40 patch and further adjusted in 1.50) do not "have to be" excluded, they "are" excluded from strategic. 7 is just the amount where cut-off was set, it could have been 8 or 6, but it seems 7 is the optimal number here.
    5. yes (I have never tried that, but should work)
     

Share This Page