Modding Help Long-range scanners indicate...

Discussion in 'Starbound Modding' started by poboy, Jan 9, 2015.

  1. poboy

    poboy Void-Bound Voyager

    I know relying on the community and also luck is fun when it comes to finding what you're looking for in the Starbound universe. There's a StarboundPlanets SubReddit and also a few posts here and elsewhere on the Internet, especially for this purpose.

    Wouldn't it be cool ALSO to have a tool (like AMIDST for Minecraft) that will find what is on a planet, before you visit it?
    You could punch in your coordinates, make sure your desired structure is there before you spend gas going and spend the time checking it out.

    So Feature 1 : Analyze a planet given its coordinates. Counts how many of each generated structure (dungeon, village, etc) exists on a planet.

    Also, wouldn't be awesome to ask for "the closest uscm base" or whatever structure you're looking for? You punch in central coordinates and the mod checks those surroundings for the required structure.

    So Feature 2 : Find a planet and stop as soon as one would have generated the given structure.

    This is what this mod-to-be is for. *To be clear there is no mod yet, hence the Modding Help tag.*


    Since Starbound is procedurally generated, that a planet's fate is sealed within its coordinates, this should be feasible. The mod would "use" the systems/ planets generator code and the micro/regular dungeon code to figure out, in memory or on disk, if a structure would be generated at a location.

    So, community, is there interest for such a mod? How do we get it off the ground?
     
  2. AstralGhost

    AstralGhost Pangalactic Porcupine

    Just a few things I think I should mention:
    1. I believe the Devs already have in mind to create planetary scanners. I believe they will probably only work when you're within the same system (otherwise they're a bit OP), but I'm pretty sure they are already on the TODO list.
    2. I'm not sure if LUA scripts have access to reading planets (maps) that you're not already on (the one currently loaded). I may be wrong, but if this is true it makes the mod impossible.
    3. Your "feature 2" is probably not feasible. How would you do something like this? Because the universe is procedural, there are an almost infinite number of planets to scan and a scanner that is just scanning for a certain kind of planet might never finish, and would certainly require a lot of CPU power. You could limit the scan to a certain range, but that only solves the biggest problem of never finding a match and freezing the game in an almost-infinite loop.
    And if the function to read planets exists, it may also write them to the hard-drive first (assuming that you're visiting the planet) in which case it's also going to be very taxing on your hard drive read/write speeds as well as using up lots of space unnecesarily.

    I don't want to be a naysayer, but I would suggest thinking up a new idea. At least one that isn't already planned by the Devs.
    However, I doubt that what the Devs do is going to feature everything you might want in Feature 1 so that's certainly something you could expand on later, or preempt if you don't mind the overlap.
     
    Last edited: Jan 9, 2015
  3. poboy

    poboy Void-Bound Voyager

    1. I didn't know this was already planned by the Devs. Good thing. If you have the some quotes or references to back that up, that would be nice.
    1.1. Even if something IS planned, doesn't mean its not a nice challenge to add it before it gets there. I'm pretty sure the matter manipulator upgrades we see now in Upbeat Giraffe were made ahead of that as mods. Plus, as you say, the Devs might not feature everything that is described here.
    2. If the LUA scripts do not have access to read the maps - or use the generation code - you're right, this won't work. Maybe somebody can check to make sure.
    3. Yes this could be somewhat taxing on the system but here's how it would work:

    - start at current or typed-in coordinates
    - using the universe seed, see what systems/ planets are possible (ie not all coordinates produce a system/ planet)
    - being limited to [0-250] X fuel, build a list of the coordinates of the possible planets, inform user
    - generate a one planet at random from the list, from its seed, in-memory, if possible
    - as soon as a this planet is verified to have the structure stop and return
    - after each planet (verified to have structure or not), free planet-generation memory
    - if no result, check with the user if he wants to continue checking the list, but using more gas
    - repeat with ]250-500] fuel, and so forth


    Edit: Each iteration planet generation would have a cost as to make it less OP.
    Edited to account for AstralGhost's suggestion below.
     
    Last edited: Jan 10, 2015
  4. AstralGhost

    AstralGhost Pangalactic Porcupine

    1. Sure.
    http://playstarbound.com/the-future-of-starbound/ (Third one down from top)
    I can only assume they are still planning these. It was written a year ago.

    2. That's a fair argument. If you're up for it, I'd love to see it. I personally just prefer spending my time on things that aren't going to be replaced. :)

    3. That would still cost a lot of CPU time and memory. I can easily imagine the game "not responding" while it is trying to scan. And a simple error in the loops length could cause it to crash or freeze the game indefinitely, making testing it a major pain.
    If you really do go through with this, rather than a "look at every planet in 'X' range I would suggest looking at an X amount of random planets within a single range. This would mean the scan always runs for a limited amount of time, but the player can scan the same area repeatedly if they don't find anything. It adds randomness to the scans, but it definitely limits the resource-use to a reasonable amount if 'X' is a low enough number.

    But again, I'd recommend you find out if it's possible, first. :) I'd check myself but I don't have any code with me right now.
     
    Last edited: Jan 9, 2015
    The | Suit likes this.
  5. poboy

    poboy Void-Bound Voyager

    I like your approach. I will adjust the pseudo-code above. Done!
    Plus I found this quote from supergeek
    I should be able to use this for when analyzing the current planet.
     
    Last edited: Jan 10, 2015

Share This Page