diff --git a/Assemblies/Fluffy_Relations.dll b/Assemblies/Fluffy_Relations.dll index 33e756e..c6a0fab 100644 Binary files a/Assemblies/Fluffy_Relations.dll and b/Assemblies/Fluffy_Relations.dll differ diff --git a/Source/ForceDirectedGraph/FactionNode.cs b/Source/ForceDirectedGraph/FactionNode.cs index 14943b1..eb215bf 100644 --- a/Source/ForceDirectedGraph/FactionNode.cs +++ b/Source/ForceDirectedGraph/FactionNode.cs @@ -39,7 +39,7 @@ public class FactionNode: Node { // apply force in direction of other velocity += force * this.DirectionTo(other); -#if DEBUG +#if DEBUG_GRAPH Graph.msg.AppendLine("\t\tOpinion: " + opinion + ", Force: " + force + ", Vector: " + (force * this.DirectionTo(other))); #endif } diff --git a/Source/ForceDirectedGraph/Graph.cs b/Source/ForceDirectedGraph/Graph.cs index 687e5a5..9dca766 100644 --- a/Source/ForceDirectedGraph/Graph.cs +++ b/Source/ForceDirectedGraph/Graph.cs @@ -30,7 +30,7 @@ public class Graph { private float temperature = .1f; private readonly Dictionary _pawnNodes = new(); -#if DEBUG +#if DEBUG_GRAPH public static StringBuilder msg = new(); #endif @@ -118,7 +118,7 @@ public class Graph { return; } -#if TRACE +#if DEBUG_GRAPH msg = new StringBuilder(); msg.AppendLine("Iteration: " + iteration); #endif @@ -128,7 +128,7 @@ public class Graph { // calculate attractive forces foreach (Edge edge in edges) { -#if TRACE +#if DEBUG_GRAPH msg.AppendLine("\tAttractive force between " + edge.nodeA.pawn.Name.ToStringShort + edge.nodeA.position + " and " + edge.nodeB.pawn.Name.ToStringShort + edge.nodeB.position); #endif edge.nodeA.AttractedTo(edge.nodeB); @@ -137,7 +137,7 @@ public class Graph { // calculate repulsive forces foreach (Node node in nodes) { -#if TRACE +#if DEBUG_GRAPH msg.AppendLine("\tRepulsion for " + node.pawn.Name.ToStringShort + node.position); #endif foreach (Node other in nodes) { @@ -182,7 +182,7 @@ public class Graph { nodes.Where(n => !n.Frozen).Min(node => node.position.y)); Vector2 offset = (size / 2f) - graphCentre; -#if TRACE +#if DEBUG_GRAPH msg.AppendLine("Centre: " + graphCentre + ", offset: " + (size / 2f)); #endif foreach (Node node in nodes) { @@ -197,7 +197,7 @@ public class Graph { //if ( !node.frozen ) // node.Clamp( size ); -#if TRACE +#if DEBUG_GRAPH msg.AppendLine("\t" + node.pawn.LabelShort + ", velocity: " + node.velocity + ", position: " + node.position); } Log.Message(msg.ToString()); @@ -213,7 +213,7 @@ public class Graph { Constants.SlotSize * 5f); temperature = MAX_TEMPERATURE * (1f - (1f / MAX_ITERATIONS * iteration)); -#if TRACE +#if DEBUG_GRAPH msg.AppendLine("idealDistance: " + idealDistance + ", temperature: " + temperature); #endif } diff --git a/Source/ForceDirectedGraph/Node.cs b/Source/ForceDirectedGraph/Node.cs index b598ec0..0e2c598 100644 --- a/Source/ForceDirectedGraph/Node.cs +++ b/Source/ForceDirectedGraph/Node.cs @@ -58,7 +58,7 @@ public class Node { float force = Graph.ATTRACTIVE_CONSTANT * Mathf.Max( this.DistanceTo( other ) - Graph.idealDistance, 0f ); velocity += force * this.DirectionTo(other); -#if DEBUG +#if DEBUG_GRAPH Graph.msg.AppendLine("\t\tForce: " + force + ", Vector: " + (force * this.DirectionTo(other))); #endif } @@ -72,7 +72,7 @@ public class Node { float force = -( Graph.REPULSIVE_CONSTANT / Mathf.Pow( this.DistanceTo( other ), 2 ) * Graph.idealDistance ); velocity += force * this.DirectionTo(other); -#if DEBUG +#if DEBUG_GRAPH Graph.msg.AppendLine("\t\tRepulsion from " + other.pawn.Name.ToStringShort + other.position + "; Distance: " + this.DistanceTo(other) + " (" + (Mathf.Pow(this.DistanceTo(other), 2) * Graph.idealDistance) + "), Force: " + force + ", Vector: " + (force * this.DirectionTo(other))); #endif } diff --git a/Source/ForceDirectedGraph/PawnNode.cs b/Source/ForceDirectedGraph/PawnNode.cs index d863fd7..15f3e7a 100644 --- a/Source/ForceDirectedGraph/PawnNode.cs +++ b/Source/ForceDirectedGraph/PawnNode.cs @@ -23,7 +23,7 @@ public class PawnNode: Node { // apply force in direction of other velocity += force * this.DirectionTo(other); -#if DEBUG +#if DEBUG_GRAPH Graph.msg.AppendLine("\t\tOpinion: " + opinion + ", Force: " + force + ", Vector: " + (force * this.DirectionTo(other))); #endif } diff --git a/modinfo.json b/modinfo.json index f432822..1af58b1 100644 --- a/modinfo.json +++ b/modinfo.json @@ -4,9 +4,9 @@ "targetDir": "FluffyRelations", "url": "https://github.com/fluffy-mods/RelationsTab", "version": { - "major": 3, - "minor": 2, - "build": 122 + "major": 4, + "minor": 1, + "build": 124 }, "author": { "name": "Fluffy", @@ -19,6 +19,15 @@ "url": "https://github.com/fluffy-mods/RelationsTab" }, "changelog": [ + { + "date": "2024-03-16T13:58:11.000Z", + "message": "update preview image, move some debug behind trace", + "author": { + "name": "Fluffy", + "email": "fluffy.l2032@gmail.com" + }, + "hash": "8cb91d2a9b93876ff03643646f6a1c3d6b411d20" + }, { "date": "2022-10-16T20:16:04.000Z", "message": "release v3.2.119",