How to create localised 'temperature' zones like Divisions' Survival mode

Hi, I posted on the unreal subreddit but have had limited responses so far.

Essentially I want to have areas (every 50m or so) across my map with different temperatures, like in Divisions Survival mode, so going up a mountain starts getting colder, down on the plains is warmer. The first thing I tried was a blueprint with a trigger volume, upon overlap cast to CharacterBP and set the ZoneTemp variable. This does work exactly how I want, but I want my map to be 50 square kilometers, so having to place every single one of these and set each temperature seems like a massive pain.

The idea that I came up with was to use a texture of the whole map with a gray scale image of where I wanted temperatures, the lighter it is the warmer it is, the darker it is the colder it is. Then just convert player location into UV coordinates and see what colour was at that pixel location. This would then update every 5 seconds or so. It made sense in my head, but upon giving it a go, I have no idea how to grab that pixel colour.

On the subreddit someone gave me the idea of using something similar to lightprobes which would then be all across my level that could then get a value somehow, then the character could interpolate between these values to see what the average temp was in that location, but with no documentation on something like this I have absolutely now idea where to start.

If anyone can give me a steer in the right direction to use either of these 2 solutions (or has an idea of any other solutions) that would be great, just a little bit stuck at the moment!

Hi !

I don’t know the reference but if you need the temperature for your gameplay (not materials), and it is only based on the height of your environment, can’t you just use the Z location of your player to determine the temperature ?

For the pixel solution, here is a thread that can help you.

The “lightprobe” solution could be a solution indeed if you want more control but it will be a little hard indeed. I don’t know how it exactly works under the hood but here are my thoughts :

  • You could start by creating a “Probe” class (that will contain the temperature you want), then, you will have to place them everywhere in area of interest.
  • Make a system to get the closest probes around your player.
  • Use maths (it should be something like SumOf(ProbeTemperature*Weight) with Weight that is calculated by the distance between the Player and the Probe) to get a linear interpolation of what should be the temperature between for the player. (I just make a little search and found something about what I was trying to explain : this post may help you)

The system to get the closest probe each frame may be heavy if not thought correctly. You will probably have to create a smart network system between the probes (for example, each node know its neighbors and can provide fast access). This kind of stuff could be auto-calculated and cached while in editor by using some editor callable functions.
Or you may want to go to a simplest solution by just setting a volume around your player and check the probes that are in the volume (thus, PhysX will do the job for you), but you will still have to fallback to another solution if there is no probe where the player is.

You can also simplify the system by making a network probe “2D”, that do not take the height in consideration, only the position along (X,Y).

I hope it will help you

Since it was interesting, I searched for more informations and found this, maybe it will help you to your implementation.

You can blend your temperature over time to get a more natural changes. You define a target value and just update your current value to smoothly changes to it in the Tick.

I was thinking I wanted more localised areas, but it would mainly related to height I guess. I really did want more of a controllable solution. For example in a town which is sheltered would be warmer than out in a field. But if I can’t get a better solution it may be one to look up more. Thanks.

Amazing! Thank you for the responses. I will see what I can implement, but that has been massively helpful!

Why Overcomplicate things? Think Simple. Use Big Volumes (think like Bioms, whole Regions) for a General Temparture. And Smaller more localized ones that Add/Remove Temparature with a Optional Falloff fom the center of the Volume. Or any secondary use you have like only Hot at 17pm-20pm because some natural Event etc.

In a Nutshell get all overlapping Temparture Volumes. Sum up their Temparture Values = Final Temparture. Add some globals like Time of Day Multipliers, Weather and fluctuation over Time and you are done and dont have to place Cubes on a Grid in Masses.

Some big Ones and a Couple local ones thats Manageble by Hand even on 50km² and Easy to customize and Control. Implementation is just simple Math and not heavy on Performance.

1 Like

Thanks for this reply.

I think this is probably the best way to go after doing more research. I just didn’t want it to be exactly like Division going from -10 suddenly to -35, it seemed unnatural, but then I was thinking too small. This seems like a happy compromise. I like the idea of biomes mixed with global variables, weather and local areas. Cheers!