System Demux
Moderators: winston, another_commander
- Dr Beeb
- Dangerous
- Posts: 127
- Joined: Sun Mar 23, 2008 10:28 pm
- Location: Mt. Vista, Oosa, Biarge System, Galaxy 1
System Demux
Want to try out some other planet textures for a while?
http://wiki.alioth.net/index.php/System ... 8Oolite%29
Note - probably not compatible with some other similar OXPs, let me know.
http://wiki.alioth.net/index.php/System ... 8Oolite%29
Note - probably not compatible with some other similar OXPs, let me know.
White dots were so much easier to hit
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: System Demux
I assume it will have problems with famous planets also.Dr Beeb wrote:Note - probably not compatible with some other similar OXPs, let me know.
And I see that you have been working on this one for some time and mainly made it with Oolite 1.73. At the end you use a "setTexture()" that is deprecated with 1.74. Should be "texture=" now. Or alternatively, when you want to keep using it with 1.73 you can also replace it with:
Code: Select all
if (0 < oolite.compareVersion("1.74"))
system.mainPlanet.setTexture('home_planet' + hp_idx + '.png')
else system.mainPlanet.texture = 'home_planet' + hp_idx + '.png';
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Noticed a few things:
1) You are defining this.system_info during startUp. That's okay, but you could do it as well outside any function, like in the original SR. I am not sure which is more efficient. Eric?
2) I don't understand the leading "0" in the array for Galaxy 1.
3) The way you exclude the famous planets has two problems. First, you make it depending on a mission variable, but this is an unreliable approach. Does Famous Planets.oxp even create a mission variable? I don't think so. And even if it does, the mission variable would continue to exist even after the player has removed Famous Planets.oxp from his AddOns-folder. Therefore a mission variable isn't a proper way to test for the existence of another OXP. You should test for the installment of the OXP script instead. Only that will give you the information you need. So, instead of
you need
or whatever the current name of the famous planets script is, as I probably have an outdated version.
Second, famous planets currently only influences Galaxies 1 and 2 (I think), and it concerns different planets in these galaxies. Your exclusion script, however, will exclude the same planets in all galaxies. And that you don't want.
1) You are defining this.system_info during startUp. That's okay, but you could do it as well outside any function, like in the original SR. I am not sure which is more efficient. Eric?
2) I don't understand the leading "0" in the array for Galaxy 1.
3) The way you exclude the famous planets has two problems. First, you make it depending on a mission variable, but this is an unreliable approach. Does Famous Planets.oxp even create a mission variable? I don't think so. And even if it does, the mission variable would continue to exist even after the player has removed Famous Planets.oxp from his AddOns-folder. Therefore a mission variable isn't a proper way to test for the existence of another OXP. You should test for the installment of the OXP script instead. Only that will give you the information you need. So, instead of
Code: Select all
if (missionVariables.famous_planets) {
Code: Select all
if (worldScripts['Famous Planets Launch Script']) {
Second, famous planets currently only influences Galaxies 1 and 2 (I think), and it concerns different planets in these galaxies. Your exclusion script, however, will exclude the same planets in all galaxies. And that you don't want.
- Cmd. Cheyd
- ---- E L I T E ----
- Posts: 934
- Joined: Tue Dec 16, 2008 2:52 pm
- Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...
Nicely Done, Dr. Beeb. I see a lot of Perlin noise. Did you use a generator or gradient overlays w/ thresholds? Just curious as to another artist's technique. Also, if you would like, I can probably provide some code to manage compatibility with FP, SR1, DH-SR2, etc...
DGill-
There's no delay because the textures are hard-coded via the planetinfo.plist. It's a faster approach, but it means (for example) MoonA1 will always appear in the exact same position and with the same texture in every system that it is spawned. DH-SR2 separates the moon's .plist entry (which stores location) and it's texture (chosen by the jscript). It's slower, but offers more dynamic results.
DGill-
There's no delay because the textures are hard-coded via the planetinfo.plist. It's a faster approach, but it means (for example) MoonA1 will always appear in the exact same position and with the same texture in every system that it is spawned. DH-SR2 separates the moon's .plist entry (which stores location) and it's texture (chosen by the jscript). It's slower, but offers more dynamic results.
Find my OXP's at:
Deep Horizon Industries - Your Planet Our Design
Deep Horizon Industries - Your Planet Our Design
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
It is almost the same script as the original SR script of SR1.2. Probably you compared with that of 1.0Commander McLane wrote:Noticed a few things:
1) You are defining this.system_info during startUp. That's okay, but you could do it as well outside any function, like in the original SR. I am not sure which is more efficient. Eric?
Me neither. The zero is added because he always adds 1 to the system ID and than the first entry is skipped. Mometimes it makes code more readable bus as the galaxy ID stays zero based I see no benefits.2) I don't understand the leading "0" in the array for Galaxy 1.
Yes that check is wrong as I mentioned elsewhere. It only checks if the player once had famous planets installed, not if it is still installed.3) The way you exclude the famous planets has two problems. First, you make it depending on a mission variable, but this is an unreliable approach. Does Famous Planets.oxp even create a mission variable? I don't think so. And even if it does, the mission variable would continue to exist even after the player has removed Famous Planets.oxp from his AddOns-folder. Therefore a mission variable isn't a proper way to test for the existence of another OXP. You should test for the installment of the OXP script instead. Only that will give you the information you need. So, instead ofyou needCode: Select all
if (missionVariables.famous_planets) {
or whatever the current name of the famous planets script is, as I probably have an outdated version.Code: Select all
if (worldScripts['Famous Planets Launch Script']) {
Second, famous planets currently only influences Galaxies 1 and 2 (I think), and it concerns different planets in these galaxies. Your exclusion script, however, will exclude the same planets in all galaxies. And that you don't want.
And as you say, your proposal only works for FP 1.0. FP 2.0 contains much more planets to exclude. But the script name has changed so you now can use both checks:
Code: Select all
var excl = new Array();
if (worldScripts['Famous Planets Launch Script']) {
excl.push(8, 130, 40, 125, 247, 101, 56, 155, 149, 142);
}
if (worldScripts['Famous Planets 2 Launch Script']) {
excl.push(7, 129, 39, 124, 246, 99, 55, 154, 147, 141, 73, 50, 89, 35, 227, 250, 188, 111, 186, 101, 222, 29, 23, 177, 93, 131, 42, 21, 100, 28, 16, 221, 36, 198, 150, 62, 172, 241, 200, 18, 86, 126, 3, 153, 132, 90, 44, 228, 13,
458,370,298,365,383,463,392,262,280,304,309,334,460,449,477,492,322,314,344,396,445,321,400,434,301,369,371,313,350,285,289,330,378,310,279,444,338,
570,677,618,710,676,
781,815,898,786,890,
1040,1217,1255,1116,1033,
1431,1286,1365,1426,1520,
1725,1682,1666,1654,1573,
1969,1823,2003,1949,1812);
}
for (var i = 0; i < excl.length; i++) this.system_info[excl[i]] = 0;
But it would probably better to not hard code the array in the script but get the list from "worldScripts['Famous Planets 2 Launch Script'].planetList[galaxy][system.ID]" directly. That way you stay correct if FP would be updated.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Yes, I only have v1.0.Eric Walch wrote:It is almost the same script as the original SR script of SR1.2. Probably you compared with that of 1.0Commander McLane wrote:Noticed a few things:
1) You are defining this.system_info during startUp. That's okay, but you could do it as well outside any function, like in the original SR. I am not sure which is more efficient. Eric?
And do you have an opinion on which way is better?
- Dr Beeb
- Dangerous
- Posts: 127
- Joined: Sun Mar 23, 2008 10:28 pm
- Location: Mt. Vista, Oosa, Biarge System, Galaxy 1
thanks all for the comments. Hmm, some homework assignments.
As for the '0' business, the original SR1.2 that I used had zeros at the beginning of each galaxy bank of random numbers, so I deleted them all after Galaxy 1 as things went out of sync in the later galaxies with the 257 entries present. I will check if Demux as it stands is correct.
As for the '0' business, the original SR1.2 that I used had zeros at the beginning of each galaxy bank of random numbers, so I deleted them all after Galaxy 1 as things went out of sync in the later galaxies with the 257 entries present. I will check if Demux as it stands is correct.
White dots were so much easier to hit
- Dr Beeb
- Dangerous
- Posts: 127
- Joined: Sun Mar 23, 2008 10:28 pm
- Location: Mt. Vista, Oosa, Biarge System, Galaxy 1
Thanks, any compatibility code much appreciated if not covered by others. Its not clear to me how to make compatible with SR1 DH-SR2 as they all spawn planets&moons in all systems, so things would just overfill? I have no problems with some of my textures going into others.Cmd. Cheyd wrote:Nicely Done, Dr. Beeb. I see a lot of Perlin noise. Did you use a generator or gradient overlays w/ thresholds? Just curious as to another artist's technique. Also, if you would like, I can probably provide some code to manage compatibility with FP, SR1, DH-SR2, etc...
You are correct that there is a lot of simplex Perlin noise going on, I wrote my own generator, which does things similar as you describe along with other basis functions, higher/lower powers to 'canyonize' or 'glaciate'. There is a major problem with most simplex Perlin noise at high frequency involving not being 'flat-fielded', maybe I should do a wiki page on what I did to give some ideas for what to do in the future.
I had never seen the inbuilt Oolite detailed planets until 1.74 came out for Macs - at which point I also discovered there was a DH-SR2 and realized that my little effort was approaching the point of never making it 'out of the door'. Getting my generator into Oolite looks like a major project/very slow and easier to keep generating pngs for a while. I noticed during this project that life (download time) would be much easier if indexed pngs were used that simply contained a height-map and a palette of colours, in my case 256 indexed simply to height. If the palette itself could be modified once the png was loaded that would generate a lot of different planets, with different sized-oceans etc, without huge texture folders. Of course this could free up space for other texture files, eg ones that gave the polar regions, or break up the mountains into different colour blocks etc.
White dots were so much easier to hit
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
That '0' at the start of each galaxy made that with SR there was one system in every galaxy that was not textured. The way it was coded, it made only the first system '1' based, the remainder stayed '0' based. It would involve a lot of more calculations to let it work. But because the main reason was to make it more readable this would be counter productive.Dr Beeb wrote:As for the '0' business, the original SR1.2 that I used had zeros at the beginning of each galaxy bank of random numbers, so I deleted them all after Galaxy 1 as things went out of sync in the later galaxies with the 257 entries present. I will check if Demux as it stands is correct.
Your code fixed a bug in SR. But than you could as well remove the first '0' and replace all occurrences of "system.ID + 1" with just "system.ID".
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
On testing my previous fix against FP I notice it does not work. Looking better, I see that all the planet ID's must be added by 1 in my list. Because the same starting '0'. So better remove that first zero also, so it enables you to work with the real system ID's. On comparing my list with that of FP 1.0 I see that 2 systems differ 2 numbers instead of 1. This must mean that already SR1.2 excluded two wrong planets in combination with FamousPlanets in galaxy 1.Eric Walch wrote:Your code fixed a bug in SR. But than you could as well remove the first '0' and replace all occurrences of "system.ID + 1" with just "system.ID".
I think both are equal. But when defining it at the main level, it is immediately accessible by other scripts when they run this.startUp. When defining in startUp itself, the other oxp can only access it is its startUp runs later.McLane wrote:1) You are defining this.system_info during startUp. That's okay, but you could do it as well outside any function, like in the original SR. I am not sure which is more efficient.
I noticed when trying to access the exclusion list of famous planets by script. It would have been easier to access by other scripts at startUp if that was defined at main level.
Edit: And I found another interesting bug. SystemDemux adds planets on every launch, not only the first launch. System Redux 1.2 Had a special check for this that was deleted in SD1.0 For the player it does not show because the duplate planets are overlapping the older ones, but when asking for a planet list in the console, you see it grow on every launch
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
- Dr Beeb
- Dangerous
- Posts: 127
- Joined: Sun Mar 23, 2008 10:28 pm
- Location: Mt. Vista, Oosa, Biarge System, Galaxy 1
Oh, that's not good.Eric Walch wrote:And I found another interesting bug. SystemDemux adds planets on every launch, not only the first launch. System Redux 1.2 Had a special check for this that was deleted in SD1.0 For the player it does not show because the duplate planets are overlapping the older ones, but when asking for a planet list in the console, you see it grow on every launch
All, let me know which textures you liked, which ones you did not and I can twiddle for the next release.
White dots were so much easier to hit