[WIP] [TC] X3 Galaxy
Moderators: Scripting / Modding Moderators, Moderators for English X Forum
-
- Posts: 35
- Joined: Wed, 10. Jun 09, 09:55
Re: [WIP] [EXPERIMENT] X3 Galaxy
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.
I am interested to see how this works performance wise, with 200 player ships or more, the map view is already getting laggy.
-
- XWiki Moderator
- Posts: 2188
- Joined: Sun, 2. Apr 06, 16:15
Re: [WIP] [EXPERIMENT] X3 Galaxy
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
But for the first steps your progress is really great!
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

But for the first steps your progress is really great!

-
- Posts: 163
- Joined: Thu, 12. Sep 13, 11:29
Re: [WIP] [EXPERIMENT] X3 Galaxy
I calculate the hex grid from a cartasian grid. The output is a galaxy.xml files with the center of the cluster coordinates inLc4Hunter 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![]()
But for the first steps your progress is really great!![]()
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";
}
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>

-
- Posts: 163
- Joined: Thu, 12. Sep 13, 11:29
Re: [WIP] [EXPERIMENT] X3 Galaxy
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 ???????
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 ???????
-
- Posts: 45
- Joined: Tue, 6. Jan 04, 04:12
Re: [WIP] [EXPERIMENT] X3 Galaxy
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.
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.
-
- Posts: 783
- Joined: Wed, 5. Dec 18, 06:17
Re: [WIP] [EXPERIMENT] X3 Galaxy
Looks damn great! With a working economy and wars and the ability to completely destroy stations, that would be a great playground!
-
- Posts: 163
- Joined: Thu, 12. Sep 13, 11:29
Re: [WIP] [EXPERIMENT] X3 Galaxy
Sooo another update
INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json
OUTPUT: https://steamuserimages-a.akamaihd.net/ ... 9D31A3D38/
the xenon have invaded, the xenon are here.
So I finished all the jobs, but left out the khaak, they had no place in the current setup and believe me look at the amount of lines in that json. You'll have plenty of stuff to shoot !
INPUT: https://github.com/Celludriel/X4_Univer ... alaxy.json
OUTPUT: https://steamuserimages-a.akamaihd.net/ ... 9D31A3D38/
the xenon have invaded, the xenon are here.
So I finished all the jobs, but left out the khaak, they had no place in the current setup and believe me look at the amount of lines in that json. You'll have plenty of stuff to shoot !
-
- Posts: 476
- Joined: Tue, 4. Dec 18, 02:14
Re: [WIP] [EXPERIMENT] X3 Galaxy
Very cool.
I just might make an electron app that reads/writes this json format, once you get it all sorted out
I just might make an electron app that reads/writes this json format, once you get it all sorted out

-
- Posts: 163
- Joined: Thu, 12. Sep 13, 11:29
Re: [WIP] [EXPERIMENT] X3 Galaxy
try electron + react and rxdb ... very fun combination to get right ... webpack HELL !SpaceCadet11864 wrote: ↑Fri, 14. Dec 18, 23:50 Very cool.
I just might make an electron app that reads/writes this json format, once you get it all sorted out![]()
-
- Posts: 448
- Joined: Thu, 15. May 14, 14:25
Re: [WIP] [EXPERIMENT] X3 Galaxy
Will you be adding any highways or acelerators?
-
- Posts: 163
- Joined: Thu, 12. Sep 13, 11:29
-
- Posts: 106
- Joined: Sat, 11. Aug 07, 01:00
Re: [WIP] [EXPERIMENT] X3 Galaxy
Perfect!!!!celludriel wrote: ↑Sat, 15. Dec 18, 00:38all gates are accelerators, highways will not be in, to frigging complicated with splices and splines and stuff .... So just gate travel (accelerator travel)
X2-Illuminatus wrote: ↑Fri, 14. Dec 18, 23:34 Wer enttäuscht vom Spiel ist, darf das hier äußern und muss sich nicht anhören (respektive lesen), welche Fehler oder Unzulänglichkeiten man aushalten soll. Solche Kommentare also bitte hier sein lassen.
-
- Posts: 476
- Joined: Tue, 4. Dec 18, 02:14
Re: [WIP] [EXPERIMENT] X3 Galaxy
celludriel wrote: ↑Fri, 14. Dec 18, 23:53try electron + react and rxdb ... very fun combination to get right ... webpack HELL !SpaceCadet11864 wrote: ↑Fri, 14. Dec 18, 23:50 Very cool.
I just might make an electron app that reads/writes this json format, once you get it all sorted out![]()
LOL I was just going to use typescript and stenciljs, no need to use webpack there XD
-
- Posts: 45
- Joined: Tue, 6. Jan 04, 04:12
Re: [WIP] [EXPERIMENT] X3 Galaxy
-
- XWiki Moderator
- Posts: 2188
- Joined: Sun, 2. Apr 06, 16:15
Re: [WIP] [EXPERIMENT] X3 Galaxy
Sorry, this is not my topic... i can basicaly understand what you´re doing but thats allcelludriel wrote: ↑Fri, 14. Dec 18, 11:26 ...
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![]()

And it´s not "easy" possible to add a little bit more space between the hexes during the calculation or something like that?
-
- Posts: 3206
- Joined: Thu, 16. Jul 09, 12:24
Re: [WIP] [EXPERIMENT] X3 Galaxy
Yup, a lot of people were decrying that this game's sectors are small. They are absoultely not, though it does beg the question is there a sector size limit? I mean at some point sectors have to have a max size right? wouldn't that just cause save size bloat? we all know that save file size already causes a longer time when saving the game.
-
- Posts: 45
- Joined: Tue, 6. Jan 04, 04:12
Re: [WIP] [EXPERIMENT] X3 Galaxy
Not at all, the physical size of a sector means nothing, each object has an X,Y,Z coordinate and that's all that matters, if each of those numbers its a double, it means that every object in space has 24 bytes assigned to it to track its location. however I would also be willing to bet that they are only using a float, and have a moving 0,0,0 origin, in this case each object only takes 12 bytes to track its location. and, this is runtime allocation in memory, in a save file its just 3 strings of coordinates that are at most 17 characters long.Requiemfang wrote: ↑Sat, 15. Dec 18, 06:50 Yup, a lot of people were decrying that this game's sectors are small. They are absoultely not, though it does beg the question is there a sector size limit? I mean at some point sectors have to have a max size right? wouldn't that just cause save size bloat? we all know that save file size already causes a longer time when saving the game.
-
- Posts: 163
- Joined: Thu, 12. Sep 13, 11:29
Re: [WIP] [EXPERIMENT] X3 Galaxy
Actually adding some space won't be that hard, but it looks really annoying then, I'll post a screenshot with it later oneLc4Hunter wrote: ↑Sat, 15. Dec 18, 06:46Sorry, this is not my topic... i can basicaly understand what you´re doing but thats allcelludriel wrote: ↑Fri, 14. Dec 18, 11:26 ...
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![]()
![]()
And it´s not "easy" possible to add a little bit more space between the hexes during the calculation or something like that?
We are hitting a rather big snag in the experiment though. We got none to blame then egosoft though. They hardcoded sectors in one of the most important files !!!!!
There is this file FactionLogic.xml, basically this runs the entire war control. Deciding if a faction wants to expand, go to war etc... However to decide the HQ of the factions, they deemed it neccesairy to hardcode it into the file
Code: Select all
<!-- Find preferred Faction HQ at gamestart -->
<cue name="FindFactionHeadquarters">
<actions>
<!-- Preferred Faction HQ depends on the faction -->
<!-- Argon Federation -->
<do_if value="$Faction" exact="faction.argon">
<debug_text text="'Finding Faction HQ for Argon Federation'" chance="$DebugChance" />
<find_cluster name="$ArgonPrime" macro="macro.cluster_14_macro" />
<find_station name="$Shipyard" space="$ArgonPrime" owner="faction.argon" shipyard="true" />
<do_if value="not $Shipyard">
<debug_text text="'No shipyard owned by Argon Federation found in Argon Prime'" chance="$DebugChance" />
</do_if>
<do_else>
<debug_text text="'$Shipyard set to ' + $Shipyard.knownname + ' ({' + $Shipyard + '}) in ' + $Shipyard.sector.knownname + ', ' + $Shipyard.cluster.knownname" chance="$DebugChance" />
<set_value name="md.$FactionData.{$Faction}.$Headquarters" exact="$Shipyard" />
<set_faction_headquarters faction="$Faction" station="md.$FactionData.{$Faction}.$Headquarters"/>
</do_else>
</do_if>
This is just a little extract, it goes on, there are 19 locations where they hardcoded a cluster name. If we want a living galaxy, we need to find a way to patch those out or we will have ships flying around trading and stuff but not going to war.
-
- Posts: 476
- Joined: Tue, 4. Dec 18, 02:14
Re: [WIP] [EXPERIMENT] X3 Galaxy
Can you use xmlpatch remove?
-
- Posts: 163
- Joined: Thu, 12. Sep 13, 11:29
Re: [WIP] [EXPERIMENT] X3 Galaxy
thats what I'm planning on @UniTrader on discord is helping me a bit with the xpath stuff , mine is really rusty. This should do the trick
Code: Select all
<replace sel="//cue[@name='FindFactionHeadquarters']/actions/do_if[@exact='faction.argon']/find_cluster/@macro">macro.x3g_cluster01_macro</replace>