Nuke.Lib - Create asteroid field - 2005-12-23 - Updated (v2)
Moderators: Moderators for English X Forum, Scripting / Modding Moderators
- nuclear_eclipse
- Posts: 1129
- Joined: Thu, 2. Sep 04, 01:54
Nuke.Lib - Create asteroid field - 2005-12-23 - Updated (v2)
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.
** DISCLAIMER **
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:
http://x.leetcode.net/x3/lib/nuke.lib.c ... 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.
Cheers.
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.
** DISCLAIMER **
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:
http://x.leetcode.net/x3/lib/nuke.lib.c ... 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.
Cheers.
Last edited by nuclear_eclipse on Sat, 24. Dec 05, 00:29, edited 1 time in total.
- nuclear_eclipse
- Posts: 1129
- Joined: Thu, 2. Sep 04, 01:54
Now we just need to make them rotate and move around. Then flying through an asteroid field would actually be risky.
Bubba Fat is where it's at!
http://yoyodyne.bravehost.com/
Shortcut to Mods--> http://x2source.com/forums/index.php?showtopic=3380
http://yoyodyne.bravehost.com/
Shortcut to Mods--> http://x2source.com/forums/index.php?showtopic=3380
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".Under God wrote:The site Download is down, do you have another place to pick this up?
Make sure you read how the RADIUS is calculated.....can get more than you bargained for if you dont!!
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:
http://forum3.egosoft.com/viewtopic.php?t=169638
check back on this thread in a bit:
http://forum3.egosoft.com/viewtopic.php?t=169638
Life is like a roll of toilet paper, the closer you get to the end, the more it seems to slip through your fingers...
-
- Posts: 290
- Joined: Thu, 30. Aug 07, 14:09
First off, sorry if I'm bringing this topic back from the dead.
Would it be possible for you (I'm speaking to the creator of the script) to make this script for X2 as well?
I still play X2 and I'm working on a custom map and it would greatly help me create Ore Belt and other systems that I want to have tons of asteroids in to have a script like this. Otherwise it would take me hours to create and place 50-100 asteroids in a sector!
Thanks,
S
Would it be possible for you (I'm speaking to the creator of the script) to make this script for X2 as well?
I still play X2 and I'm working on a custom map and it would greatly help me create Ore Belt and other systems that I want to have tons of asteroids in to have a script like this. Otherwise it would take me hours to create and place 50-100 asteroids in a sector!
Thanks,
S
As they say, you wouldn’t want to boronificate your potassigastrous plutonimeter before it magnesorites.
-
- Posts: 230
- Joined: Tue, 18. Sep 07, 06:57