Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RevolutionaryGamesCommon
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This I think is still a revert, if you press the "updated 1 files" on github and it opens a page that says

kuva

there isn't anything to compare, then that means that the submodule is going backwards in versions.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats really odd, ill run sync again, hopefully should clear that up

3 changes: 1 addition & 2 deletions Thrive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@
<ItemGroup>
<ProjectReference Include="RevolutionaryGamesCommon\LauncherThriveShared\LauncherThriveShared.csproj" />
<ProjectReference Include="RevolutionaryGamesCommon\SharedBase\SharedBase.csproj" />
<ProjectReference Include="third_party\Arch.Extended\Arch.System.SourceGenerator\Arch.System.SourceGenerator.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="third_party\Arch.Extended\Arch.System.SourceGenerator\Arch.System.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for this change?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, i dont believe i touched i just compiled it

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, then you should revert this file as well.

<ProjectReference Include="third_party\Arch.Extended\Arch.System\Arch.System.csproj" />
<ProjectReference Include="third_party\Arch\src\Arch\Arch.csproj" />
<ProjectReference Include="third_party\ThirdParty.csproj" />
Expand Down
119 changes: 119 additions & 0 deletions Thrive.csproj.old.1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old project backup files shouldn't be committed.

Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Godot.NET.Sdk/4.5.1">
<PropertyGroup>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<TargetFramework>net10.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'android' ">net9.0</TargetFramework>
<TargetFramework Condition=" '$(GodotTargetPlatform)' == 'ios' ">net8.0</TargetFramework>
<EnableDynamicLoading>true</EnableDynamicLoading>
<LangVersion>14</LangVersion>
<Nullable>enable</Nullable>
<Company>Revolutionary Games Studio</Company>
<Version>1.0.0.0</Version>
<!--<InformationalVersion>-beta</InformationalVersion>-->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
<!-- Ignore the subproject source files -->
<PropertyGroup>
<DefaultItemExcludes>
$(DefaultItemExcludes);Scripts\**\*;ThriveScriptsShared\**\*;test\code_tests\**\*;test\code_benchmarks\**\*;RevolutionaryGamesCommon\**\*;third_party\**\*
</DefaultItemExcludes>
</PropertyGroup>
<!-- Ignore exporting tests when making release build of Thrive -->
<PropertyGroup>
<DefaultItemExcludes Condition="'$(Configuration)' == 'ExportRelease'">
$(DefaultItemExcludes);test/**/*;addons\gdUnit4\**\*
</DefaultItemExcludes>
</PropertyGroup>
<!-- Non-Steam build needs to skip this file -->
<ItemGroup>
<Compile Remove="src\steam\SteamClient.cs" />
</ItemGroup>
<!-- In case the hot reload in Godot editor would fail with the system JSON referenced, this single file is picked out -->
<ItemGroup>
<Compile Include="RevolutionaryGamesCommon\DevCenterCommunication\Models\Enums\PrecompiledTag.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="shaders\" />
<Folder Include="src\auto-evo\steps\" />
<Folder Include="src\auto-evo\simulation\" />
</ItemGroup>
<!-- Test resources -->
<ItemGroup Condition="'$(Configuration)' != 'ExportRelease'">
<PackageReference Include="gdUnit4.api" Version="5.1.0-rc3" />
<PackageReference Include="gdUnit4.test.adapter" Version="3.0.0" />
<!-- Re-enable this this once newer compiler versions are deployed everywhere
<PackageReference Include="gdUnit4.analyzers" Version="1.0.0">
<PrivateAssets>none</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> -->
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.4.0" />
<PackageReference Include="GraphShape" Version="1.2.1" />
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="System.IO.Hashing" Version="10.0.1" />
<PackageReference Include="Nito.Collections.Deque" Version="1.2.1" />
<PackageReference Include="XoshiroPRNG.Net" Version="1.6.0" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.101" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<Content Include=".config\dotnet-tools.json" />
<Content Include="export_presets.cfg" />
<Content Include="global.json" />
<Content Include="README.md" />
<Content Include="RevolutionaryGamesCommon\stylecop.json" />
<Content Include="RevolutionaryGamesCommon\StyleCop.ruleset" />
<Content Include="simulation_parameters\awakening_stage\crafting_recipes.json" />
<Content Include="simulation_parameters\awakening_stage\equipment.json" />
<Content Include="simulation_parameters\awakening_stage\structures.json" />
<Content Include="simulation_parameters\awakening_stage\technologies.json" />
<Content Include="simulation_parameters\awakening_stage\world_resources.json" />
<Content Include="simulation_parameters\common\achievements.json" />
<Content Include="simulation_parameters\common\auto-evo_parameters.json" />
<Content Include="simulation_parameters\common\credits.json" />
<Content Include="simulation_parameters\common\difficulty_presets.json" />
<Content Include="simulation_parameters\common\gallery.json" />
<Content Include="simulation_parameters\common\help_texts.json" />
<Content Include="simulation_parameters\common\input_options.json" />
<Content Include="simulation_parameters\common\music_tracks.json" />
<Content Include="simulation_parameters\common\patch_notes.yml" />
<Content Include="simulation_parameters\common\screen_effects.json" />
<Content Include="simulation_parameters\common\stage_resources.json" />
<Content Include="simulation_parameters\common\translations_info.json" />
<Content Include="simulation_parameters\common\visual_resources.json" />
<Content Include="simulation_parameters\common\wiki.json" />
<Content Include="simulation_parameters\industrial_stage\units.json" />
<Content Include="simulation_parameters\microbe_stage\backgrounds.json" />
<Content Include="simulation_parameters\microbe_stage\biomes.json" />
<Content Include="simulation_parameters\microbe_stage\bio_processes.json" />
<Content Include="simulation_parameters\microbe_stage\compounds.json" />
<Content Include="simulation_parameters\microbe_stage\enzymes.json" />
<Content Include="simulation_parameters\microbe_stage\membranes.json" />
<Content Include="simulation_parameters\microbe_stage\meteors.json" />
<Content Include="simulation_parameters\microbe_stage\organelles.json" />
<Content Include="simulation_parameters\microbe_stage\patch_syllables.json" />
<Content Include="simulation_parameters\microbe_stage\species_names.json" />
<Content Include="simulation_parameters\space_stage\space_structures.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="RevolutionaryGamesCommon\LauncherThriveShared\LauncherThriveShared.csproj" />
<ProjectReference Include="RevolutionaryGamesCommon\SharedBase\SharedBase.csproj" />
<ProjectReference Include="third_party\Arch.Extended\Arch.System.SourceGenerator\Arch.System.SourceGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="third_party\Arch.Extended\Arch.System\Arch.System.csproj" />
<ProjectReference Include="third_party\Arch\src\Arch\Arch.csproj" />
<ProjectReference Include="third_party\ThirdParty.csproj" />
<ProjectReference Include="ThriveScriptsShared\ThriveScriptsShared.csproj" />
</ItemGroup>
<!-- StyleCop Analyzers configuration -->
<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)RevolutionaryGamesCommon/StyleCop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)RevolutionaryGamesCommon/stylecop.json" Link="stylecop.json" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions src/auto-evo/AutoEvoExploringTool.Export.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ private void ExportCurrentWorldSpeciesHistory(string basePath)
microbeSpecies.BaseRotationSpeed.ToString(CultureInfo.InvariantCulture),
microbeSpecies.StorageCapacities.Nominal.ToString(CultureInfo.InvariantCulture),
microbeSpecies.IsBacteria.ToString(),
microbeSpecies.Organelles.Count.ToString(),
microbeSpecies.ReadonlyOrganelles.Count.ToString(),
});

data.AddRange(allOrganelles
.Select(d => microbeSpecies.Organelles.Count(t => t.Definition == d).ToString()));
.Select(d => microbeSpecies.ReadonlyOrganelles.Count(t => t.Definition == d).ToString()));
}
else
{
Expand Down
14 changes: 8 additions & 6 deletions src/auto-evo/AutoEvoExploringTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1169,18 +1169,20 @@ public void UpdateWorldStatistics()
foreach (var organelle in SimulationParameters.Instance.GetAllOrganelles())
{
MicrobeSpeciesOrganelleStatistics[organelle] = (
microbeSpecies.Average(s => s.Organelles.Any(o => o.Definition == organelle) ? 1 : 0),
microbeSpecies.Average(s => s.Organelles.Count(o => o.Definition == organelle)));
microbeSpecies.Average(s => s.ReadonlyOrganelles.Any(o => o.Definition == organelle) ? 1 : 0),
microbeSpecies.Average(s => s.ReadonlyOrganelles.Count(o => o.Definition == organelle)));
}

foreach (var upgradeName in MicrobeSpeciesUpgradesStatistics.Keys)
{
MicrobeSpeciesUpgradesStatistics[upgradeName] = (
MicrobeSpeciesUpgradesStatistics[upgradeName].Name,
microbeSpecies.Average(s =>
s.Organelles.Any(o => o.Upgrades?.UnlockedFeatures.Contains(upgradeName) ?? false) ? 1 : 0),
s.ReadonlyOrganelles.Any(o => o.Upgrades?.UnlockedFeatures.Contains(upgradeName) ?? false) ?
1 :
0),
microbeSpecies.Average(s =>
s.Organelles.Count(o => o.Upgrades?.UnlockedFeatures.Contains(upgradeName) ?? false)));
s.ReadonlyOrganelles.Count(o => o.Upgrades?.UnlockedFeatures.Contains(upgradeName) ?? false)));
}

foreach (var membrane in SimulationParameters.Instance.GetAllMembranes())
Expand All @@ -1192,11 +1194,11 @@ public void UpdateWorldStatistics()
foreach (var enzyme in MicrobeSpeciesEnzymesStatistics.Keys)
{
MicrobeSpeciesEnzymesStatistics[enzyme] = (
microbeSpecies.Average(s => s.Organelles.Any(o =>
microbeSpecies.Average(s => s.ReadonlyOrganelles.Any(o =>
o.Definition.Enzymes.TryGetValue(enzyme, out var value) && value > 0) ?
1 :
0),
microbeSpecies.Average(s => s.Organelles.Count(o =>
microbeSpecies.Average(s => s.ReadonlyOrganelles.Count(o =>
o.Definition.Enzymes.TryGetValue(enzyme, out var value) && value > 0)));
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/auto-evo/mutation_strategy/AddOrganelleAnywhere.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public static AddOrganelleAnywhere ThatConvertBetweenCompounds(Compound fromComp
continue;

// Don't add duplicate unique organelles
if (organelle.Unique && baseSpecies.Organelles.Select(x => x.Definition).Contains(organelle))
if (organelle.Unique && baseSpecies.ModifiableOrganelles.Select(x => x.Definition).Contains(organelle))
continue;

var newSpecies = (MicrobeSpecies)baseSpecies.Clone();
Expand Down
6 changes: 3 additions & 3 deletions src/auto-evo/mutation_strategy/ModifyOrganelleBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ModifyOrganelleBase(Func<OrganelleDefinition, bool> criteria, bool should
List<int>? organelleIndexesToMutate = null;

// Manual looping to avoid one enumerator allocation per call
var organelleList = baseSpecies.Organelles.Organelles;
var organelleList = baseSpecies.ModifiableOrganelles.Organelles;
var organelleCount = organelleList.Count;
for (var i = 0; i < organelleCount; ++i)
{
Expand Down Expand Up @@ -98,14 +98,14 @@ public ModifyOrganelleBase(Func<OrganelleDefinition, bool> criteria, bool should

// We did not change the position at all, so we can safely put down the organelle as upgrades
// cannot affect the shape
newSpecies.Organelles.AddAutoEvoAttemptOrganelle(upgradedOrganelle);
newSpecies.ModifiableOrganelles.AddAutoEvoAttemptOrganelle(upgradedOrganelle);
mutatedOrganelle = true;
}
else
{
// TODO: switch away from cloning again once ensured that auto-evo does not modify original
// organelles
newSpecies.Organelles.AddAutoEvoAttemptOrganelle(organelleList[j].Clone());
newSpecies.ModifiableOrganelles.AddAutoEvoAttemptOrganelle(organelleList[j].Clone());

// newSpecies.Organelles.AddAutoEvoAttemptOrganelle(organelleList[j]);
}
Expand Down
5 changes: 3 additions & 2 deletions src/auto-evo/mutation_strategy/MoveOrganelleBack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ public MoveOrganelleBack(Func<OrganelleDefinition, bool> criteria)
var workMemory2 = new List<Hex>();
var workMemory3 = new HashSet<Hex>();

foreach (OrganelleTemplate organelle in baseSpecies.Organelles.Where(x => allOrganelles.Contains(x.Definition)))
foreach (OrganelleTemplate organelle in baseSpecies.ModifiableOrganelles.Where(x =>
allOrganelles.Contains(x.Definition)))
{
MicrobeSpecies newSpecies = (MicrobeSpecies)baseSpecies.Clone();

newSpecies.Organelles.Remove(organelle);
newSpecies.ModifiableOrganelles.Remove(organelle);

if (CommonMutationFunctions.AddOrganelle(organelle.Definition, CommonMutationFunctions.Direction.Rear,
newSpecies, workMemory1, workMemory2, workMemory3, random))
Expand Down
11 changes: 6 additions & 5 deletions src/auto-evo/mutation_strategy/RemoveOrganelle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static RemoveOrganelle ThatCreateCompound(Compound compound)
if (mp < Constants.ORGANELLE_REMOVE_COST)
return null;

var organelles = baseSpecies.Organelles.Where(x => Criteria(x.Definition))
var organelles = baseSpecies.ModifiableOrganelles.Where(x => Criteria(x.Definition))
.OrderBy(_ => random.Next()).Take(Constants.AUTO_EVO_ORGANELLE_REMOVE_ATTEMPTS);

List<Tuple<MicrobeSpecies, double>>? mutated = null;
Expand All @@ -73,8 +73,8 @@ public static RemoveOrganelle ThatCreateCompound(Compound compound)
// Is this the best way to do this? Probably not, but this is how mutations.cs does is
// and the other way outright did not work
// This is now slightly improved - hhyyrylainen
var baseOrganelles = baseSpecies.Organelles.Organelles;
var count = baseSpecies.Organelles.Count;
var baseOrganelles = baseSpecies.ReadonlyOrganelles.Organelles;
var count = baseSpecies.ReadonlyOrganelles.Count;

for (var i = 0; i < count; ++i)
{
Expand All @@ -85,10 +85,11 @@ public static RemoveOrganelle ThatCreateCompound(Compound compound)

// Copy the organelle
var newOrganelle = parentOrganelle.Clone();
newSpecies.Organelles.AddIfPossible(newOrganelle, workMemory.WorkingMemory1, workMemory.WorkingMemory2);
newSpecies.ModifiableOrganelles.AddIfPossible(newOrganelle, workMemory.WorkingMemory1,
workMemory.WorkingMemory2);
}

CommonMutationFunctions.AttachIslandHexes(newSpecies.Organelles, workMemory);
CommonMutationFunctions.AttachIslandHexes(newSpecies.ModifiableOrganelles, workMemory);

mutated ??= new List<Tuple<MicrobeSpecies, double>>();
mutated.Add(Tuple.Create(newSpecies, mp - Constants.ORGANELLE_REMOVE_COST));
Expand Down
13 changes: 7 additions & 6 deletions src/auto-evo/mutations/CommonMutationFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static MicrobeSpecies GenerateRandomSpecies(MicrobeSpecies mutated, Patch
MutationLogicFunctions.ColourNewMicrobeSpecies(random, mutated);
}

mutated.ModifiableTolerances.CopyFrom(forPatch.GenerateTolerancesForMicrobe(mutated.Organelles));
mutated.ModifiableTolerances.CopyFrom(forPatch.GenerateTolerancesForMicrobe(mutated.ReadonlyOrganelles));

// Override the default species starting name to have more variability in the names
var nameGenerator = SimulationParameters.Instance.NameGenerator;
Expand Down Expand Up @@ -119,17 +119,18 @@ public static bool AddOrganelleWithStrategy(OrganelleAddStrategy strategy, Organ
switch (strategy)
{
case OrganelleAddStrategy.Realistic:
position = GetRealisticPosition(organelle, newSpecies.Organelles, direction, workMemory1, workMemory3,
position = GetRealisticPosition(organelle, newSpecies.ModifiableOrganelles, direction, workMemory1,
workMemory3,
random);
break;
case OrganelleAddStrategy.Spiral:
position = GetSpiralPosition(organelle, newSpecies.Organelles, workMemory1, workMemory3);
position = GetSpiralPosition(organelle, newSpecies.ModifiableOrganelles, workMemory1, workMemory3);
break;
case OrganelleAddStrategy.Front:
position = GetFrontPosition(organelle, newSpecies.Organelles, workMemory1, workMemory3);
position = GetFrontPosition(organelle, newSpecies.ModifiableOrganelles, workMemory1, workMemory3);
break;
case OrganelleAddStrategy.Back:
position = GetBackPosition(organelle, newSpecies.Organelles, workMemory1, workMemory3);
position = GetBackPosition(organelle, newSpecies.ModifiableOrganelles, workMemory1, workMemory3);
break;
default:
throw new ArgumentOutOfRangeException(nameof(strategy), strategy, null);
Expand All @@ -139,7 +140,7 @@ public static bool AddOrganelleWithStrategy(OrganelleAddStrategy strategy, Organ
if (position == null)
return false;

newSpecies.Organelles.AddFast(position, workMemory1, workMemory2);
newSpecies.ModifiableOrganelles.AddFast(position, workMemory1, workMemory2);

// If the new species is eukaryotic, mark this as such.
if (organelle == Nucleus)
Expand Down
4 changes: 2 additions & 2 deletions src/auto-evo/mutations/MutationLogicFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public static void ColourNewMicrobeSpecies(Random random, MicrobeSpecies newSpec

private static bool MicrobeSpeciesIsNewGenus(MicrobeSpecies species1, MicrobeSpecies species2)
{
var species1UniqueOrganelles = species1.Organelles.Select(o => o.Definition).ToHashSet();
var species2UniqueOrganelles = species2.Organelles.Select(o => o.Definition).ToHashSet();
var species1UniqueOrganelles = species1.ReadonlyOrganelles.Select(o => o.Definition).ToHashSet();
var species2UniqueOrganelles = species2.ReadonlyOrganelles.Select(o => o.Definition).ToHashSet();

return species1UniqueOrganelles.Union(species2UniqueOrganelles).Count()
- species1UniqueOrganelles.Intersect(species2UniqueOrganelles).Count()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public override float Score(Species species, Patch patch, SimulationCache cache)
// being in a colony no longer reduces osmoregulation cost.
var bindingModifier = 1.0f;

MicrobeInternalCalculations.GetBindingAndSignalling(microbeSpecies.Organelles.Organelles,
MicrobeInternalCalculations.GetBindingAndSignalling(microbeSpecies.ReadonlyOrganelles.Organelles,
out var hasBindingAgent, out var hasSignallingAgent);

if (hasBindingAgent)
Expand Down
Loading