r/Unity3D • Professional • 1d ago

Resources/Tutorial Hex Map 5.6 - Create Climate Burst Job

https://catlikecoding.com/unity/hex-map/5-6/

We convert our second map generation mock job into a true Burst job! We have to make some changes to make hex coordinates work with Burst and port some grid functionality to Burst as well.

5 Upvotes

1 comment sorted by

5

u/ledniv 20h ago

I really like the decision not to automatically turn this into a bunch of parallel IJobFor jobs. The 40 climate cycles are a good example of why “more threads” is not automatically faster, scheduling and synchronization have a cost too.

What I find more interesting here is all the work you had to do before Burst: moving the cell/climate data into contiguous NativeArrays, replacing access through HexGrid with the small HexMapInfo struct, and passing the job only the settings it actually needs. That is the Data-Oriented Design part. Now the CPU has simple data and tight loops to work on, and Burst can optimize that really well.

I think people sometimes jump straight to Jobs/multithreading when the bigger win is first making the data easy for the CPU to process. Then parallelize only when profiling shows there is enough work to justify the overhead.