Commit 74d7304f

– Extend Python API to support object specific temperature functions
– Add some glue code to the GameState to allow passing of the current tile temperature to the Python side
– Add a very simple WiP implementation on the Python side that just uses the current tile temperature as the object one
– Make the linter happier
– Play around with some constants in regards to temperature propagation through walls (feels more realistic now)

Relates to #61

Hello! While not exactly atomic in nature, this commit is mainly about getting the temperature calculation going. The actual “calculation” as such is simply done assigning the temperature value of an agent’s underlying tile to the object itself, but bulk of the work here was setting up all the right values without getting too much of a performance hit.

The latter can happen since this code is being executed on every tick and calls from C++ land to Python (and vice versa) can end up in more overhead that one may initially anticipate.

To somewhat mitigate this effect the pre-fetched value is being passed when calling to the tick handler from the C++ side, even though the Python API could simply fetch it on its own, in order not to make yet another call on every tick.

You can check out below what that currently looks like:

Next up will be writing some actual logic to make it feel a bit nicer, but I probably won’t get hung up on too many details here, as there is another ticket or two (or three) to be done overall before the temperature topic can be considered more or less done. Bye. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *