Galaxy Shape Variables

Galaxy Shape Variables; support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Galaxy Shape Variables

Post by Gowron »

As introduced in the Dynamic Key Variables topic, subroutine 4AF020 sets some values depending on galaxy size and shape. These dynamic values control the layout of the galaxy.

Spocks-cuddly-tribble already identified the minimum empire distance value.

Some variables are write-only, and this strongly implies that they don't have any influence. But who knows... ;)


Size indications can be absolute or relative. So numbers do not always equal "numbers of squares".


asm address: 5CB304
applies to: -
effect: write-only
default value(s): 0.05 (small ring, small spiral, medium spiral), 0.1 (large ring, large spiral), 0.2 (medium ring), 0.25 (medium elliptic), 0.9 (small elliptic)

asm address: 5CB308
applies to: -
effect: write-only
default value(s): 0x298 (small), 0x26E (medium), 0x2A4 (large)

asm address: 5CB30C
applies to: -
effect: write-only
default value(s): 0x1C4 (small), 0x288 (medium), 0x2BE (large)

asm address: 5CB310
applies to: all
effect: minimum desired horizontal or vertical (either one will suffice) distance between major empire starting positions (in squares)
default value(s): 3 (small elliptic, small spiral), 4 (small irregular, small ring, medium), 6 (large)

asm address: 5CB314
applies to: all
effect: long edge of map (in squares)
default value(s): 13 (small), 16 (medium), 25 (large)

asm address: 5CB318
applies to: -
effect: write-only
default value(s): 38 (small), 0 (medium), -54 (large)

asm address: 5CB31C
applies to: -
effect: write-only
default value(s): 160 (small), -26 (medium), -64 (large)

asm address: 5CB320
applies to: elliptic and spiral galaxies
effect: major axis of the galaxy (elliptic galaxies) resp. the central ellipse (spiral galaxies)
default value(s): 28 (small elliptic), 33 (medium elliptic), 68 (large elliptic), 13 (small spiral, medium spiral), 14 (large spiral)

asm address: 5CB324
applies to: ring galaxies
effect: size of the central area
default value(s): 9 (small), 12 (medium), 15 (large)

asm address: 5CB328
applies to: spiral galaxies
effect: width of a spiral arm
default value(s): 5 (small), 6 (medium), 7 (large)

asm address: 5CB32C
applies to: elliptic and spiral galaxies
effect: minor axis of the galaxy (elliptic galaxies) resp. the central ellipse (spiral galaxies)
default value(s): 20 (small elliptic), 25 (medium elliptic), 60 (large elliptic), 10 (small spiral, medium spiral), 14 (large spiral)

asm address: 5CB330
applies to: all
effect: long edge of map (in squares)
default value(s): 13 (small), 16 (medium), 25 (large)

asm address: 5CB334
applies to: irregular galaxies
effect: another galactic density factor
default value(s): 0.6 (small), 0.75 (medium, large)

asm address: 5CB338
applies to: ring galaxies
effect: width of the ring (in squares; ALWAYS needs to be smaller than half of the short edge of the map)
default value(s): 4 (small), 5 (medium), 6 (large)

asm address: 5CB33C
applies to: all
effect: 5x the length of the short edge of the map (in squares)
default value(s): 50 (small), 60 (medium), 90 (large)

asm address: 5CB340
applies to: all
effect: short edge of map (in squares)
default value(s): 10 (small), 12 (medium), 18 (large)

asm address: 5CB344
applies to: all
effect: 5x the length of the long edge of the map (in squares)
default value(s): 65 (small), 80 (medium), 125 (large)
Last edited by Gowron on Thu May 21, 2009 6:10 pm, edited 2 times in total.
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7871
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

can't wait to try it out. :lol:

just in time too just getting ready to redo UDM trek.exe :wink:

thunderchero
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron »

Just fixed a typo.
(the default value for the size of the central area of medium ring galaxies is 12, not 13)
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7871
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

I don't understand..... :cry:

I went back to your assembler offsets post, And looked for asm address above and could not find range for correct displacement value to subtract.

then I noticed you are listing asm address, is this the same thing as assembler offsets?

Then I searched trek.exe for values listed above, and from what I know and found nothing.

Any guidance would be greatly appreciated :wink:

thunderchero
User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron »

thunderchero wrote:I don't understand..... :cry:

I went back to your assembler offsets post, And looked for asm address above and could not find range for correct displacement value to subtract.

then I noticed you are listing asm address, is this the same thing as assembler offsets?

Then I searched trek.exe for values listed above, and from what I know and found nothing.

Any guidance would be greatly appreciated :wink:

thunderchero
They're dynamic variables, so they cannot be changed directly, but instead you can edit the code at the point where they're set. And that's within subroutine 4AF020.

These are the exact locations in subroutine 4AF020, in C++ format already:

Code: Select all

// minimum empire distance
       const int loc_mindists[] = {0x4AF144, 0x4AF163, 0x4AF190, 0x4AF1E6};
       const int loc_mindistm[] = {0x4AF0A1, 0x4AF1FF, 0x4AF243, 0x4AF265};
       const int loc_mindistl[] = {0x4AF2F5, 0x4AF2D2, 0x4AF306, 0x4AF359};
       
// irregular galaxy density
       const int loc_irregdensity_s = 0x4AF13F;
       const int loc_irregdensity_m = 0x4AF09C;
       const int loc_irregdensity_l = 0x4AF2F0;
      
// major axis of ellipse
       const int loc_majoraxis_s[] = {0x4AF172, 0x4AF1D0};   // elliptic, spiral
       const int loc_majoraxis_m[] = {0x4AF20E, 0x4AF260};   // elliptic, spiral
       const int loc_majoraxis_l[] = {0x4AF2DC, 0x4AF341};   // elliptic, spiral
       
// minor axis of ellipse
       const int loc_minoraxis_s[] = {0x4AF168, 0x4AF1CB};   // elliptic, spiral
       const int loc_minoraxis_m[] = {0x4AF204, 0x4AF25B};   // elliptic, spiral
       const int loc_minoraxis_l[] = {0x4AF2D7, 0x4AF341};   // elliptic, spiral

// width of spiral arm       
       const int loc_armwidth_s = 0x4AF1C6;
       const int loc_armwidth_m = 0x4AF256;
       const int loc_armwidth_l = 0x4AF33C;

// size of galactic core for ring galaxies    
       const int loc_ringcentersize_s = 0x4AF195;
       const int loc_ringcentersize_m = 0x4AF228;
       const int loc_ringcentersize_l = 0x4AF30B;

// width of ring for ring galaxies
       const int loc_ringwidth_s = 0x4AF190;
       const int loc_ringwidth_m = 0x4AF223;
       const int loc_ringwidth_l = 0x4AF306;
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7871
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Post by thunderchero »

Thanks Gowron,

For me that helped so much. :D

I had some time tonight to experiment with code.

I started with ring galaxy

here is before


here is after


home systems have been set to a min of 18 sectors apart :D

This will take some testing and larger values will cause galaxy hang ups.

I have also noticed some values share the same assembler offsets;

// minimum empire distance
const int loc_mindists[] = {0x4AF144, 0x4AF163, 0x4AF190, 0x4AF1E6};
const int loc_mindistm[] = {0x4AF0A1, 0x4AF1FF, 0x4AF243, 0x4AF265};
const int loc_mindistl[] = {0x4AF2F5, 0x4AF2D2, 0x4AF306, 0x4AF359};


// width of ring for ring galaxies
const int loc_ringwidth_s = 0x4AF190;
const int loc_ringwidth_m = 0x4AF223;
const int loc_ringwidth_l = 0x4AF306;

I am sure for you this is normal, but I was surprised to see 0x4AF223 not sharing same code. :wink:

Looks like larger maps will improve greatly soon 8O

thunderchero
Post Reply

Return to “Galaxy Shape Variables”