For example, i have difference regions in my level and i bake them into a texture. For a given location, I need to know which region it belongs to. So i need a texture sampling api.
Any blueprint api for texture sampling? If there is not, what is the proper way to achieve this?
Hi there, if you want to divide location data into more granular location info (metadata, Region, Area, Town, Village, Continent etc) can be mix and match of many techniques.
However the main idea is to have data coralated with the map itself.
Approach Manual, Raster Masks : You have an image of map and you can sample R G B channels manually with different data or have multiple data textures. Player location is coralated with these extracting metadata of it.
Voronoi Maps : Voronoi tessellation having multiple definations of actors that generate a region without human intervention which is very fast quite reliable however can be topogically not so accurate sometimes and can be harder to control if you have an over the top map.
Uniform grid : You can uniform grid 64x64 and tell what data each grid has and resolve player position to that. You can do this without textures like in raster masks.
Voxelization : Another technique using voxelization but needs baking etc to the world.
Automaps and logical abstract regions : This is something I made which is experimental. This simply gets border data points from a spline, creates a polygonmesh for that region and all region meshes combined with correct polyon ids. So polygon ids coralated directly with metadata. When a location info is needed, player location resolved into mesh coordinate and a trace is made to the mesh returning polygon id which gives area,location,region data and changes detected and events occur if location data changes for player etc.. It is experimental however works nice as design.
Let us know how your game is?
Open World? Loaded Levels?
You only need regions? or there is regions, subregions, underground locations etc?
Is your map dyamic, changing or updating a lot etc?
Give us the details so we can point out the proper solution.