questions about possible new Map/Mod Idea/Concept

The place to discuss scripting and game modifications for X³: Farnham's Legacy

Moderators: Moderators for English X Forum, Scripting / Modding Moderators, Moderators for the X3:FL Forums

Post Reply
dirkf
Posts: 30
Joined: Wed, 7. Jan 04, 00:34
x3tc

questions about possible new Map/Mod Idea/Concept

Post by dirkf » Sun, 3. Oct 21, 15:00

Yesterday I had an idea about a game concept with a partially random map.
However it would be a lot of work to put the required scripts together, and I would like some input from experienced modders if the idea can function before putting in all that work, especially as it would be my first mod project around here.


Basically the map would be structured in clusters of sectors that contain only the gates, asteroids and neutral objects, and on game start a script would assign each cluster a random race/faction and call a faction script that would place the stations, docks and shipyards in those sectors assigned.
The result would be that each new game the player would have no idea where to find which race, and has to explore from zero.


Can that work? The gamestart would probably be really long in setting everything up, and would require some sort of progress messages to prevent the player from assuming a freeze.

But the problems might be that the engine can't handle that setup (especially if the first stations automatically start planning before all other stations are placed), or that few people like random maps in a game like this, or that the NPC economy would crash without preselected station positions or a few other possible problems with that.

Please comment so that I can decide to start with this idea or better scrap it, thanks.

Cycrow
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 22201
Joined: Sun, 14. Nov 04, 23:26
x4

Re: questions about possible new Map/Mod Idea/Concept

Post by Cycrow » Sun, 3. Oct 21, 16:40

it shouldn't be overly difficult to achieve.

The most difficult part is to make sure the economy is somewhat balanced so goods can actually be produced.
also, if you just randomly pick races for each sector, then you could end up with alot of isolated race sectors, especially if they end up surrounded by enemies.

Clustering the races will be a better approach, when you would pick a random race for a sector, then pick a random cluster number, then assign that race to each surrounding sector upto the cluster number.

the loading speed for creating stations/asteroids/etc shouldn't be a problem, as most of them will be created OOS, which doesn't require loading the models initially, which is what takes the time. To improve this you could create a holding sector that the player is initially spawned into, then move the player into the start sector once its all done. This is what the Custom Start scripts do

You will also need to be careful about the jobs engine, this will need to be adjusted to remove any jobs that are for specific sectors. You will also need to make use of the plot flags, assigning all the jobs to a custom plot flag, then enabling this flag when the universe is setup. The reason for this is that otherwise ships will be created (or not) based on the initial sector owners, so delaying that with a plot flag will allow all the sectors to be populated properly.

FL also adds the ability to add proposed stations are run time, these sectors are added to the list of sectors available to GOD, allowing the races to build more stations over time based on the economy. So having a good number of these available too will allow the AI to adapt the economy to work better as needed

dirkf
Posts: 30
Joined: Wed, 7. Jan 04, 00:34
x3tc

Re: questions about possible new Map/Mod Idea/Concept

Post by dirkf » Sun, 3. Oct 21, 18:53

Cycrow wrote:
Sun, 3. Oct 21, 16:40
it shouldn't be overly difficult to achieve.

The most difficult part is to make sure the economy is somewhat balanced so goods can actually be produced.
also, if you just randomly pick races for each sector, then you could end up with alot of isolated race sectors, especially if they end up surrounded by enemies.
Already though of that. The map would be build with clusters of 5x5 sectors, and each race would get its own setup script that is based on a variable coordinate.
The main assignment would give each cluster of 25 sectors a random race assignment, and would ensure that each race gets two adjacent sectors to fill by script.
That way each group of sectors would be internally stable, although it might be worth considering assigning the races in a weighted manner instead of completely random.

The clusters of sectors would also have 2-3 neutral or pirate sectors between them to prevent direct clashes between enemy races.

And since each race would be handled by its own script, the required number of stations of which type can be calculated before time and programmed into that.
Cycrow wrote:
Sun, 3. Oct 21, 16:40
To improve this you could create a holding sector that the player is initially spawned into, then move the player into the start sector once its all done. This is what the Custom Start scripts do
I already planned it that way, especially to keep some options open with a number of unconnected sectors
Cycrow wrote:
Sun, 3. Oct 21, 16:40
You will also need to be careful about the jobs engine, this will need to be adjusted to remove any jobs that are for specific sectors. You will also need to make use of the plot flags, assigning all the jobs to a custom plot flag, then enabling this flag when the universe is setup. The reason for this is that otherwise ships will be created (or not) based on the initial sector owners, so delaying that with a plot flag will allow all the sectors to be populated properly.

FL also adds the ability to add proposed stations are run time, these sectors are added to the list of sectors available to GOD, allowing the races to build more stations over time based on the economy. So having a good number of these available too will allow the AI to adapt the economy to work better as needed
Good advice, haven't looked at the jobs engine at all so far. But that is a task much farther down the line after the rest is at least partially workable.

User avatar
Ketraar
EGOSOFT
EGOSOFT
Posts: 11741
Joined: Fri, 21. May 04, 17:15
x4

Re: questions about possible new Map/Mod Idea/Concept

Post by Ketraar » Fri, 10. Dec 21, 13:07

This has been done to some extent. RSM is based on the idea of randomised universe creation. The complex part is making sure the procedural creation fits within your parameters. IIRC XTM had such a game start where the map would be defined "as you go".

The basis of it is to create a complete map bod with all 480 sectors and connections, so that you can place stuff everywhere without having to check if there is a bod entry. The you can specify some sort of spawn point/sector for each race and then have the script "grow" the expansion of each. Placing structures and activating jobs is very "easy" in X3FL as Cycrow was kind enough to add control to turn jobs on and off via SE/MD, allowing to have as detailed jobs activations as you like (within limits of the available flags, iirc 32). The tricky part is the universe creation, planets, moons etc. Unlike other objects (stations ships etc) planets, moons etc done have collision checks to move them apart to avoid, well colliding and they have varied sizes. So would require you to create groupings to make sure the right ones are placed in right locations. Here look at enenra's XTM code to see how he did it.

In general this has great potential I think (reason I made RSM I guess), but it is very tedious to debug, as with most things randomised stuff tends to happen in ways you dont want and there I think will be the major battle. Happy to answer any questions if there are any, would be interested in seeing something like this.

MFG

Ketraar
Image

Post Reply

Return to “X³: Farnham's Legacy - Scripts and Modding”