Finally got selectable provinces working in my procedural map game!

https://video.gamerstavern.online/w/wGhkYRCTJs98dE7ULC3EYn

After a lot of tech torture, I finally got selectable provinces working in my map game! The way it works is the script checks the position of a mouse click on the collision mesh of the map against an image of the province map (which is dynamic and can be updated at runtime), which will select the corresponding province associated with that colour. This information is also passed to a shader which highlights the province on the map.

I spent way too long messing around with raycasting before I realised that Godot's _on_input_event signal does all the heavy lifting for you...

50 points · 3 comments · view on lemmy.world

3 Comments

GandalftheBlack@feddit.org · 6 pts · 168d

Also realised I used the same map seed as last time, I promise it's procedurally generated...

sbeak@sopuli.xyz · 5 pts · 168d (1 reply)

yooo that's sick!

GandalftheBlack@feddit.org · 3 pts · 168d

Thanks!