Skip to content

Commit fc83344

Browse files
committed
Revised body exploration values to be more conservative for systems within the pre-Odyssey bubble.
- Remove 30% Odyssey mapping bonus for star systems within the pre-Odyssey bubble. - The "First Discovery" bonus is applied haphazardly within the pre-odyssey bubble. Assume it won't be awarded to bodies in that region.
1 parent d46b6f0 commit fc83344

3 files changed

Lines changed: 63 additions & 53 deletions

File tree

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Full details of the variables available for each noted event, and VoiceAttack in
55
## 4.1.5
66
* Core
77
* Added support for the Panther Clipper Mk. II.
8+
* Revised body exploration values to be more conservative for systems within the pre-Odyssey bubble.
89
* Replaced the legacy `CSCore` voice effect library with the more modern `NAudio` library. The effects library isn't exactly the same so some audio effects may be slightly different than they were before. The largest difference is the way that distortion in response to ship damage is handled.
910
* Many carrier events now trigger for both your personal fleet carrier and for your squadron carrier - a `carrierType` field has been added to applicable events to identify the event source.
1011
* Events

DataDefinitions/Body.cs

Lines changed: 56 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
using System;
44
using System.Collections.Generic;
55
using System.ComponentModel;
6+
using System.Runtime.CompilerServices;
67
using System.Runtime.Serialization;
78
using System.Text.RegularExpressions;
89
using Utilities;
910

11+
[assembly: InternalsVisibleTo( "Tests" )]
1012
namespace EddiDataDefinitions
1113
{
1214
/// <summary>
@@ -328,42 +330,41 @@ public Body(string bodyName, long? bodyId, string systemName, ulong systemAddres
328330
[PublicAPI, JsonIgnore]
329331
public decimal? absolutemagnitudeprobability => starClass == null ? null : Probability.CumulativeP(starClass.absolutemagnitudedistribution, absolutemagnitude);
330332

331-
private long estimateStarValue()
333+
private long estimateStarValue ()
332334
{
333335
// Credit to MattG's thread at https://forums.frontier.co.uk/threads/exploration-value-formulae.232000/ for scan value formulas
334336

335-
if (stellarclass is null || solarmass is null)
337+
if ( stellarclass is null || solarmass is null )
336338
{
337339
return 0;
338340
}
339341

340342
// Scan value calculation constants
341343
const double scanDivider = 66.25;
342344

343-
double k = 1200; // base value
344-
double result;
345+
var k = 1200d; // base value
345346

346347
// Override constants for specific types of bodies
347-
if ((stellarclass == "H") || (stellarclass == "N"))
348+
if ( stellarclass == "H" || stellarclass == "N" )
348349
{
349350
// Black holes and Neutron stars
350351
k = 22628;
351352
}
352-
else if (stellarclass == "SuperMassiveBlackHole")
353+
else if ( stellarclass == "SuperMassiveBlackHole" )
353354
{
354355
// Supermassive black hole
355356
// this is applying the same scaling to the 3.2 value as a normal black hole, not confirmed in game
356357
k = 33.5678;
357358
}
358-
else if (stellarclass.StartsWith("D") && (stellarclass.Length <= 3))
359+
else if ( stellarclass.StartsWith( "D" ) && ( stellarclass.Length <= 3 ) )
359360
{
360361
// White dwarves
361362
k = 14057;
362363
}
363364

364365
// Calculate exploration scan values - (k + (m * k / 66.25))
365-
result = k + ((double)solarmass * k / scanDivider);
366-
return (long)Math.Round(result);
366+
var result = k + ( (double)solarmass * k / scanDivider );
367+
return (long)Math.Round( result );
367368
}
368369

369370
// Body-specific items
@@ -492,11 +493,11 @@ public Body(string bodyName, long? bodyId, string systemName, ulong systemAddres
492493
[PublicAPI, JsonIgnore] // The ground speed of the parent body's shadow on the surface of the body in meters per second
493494
public decimal? solarsurfacevelocity => 2 * (decimal)Math.PI * radius * 1000 / (solarday * 86400);
494495

495-
private long estimateBodyValue(bool isMapped, bool isMappedEfficiently)
496+
private long estimateBodyValue ( bool isMapped, bool isMappedEfficiently )
496497
{
497498
// Credit to MattG's thread at https://forums.frontier.co.uk/threads/exploration-value-formulae.232000/ for scan value formulas
498-
499-
if (earthmass is null || terraformState is null || planetClass is null)
499+
500+
if ( earthmass is null || terraformState is null || planetClass is null )
500501
{
501502
return 0;
502503
}
@@ -508,59 +509,60 @@ private long estimateBodyValue(bool isMapped, bool isMappedEfficiently)
508509
const double firstDiscoveryMultiplier = 2.6;
509510
const double efficientMappingMultiplier = 1.25;
510511

511-
int k = 300; // base value
512-
int k_terraformable = 93328;
512+
// Base values
513+
var k = 300; // base value
514+
var k_terraformable = 93328;
515+
var mappingMultiplier = 1d;
516+
517+
var isFirstDiscoverer = !alreadydiscovered ?? false;
513518

514-
var alreadyDiscovered = (alreadydiscovered ?? true);
515-
var alreadyMapped = (alreadymapped ?? true); // If we don't know then we'll assume true to underestimate rather than overestimate the value
519+
// If we don't know then we'll assume we are not the first to map the body and underestimate rather than overestimate the value
520+
var isFirstMapper = !alreadymapped ?? false;
521+
522+
// There is a special case where bodies within the pre-Odyssey colonized bubble of star systems use different rules for calculating values.
523+
// They do get First Discoverer bonus - which kinda makes sense, given journals report them not discovered, but they do not get the Odyssey 30% when mapped.
524+
var isPreOdysseyBubble = isFirstDiscoverer && !isFirstMapper;
516525

517526
// Override constants for specific types of bodies
518-
if (planetClass.edname == "AmmoniaWorld")
527+
if ( planetClass.edname == "AmmoniaWorld" )
519528
{
520-
// Ammonia worlds
521-
k = 96932;
529+
k = 96932; // Ammonia worlds
522530
}
523-
else if (planetClass.edname == "EarthLikeBody" || planetClass.edname == "WaterWorld")
531+
else if ( planetClass.edname == "EarthLikeBody" || planetClass.edname == "WaterWorld" )
524532
{
525-
// Earth-like & water worlds
526-
k = 64831;
533+
k = 64831; // Earth-like & water worlds
527534
k_terraformable = 116295;
528535
}
529-
else if (planetClass.edname == "MetalRichBody")
536+
else if ( planetClass.edname == "MetalRichBody" )
530537
{
531-
// Metal rich worlds
532-
k = 21790;
538+
k = 21790; // Metal rich worlds
533539
}
534-
else if (planetClass.edname == "HighMetalContentBody")
540+
else if ( planetClass.edname == "HighMetalContentBody" )
535541
{
536-
// High metal content worlds
537-
k = 9654;
542+
k = 9654; // High metal content worlds
538543
k_terraformable = 100677;
539544
}
540-
else if (planetClass.edname == "SudarskyClassIGasGiant")
545+
else if ( planetClass.edname == "SudarskyClassIGasGiant" )
541546
{
542-
// Class I gas giants
543-
k = 1656;
547+
k = 1656; // Class I gas giants
544548
}
545-
else if (planetClass.edname == "SudarskyClassIIGasGiant")
549+
else if ( planetClass.edname == "SudarskyClassIIGasGiant" )
546550
{
547-
// Class II gas giants
548-
k = 9654;
551+
k = 9654; // Class II gas giants
549552
}
550553

551554
// Terraformability is a scale from 0-100%, but since we don't know the % we'll assume 100% for the time being.
552-
k = terraformState.edname == "Terraformable" || terraformState.edname == "Terraformed"
553-
? (k + k_terraformable)
555+
k = terraformState.edname == "Terraformable" || terraformState.edname == "Terraformed"
556+
? k + k_terraformable
554557
: k;
555558

556-
double mappingMultiplier = 1;
557-
if (isMapped)
559+
if ( isMapped )
558560
{
559-
if (!alreadyDiscovered && !alreadyMapped) // First to discover and first to map
561+
if ( isFirstDiscoverer && isFirstMapper ) // First to discover and first to map
560562
{
561563
mappingMultiplier = 3.699622554;
562564
}
563-
else if (!alreadyMapped) // Not first to discover but first to map
565+
else if ( isFirstMapper ) // Not first to discover but first to map
564566
{
565567
mappingMultiplier = 8.0956;
566568
}
@@ -571,17 +573,24 @@ private long estimateBodyValue(bool isMapped, bool isMappedEfficiently)
571573
}
572574

573575
// Calculate exploration scan values
574-
double value = Math.Max(scanMinValue, (k + (k * q * Math.Pow((double)earthmass, scanPower))) * mappingMultiplier);
575-
if (isMapped)
576+
var value = Math.Max( scanMinValue,
577+
( k + ( k * q * Math.Pow( (double)earthmass, scanPower ) ) ) * mappingMultiplier );
578+
if ( isMapped )
576579
{
577-
value += ((value * 0.3) > 555) ? value * 0.3 : 555;
578-
if (isMappedEfficiently)
580+
if ( !isPreOdysseyBubble )
581+
{
582+
value += ( value * 0.3 ) > 555 ? value * 0.3 : 555;
583+
}
584+
585+
if ( isMappedEfficiently )
579586
{
580587
value *= efficientMappingMultiplier;
581588
}
582589
}
583-
value *= !alreadyDiscovered ? firstDiscoveryMultiplier : 1;
584-
return (long)Math.Round(value);
590+
591+
// The "First Discovery" bonus is applied haphazardly within the pre-odyssey bubble. Assume it won't be awarded to bodies in that region.
592+
value *= isFirstDiscoverer && !isPreOdysseyBubble ? firstDiscoveryMultiplier : 1;
593+
return (long)Math.Round( value );
585594
}
586595

587596
// Miscellaneous and legacy properties and methods
@@ -691,7 +700,7 @@ private void OnDeserialized(StreamingContext context)
691700
#region Implement INotifyPropertyChanged
692701
public event PropertyChangedEventHandler PropertyChanged;
693702

694-
public void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberNameAttribute] string propName = null)
703+
public void OnPropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propName = null)
695704
{
696705
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propName));
697706
}

Tests/JournalMonitorTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,13 +1333,13 @@ public void TestSignalDetectedEvent5 ()
13331333
[TestMethod, DoNotParallelize]
13341334
public void TestSignalDetectedUnique()
13351335
{
1336-
EDDI.Instance.CurrentStarSystem = new StarSystem { systemname = "TestSystem", systemAddress = 6606892846275 };
1336+
EDDI.Instance.CurrentStarSystem = new StarSystem { systemname = "TestSystem", systemAddress = 6606892846276 };
13371337

1338-
var line0 = @"{ ""timestamp"":""2019-02-04T02:20:28Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846275, ""SignalName"":""$NumberStation;"", ""SignalName_Localised"":""Unregistered Comms Beacon"" }";
1339-
var line1 = @"{ ""timestamp"":""2019-02-04T02:25:03Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846275, ""SignalName"":""$NumberStation;"", ""SignalName_Localised"":""Unregistered Comms Beacon"" }";
1340-
var line2 = @"{ ""timestamp"":""2019-02-04T02:28:26Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846275, ""SignalName"":""$Fixed_Event_Life_Ring;"", ""SignalName_Localised"":""Notable stellar phenomena"" }";
1341-
var line3 = @"{ ""timestamp"":""2019-02-04T02:38:53Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846275, ""SignalName"":""$Fixed_Event_Life_Ring;"", ""SignalName_Localised"":""Notable stellar phenomena"" }";
1342-
var line4 = @"{ ""timestamp"":""2019-02-04T02:38:53Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846275, ""SignalName"":""$NumberStation;"", ""SignalName_Localised"":""Unregistered Comms Beacon"" }";
1338+
var line0 = @"{ ""timestamp"":""2019-02-04T02:20:28Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846276, ""SignalName"":""$NumberStation;"", ""SignalName_Localised"":""Unregistered Comms Beacon"" }";
1339+
var line1 = @"{ ""timestamp"":""2019-02-04T02:25:03Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846276, ""SignalName"":""$NumberStation;"", ""SignalName_Localised"":""Unregistered Comms Beacon"" }";
1340+
var line2 = @"{ ""timestamp"":""2019-02-04T02:28:26Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846276, ""SignalName"":""$Fixed_Event_Life_Ring;"", ""SignalName_Localised"":""Notable stellar phenomena"" }";
1341+
var line3 = @"{ ""timestamp"":""2019-02-04T02:38:53Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846276, ""SignalName"":""$Fixed_Event_Life_Ring;"", ""SignalName_Localised"":""Notable stellar phenomena"" }";
1342+
var line4 = @"{ ""timestamp"":""2019-02-04T02:38:53Z"", ""event"":""FSSSignalDiscovered"", ""SystemAddress"":6606892846276, ""SignalName"":""$NumberStation;"", ""SignalName_Localised"":""Unregistered Comms Beacon"" }";
13431343

13441344
var events0 = JournalMonitor.ParseJournalEntry(line0);
13451345
var event0 = (SignalDetectedEvent)events0[0];

0 commit comments

Comments
 (0)