[WIP] [TC] X3 Galaxy

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

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

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

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

Ok so I took a few steps back today , and started working on a java tool that inputs json and outputs a flyable galaxy. It's coming together nicely

INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json

OUTPUT: https://steamuserimages-a.akamaihd.net/ ... 1BE5F66EE/

I still got some work like wrong coordinates for gates and a mistake in the json file for two gates. But I basically have recreated what I did the past two days by hand now, automatically with a click of a button.
XTC0R
Posts: 401
Joined: Sat, 1. Dec 18, 19:58
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by XTC0R »

celludriel wrote: Wed, 12. Dec 18, 21:38 Ok so I took a few steps back today , and started working on a java tool that inputs json and outputs a flyable galaxy. It's coming together nicely

INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json

OUTPUT: https://steamuserimages-a.akamaihd.net/ ... 1BE5F66EE/

I still got some work like wrong coordinates for gates and a mistake in the json file for two gates. But I basically have recreated what I did the past two days by hand now, automatically with a click of a button.
You impress me more and more every day. We might really get a galaxy editor at the end? ;)
jmattspartacus2
Posts: 73
Joined: Wed, 5. Dec 18, 07:04

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by jmattspartacus2 »

That is beautiful :D keep up the good work!
nickolaiproblem
Posts: 246
Joined: Mon, 5. Nov 18, 23:12
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by nickolaiproblem »

celludriel wrote: Wed, 12. Dec 18, 21:38 Ok so I took a few steps back today , and started working on a java tool that inputs json and outputs a flyable galaxy. It's coming together nicely

INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json

OUTPUT: https://steamuserimages-a.akamaihd.net/ ... 1BE5F66EE/

I still got some work like wrong coordinates for gates and a mistake in the json file for two gates. But I basically have recreated what I did the past two days by hand now, automatically with a click of a button.
I'm likely what I'm seeing when do you think version 1.0 will come out?
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json

OUTPUT: https://steamuserimages-a.akamaihd.net/ ... F844C3F94/

Small progress update, now all stations are being generated by the tool after reading the input from the json. So all balancing can be done in the json.

@nickolaiproblem "when it's done :wink:"
RTest
Posts: 16
Joined: Thu, 29. Nov 18, 01:16
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by RTest »

I will try to create an galaxy generator that generate a json then use your json to xml.
TR0LL
Posts: 45
Joined: Tue, 6. Jan 04, 04:12
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by TR0LL »

Is the size of each sector static or can this be changed?
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

RTest wrote: Thu, 13. Dec 18, 15:15 I will try to create an galaxy generator that generate a json then use your json to xml.
My json isn't final yet, you can start on it but be weary for changes
TR0LL wrote: Thu, 13. Dec 18, 20:59 Is the size of each sector static or can this be changed?
Annoying more like it, it scales automatically if you add a zone to a sector. Even if you want to add a tiny little gate, it adds 200km of space. So no it's not static, but also hard to control
RTest
Posts: 16
Joined: Thu, 29. Nov 18, 01:16
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by RTest »

i did a basic galaxy generator this afternoon. The red dot are for sector placement and white edge for jump link.
[ external image ]
The next step is to generate a json compatible with the celludriel one.
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

I've been updating as well and I got entire Argon jobs running modelled from the json

ok so here we are

INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json

OUTPUT: https://steamuserimages-a.akamaihd.net/ ... F844C3F94/

Full generation of jobs based on the input json ... and all the ships are happily flying around
Riccardoman
Posts: 155
Joined: Thu, 9. Nov 17, 18:57
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by Riccardoman »

You have a talent sir
TR0LL
Posts: 45
Joined: Tue, 6. Jan 04, 04:12
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by TR0LL »

Very good work! So here is a question, is it possible to generate a galaxy that is empty except for resources and have a small hub for each faction and allow them to expand from there? The player could potentially start in their own empty sector with some basic starting stuff and build up. It would be like play a 4X, of... X4....
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

TR0LL wrote: Fri, 14. Dec 18, 00:04 Very good work! So here is a question, is it possible to generate a galaxy that is empty except for resources and have a small hub for each faction and allow them to expand from there? The player could potentially start in their own empty sector with some basic starting stuff and build up. It would be like play a 4X, of... X4....
Yes that is possible, just needs work writing the generator and figuring out the balance needed for X4 to get it's econ going.

So things will still break in the coming days but for those that absolutly can't wait

https://github.com/Celludriel/x4_x3_gal ... evelop.zip

you can download the zip here and copy the x3galaxy folder to your /extensions folder. It should work ... but diasble it if you want to play a new regular game. This mod removes ALL jobs and god entries on launching a new game even from the official gamestarts.
TR0LL
Posts: 45
Joined: Tue, 6. Jan 04, 04:12
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by TR0LL »

celludriel wrote: Fri, 14. Dec 18, 00:26
TR0LL wrote: Fri, 14. Dec 18, 00:04 Very good work! So here is a question, is it possible to generate a galaxy that is empty except for resources and have a small hub for each faction and allow them to expand from there? The player could potentially start in their own empty sector with some basic starting stuff and build up. It would be like play a 4X, of... X4....
Yes that is possible, just needs work writing the generator and figuring out the balance needed for X4 to get it's econ going.

That is awesome, and could easily be a new mod on its own.
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

so we have some progress

https://steamuserimages-a.akamaihd.net/ ... 215D46C2F/

next up:

- add connections
- add stations
- add ware producing stations
- *shudder* add jobs
respaekt
Posts: 35
Joined: Wed, 10. Jun 09, 09:55

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by respaekt »

Great progress, watching this with great anticipation.
I am interested to see how this works performance wise, with 200 player ships or more, the map view is already getting laggy.
Lc4Hunter
XWiki Moderator
XWiki Moderator
Posts: 2193
Joined: Sun, 2. Apr 06, 16:15
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by Lc4Hunter »

Looks good so far.
But, and i hope you agree, the overwiew ist not very good with all these hexagons directly next to each other.

I would like to know if this grid is somekind of hardcoded or if it´s defined in a file we can change somehow.
It would be great to change the layout to something with a bit more overview :D

But for the first steps your progress is really great! :thumb_up:
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

Lc4Hunter wrote: Fri, 14. Dec 18, 10:17 Looks good so far.
But, and i hope you agree, the overwiew ist not very good with all these hexagons directly next to each other.

I would like to know if this grid is somekind of hardcoded or if it´s defined in a file we can change somehow.
It would be great to change the layout to something with a bit more overview :D

But for the first steps your progress is really great! :thumb_up:
I calculate the hex grid from a cartasian grid. The output is a galaxy.xml files with the center of the cluster coordinates in

Code: Select all

    
    public static final int SEMI_X_MOVEMENT = 15000000;
    public static final int FULL_X_MOVEMENT = 30000000;
    public static final int SEMI_Y_MOVEMENT = 8660000;
    public static final int FULL_Y_MOVEMENT = 17320000;
    
    @JsonIgnore
    public String getClusterX(){
        return Long.toString(x * SEMI_X_MOVEMENT);
    }

    @JsonIgnore
    public String getClusterZ() {
        if(x % 2 < 0 && y == 0){
            return Long.toString(y - SEMI_Y_MOVEMENT);
        } else if(x % 2 > 0 && y == 0){
            return Long.toString(y + SEMI_Y_MOVEMENT);
        } else if (x % 2 == 0 && y > 0){
            return Long.toString(y * FULL_Y_MOVEMENT);
        } else if (x % 2 == 0 && y < 0){
            return Long.toString(y * FULL_Y_MOVEMENT);
        } else if(y < 0) {
            int offset = x > 0 ? SEMI_Y_MOVEMENT : -SEMI_Y_MOVEMENT;
            return Long.toString(offset - (Math.abs(y) * FULL_Y_MOVEMENT));
        } else if(y > 0) {
            int offset = x > 0 ? SEMI_Y_MOVEMENT : -SEMI_Y_MOVEMENT;
            return Long.toString(offset + (Math.abs(y) * FULL_Y_MOVEMENT));
        }
        return "0";
    }
example output cluster30 for input json

Code: Select all

    {
      "id": "30",
      "name": "Duke's Domain",
      "description": "Duke's Domain",
      "music": "music_cluster_02",
      "sunlight": "1",
      "economy": "0.5",
      "security": "0.25",
      "x": 1,
      "y": -5,
      "backdrop": "empty_space",
      "connections": [
        {
          "targetClusterId": "26",
          "connectionType": "NE"
        }
      ]
    },

Code: Select all

      <!-- cluster setup 30 -->
      <connection name="x3g_cluster30_connection" ref="clusters">
        <offset>
          <position x="15000000" y="0" z="-77940000" />
        </offset>
        <macro ref="x3g_cluster30_macro" connection="galaxy" />
      </connection>
          <!-- gate connection setup 30 -->
          <connection name="x3g_gate_c30s001z003_c26s001z004" ref="destination" path="../x3g_cluster30_connection/x3g_cluster30_sector001_connection/x3g_zone003_cluster30_sector001_connection/x3g_gate_c30s001z003_c26s001z004_connection">
            <macro connection="destination" path="../../../../../x3g_cluster26_connection/x3g_cluster26_sector001_connection/x3g_zone004_cluster26_sector001_connection/x3g_gate_c26s001z004_c30s001z003_connection" />
          </connection>
Remember I feed an input json to my generator and get output I don't manually sculpt anything. If you can devise an algorithm that makes a nice clean layout I'm all ears :)
celludriel
Posts: 163
Joined: Thu, 12. Sep 13, 11:29
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by celludriel »

Small update

INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json

OUTPUT: https://steamuserimages-a.akamaihd.net/ ... 01F0CA46D/

there are still a few things that need to be done

- place shipyards and wharfs balanced and well for each race
- Ministry has to become part of the teladi empire since they can't own space
- ScalePlate needs to be defended by HatkiVah since they ALSO can't own space ... I won't understand why not but they can't
- Add all the jobs for all the races ... can't someone else do this for me ... pretty please ???????
TR0LL
Posts: 45
Joined: Tue, 6. Jan 04, 04:12
x4

Re: [WIP] [EXPERIMENT] X3 Galaxy

Post by TR0LL »

I like that its a hex grid, the X4 map not adhering to a grid really annoyed me. If you wanted to add space between sectors, could you not just use more empty hexes?

Also for those that are worried about performance, this may not be a good mod for you, there is however a Trade Satellite mod that only gives you trade updates but doesn't display ships / view, that would make the performance not awful for you.

Return to “X4: Foundations - Scripts and Modding”