Nuke.Lib - Create asteroid field - 2005-12-23 - Updated (v2)

The place to discuss scripting and game modifications for X³: Reunion.

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

Hot or Not

I like pancakes
Total votes: 51

User avatar
Posts: 1128
Joined: Thu, 2. Sep 04, 01:54

Nuke.Lib - Create asteroid field - 2005-12-23 - Updated (v2)

Post by nuclear_eclipse » Sat, 24. Dec 05, 00:48

This is a really wonderful way of creating great-looking asteroid fields for your custom sectors/maps, as well as a way of repopulating a sector after you've gone through it mobile-mining. I have used this script to good effect in my Syndicate galaxy, and offer the chance for you to use it in your own galaxies.

This library script, meant for use with 1.3's big and mini roids, will calculate and place a randomized asteroid field based on eight parameters:

Sector & Position - target sector and coordinate center of field
X Range (km) - Positive range on the X axis in kilometers
Y Range (km) - Positive range on the Y axis in kilometers
Z Range (km) - Positive range on the Z axis in kilometers
Density (1-10) - Density of asteroids in the field
Resources (1O-2S-3N-4All-5OS) - Resource type(s) of the asteroids
Maximum Yield - Maximum yield possible for asteroids
Big Roid Odds (1-10) - Odds of placing a big asteroid

Once run, the script will determine how many 'packs' of asteroids should be placed. These packs always consist of two 'mini-roid' fields, and may or may not contain a big asteroid (the type used for stations). The mini-roids and big roids in each pack will always have the same resource as the others in that same pack, although each pack may have different resources from another pack.

When run, this script creates a very organic looking field of asteroids that looks similar to the fields created by Egosoft for their sectors. Each astorid and miniroid cluster is placed with random rotations as well to make it look more organic and natural. It is very pretty to look at, but the script must be used carefully, or a sector can be quickly overloaded with asteroids, dropping framerates like a rock.

Now for the full description of each input:

Range is calculated in 'radius' form: A range of 25 will allow the placement of asteroids between -25km and 25 km. Any value less than 4km will default to 4km. Once maximum ranges are calculated, the center coordinates are added in to get the effective range. Eg. range of 25km and center at -10km would give a range of -35km to 15km.

Density is a calculated value based on expected input between 1 and 10, although higher or lower values can be used for extreme cases. The density is used to calculate a 'zone' value between 8km and 20km. This 'zone' value is then divided into the ranges to determine how many packs should be placed.

Recomended Density value is between 3 and 8. Go lower, and you may only get a few packs placed; go to 10 or higher, and you will overload the sector, unless you've set your ranges low enough to compensate. For really small ranges (less than 15km or so), you may prefer to set the density around 12 or 14 to get a result similar to the really dense part of Herron's Nebula, for example.

Resource is a simple value translation. Use 1 to generate a field of only Ore, 2 for a field of only Silicon, 3 for a field of only Nividium, 4 for a field of Ore, Silicon, and Nividium, or 5 for a field of only Ore and Silicon. Any value less than 1 or greater than 5 will default to 5, Ore and Silicon only.

Maximum Yield determines the range of yields possible. Big roids will have a yield between 5 and this value, and mini roids will have a yield between 5 and 4/3 this value (so that they are similar in value to the pieces broken from each roid). Any yield less than 5 will default to 5.

Big Roid Odds is a calculated value to determine the odds of placing a big (station-ready) asteroid in each pack of asteroids. A value of 10 or higher will *guarantee* that a big roid is spawned with every pack, while a value less than 1 will produce an asteroid field practically devoid of bi asteroids. I recommend a value between 3 and 6 for best effect.

This file is free to be used and distributed as part of your own scripts, maps and mods, but PLEASE give credit wherever it is due. Please do not take others' hard work for granted. Thank you.

If you download this script, test it out and let mo know what you think, or if you have any suggestions. I would love to know what I could to make this even better.

Download Link: ... dfield.xml

EDIT - 2005-12-23: I have added random rotations and the ability to choose the center coordinates for the asteroid field. I've updated the information below to match. If you downlooded version 1, download version 2 from the same link to get the new features.

Last edited by nuclear_eclipse on Sat, 24. Dec 05, 01:29, edited 1 time in total.

Posts: 2518
Joined: Tue, 28. Dec 04, 03:19

Post by Galaxy613 » Sat, 24. Dec 05, 01:00

Sweet! I already have something to this effect, but it's standard asteroids only, this will help alot in galaxy making! :D
10,000 Lightyears of awesomeness

User avatar
Posts: 1128
Joined: Thu, 2. Sep 04, 01:54

Post by nuclear_eclipse » Sat, 24. Dec 05, 01:30

In a quick update to the first release, I have added the ability select the center of the asteroid field, as well as added the usage of random rotations when creating objects, to make things look that much more random...

Grab the new version (2) to get these new changes.

User avatar
Bubba Fat
Posts: 211
Joined: Sat, 8. May 04, 22:29

Post by Bubba Fat » Mon, 26. Dec 05, 23:07

Now we just need to make them rotate and move around. Then flying through an asteroid field would actually be risky.

Under God
Posts: 183
Joined: Tue, 27. Dec 05, 06:19

Post by Under God » Fri, 30. Dec 05, 01:36

The site Download is down, do you have another place to pick this up?
This was left intentionally blank for formating purposes.

User avatar
Posts: 166
Joined: Tue, 20. Jul 04, 16:43

Post by NumNuts » Fri, 30. Dec 05, 08:48

Under God wrote:The site Download is down, do you have another place to pick this up?
hmm, just worked for me. It's the actual .xml file so clicking on the link wont help. ie. right click on the link and select "save as".

Make sure you read how the RADIUS is calculated.....can get more than you bargained for if you dont!! :o

Posts: 9
Joined: Sat, 9. Dec 06, 21:02

Post by Hellsniper1 » Tue, 19. Dec 06, 21:54

Link don't work pleas reupload...

Posts: 24
Joined: Wed, 13. Sep 06, 23:05

Post by Revan2200 » Fri, 26. Jan 07, 02:51

it's not working and i would rreally like this please fix it

Posts: 24
Joined: Wed, 13. Sep 06, 23:05

Post by Revan2200 » Mon, 29. Jan 07, 03:19

hey dude can you please fix it I can't download it

Posts: 154
Joined: Tue, 2. May 06, 19:29

Post by exelsiar » Mon, 29. Jan 07, 13:06

the link seems to work, but as soon as my lappy's dl'd it, it disapears without trace :S
anychance some one could put this in a zip, i'd love to finaly have some asteroids in Averice :D

Posts: 70
Joined: Mon, 22. Mar 04, 18:59

Post by Temmujin » Mon, 29. Jan 07, 18:38

yup, link appears to be broken. fud is working on reposting his version of an asteroid creator. I too am looking for some to place in Averice.

check back on this thread in a bit:
Life is like a roll of toilet paper, the closer you get to the end, the more it seems to slip through your fingers...

User avatar
Posts: 5
Joined: Fri, 2. Feb 07, 07:09

Post by Pelu » Mon, 12. Feb 07, 14:57

Hello there

I'm on the first steps to create a custom galaxy, and I think this script could become very useful to me (for now I've created a few asteroid fields manually and it's a quite tedious work).

Any chance to fix the link, please? Thanks!

Posts: 154
Joined: Tue, 2. May 06, 19:29

Post by exelsiar » Thu, 8. Mar 07, 16:13

I too would find this a most legendarily usefull script, just a shame the link is dead.

edit: maybe someone who already has it could temporarily host it somewhere?
Last edited by exelsiar on Fri, 9. Mar 07, 15:00, edited 1 time in total.

Posts: 18
Joined: Tue, 28. Nov 06, 03:59

Post by ohnoes1234 » Thu, 8. Mar 07, 21:49

yea link is definatley broken

Posts: 28
Joined: Sun, 9. Jul 06, 02:25

Post by Genoce » Sun, 29. Apr 07, 02:12

Would anyone be kind enough to repost the link?

This would be very very useful to me. Im attempting to make a universe where mobile mining using TL with a fleet of TS's is profitable :D

Obviously hard with the...well...lacking current universe

Thankyou in advance

Post Reply

Return to “X³: Reunion - Scripts and Modding”