Commit Graph

21 Commits

Author SHA1 Message Date
DrSmugleaf
ffce93c3e1 Fix FixedPoint2.Abs multiplying the value by 100 (#28378) 2024-05-29 18:42:15 +10:00
Pieter-Jan Briers
33611b7094 Solution precision fixes (#25199)
* Add test for two chemistry issues

1. rounding issue with reaction processing when making chloral hydrate
2. reliable assert trip due to the ValidateSolution() heat capacity issue.

* Fix FixedPoint2 arithmetic

Fix internal floating point arithmetic in places where it could be avoided.

Fix incorrect rounding mode used in other places (it should always floor, like regular int arithmetic).

I had to add an explicit epsilon value for float -> FixedPoint2 because something like 1.05 is actually like 1.04999 and that'd cause it to be rounded down to 1.04.

This fixes reaction reagent processing in cases where the reagent inputs can't cleanly divide. Previously, when making 30u chloral hydrate by adding the chlorine in 10u increments you'd end up with 0.04 chlorine left over. This was caused by division in the reaction code rounding up in some cases. Changing division here to always round down fixes it.

* Attempt to fix heat capacity precision assert issues.

Fixes #22126

First, we just increase the tolerance of the assert. It was way too low.

Second, actually put a cap on float drift from one-off _heatCapacity changes.

* Fix float -> FixedPoint2 epsilon for negative number, fix tests.

* Fix DamageableTest

* Oh yeah I need to call CleanReturnAsync
2024-02-16 16:54:27 -07:00
Pieter-Jan Briers
bf16698efa Portable Generator Rework (#19302) 2023-08-25 11:40:42 -07:00
Leon Friedrich
6982f238e8 Add SaveLoadSavePrototype test (#18859) 2023-08-08 17:27:16 +10:00
Nemanja
9147c91ceb Make guidebooks specify both damage types and groups (#18510)
* Make guidebooks specify both damage types and groups

* slothhhhhhhhhh i was in vc you didn't have to leave revIIEEEEWWWWWWW
2023-08-01 00:10:05 -06:00
Visne
c6d3e4f3bd Fix warnings and code cleanup/fixes (#13570) 2023-01-19 13:56:45 +11:00
Leon Friedrich
466384b081 Solution rejig (#12428) 2023-01-12 14:41:40 +11:00
Paul Ritter
3884c4d3db serv4 + submodule update (#12740)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
2022-11-27 19:25:55 +01:00
Leon Friedrich
5cade18119 FixedPoint2 tweaks (#12431) 2022-11-08 10:14:13 +11:00
wrexbe
bc68ac96dd Cleanup the namespaces (#8132) 2022-05-13 17:59:03 +10:00
Leon Friedrich
c95516e5b2 Revert "Explosion refactor TEST MERG (#6995)" (#7005) 2022-03-06 04:02:34 +11:00
Moony
4a466f4927 Explosion refactor TEST MERG (#6995)
* Explosions

* fix yaml typo

and prevent silly UI inputs

* oop

Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2022-03-04 13:48:01 -06:00
Leon Friedrich
0da74b1bfb misc optimization (#6436) 2022-02-02 22:40:22 -07:00
Sam Weaver
adddd2fac6 FIXED: Chemistry JSON dump tool and companion GitHub Action (#6222)
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
2022-01-18 14:44:22 -07:00
Moony
5fd45fc82a Revert "Chemistry JSON dump tool and companion GitHub Action (#6134)" (#6217)
This reverts commit 40e2e78e0f.
2022-01-17 16:06:19 -06:00
Sam Weaver
40e2e78e0f Chemistry JSON dump tool and companion GitHub Action (#6134)
* fuck

* oh boy

* Sorted every chem into guide groups

* WHY ARE YOU NOT ABSTRACT

* removes the target thing in favor of simply generating everything.

* eee

* Add group for med

* Update wiki JSON generation to use System.Text.Json

* Fix error on shutdown during wiki JSON generation

* First pass at automatic wiki workflow

* Add a temporary workaround while the build is continuing to give errors

* Update workflow to reference correct API url, track dependency.

* Compile wiki actions into one job rather than two

* Update page name to reference editable page

* Add other JSON file and parameterize root page path

* A few steps closer to using `System.Text.Json` to serialize properly

* Revert System.Text.Json and return to Newtonsoft.Json.

* Revert the revert. Return to System.Text.Json.

This reverts commit a5ea98dfdcfab3f605ac4d82d3b110f099324308.

* Add and register UniversalJsonConverter class.

* Narrow triggers for update-wiki GitHub action.

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
2022-01-17 13:50:02 -06:00
DrSmugleaf
c3fe5909ad THE RETURN OF THE KING
This reverts commit c18d07538a.
2021-11-22 19:08:27 +01:00
DrSmugleaf
c18d07538a Revert "Admin logs (#5419)"
This reverts commit 319aec109d.
2021-11-22 18:55:17 +01:00
Javier Guardia Fernández
319aec109d Admin logs (#5419)
* Add admin logging, models, migrations

* Add logging damage changes

* Add Log admin flag, LogFilter, Logs admin menu tab, message
Refactor admin logging API

* Change admin log get method names

* Fix the name again

* Minute amount of reorganization

* Reset Postgres db snapshot

* Reset Sqlite db snapshot

* Make AdminLog have a composite primary key of round, id

* Minute cleanup

* Change admin system to do a type check instead of index check

* Make admin logs use C# 10 interpolated string handlers

* Implement UI on its own window
Custom controls
Searching
Add admin log converters

* Implement limits into the query

* Change logs to be put into an OutputPanel instead for text wrapping

* Add log <-> player m2m relationship back

* UI improvements, make text wrap, add separators

* Remove entity prefix from damaged log

* Add explicit m2m model, fix any players filter

* Add debug command to test bulk adding logs

* Admin logs now just kinda go

* Add histogram for database update time

* Make admin log system update run every 5 seconds

* Add a cap to the log queue and a metric for how many times it has been reached

* Add metric for logs sent in a round

* Make cvars out of admin logs queue send delay and cap

* Merge fixes

* Reset some changes

* Add test for adding and getting a single log

* Add tests for bulk adding logs

* Add test for querying logs

* Add CallerArgumentExpression to LogStringHandler methods and test

* Improve UI, fix SQLite, add searching by round

* Add entities to admin logs

* Move distinct after orderby

* Add migrations

* ef core eat my ass

* Add cvar for client logs batch size

* Sort logs from newest to oldest by default

* Merge fixes

* Reorganize tests and add one for date ordering

* Add note to log types to not change their numeric values

* Add impacts to logs, better UI filtering

* Make log add callable from shared for convenience

* Get current round id directly from game ticker

* Revert namespace change for DamageableSystem
2021-11-22 18:49:26 +01:00
mirrorcult
5ba9529414 Damage movespeed (#5244) 2021-11-10 11:06:27 +01:00
mirrorcult
3ab4a30a0f Generalize ReagentUnit into FixedPoint2 and use it for damage calculations (#5151)
* Damage units

* sum ext method
2021-11-03 16:48:03 -07:00