[WIP] Planet preview creator script + service (?)

Discussion in 'Mod Discussions' started by SXX, February 15, 2014.

  1. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    When I watch latest streams and seen many improvements related to naval units I'm started to think about playing on water planets. Unfortunately it's pretty hard to generate proper island map at moment and it's can actually take hours before you find good one.

    So now my idea was to automate planet generation process and make few screenshots of each map, e.g:
    frame-01_18.jpg frame-30_18.jpg

    After some initial testing I decide to create proper preview of map in GIF. First I tried to move map using arrows camera pan keys and make screenshot after each small movement, but that didn't work well, e.g game always react quite differently and final animation looks bad. Then I'm tried to grab video with ffmpeg and then convert it to frames and gif and this worked awesome. I'm already generate about 300 GIFs and there is still some adjustments required, but it's most of previews looks awesome.

    Here is some examples (click to see animation, each gif just abot 1MB):
    rotation_earth.gif rotation_metal.gif rotation_lava.gif rotation_moon.gif

    Obviously in terms of unstable map generator we can't built preview for each planet, but I think such previews can be good addition for system sharing mod. E.g it's will be possible to use previewer as service that will able to create previews on demand.

    At moment it's just work in progress, but I want to make something cool with it. For now it's dirty bash script that use xmacro, xdotool, ffmpeg and imagemagick. :)

    PS: I'm lazy so I'm now put some status/todo in this topic:
    • [DONE] Preview video capturing and conversation to WEBM
    • [DONE] Ability to remove the sun and background
    • [WIP] Ability to change background color to simplify separation
    • [WIP] Automated transparent background for WEBM video
    • [TODO] Disable all shadows to make it preview look better
    • [TODO] Some service with PHP and queue
    Last edited: March 19, 2014
    ORFJackal, shootall, Raevn and 6 others like this.
  2. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Wow. Just wow

    EDIT: Having the mex spot visible would be cool though.
    shootall, Raevn and maxpowerz like this.
  3. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Any idea how to enable metal spot placement/rendering in system editor?

    Technically I can preview each planet on server, but I guess Uber won't be happy. :oops:
  4. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    No idea, I tried to do that a while ago and everything failed.
  5. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    could these work as live icons in lobby?
  6. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Do you mean just replace normal icons with those GIFs? Yes, it's just normal animation and actually I have video in MKV format. But I can say for sure there is far better planets that can be used as icons and possible it's better re-generate them with all effects enabled. :)

    If you mean use them as icons that actually represent how planet looks like - yes, but only if there will be some DB of pre-generated icons. It's why I notice that can be integrated into planet sharing.
    maxpowerz likes this.
  7. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    Yes that, live icon of planet in lobby.

    I guessed a DB of pre-recorded icons would be needed, lots of rendering.. lol
  8. maxpowerz

    maxpowerz Post Master General

    Messages:
    2,208
    Likes Received:
    885
    how many combination of biome per planet.
    (seeds) x (height) x (water height) x (temp)..

    Wow ,, hmmm terrabytes of database.
  9. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Idea is to generate previews of good planets or make it easier to find them. E.g there is no reason to store everything. :)
    shootall and maxpowerz like this.
  10. superouman

    superouman Post Master General

    Messages:
    1,007
    Likes Received:
    1,139
    That's some top tier stuff here.
  11. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    I would add this to the Enhanced System Preview mod. I could put it in System sharing, but I split out all the ui improvements into a separate mod early on so it can work in your own collection too. If I need to save images to the database, that's the only reason to change system sharing. Really looking forward to how this works out!
  12. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    What you might want to do is release a custom collection of good planets and override their preview thumbnail with your own. Then we could find them in our templates or the planet page. I think that integrates best with the client and will hold up to future ui changes better.
  13. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Here is 10 more totally random GIFs just to show how well this work.

    It's lava planets with 800 radius and water level 56, number in name it's seed.
    Unfortunately I didn't remember exact "height range"m but most likely it's default 60. Good that it's not affect generation result a lot anyway.

    Attached Files:

    DeathByDenim likes this.
  14. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    This is an original idea, but obviously I want others to choose planets or use planets from pre-shared systems. I don't have time to build collection of planets myself, but can run some service that will have queue for preview creation so people who don't want run it locally can use it. :)
    shootall likes this.
  15. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
  16. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    Yeah, if systm sharing ever takes off we could automate thumbnail generation on those planets.
  17. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Could PA Stats somehow use that to generate images for every planet it sees?
    shootall and cptconundrum like this.
  18. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    This is going to change the game forever. Combine a large planet image, live location data for all units, and a 3d > 2d projection to correct for the curvature, and you could in theory show radar blips in real time.
  19. SXX

    SXX Post Master General

    Messages:
    6,896
    Likes Received:
    1,812
    Yes and if you have PA version logged I can even create previews with older versions of game because I most likely have all of them here. :)

    At moment Main problem will be limited performance of my crappy CPU, but if somebody else with Linux setup own preview render farm It's can go faster. I'll play around and check what exactly do I need to make it work properly, possible I'll able to put it on my headless server.
    cola_colin likes this.
  20. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    yes I do have the PA versions :)
    I could throw the data of like 20k games at you :p

Share This Page