On this page
Monday 3rd Setting up test harness for thermal systems Creating component for simulating phase change heating/coolingBasic system tracking only one phase change Rough system tracking all 3 phases Better system tracking all three phases Sanity checking against real values for a kettle of water Setting up formula to calculate boiling point of liquid at different pressures Set up basic framework for code generation of units structs (kg, kelvin, mole etc)Rewriting test code to use strongly typed units Worked through all the unit relations setting up operators and sub units Tuesday 4th Adding pressure calculation to boiling Sub stepping adding energy, updating the boiling temperature as pressure changes. Not technically correct since the temperature doesn't change as that energy is added, but simplifies things a lot. Updating units system to remove alt units (e.g. Celsius vs Kelvin) Creating Material
struct with all material properties Researching heat exchangers Wednesday 5th Refactoring units system so it can be completely turned off by a compiler switchOk that's not really practical without losing much of the benefits Investigating serialization for Unity/non-Unity projectsMemoryPack claims to be fast, compact and has both Unity and non-Unity support Created a simple serializable table which can store multiple series of data Generating a static table of data from a phase change simulation, this can be generated at edit time (ship design) and used at runtime (during combat) Writing a system to linearly simplify a dataset, removing points which can be predicted from the points on either sideRewritten to ensure it can't flatten out subtle curves Implementing radiators Further fiddling with modifying code generator to completely compile out unitsOverloads are a problem, e.g.Pascal IdealGasLaw(Kelvin temperature, MetreCube volume, Kilogram gas)
Pascal IdealGasLaw(Kelvin temperature, MetreCube volume, Mole gas)
These become the same signature! Thursday 6th Cleaning up Steradian code Testing absorption from Earth and Sol Rewritten linear simplification again to fix the issue with sometimes flattening out curves (testing against the baseline, so it can't drift) Added GameTime
class to Myriad.ECS
(instead of defining it in basically every project that uses Myriad)Updated Myriad+Unity package Design work on thermal management algorithm Friday 7th Finding a graph package to use for testing Using QuikGraph Investigating MSAGL for debug drawing Simulating heat pump COP Monday 10th Setting up basic thermal simStarship fuel quantities 2MW reactor (waste heat) 1MW laser (waste heat) 44m high temp radiator 8m low temp radiator Find thermophysical properties of oxygen System for heating phase change sinks to a set temperature Adapted heating function to have temp/pressure/joule limits Thermal simulation algorithmMove joules from source to loop Subtract joules from loop through radiators Move excess joules into attached sinks which are cooler than the loop Move joules from sinks into cooling loops which have spare capacity (through heat pump) until sink is at preferred temperature Tuesday 11th Implementing cooling for phase change materials Implementing moving heat out of sinks into cooling loops (down to the preferred temperature) Solving for total work in heat pumps Refactoring prototype sim code Working out a new algorithm for distributing heat from sinks to cooling loops with spare capacityIn order, from coldest to hottest loopWork out how many sinks target this loop = NFor each of those sinks, take at most SpareLoopCapacity / N
Repeat this step, removing sinks which have had their max cooling applied Break out once all sinks have been removed or the SpareLoopCapacity == 0
Implemented that Testing an idea for simplifying phase change sim - record a big table of data from a heating cycle then just lookup values in that.Seems reasonable, and it should allow for higher fidelity simulation of curves in large steps. Wednesday 12th Investigating better linear simplification Data table idea (mentioned yesterday) has some issues:It's only valid for a fixed volume and quantity of materialCan't support pressure relief Can't remove material (e.g. fuel) from tanks Fixed some bugs in phase change material with heating/cooling breaking limits Test runs with different step sizes and counts (always multiplying to the same amount of time):1000x1s: 0J Temps: [96.524773K, 67.925144K]
100x10s: 0J Temps: [96.524775K, 67.925146K]
10x100s: 0J Temps: [96.524797K, 67.925157K]
1x1000s: 0J Temps: [96.525013K, 67.925271K]
Implementing Ramer Douglas Peucker Created new HotStuff
library to clean up prototype sim codePorting over parts one by one and writing tests with 100% coverage Thursday 13th Porting PhaseChange
materialStruggling to find an efficient way to implement boiling due to change in boiling point as pressure changes Using a constant boiling point instead Implemented a new system for heating with limits, binary searching the energy range to find the amount of energy to add Implemented cooling using the same binary search system Friday 14th Fixing some edge case bugs in search system (e.g. wasting time searching below zero kelvin) Simplified unit naming conventions Porting thermal simExtra safety checks during setup Unifying heat sources and pumped heat sources into common interface Fixed issue with extracting heat from sinks still checking sinks that are already at preferred temperature Writing covering tests for thermal sim Added calculation of "load factor" for each cooling loop Sunday 16th Improved test coverage on thermal simulation JSON serialization for unit types (Newtonsoft) JSON serialization for other types Setting up package ready for import into Unity Monday 17th Brainstorming more ideas for ship design (areas besides thermals) Minor cleanup of thermal sim library Getting more material properties (Hydrogen) Working on radiator absorption from sky (sun, planets, other radiators) Tried moving project to Unity packageSucks to work with: Old C# version, t4 templates don't work. More work on sky systemSimplified overlap test - if the vector to the further object is within the area of the closer one, the further one is totally obscured. For space scenes where the distances involved are so huge this shouldn't make much difference. Finished absorbing heat from sky sources Tuesday 18th Documenting usage of HotStuff
thermal simulation library Importing HotStuff
into Unity againRemoved file scope namespace Removed record struct
Removed ref readonly
Removed collection constructors ([]
) Removed primary constructors Dependency on Newtonsoft JSON Removed ImplicitUsings
(https://learn.microsoft.com/en-gb/dotnet/core/project-sdk/overview#implicit-using-directives ) Added IsExternalInit
shim Not using double.Min
etc Removed string.Create
Renamed Material
to Substance
just prevent name collision with Material
in a rendering context It finally works! Setting up a scene to run HotStuff
sim in UnityTesting sphere obscurance visually Wednesday 19th Investigating t4 templates in Unity Modifying HotStuff
to work with Unity serialisationUnit structs no longer read-only Serialization attributes when necessary Property drawer Building an end-to-end tests scene with a mock ship and some heat sources in the skyFixed hydrogen temperatures Removing heat sinks from candidate list once their heat pumps are at capacity instead of re-checking and discovering it is still zero Thursday 20th Adding more bits to thermal test sceneSecondary loop More radiators More pumps Not capping capacity factor calculation at 1, this gives an indication just how much over capacity a loop is Automatically disregarding radiators that are absorbing more than they are emitting More live stats added to bits of cooling system Automatically deriving more unit relationshipse.g. A = B * C
-> A = C * B
, B = A / C
etc Started work on ECS bits for thermal system Friday 21st Added Collect
queries to Myriad.ECS
- collecting results from a query into a list Implemented system to gather heat sources from sky and update thermal simulation Experimented with other ships acting as heat sourcesSun at 1au: 1361W Ship at 1km, 10m radius radiator, 3000C: 650W That's extremely hot and very close, and it's still not significant. Can safely ignore ships as heat sources Replacing Ephemeris Unit structs with HotStuff structsMetre Kilogram Second Radian Saturday 22nd Monday 24th Fixed issue with orbit rail visuals breaking if changed at the wrong time (while a conversion job was in flight) Myriad.ECS
Transform system optimisationsDirectly using some internal/unsafe APIs, to skip some checks Fixed potential issue with clearing command buffers Reviewing assets in projectUpdated Shapes
Updated Hot Reload
Updated Mirror
Fixed error with UI blur feature Investigating can't AddPlayer before being ready
errorNot really an issue, just a false alarm from Mirror Working out best way to pass data from lobby to game scene Tuesday 25th Modified network loading system to request scenario from server Compacted tree view some more Created NetworkBarrier
which blocks clients until all clients are blocked. Wednesday 26th Refactoring system groups into one common location Started creating systems to sync entity creation from server to client Thursday 27th Experimenting with creating a system to sync entities using Mirror & GameObjects - almost all synced entities will have a GameObject representation, so why not just sync that using classic Mirror (and create the entity when the GO is instantiated).Setup spawning from server And from client Syncing initial values (i.e. setting data before spawning) Fixed time speed sync being broken, due to change in spawning players Using Singleton
for GameTimeWorldHost
Splitting NBody physics (position sampling, rails etc) out from integration (extending rails with new data). Needed for spawning NBodies which are remote integrated Experimenting with compression for orbit data pagesBenchmarks (extremely rough):GZIP: 0.77x Brotli: 0.82x DEFLATE: 0.76x XOR: 0.79x (here )Tried some variations of this, e.g. deriving velocity from position and storing the errors to the actual velocity value, to reduce the magnitude of the numbers involved. This made it worse ! This is the simplest, fastest and is nearly the smallest. Friday 28th Monday 31st Started setting up a "work queue" of things that the rail system needs to sync, this can be driven by the events Rewriting sync system to use eventsIndices are tricky, they get offset by various things. Need to only use them as a "hint" everywhere they're used. Written system to find a page by ID, using a hint index. We know pages are always in order, so based on the ID of the page at the hint we know which direction to search. Updated RailTrimmer
to not run on remotely integrated entities. The owner will trim the rail as appropriate. Written custom serializer, using pooled arrays to avoid allocations Refactored custom serializer to use XOR compression in position/velocity/timestamp data streamsInterleaving the X/Y/Z streams instead of writing them out one after the other. This simplifies decoding (and should speed it up too). Added unit tests for serialization Written Bool8 serialization extensions (8 bools as a byte)