Jump to content

[MOD]Asteroid Variety and Exploration Adjustments


tz7yo3g

Recommended Posts

This makes a few relatively small adjustments to the generation of asteroid fields to improve variety and fun, and slightly (10-20%?) increases the chances of finding exploration and salvage oriented sectors. You'll need to login to the forum to see the  post's attached files I think.

 

What's changed, checked with v 0.20.2 r13565 : In SectorGenerator.lua - changes to code to make more variety in asteroid field size, each asteroid size, and range over each possible selection of types of each of these. Trying to put a simpler explanation here first : So as partly shown in the code boxes below, asteroid size based on the numbers can be larger by up to (117.5 / 25 ~= 4.7) times larger...Would be, if asteroids were uniform spheres, they are often oblong and flat , so the result is they are not as large as that and even then, not very often, since that's the maximum of only one of the five types possible, Much more often sizes stay in the middles of normalish distributions of the other choices types anyway.  And at minimum the reduction is not very much smaller than the minimum of 5.0, just to be safe to keep asteroids noticeable at all, and counts reasonable. So I tried to use the templates/types the game already had for the intended purposes, just more exaggerated. I  changed a line or so of code for asteroids with minerals to keep them the same size as stock ( 5.0 to 25.0 ), since changing size of those would have changed the amount of resources in them, found by earlier modders. Of the five types of fields the game chooses and then varies more, I added more range in variety in of each of these five types first. Of these volume "areas", several of which are usually already chosen per sector, they now can vary in size by between 0.15 at the lowest (smaller and about as empty as stock for that template/type) to 3.87 times larger at the largest (dense sectors with the largest asteroids). I forget whether those volumes are spherical, and if not, I intended to change that but got sidetracked. More details below, or look in the file, lines ~292 to ~363 for asteroid changes, though this file links up with other generation files in a little more complicated way to determine how fields,system types and things in them are made. Wormholes of any kind are a little more common, and of them ringwormholes(lateral) and randomized types are a little more common than deepwormholes(toward/away from center) than before. Practically everything was already done by the existing modding structure and system.

 

In passingships.lua, a partly appearance  , less gameplay difference that adds a little more variety to frequency of passing ships in terms of time, and since it's possible for more frequent appearances at times of trader convoys, group size lowered from 6 to 5.

 

In sectors/[sectortype] lua files : raised by a little (10-20%?) chance for ancientgates, cultists, functional wreckage, station wreckage and wreckage asteroid fields to appear relative to everything else, about 10-20 other types of things depending on how they are selected by the game.

lowers by a little the chances for pirate asteroid fields and smuggler hideours to appear as sector types. Does not change pirate attacks, xsotan attacks or the core.

 

I don't know more accurately what the chance increase is since I don't know how the chance based selector for the game's choosing a weighted? sector type is done, I can guess though and I think i'm close. For asteroid variety, they are now more varied by how much I have more trouble saying, since the files use not just four main types to choose from, but many chance based variations from those sets that are chosen when each new sector's asteroids are picked. I added a seperate variable to control each sub asteroid field size(and thereby density, and then again adjusting number of asteroids with the other built in value, having more control over density in that way..it makes more sense looking at sectorgenerator maybe.) From each asteroid size, the game already had controls for changing the size and number of asteroids found in a sector. I found that asteroid total numbers too high could cause long load times and too large asteroids were too blocky, but fewer larger asteroids ran better than more smaller ones. There sometimes an initial lower frame rate for ten seconds or so with sectors that have more asteroids than usual while the physics engine settles I guess. Other than that I'm happier with these settings, more varied types of asteroid density ranging from more dense to a few times more dense, per field, with different field sizes, sizes of asteroids (now up to a little larger than the large claimable ones, and less frequently asteroids can be smaller than usual and in some sectors less dense than usual, or more empty than before. The changes aren't as intense as other asteroid mods, but those were fun and good inspiration.

I liked these asteroids causing better navigation difficulty and they crowd around mining bases at times, while being less changed in more populated sectors, since the stock game settings included that balance itself.

 

Specifically at most the sizes and densities of asteroids are in this type, one of the five :

function SectorGenerator:createDenseAsteroidField(probability)
    local fieldSize = getFloat(1.4, 3.87) --MOD, seperate multiplier for fieldSize
    local size = getFloat(0.8, 1.25)

    return self:createAsteroidFieldEx(600 * size, 1800 * fieldSize, 3.5, 117.5, 1, probability);--MOD
end

 

 

and at smallestish :

function SectorGenerator:createEmptySmallAsteroidField()
    local fieldSize = getFloat(0.15, 0.45)
    local size = getFloat(0.2, 0.4)

    return self:createAsteroidFieldEx(200 * size, 1800 * fieldSize, 5.0, 25.0, 0);
end

 

Mods can be tested out in a newly made creative galaxy and the galaxy can be deleted to tidy things up. Please know that you can make backups of the scripts folder and your savegames often, and verify files when you're ready to have steam force update all script files. Note that when avorion verion changes, modded stock files may not get replaced unless you force verify. This can be a good thing since it won't get rid of modded files without you knowing, but you'll need to reverify to make sure anything that was changed gets replaced with newer script files. At least, this has been my experience in the last year. Force reverifying will replace any modded files, and then you can compare what's changed with kdiff3 folder compare or a similar tool(git?) in the new version to changes made by modded files. This won't remove any new mod added script files though, so you'll need to periodically delete and replace the whole scripts folder to make sure everything's clean. This mod doesn't add new script files and doesn't change very many stock ones. When sectors are generated and then explored, they are saved into the saved game, that's not something I know how to change if possible by script.

 

Speculation about stuff that smarter people than me could do: higher detail asteroids could be used by script for the few largest asteroids when they're generated, wouldn't be a performance hit if not many were replaced. Increasing number of possible stashes, beacons, very small wrecks, etc very slightly might be good since the fields are more dense to hide them a little better. Varying sector types might be cool too, seems possible? Please by all means, someone do all that good stuff. Maybe a very small chance of very small wormholes hidden by more asteroids, but I hesitated to try since I don't know how ancient gates now work into the gameplay of wormholes, and only recently the ai control got good ability to navigate by itself. Avorion does a very good job of documenting the modding system, using good mod languages, but what's often not documented is maybe game logic flow? Though maybe that's asking a lot and I just don't have a good tool for that or something..I got tired when trying to wrap my head around how the asteroid generating logic stuff ends up working between the several files it goes through, so I just adjusted sizes of things the way I guessed they would turn out. Please use this mod for whatever you like. Questions, comments? How's my intragalactic space drivin'? Bueller? Bueller?!  :D

 

edit 1 : fixed a typo, added info on the asteroid size multiples, maximums, minimums, code meanings and info about volumes of fields already done by the game.

avea_0202_r13565.zip

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...