[TOOL] Procedural Scenario Modificator

Discussion in 'Scenarios' started by cmwhee, Jul 26, 2017.

  1. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    I created a thing, it can be found here:

    https://github.com/lostinplace/egs-scenario-updater

    Here's the readme:

    Empyrion Scenario Updater
    Summary
    This is a script that I created to meet the needs of my play group.

    This script reads a scenario, and writes out a copy with the following modifications:

    • All Pentaxid (Resources and Crystals) are removed
    • All Resource deposits have been dramatically shrunk, but the number of deposits is much higher
    • A Faction Mission has been generated for every planet with randomly generated POIs
      • There is a task for each POI randomly generated type that can be found on the planet
      • Placing a core block on 1 of each type rewards the faction with 5 pentaxid
      • Conquering 1 of each POI type completes the mission and rewards the faction with 100 Gold coins
    Instructions
    To run the script from the command line:

    ~ git clone [email protected]:lostinplace/egs-scenario-updater.git
    ~ cd egs-scenario-updater
    ~ ./updater.py --basepath=<PATH TO CONTENT FOLDER> <NAME OF SOURCE SCENARIO> <NAME OF OUTPUT SCENARIO>

    You can also see usage by running:

    ~ ./updater.py -h

    If you's like, you can place the basepath in a file called .updater-config it will traverse to root looking for it, and it will use the file contents as a basepath

    I ran every thing on WSL (bash for windows) I haven't tried it on the windows command line

    Feedback
    I created this as the precursor to a framework for programatically generating scenarios, let me know if you have any questions

    ---Updated: config file stuff
     
    #1
    Last edited: Jul 28, 2017
  2. binhthuy71

    binhthuy71 Rear Admiral

    Joined:
    Oct 17, 2016
    Messages:
    1,072
    Likes Received:
    2,788
    This has tons of potential. Thank you for your work on it. I'll be following your progress.
     
    #2
  3. Hummel-o-War

    Hummel-o-War Administrator Staff Member Community Manager

    • Developer
    Joined:
    Jun 15, 2015
    Messages:
    5,506
    Likes Received:
    8,502
    Do you also plan to do something like reading a Playfield, then programmatically altering planet parameters (gravity, colors of sunflower and so on), altering Used POI (swap groups with random prefabs) and NPCs and so on?

    Or is your tool more geared towards Missions and mission-permutations, thus creating the correct environment for them to work as a side effect?
     
    #3
    Ephoie likes this.
  4. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    It was built so that I could start to describe generic edits to playfields based on MDP ( https://en.wikipedia.org/wiki/Markov_decision_process ) The missions are kind of an afterthought to make the playfields actually useful.

    So yeah, I'm hoping to build an AI that will create our planets for us
     
    #4
    Ephoie likes this.
  5. SixxGunZ

    SixxGunZ Commander

    Joined:
    May 22, 2017
    Messages:
    98
    Likes Received:
    35
    Is there any way you could create a batch file or config option to set the file paths? I might be doing something wrong but It throws syntax errors for me. Using the windows / python command line
     
    #5
  6. SixxGunZ

    SixxGunZ Commander

    Joined:
    May 22, 2017
    Messages:
    98
    Likes Received:
    35
    Actually if you could maybe show a way to hard code in the file paths for the scenario / prefab / new custom folder name that would be alot easier and I can edit those.


    ***UPDATE***

    I'm a dummy - Found it in the playfield manager.


    playfield_folder_path_format = "{}/Playfields/{}"
    playfield_file_path_format = "{}/playfield.yaml"


    playfield_path_format = "{}/Playfields/{}/playfield.yaml"

    Sector processing has this -

    sector_file_path_format = "{}/Sectors/Sectors.yaml"


    Run.py has

    playfield_folder_path_format = "{}/Playfields/{}"

    pda manager has

    pda_folder_format = "{}/Extras/PDA"
    pda_path_format = "{}/PDA.yaml"
    pda_messages_path_format = "{}/PDA.csv"


    Now my next question is this safe? I'm only a dabbler in the coding world, so my knowledge is limited but I'm assuming I could use this to manually set the file paths?
     
    #6
    Last edited: Jul 27, 2017
  7. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    I think it's a good idea to have configurable basepath, I'm just not sure what the syntax would be. maybe a settings.yaml

    how would you like to be able to call the script?
     
    #7
  8. SixxGunZ

    SixxGunZ Commander

    Joined:
    May 22, 2017
    Messages:
    98
    Likes Received:
    35
    any sort of txt based config file is fine. .ini / .yaml
     
    #8
  9. SixxGunZ

    SixxGunZ Commander

    Joined:
    May 22, 2017
    Messages:
    98
    Likes Received:
    35
    For the time being do you think its possible for me to set the basepath in the .py files I listed above? Or is the script calling the basepath in a different fashion?

    Btw, I love how you left the .py files exposed - this will allow me to customize and edit resource amounts / poi amounts and such
     
    #9
  10. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    @SixxGunZ do me a favor and add an issue to the repo with something like, "I'd like a basic configuration file" I'll try to get to it before EOD today
     
    #10
    SixxGunZ likes this.
  11. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    done
     
    #11
  12. SixxGunZ

    SixxGunZ Commander

    Joined:
    May 22, 2017
    Messages:
    98
    Likes Received:
    35
    Just got home a little bit ago so I couldnt post on the Github, but thanks for workin on it!
     
    #12
  13. SixxGunZ

    SixxGunZ Commander

    Joined:
    May 22, 2017
    Messages:
    98
    Likes Received:
    35
    Well, first set of error logs for ya

    ModuleNotFoundError: No module named 'ruamel'

    I can only run this under windows / python atm, and I'm honestly not sure if python is working correctly for me, so some of this may be user error
     
    #13
    Last edited: Jul 28, 2017
  14. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    little python knowledge for you:

    `pip install -r requirements.txt`
     
    #14
  15. SixxGunZ

    SixxGunZ Commander

    Joined:
    May 22, 2017
    Messages:
    98
    Likes Received:
    35
    Where do I put that at? I feel so incompetant with anything linux based lol
     
    #15
  16. cmwhee

    cmwhee Commander

    Joined:
    Oct 31, 2016
    Messages:
    118
    Likes Received:
    72
    I've updated the readme
     
    #16
  17. Jeffglobal

    Jeffglobal Commander

    Joined:
    May 11, 2019
    Messages:
    113
    Likes Received:
    154
    I want to replace my default base attack scenario base with a base of my choosing. I've been directed to the .yaml, in the scenarios folder, but I have to do something with the PDA.

    I searched, "PDA" in the forum search bar, and of course, nothing came up...o_O

    But Idk wth the "PDA" is... may I be directed to a source where I can learn what the PDA is such that I can affect my base getting attacked until I die!
     
    #17
  18. Kaeser

    Kaeser Rear Admiral

    Joined:
    Aug 17, 2015
    Messages:
    1,739
    Likes Received:
    2,458

    To achieve that you'll need a couple of things

    First your base will need at least one player spawner otherwise you'll start the game outside the base
    It also needs a personal locker because that's where the initial loot will be, you can also change the content of the loot in the yaml file

    Then after creating a BP of the base you'll have to edit the settings of the BP like this, by double clicking the BP name in the BP Factory

    The group name DN_BaseAttack it's what's used in the YAML file, you need to change that to something different for your BP
    You also need to add the name StarterBase and this has to be exactly like that otherwise it may not work

    20190620204029_1.jpg

    After that you need to copy your bp file (.epb) from the folder it is, somewhere in:
    C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Saves\Blueprints\(your steam user ID)\(Name of the BP)\

    Into the folder Prefabs in:
    C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Content\Prefabs\

    After that you need to edit the playfield_static.yaml file in:
    C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Content\Scenarios\Default Base Attack\Playfields\AridBaseAttack\

    There's several planets in the scenario but only the Arid is in use currently

    Use notepad++ to edit the file and be careful with indentation otherwise it wont work and change the DN_BaseAttack in these two places to the one you use in your BP
    upload_2019-6-20_21-53-21.png

    You can also change the content of the personal container but be careful to only use the internal names in there

    Check the file Localization.csv for the correct names of the items you want in folder:
    C:\Program Files (x86)\Steam\steamapps\common\Empyrion - Galactic Survival\Content\Extras\
     
    #18
    Jeffglobal and ravien_ff like this.
  19. ravien_ff

    ravien_ff Rear Admiral

    Joined:
    Oct 22, 2017
    Messages:
    6,395
    Likes Received:
    12,004
    I also recommend you copy the "default base attack scenario" and rename it to something different, so the game doesn't override your changes.
     
    #19
  20. Jeffglobal

    Jeffglobal Commander

    Joined:
    May 11, 2019
    Messages:
    113
    Likes Received:
    154
    Thank you for the additions. The Eleon devs actually just created a #pdacs thread on their discord server to address this issue. They told me I also had to change the PDA.cs file and to use the ~/Scenarios/Default Base Attack/Content/Prefabs folder instead of the game's Prefab folder, but I but it in both, cause I'm overly cautious...

    You can read that thread to see what their instructions were to me. Also they directed me to the temperate folder not the arid folder, idk y, but it worked!
    https://www.dropbox.com/s/9ujl9wfp0gpuam5/BaseAttackGeneralTest.mp4?dl=0
     
    #20
    Last edited: Jun 22, 2019

Share This Page