[WIP] Templates for Random System Generation [57703]

Discussion in 'Mod Discussions' started by Dementiurge, December 7, 2013.

  1. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    PA_systemtemplatemod010.jpg
    In the Nov. 27 livestream there was mention of how the system generation is planned to be improved with templates, so that you can choose the kind of system to be randomly generated, without using the system editor.

    Well I'm not waiting! I've worked up a very basic prototype, and added a couple new templates to choose from. Long term, I'm hoping to use saved System Editor systems as templates, as that'll probably be more convenient than anything else.

    Short term, I'm taking suggestions for what default templates to have, as well as ideas on what should randomly vary on planets. (E.g. if water height should be able to go to 100.)

    You can see a nod to Garat's test system as well.

    Compatibility: So long as nothing else touches the 'Generate New' link.

    Attached Files:

    Last edited: December 7, 2013
    stuart98, Quitch, mishtakashi and 2 others like this.
  2. mushroomars

    mushroomars Well-Known Member

    Messages:
    1,655
    Likes Received:
    319
    This is pretty butt-kick. I think ideally there should be sliders, tickboxes and text boxes for a "quick system". Like, amount of planets, the size variance of planets, the relation of planets to others (frequency of moons, micromoons and asteroids), and inputs to the procedural generator's weights (mass concentration, mass frequency, relative biome size, temperature, etc.).

    But in the mean time this is better than binary quick systems. Awesome work!
  3. kryovow

    kryovow Well-Known Member

    Messages:
    1,112
    Likes Received:
    240
    1 planet template as long as interplanetary warfare sucks^^
  4. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885

    I had issues with "lava" planets so i fixed your mod :) Attached fixed .zip to this post

    I added 2 extra templates :)
    "Low RAM system" (1 Planet 351-500 size, random planet + 1 moon 50-100)
    "MaxTasTic System" (1 Planet 450-900 size, 2 small moons 50-120 size)

    I removed "Lava" from the random Biome picker.. as it wont work at the moment, i can't get lava planets to load..

    I also play at 1360x768, so when the planet list grows over 3 planets it pushes the publish button off the bottom of my screen when the extra template buttons are pushed down.,
    So i added a line of code at the bottom of the "rts.js" file
    Code:
    $("div[style*='max-height: 297px']").css({"max-height":'140px'});
    It limits height of the planets list table to 140px was ~297px same height as the lobby table.
    (Thank-you raevn .. thank-you :) )

    AWESOME mod ... Cheers!!!!

    --edited--
    Raevn helped me add the code needed to limit the size of the planet list :)
    Changing attachment here for you.. this one works great.. :)

    Attached Files:

    Last edited: December 8, 2013
  5. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    @maxpowerz - You need to use jquery to modify the bits of HTML you want dynamically.

    eg.

    $('#some_div').replaceWith("<p>content here</p>");

    or .append etc.
    maxpowerz likes this.
  6. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Cheers, i was slowly working that out reverse engineering out peoples mods :)

    Also i got my models working in game.. so cheers again for the papa import for blender :)
    Raevn likes this.
  7. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    --edited--
    raevn help me with my issue :)
    Last edited: December 8, 2013
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    You just need to add the following line to rst.js:

    $("div[style*='max-height: 297px']").css({"max-height":'140px'});

    Edit: I'd actually recommend just setting the height to a fixed 140px, so it doesn't slightly change size:

    $("div[style*='max-height: 297px']").css({"height":'140px'});

    @Dementiurge, let me know if you want this available via the mod manager. I haven't added it yet as I'm not sure if you consider it finished yet, or you wish until you've worked out which templates to use.
    Last edited: December 8, 2013
    maxpowerz likes this.
  9. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Thank-you , my forehead was starting to hurt, this kind of coding is like headbutting a brick wall when your learning .. lol
    LavaSnake likes this.
  10. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    The main issue is that the UI files are currently extremely lacking in unique tag IDs and other methods of selection so you need to filter on css values or do crazy chains like .parent().parent().parent() ...
    LavaSnake and maxpowerz like this.
  11. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    @Dementiurge
    I have fixed the mod so it has 5 templates,
    It will no longer randomly generate "Lava Planets"
    And it doesn't push the publish button offscreen anymore @ ****x768 resolutions and works well with raevn's mod manger..
    ( Thank-you Raevn :) )

    To install..
    1, download and extract randomsystemtemplates.zip.
    2, copy the extracted randomsystemtemplates folder into the PA mods directory.
    3, Enable with raevn's mod manager.

    Attached Files:

    Last edited: December 8, 2013
  12. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    I'm having trouble posting and uploading at the moment.
    Edit: The forum logs me out when I try to add files, especially images. Not sure what the issue is. But I can edit posts. Shrug.

    [​IMG]

    I've added a scrollbar so any number of templates can be added, as well as some of your other changes, but I think changing the planet list should be done in a different mod. Compartmentalization may help with mod compatibility in the future.

    Attached Files:

    Last edited: December 8, 2013
    maxpowerz likes this.
  13. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Does this version put your buttons into a table with a scrollbar?
  14. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    I still had i tiny issue with the button moving off screen still *sighs*
    But i didn't need to limit the size of the planet list table as much..

    Here are my edit's

    rts.css
    line 5 i changed this
    Code:
    max-height: 140px; overflow:auto;
    
    Displays all 5 buttons now, but still adds scroll bar if more buttons are added.


    rts.js
    at bottom of file 4th last line i added this..
    Code:
    $("div[style*='max-height: 297px']").css({"height":'180px'});
    
    Force-ably sets the planet list height to 180pixel.

    Here's a screen shot of the compromise i made between the two table height sizes, i hope you like it.
    Untitled.jpg
    I love this mod .. MEGA AWESOMNESS!!!!

    Attached a revision v3 of your mod :)
    Thank-you dementiurge for making this!!!

    --edited-- uploaded wrong screenshot .. fixed now

    Attached Files:

    Last edited: December 8, 2013
  15. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    Yeah, if you want five templates shown at once then it will use more room than the default.
    I'm hoping to make a completely different presentation that works better given the (lack of) room available.
    Methlodis and maxpowerz like this.
  16. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    What about using a drop-down list? That would let you have any number.

    Edit: Maxpowerz, maybe hold off a bit until Dementiurge has finished the base of his mod. You're stepping on each others' toes ;)
    maxpowerz likes this.
  17. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Maybe make it a popup window like the patch notes..
    Then have a button to popup the window where you can select the desired layout for random generation.
    that would give you more room to play with , you could even go as far as making it "Fancy" by giving the random templates descriptions..

    I'd make you a mock template but i really do suck at JavaScripting.. lol

    I'll try photoshop you up a picture of what i mean if it doesn't make sence..
    idea.jpg
    Last edited: December 8, 2013
  18. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    My bad,
    Just wanted to help with idea's on Demetiurge's BEST MOD IN THE WORLD!! :)
    And to point out where people playing at ****x768 res or even x720 may have issues..

    I gotta admit this mod is so awesome it's the first by someone else i have ever installed..
    It inspired me to want to help make it more AWESOME..
  19. Dementiurge

    Dementiurge Post Master General

    Messages:
    1,094
    Likes Received:
    693
    I'll make a [REL] thread when it's ready.

    Since it's a [WIP] thread, I don't mind anyone stepping on my toes, just remember to wear a hard hat. ;)
    It's also a convenient excuse for not wrestling with the forum software to update the OP.

    I've already thought of a pop-up window, or a table that swaps with the planet list. Even something that hangs off the side is a possibility. I'll probably figure it out after I revamp the template system.
    maxpowerz likes this.
  20. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    @Dementiurge

    This mod plus your "Planet Preview Details" mod makes the best pre-lobby random system generator out there :)

    With both mods installed customizing a random system is easy.
    Mash generate new system on your favorite template to get a few good planets,
    Then press the "preview planet info" link under a planet icon and then pick a new seed,
    All without needing to go into the custom system editor ..

    WOW..

Share This Page