Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: [REDACTED] systems  (Read 1533 times)

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
[REDACTED] systems
« on: September 20, 2019, 04:44:19 PM »

Is there any way to increase amount of [REDACTED]-infested systems generated at the start of the new game?
« Last Edit: September 20, 2019, 05:08:34 PM by Nerzhull_AI »
Logged

Harmful Mechanic

  • Admiral
  • *****
  • Posts: 1082
  • For space is wide and good friends are too few.
    • View Profile
Re: [Redacted] systems
« Reply #1 on: September 20, 2019, 05:10:24 PM »

Yes, but you'll need to replace the script RemnantThemeGenerator.java with an altered version.

The relevant section of code is here:
Code
	public static final int MIN_CONSTELLATIONS_WITH_REMNANTS = 15;
public static final int MAX_CONSTELLATIONS_WITH_REMNANTS = 25;

public static float CONSTELLATION_SKIP_PROB = 0.25f;

Turn the min and max numbers up and you should be good to go.
Logged
People need societies, but they don't necessarily need nations.

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [Redacted] systems
« Reply #2 on: September 20, 2019, 05:31:36 PM »

Yes, but you'll need to replace the script RemnantThemeGenerator.java with an altered version.

The relevant section of code is here:
Code
	public static final int MIN_CONSTELLATIONS_WITH_REMNANTS = 15;
public static final int MAX_CONSTELLATIONS_WITH_REMNANTS = 25;

public static float CONSTELLATION_SKIP_PROB = 0.25f;

Turn the min and max numbers up and you should be good to go.
Nvm, found it. Can't express how grateful i am.
« Last Edit: September 20, 2019, 05:34:19 PM by Nerzhull_AI »
Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [REDACTED] systems
« Reply #3 on: September 20, 2019, 06:21:48 PM »

This is gonna be FUN.

Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [Redacted] systems
« Reply #4 on: September 21, 2019, 12:21:04 PM »

Yes, but you'll need to replace the script RemnantThemeGenerator.java with an altered version.

The relevant section of code is here:
Code
	public static final int MIN_CONSTELLATIONS_WITH_REMNANTS = 15;
public static final int MAX_CONSTELLATIONS_WITH_REMNANTS = 25;

public static float CONSTELLATION_SKIP_PROB = 0.25f;

Turn the min and max numbers up and you should be good to go.
Okay, i'm doing something wrong.
So, i changed MIN_CONSTELLATIONS_WITH_REMNANTS to 75, MAX_CONSTELLATIONS_WITH_REMNANTS to 125, and overall amount of constellations up to 300, using Grand Sector mod. Also turned CONSTELLATION_SKIP_PROB=0f
I started new game, and decided to check through devmode on, ctrl+z and going "outside", and i got only 22 remnant beacons.
I turned Grand Sector off, and cranked up both sector size in settings, and "count" in SectorProcGen.java, but got the same result.
Spoiler
[close]
Broadcasts the Distress Call.
« Last Edit: September 21, 2019, 12:24:27 PM by Nerzhull_AI »
Logged

Mar Sara

  • Ensign
  • *
  • Posts: 26
    • View Profile
Re: [REDACTED] systems
« Reply #5 on: September 21, 2019, 05:21:36 PM »

Where did you put the new file?
Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [REDACTED] systems
« Reply #6 on: September 21, 2019, 05:44:54 PM »

Where did you put the new file?
Long story short, i discovered me being slightly [redacted] and look into starfarer.api.jar, extracted RemnantThemeGenerator.class, replaced MIN_CONSTELLATIONS_WITH_REMNANTS and MAX_CONSTELLATIONS_WITH_REMNANTS in it using some software, placed redacted RemnantThemeGenerator.class back into .jar, but it doesn't seems to work, still got 20 remnant systems
Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [REDACTED] systems
« Reply #7 on: September 22, 2019, 04:49:03 PM »

At this point, i just wonder if there's some sneaky file that overrides this data. Can't find it though.
Tried implementing these changes as a mod, got same result.
Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [REDACTED] systems
« Reply #8 on: September 22, 2019, 05:07:45 PM »

Ok, two things.
First:
Spoiler
[close]
Second: i'm pretty sure i break something.
Spoiler
public void generateForSector(ThemeGenContext context, float allowedUnusedFraction) {
      
      float total = (float) (context.constellations.size() - context.majorThemes.size()) * allowedUnusedFraction;
      if (total <= 0) return;
      
      int num = (int) StarSystemGenerator.getNormalRandom(MIN_CONSTELLATIONS_WITH_REMNANTS, MAX_CONSTELLATIONS_WITH_REMNANTS);
      //if (num > total) num = (int) total;
[close]

Also, apparently, i'm unable do the same through mod. Feelsbad.
« Last Edit: September 22, 2019, 05:13:27 PM by Nerzhull_AI »
Logged

Crimson Sky Gaurdian

  • Captain
  • ****
  • Posts: 484
    • View Profile
Re: [REDACTED] systems
« Reply #9 on: September 22, 2019, 05:14:53 PM »

So from what I'm reading, total (which is (context.constellations.size() - context.majorThemes.size()) * allowedUnusedFraction) is a secret cap, above and beyond MAX_CONSTELLATIONS_WITH_REMNANTS.

Odd that it's a float though, I always thought that those were <1.

For a lark, try instead replacing it with something like:
Code
(context.constellations.size() - context.majorThemes.size()) * allowedUnusedFraction * 20

Or if you can find allowedUnusedFraction somewhere, try upping that.
« Last Edit: September 22, 2019, 05:18:18 PM by Crimson Sky Gaurdian »
Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [REDACTED] systems
« Reply #10 on: September 22, 2019, 05:39:00 PM »

For a lark, try instead replacing it with something like:
Code
(context.constellations.size() - context.majorThemes.size()) * allowedUnusedFraction * 20
Or if you can find allowedUnusedFraction somewhere, try upping that.
Nah, if i do that this way it will probably generate zero remnants, since total will be smaller.
I'm currently searching for allowedUnusedFraction, but so far i didn't found it.

Also, i'd appreciated if someone posted at least rough instruction how to implement these changes through mod. Right now i only have vague memories of java, some mods as a references/examples and well, that's it.
Logged

Crimson Sky Gaurdian

  • Captain
  • ****
  • Posts: 484
    • View Profile
Re: [REDACTED] systems
« Reply #11 on: September 22, 2019, 05:41:57 PM »

Nah, if i do that this way it will probably generate zero remnants, since total will be smaller.
Why would multiplying total make it smaller?
Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [REDACTED] systems
« Reply #12 on: September 22, 2019, 05:57:37 PM »

Nah, if i do that this way it will probably generate zero remnants, since total will be smaller.
Why would multiplying total make it smaller?
Spoiler
float total = (float) (context.constellations.size() - context.majorThemes.size()) * allowedUnusedFraction;
      if (total <= 0) return;
      
      int num = (int) StarSystemGenerator.getNormalRandom(MIN_CONSTELLATIONS_WITH_REMNANTS, MAX_CONSTELLATIONS_WITH_REMNANTS);
      if (num > total) num = (int) total;
[close]
Well, if MIN_CONSTELLATIONS_WITH_REMNANTS=75, and MAX_CONSTELLATIONS_WITH_REMNANTS=125, num will be somewhere in-between, let's say 100. If number > total => number==total, so maximum possible amount of remsystems decreases.
Since total is something similar to "constellations free for new themes", by multiplying allowedUnusedFraction we decreasing "total" number.
At least this is what i'm seeing here.

Also, i found this:
Spoiler
   public interface ThemeGenerator {
   String getThemeId();
   
   void generateForSector(ThemeGenContext context, float allowedUnusedFraction);
   
   /**
    * Themes with lower "order" values get their shot at generating content first.
    * @return
    */
   int getOrder();
   
   
   /**
    * What fraction of the Sector this theme wants to be used for, relative to other themes.
    *
    * The fraction it gets is weight / (total weight of all themes).
    *
    * Base value is 100.
    *
    * @return
    */
   float getWeight();

   Random getRandom();
   void setRandom(Random random);
}
[close]
So it make sense.
Logged

Crimson Sky Gaurdian

  • Captain
  • ****
  • Posts: 484
    • View Profile
Re: [REDACTED] systems
« Reply #13 on: September 22, 2019, 06:02:05 PM »

Spoiler
float total = (float) (context.constellations.size() - context.majorThemes.size()) * allowedUnusedFraction;
      if (total <= 0) return;
      
      int num = (int) StarSystemGenerator.getNormalRandom(MIN_CONSTELLATIONS_WITH_REMNANTS, MAX_CONSTELLATIONS_WITH_REMNANTS);
      if (num > total) num = (int) total;
[close]
Well, if MIN_CONSTELLATIONS_WITH_REMNANTS=75, and MAX_CONSTELLATIONS_WITH_REMNANTS=125, num will be somewhere in-between, let's say 100. If number > total => number==total, so maximum possible amount of remsystems decreases.
Since total is something similar to "constellations free for new themes", by multiplying allowedUnusedFraction we decreasing "total" number.
At least this is what i'm seeing here.
Right, so let's say total, as is, is 90.
Sticking * 20 on the end now makes total 1800. So now the cap for the maximum number of systems is 20 times higher.
Code
if (num > total) num = (int) total;
Means that if num is higher than total, it is set to total. So the higher total is, the higher num can be before getting capped, not the lower.
Logged

Nerzhull_AI

  • Lieutenant
  • **
  • Posts: 90
  • In self-sustaining chaos.
    • View Profile
Re: [REDACTED] systems
« Reply #14 on: September 22, 2019, 06:04:08 PM »

Spoiler
float total = (float) (context.constellations.size() - context.majorThemes.size()) * allowedUnusedFraction;
      if (total <= 0) return;
      
      int num = (int) StarSystemGenerator.getNormalRandom(MIN_CONSTELLATIONS_WITH_REMNANTS, MAX_CONSTELLATIONS_WITH_REMNANTS);
      if (num > total) num = (int) total;
[close]
Well, if MIN_CONSTELLATIONS_WITH_REMNANTS=75, and MAX_CONSTELLATIONS_WITH_REMNANTS=125, num will be somewhere in-between, let's say 100. If number > total => number==total, so maximum possible amount of remsystems decreases.
Since total is something similar to "constellations free for new themes", by multiplying allowedUnusedFraction we decreasing "total" number.
At least this is what i'm seeing here.
Right, so let's say total, as is, is 90.
Sticking * 20 on the end now makes total 1800. So now the cap for the maximum number of systems is 20 times higher.
Code
if (num > total) num = (int) total;
Means that if num is higher than total, it is set to total. So the higher total is, the higher num can be before getting capped, not the lower.
Oh, i'm just [REDACTED] and didn't saw that ")" in before allowedUnusedFraction.
Thanks for pointing that out.
Maybe i shouldn't do this at 4 a.m. after busy day. Oh well.
Logged
Pages: [1] 2