[TOOL] X4 Galaxy Creator

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

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

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

Re: [TOOL] X4 Galaxy Creator

Post by celludriel » Fri, 11. Jan 19, 17:06

Hornet108 wrote:
Thu, 10. Jan 19, 21:44
Problem seemed to be the ID's, changing them for number strings seems to have fixed it. Probably better to just use numbers anyway, much more straight forward and reduces complexity
This has been fixed in the latest release

Cappy1401
Posts: 313
Joined: Sun, 27. Apr 08, 02:16
x4

Re: [TOOL] X4 Galaxy Creator

Post by Cappy1401 » Thu, 17. Jan 19, 20:27

It is not possible to export a map as soon as a station has been set in the map.

When comparing the JSON files from two maps, huge differences are also visible.

Have both maps as an archive.

In the folder functional is the file of the map which can be exported with stations.
In the second folder is the file, which I have created, this can only be exported without any station.
If only one station is set in my map, the export is no longer possible.

Please take a look at it, because the great thing about it is really awesome.

Map-Archive


Sorry for Bad Englisch, its Googletrans :doh:

Greeting Cappy1401
Jedes Kriegsschiff, das unsere Werften verlässt, jedes abgefeuerte Geschütz bedeutet letztlich einen Diebstahl an denen, die sich nicht wehren können, nämlich an unseren Kindern. Eine Welt bewaffnet bis an die Zähne feuert nicht nur gebündelte Energie allein. Sie feuert auch oft genug die Hoffnung ihrer Kinder nutzlos in den Weltraum hinaus. Doch hin und wieder lässt man uns keine Wahl, dann jedoch besteht jede Salve aus der geballten Hoffnung das endlich wieder Frieden herrscht.

Der Amazone

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

Re: [TOOL] X4 Galaxy Creator

Post by celludriel » Thu, 17. Jan 19, 21:00

Thanks I found a bug in the json output, the new private fields should never have gone into the json.

I'll put in a fix and see if badger has time to release a new version

Seems someone beat me to it :)

https://github.com/killeroguk/X4GalaxyCreator/pull/26

I've asked badger to merge the fixes and bring out a release

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Re: [TOOL] X4 Galaxy Creator

Post by killerog » Thu, 17. Jan 19, 21:58

Merged the fixes, so thanks to whoever did that. Ill release a new version tomorrow night or at the weekend with these fixes included.
Image

Cappy1401
Posts: 313
Joined: Sun, 27. Apr 08, 02:16
x4

Re: [TOOL] X4 Galaxy Creator

Post by Cappy1401 » Fri, 18. Jan 19, 08:57

Thank you for your prompt reply.

I also noticed something.

Some of the Factions have the same color for me, including: Ministry, Player, Ownerless and None.

The color is a kind of pink, which makes it impossible to determine which faction it is.

Here are four screenshots.

In the upper left corner are the four sectors where it will show.

On the right is visible, which factions are set.

I use Win 10-64Bit

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Greeting Cappy1401
Last edited by Cappy1401 on Mon, 28. Jan 19, 20:39, edited 1 time in total.
Jedes Kriegsschiff, das unsere Werften verlässt, jedes abgefeuerte Geschütz bedeutet letztlich einen Diebstahl an denen, die sich nicht wehren können, nämlich an unseren Kindern. Eine Welt bewaffnet bis an die Zähne feuert nicht nur gebündelte Energie allein. Sie feuert auch oft genug die Hoffnung ihrer Kinder nutzlos in den Weltraum hinaus. Doch hin und wieder lässt man uns keine Wahl, dann jedoch besteht jede Salve aus der geballten Hoffnung das endlich wieder Frieden herrscht.

Der Amazone

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

Re: [TOOL] X4 Galaxy Creator

Post by celludriel » Fri, 18. Jan 19, 17:08

Cappy1401 wrote:
Fri, 18. Jan 19, 08:57
Some of the Factions have the same color for me, including: Ministry, Player, Ownerless and None.
These factions cannot claim space for themselfes. So they are treated as empty sectors. The pink color is the unowned color. This is normal behavior
Cappy1401 wrote:
Fri, 18. Jan 19, 08:57
!!! EDIT !!!

I just noticed the following.

With version 1.0.2 please do not create maps, this is not functional, Map is destroyed
It comes in the attempt to display the map to the CTD.
I'm not sure what you mean, since 1.0.2 you have to select the map editor from the editors menu option explicitly. This has to do with having to initialize some parameters. It's more a hack not to have to do all to complicated stuff. I just tested it myself and as far as I know no map is being destroyed. It does seem description is required in my java generator and the editor allows to have an empty description that is something I either have to make mandatory in the editor or fix in the generator.

Cappy1401
Posts: 313
Joined: Sun, 27. Apr 08, 02:16
x4

Re: [TOOL] X4 Galaxy Creator

Post by Cappy1401 » Sat, 19. Jan 19, 10:43

Here is the map that I created with V1.0.2.
The map can be loaded via the menu after starting the program.
If I choose the Mapeditor in the menu, it comes to the CTD.

Map


Edit

Saving with V1.0.0 does not help, there is still a CTD
Last edited by Cappy1401 on Sat, 19. Jan 19, 11:17, edited 1 time in total.
Jedes Kriegsschiff, das unsere Werften verlässt, jedes abgefeuerte Geschütz bedeutet letztlich einen Diebstahl an denen, die sich nicht wehren können, nämlich an unseren Kindern. Eine Welt bewaffnet bis an die Zähne feuert nicht nur gebündelte Energie allein. Sie feuert auch oft genug die Hoffnung ihrer Kinder nutzlos in den Weltraum hinaus. Doch hin und wieder lässt man uns keine Wahl, dann jedoch besteht jede Salve aus der geballten Hoffnung das endlich wieder Frieden herrscht.

Der Amazone

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

Re: [TOOL] X4 Galaxy Creator

Post by celludriel » Sat, 19. Jan 19, 11:11

Cappy1401 wrote:
Sat, 19. Jan 19, 10:43
Here is the map that I created with V1.0.2.
The map can be loaded via the menu after starting the program.
If I choose the Mapeditor in the menu, it comes to the CTD.

Map
You seem to have connections without a targetClusterId

Code: Select all

   {
      "id": "270",
      "name": "{7,127000}",
      "description": "xenon hub",
      "music": "music_cluster_02",
      "sunlight": "1",
      "economy": "0.75",
      "security": "0.75",
      "x": 3,
      "y": -1,
      "backdrop": "cluster_01",
      "connections": [
        {
          "connectionType": "N"
        }
      ],
      "belts": [],
      "stations": [
        {
          "type": "DEFENCE",
          "race": "ARGON",
          "owner": "PLAYER",
          "faction": "PLAYER"
        }
      ],
      "spaceObjects": []
    },
I'll make a bug ticket so the application doesn't crash but gives a warning of some sort

Cappy1401
Posts: 313
Joined: Sun, 27. Apr 08, 02:16
x4

Re: [TOOL] X4 Galaxy Creator

Post by Cappy1401 » Sat, 19. Jan 19, 11:26

FULLEDIT

Have found a second goal without a goal and deleted.
You can find the gate if you are looking for {7,135000}
The map can now be displayed again in the map editor.
Export but not possible.

Cappy1401


EDIT OF EDIT

I just remembered.
The removal for gates has no effect, a set gate can not be removed.
Jedes Kriegsschiff, das unsere Werften verlässt, jedes abgefeuerte Geschütz bedeutet letztlich einen Diebstahl an denen, die sich nicht wehren können, nämlich an unseren Kindern. Eine Welt bewaffnet bis an die Zähne feuert nicht nur gebündelte Energie allein. Sie feuert auch oft genug die Hoffnung ihrer Kinder nutzlos in den Weltraum hinaus. Doch hin und wieder lässt man uns keine Wahl, dann jedoch besteht jede Salve aus der geballten Hoffnung das endlich wieder Frieden herrscht.

Der Amazone

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Re: [TOOL] X4 Galaxy Creator

Post by killerog » Sat, 19. Jan 19, 12:54

Version 1.0.3 released with bug fixes from ianb1987.
Image

Cappy1401
Posts: 313
Joined: Sun, 27. Apr 08, 02:16
x4

Re: [TOOL] X4 Galaxy Creator

Post by Cappy1401 » Mon, 28. Jan 19, 21:00

Found problems in the Galaxy Creator.


The removal Button for Gates has no effect, a placed Gate can not be removed.

The randomly chosen Clusters for the Datafaults in PlacedObjects.xml do not always correspond with Clusters to existing in the Galaxy.
There are double occupancy of Clusters.

The Generator not comply with existing conventions.


example

The generator generates macro of a zone

<macro name = "x3g_zone002_cluster01_sector001_macro" class = "zone">
_______________________________^ Underscore missing, change the case of zone to Zone and cluster to Cluster and add the underscore to Cluster = Cluster_

Original Macro of a Zone from X4 Stand V1.50

<macro name = "Zone003_Cluster_01_Sector001_macro" class = "zone">

The prefix may be Optional, as it is not mandatory.
The Generator should comply with existing conventions.
So the Mod remains compatible with Egosoft and other Mods.

Manual work is still needed to start the Game with the exported Galaxy.

Missing spaces between the Tags in Arrys in the Jobs.xml which causes problems when starting the Jobships.

Instead of:

[factionlogic, freighter, trader]

the Generator writes:

[Factionlogic,freighter,trader] <-- causes problems on Start

Job Editor lacks all existing jobs from Antigon, Scaleplate, Hatikvah and Ministry.




Here is an archive in which I have saved several export tests.
Information about the export errors are stored in the XML file.

Archive




To the map editor:

Even if there are factions that are not claimable. So you should still have your own colors.
Because this way, you know where you have placed these factions and you will not have to search for them later.

Also an info page would be a very good idea that you can call in the Menu and displays all information about the Galaxy.

In individual Tabs kann be displayed, for example.

Which Factions are present in the Galaxy.
Is the Ffaction claimable or not?
In which Sector is the HQ
Where are Shipyards, Equipmentdocks and Tradingstations.
Likewise a page indicating where ships or other has been placed in Sectors.

So you can easily make changes after some time, because you can see where you have placed something.

Greeting Cappy1401

sorry google translate is :doh: :doh: :doh:
Jedes Kriegsschiff, das unsere Werften verlässt, jedes abgefeuerte Geschütz bedeutet letztlich einen Diebstahl an denen, die sich nicht wehren können, nämlich an unseren Kindern. Eine Welt bewaffnet bis an die Zähne feuert nicht nur gebündelte Energie allein. Sie feuert auch oft genug die Hoffnung ihrer Kinder nutzlos in den Weltraum hinaus. Doch hin und wieder lässt man uns keine Wahl, dann jedoch besteht jede Salve aus der geballten Hoffnung das endlich wieder Frieden herrscht.

Der Amazone

killerog
Posts: 3464
Joined: Fri, 28. Oct 05, 16:31
x4

Re: [TOOL] X4 Galaxy Creator

Post by killerog » Mon, 28. Jan 19, 21:06

Quick reply before I head out.

I have already fixed it in the next version so you can remove gates.

The colour of the sector is related to who owns that sector - as some factions can not own sectors they do not get there own colour. I would like to add more info to a sector hex (or its popup) that will make it easier at a glance to see what is in each sector.

A sort of sector overview sounds like it could be a good idea. Ill think about that.

The stuff todo with the generation I will leave to celludriel to answer as I think that's to do with his tool (tho I could be wrong in a rush).
Image

Cappy1401
Posts: 313
Joined: Sun, 27. Apr 08, 02:16
x4

Re: [TOOL] X4 Galaxy Creator

Post by Cappy1401 » Mon, 28. Jan 19, 22:28

what would you say if the non-claimable factions share the color with the claimable factions?
Described differently.

Non-claimable factions have their own color, but do not stand by themselves.

The color occupies only one third of a sector, so it would be visible, that there is also a non Clamaible faction present and it is recognizable which one is.


Cappy1401
Jedes Kriegsschiff, das unsere Werften verlässt, jedes abgefeuerte Geschütz bedeutet letztlich einen Diebstahl an denen, die sich nicht wehren können, nämlich an unseren Kindern. Eine Welt bewaffnet bis an die Zähne feuert nicht nur gebündelte Energie allein. Sie feuert auch oft genug die Hoffnung ihrer Kinder nutzlos in den Weltraum hinaus. Doch hin und wieder lässt man uns keine Wahl, dann jedoch besteht jede Salve aus der geballten Hoffnung das endlich wieder Frieden herrscht.

Der Amazone

Dreamtide
Posts: 18
Joined: Wed, 27. Jun 12, 02:31
x4

Re: [TOOL] X4 Galaxy Creator

Post by Dreamtide » Wed, 30. Jan 19, 22:20

My brain's not in the right place to make proper use of this right now, but just wanted to pop in and give this a huge thumbs-up. The potential for creative and awesome scenarios, even shared among different players, makes this idea a massive win for X4 in general. Well done. Keep it up!

DaMuncha
Posts: 1394
Joined: Mon, 1. Nov 10, 10:00
x4

Re: [TOOL] X4 Galaxy Creator

Post by DaMuncha » Fri, 1. Feb 19, 04:36

Would some one remake the X3 galaxy?
Just... another... bug.

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

Re: [TOOL] X4 Galaxy Creator

Post by celludriel » Mon, 4. Feb 19, 01:50

I needed a little break from X4, after spending what feels like an eternity in md script getting fought by the language every step I took.

I'll have a look at the generator maybe I missed something. However it will have to wait till next weekend. I have a heavy work week ahead of me with plenty of java. Coming home and doing more java would fry my brain.
However here a few observations about your comments.

- The naming of the zones and clusters don't have to be egosofts naming conventions. In fact I chose my own because it was easier to work with.
- The spaces in the arrays don't matter for the arrays. However I do notice Factionlogic has a capital there instead of factionlogic. That could be the culprit.
- The datavaults could pick up the same sector, so two datavaults in one sector is perfectly possible

For now the custom factionlogic code is still not finished, not sure I'll ever be able to finish it. So creating galaxies will always work, having decent gameplay in them less so. The one guy asking to recreate x3 galaxy, I already did. Look for another thread from me where I did that.

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [TOOL] X4 Galaxy Creator

Post by DeadAirRT » Mon, 4. Feb 19, 21:41

Quick question:

Was there any particular reason this is restricted to only acceleration gates? I just managed to mod in a gate from antigone memorial to second contact XI in my game and was wondering if it would cause problems that I used a jump gate.

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

Re: [TOOL] X4 Galaxy Creator

Post by celludriel » Tue, 5. Feb 19, 19:30

DeadAirRT wrote:
Mon, 4. Feb 19, 21:41
Quick question:

Was there any particular reason this is restricted to only acceleration gates? I just managed to mod in a gate from antigone memorial to second contact XI in my game and was wondering if it would cause problems that I used a jump gate.
No there shouldn't be a problem to use different models. I just hardcoded the gate in my original galaxy generator. It could be a feature to choose the gate. I just never put any attention to it. When my mod batteries are recharged and I dive in the generator code again I'll see what I can do about that.

However top priority should still be finishing up the custom faction logic. However I just can't bring myself to do any md script. It drains your soul

DeadAirRT
Posts: 1022
Joined: Fri, 25. Jan 19, 03:26
x4

Re: [TOOL] X4 Galaxy Creator

Post by DeadAirRT » Tue, 5. Feb 19, 22:57

Thanks for the info! I barely mess around with the simple stuff, glad there are people like you who will tackle the hard things! Best of luck and don't burn yourself out.

blade21
Posts: 659
Joined: Sun, 8. Feb 04, 02:37
x4

Re: [TOOL] X4 Galaxy Creator

Post by blade21 » Sun, 22. Sep 19, 09:45

nice! hope for more updates!

Post Reply

Return to “X4: Foundations - Scripts and Modding”