[MOD] Random Galaxy Tool - Second Realignment

The place to discuss scripting and game modifications for X4: Foundations.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

General Vash
Posts: 24
Joined: Thu, 30. Jan 20, 05:13
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by General Vash » Tue, 28. Dec 21, 02:07

So, the free tier of service I am using for this app can only do 550 hours per month, and I've hit 80% of those hours for December. There may be some downtime before the next month rolls around...I'll try to think of a way that's simpler for people to maybe get the tool for desktop from my git page instead. I'll add something to the readme for technically savvy people, but I obviously don't expect most people to build and run from source. The new year is just around the corner, but I'll have to see how the usage hours add up for January and decide what to do at that point.

SirConnery
Posts: 284
Joined: Mon, 10. Dec 18, 07:26

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by SirConnery » Mon, 3. Jan 22, 22:52

Trying this out now, does it generate minor factions?

Edit:
I created a galaxy where most factions have 2 or 3 sectors. I really like the economy is just starting out, very few stations and so you can really influence the development of the galaxy. Really wish they made this a custom game variant for the base game. Have each faction start with just a few zones.

Some observations though. There is way too much of ore and gas mining opportunities in most sectors. I would suggest cutting the amount of gas areas generated by -50%. There is also a bit too much ore around and the yields are ridicilous with most being around 0.5 . Suggestion to cut the spawning of various ore areas by 30% and introduce much more randomness to the yields. I think most yields in base game map are around 0.1 .

General Vash
Posts: 24
Joined: Thu, 30. Jan 20, 05:13
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by General Vash » Tue, 4. Jan 22, 14:59

Thanks for checking it out! I agree that yields and resource locations are a bit too plentiful in general, however that part of the generation was done by Celludriel and I haven't reverse engineered it yet. He isn't really active on this project so it might be some time before I can tweak the resources more significantly than just reducing their spawn rate. I was reluctant to do that, however, since some factions might end up being completely denied access to a raw resource. Anyway, I'll adjust it eventually and probably add sliders to the tool for resource scarcity.

SirConnery
Posts: 284
Joined: Mon, 10. Dec 18, 07:26

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by SirConnery » Tue, 4. Jan 22, 20:13

Other improvement I suggest is being able to manually place faction start sectors but I'm not sure how feasible that is to do.

enriquan
Posts: 4
Joined: Fri, 15. Aug 14, 02:51
x3tc

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by enriquan » Sun, 27. Feb 22, 18:15

How would I enable custom start to this? I'd like to begin as my own faction with some sectors and prebuilt stations...

Malankatank
Posts: 106
Joined: Wed, 6. Nov 13, 19:54
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by Malankatank » Thu, 3. Mar 22, 22:22

Just found out about your mod today. From what I can see it really spices things up. Thanks.
over thinking and over analyzing since '87

raim729
Posts: 157
Joined: Mon, 17. Dec 18, 16:21
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by raim729 » Sat, 5. Mar 22, 08:18

Hi there,

Is there a guide for that too?
Can I also link non-active gates with each other?

Realspace
Posts: 1342
Joined: Wed, 15. Nov 06, 10:21
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by Realspace » Mon, 14. Mar 22, 16:54

This tool is incredible, thank you!
Do you plan on making the output customizable, like changing ownership of single sectors after the generation of universe?
Or even better, modify the generated layout?
Last edited by Realspace on Sat, 2. Apr 22, 13:03, edited 1 time in total.

SirConnery
Posts: 284
Joined: Mon, 10. Dec 18, 07:26

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by SirConnery » Thu, 17. Mar 22, 19:32

For now it's not that great since it generates way too much ore and gas everywhere. Otherwise a very good tool.

celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by celludriel » Fri, 25. Mar 22, 23:50

I approve of this tool :)

I had a quick look at how I wrote the code for the belts. It appears I added an option for manual belts ... sooooooooo technically you could add it to the random tool I guess. The random generation is hardcoded though

Code: Select all


public class BeltProcessor {

    public static final long ZONERANGE = 150000L;

    private final Randomizer randomizer;

    public BeltProcessor(Randomizer randomizer) {
        this.randomizer = randomizer;
    }

    public void processBelts(Galaxy galaxy, Cluster cluster){
        if(cluster.isNoBelts()){
            return;
        }

        List<Belt> belts = cluster.getBelts();
        if(belts.size() > 0){
            addManualSelectedBelts(belts);
        }else{
            generateRandomBelts(galaxy.getMinRandomBelts(), galaxy.getMaxRandomBelts(), cluster);
        }
    }

    private void generateRandomBelts(int minRandomBelts, int maxRandomBelts, Cluster cluster) {
        int amountOfBelts = randomizer.randomInt(minRandomBelts, maxRandomBelts);
        for(int i = 0; i < amountOfBelts;i++){
            Belt belt = new Belt();
            belt.setType(randomizer.getRandomBelt());
            belt.setX(randomizer.generateRandomCoordinate(-ZONERANGE, ZONERANGE));
            belt.setY(randomizer.generateRandomCoordinate(-ZONERANGE, ZONERANGE));
            belt.setRotation(randomizer.getRandomRotation());
            cluster.addToBelts(belt);
        }
    }

    private void addManualSelectedBelts(List<Belt> belts) {
        for (Belt belt : belts) {
            if(belt.getX() == null){
                belt.setX(randomizer.generateRandomCoordinate(-ZONERANGE, ZONERANGE));
            }
            if(belt.getY() == null){
                belt.setY(randomizer.generateRandomCoordinate(-ZONERANGE, ZONERANGE));
            }
            if(belt.getRotation() == null){
                belt.setRotation(randomizer.getRandomRotation());
            }
        }
    }
}

It seems the Json model is held on Cluster level

https://github.com/Celludriel/X4_Univer ... uster.java
https://github.com/Celludriel/X4_Univer ... /Belt.java
https://github.com/Celludriel/X4_Univer ... tType.java

Shouldn't be too hard to implement ... if it all works as supposed to in the generator :)

st3k
Posts: 62
Joined: Sat, 22. Dec 18, 12:45
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by st3k » Sat, 2. Apr 22, 07:17

can we expect updates wich includes new factions?

SirConnery
Posts: 284
Joined: Mon, 10. Dec 18, 07:26

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by SirConnery » Sat, 2. Apr 22, 20:53

celludriel wrote:
Fri, 25. Mar 22, 23:50
I approve of this tool :)

I had a quick look at how I wrote the code for the belts. It appears I added an option for manual belts ... sooooooooo technically you could add it to the random tool I guess. The random generation is hardcoded though
What do you mean by belts? Are these the asteroid and gas fields? Or the connections between sectors? Please explain.

vadiolive
Posts: 337
Joined: Wed, 18. Dec 13, 04:36
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by vadiolive » Sun, 3. Apr 22, 02:29

Indeed

SCA/HAT is missing
And expect in fact news faction as well

This mod with DeadAir DynamicWars
Faction Enhancer

DeadAir AI Tweaks and Kuerte Ai Tweaks as well
Its refresh everytime for each new gameplay

Kospy
Posts: 10
Joined: Sun, 21. Jan 07, 10:38
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by Kospy » Sun, 24. Apr 22, 14:05

Wow this mod look awesome!
I was just thinking, but instead of trying to create a full random universe, why not just shifting gate connections?
Sectors keep there names, layout, backdrop, story mission and all, but the whole layout is changed.
Look way easier and it would already be an huge change for a restart no?

WRTaylor
Posts: 1
Joined: Fri, 13. May 22, 02:34

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by WRTaylor » Fri, 13. May 22, 02:36

Will this mod work with the new X4 Tides of Avarice?

Bozz11
Posts: 252
Joined: Fri, 23. Nov 18, 08:54
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by Bozz11 » Fri, 13. May 22, 16:02

Kospy wrote:
Sun, 24. Apr 22, 14:05
Wow this mod look awesome!
I was just thinking, but instead of trying to create a full random universe, why not just shifting gate connections?
Sectors keep there names, layout, backdrop, story mission and all, but the whole layout is changed.
Look way easier and it would already be an huge change for a restart no?
That would not works, factions if unlucky would have nowhere to mine some ressources and would just get destroyed

Galleta
Posts: 1
Joined: Fri, 3. Jun 22, 19:47

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by Galleta » Fri, 3. Jun 22, 19:48

Is the mod still being worked on?

Zordiark Darkeater
Posts: 4
Joined: Mon, 6. Jun 22, 23:02

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by Zordiark Darkeater » Mon, 6. Jun 22, 23:11

Galleta wrote:
Fri, 3. Jun 22, 19:48
Is the mod still being worked on?
Want to know that too :/

SirConnery
Posts: 284
Joined: Mon, 10. Dec 18, 07:26

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by SirConnery » Sun, 1. Jan 23, 16:44

I guess this doesn't work anymore. Shame.

Really wish this kind of tool was made into the base game to generate random galaxies for new game starts.

General Vash
Posts: 24
Joined: Thu, 30. Jan 20, 05:13
x4

Re: [MOD] Random Galaxy Tool - Second Realignment

Post by General Vash » Wed, 22. Feb 23, 03:51

The hosting for the web application is no longer working, and I admittedly don't know when it broke. I'm tentatively planning to rewrite this as a desktop application so that it doesn't stop working randomly due to server hosting. Probably will work on it after Kingdom End DLC.

In the meantime, I apologize that it is no longer working!

Post Reply

Return to “X4: Foundations - Scripts and Modding”