Heatmap-To-Vector Flow Field Convolution


J.Koher 2023-01-29 14:26 (Edited)

**UPDATE: now with user's choice of 4-way or 8-way movement/ diagonal counting designations**

This program develops a goal-based heatmap and vector flow field. The green alien character is set to register as a target cell and the stylized block is a hard-block obstacle. Of course, you can have more than one target, but don't get carried away as it's not written for the edge-cases where there are lots of targets spread out over large maps. The counting scheme is '+1' on the cardinals, and you can now choose between '+rt(2)' and '+2' on the diagonals. The convolution used for the '+2' diag. counting regime won't yield diagonal vectors as it is built for the 4-way motion designation.

J.Koher 2023-01-29 16:40

Sorry, I keep screwing up the screenshot trying new things.

Timo 2023-01-29 20:05

Desktop: Ctrl + s
iOS: Ingame menu “Capture Program Icon”

J.Koher 2023-01-29 21:07

Thank you, but using Windows10 I just get "SCREENSHOT ERROR" in-program using Ctrl + s. Probably a bug on my end as the Windows shortcut key method, Window button + Shift + S, only works occasionally for some reason, but the full screen method works fine... Yeah, idk. I suppose I'll just have to upload from my iphone to get good screenshots

Timo 2023-01-30 08:01

Hm, maybe the application cannot access the Desktop folder. Some new security thing of Windows 10? (I'm a Mac user and don't know a lot about Windows)

McPepic 2023-02-02 16:22

Cool! I imagine it could be easily modified to be used for pathfinding on an AI.

J.Koher 2023-02-03 21:04

Thank you!
Yes, I created it for use with goal-based AI. Of course, it could be further tailored to meet particular game requirements. I use a weighted-average of the Heat Value Min.s' vector-equivalents (based on their relative positions around the seed) approach to develop the vectors with a simple patch-filter to fill in any zero value vector spaces after the first full pass. I plan on making a more 'organic' convolution that ensures hard environmental blocks are better steered away from. It is set up so that one can change the map size and shape as well as the diagonal distance counting scheme (var. DIAG_DIST) to match the type of movements allowed in-game. I am working on making the vector field origin dynamic so that it can be set to the relevant section of the Source BG for the game state; ie, different levels,scroll positions, etc.

G-9 2023-02-04 13:14

you can enter the walls by going diagonally in it :D

Log in to reply.