Hi! I’m making a grand strategy game and need help with province coloring.
I have a country overlay and an ID map, and each province is not stored in a usual variable—it works a bit differently. Also, each map is a separate sprite, and I want it so that when a province is clicked or captured, the game reads its ID from the ID map and changes the color of just that part of the overlay sprite to match the player’s country.
Basically: click → get province ID → recolor the correct area of the overlay sprite to the player’s color.
If anyone has experience with this and can guide me, please DM me on Discord: @wesetr_43013. Any tips or examples would be really appreciated!
What’s stopping you from changing the colour in the event when the mouse click occurs on a province?
All my provinces are one object, i cant change color of few pixels on the map ( provinces object)
It is hard to get what you need without your event sheet, maybe you can have a look here…to see if it may help how areas are colored.
Does this feature allow changing the color of a specific area of a sprite — in other words, recoloring a particular region on the sprite?
There is no point in showing my event sheet because it only contains very simple logic. The way my system works is:
The player clicks (or touches) the Visual Map object.
Then the ProvinceID variable is set using ReadPixel, specifically ReadPixelRed from the ID Map.
Using this ProvinceID, the system then finds the X and Y coordinates of the province center.
It seems so from the video…but i haven’t tested iit yet.
Personally i would use a custom object with various regions as childs and use the color events by custom object itself.
…also you could try the Color Replace effect…
I need to have 7k provinces ![]()
Are you re-creating Google Maps in Gdevelop?.
No, i am making grand strategy game where you can capture provinces
Its not google mal dude, i have 7k provinces to make the game more interesting
looks unique…
not even steam have a game with 7k provinces.
btw…you gonna need to plan any of your move carefully in event sheet…
cos every action checking 7000 things would send back your rig to preistoric era.
I have a plan, a good one…
I will automatize the process.
Provinces will form regions and player will build not in one province but in 10 at once
then you should dig into c.objects…
it gonna be An Unexpected Journey… ![]()
Hearts of iron 4 ~ 14k
Age of history 3 ~ 12k
I need someone to create an extension to color exact area on the sprite
oh…i have hearts of iron…14k? you sure? …isn’t a earth map?
Have you checked this:
Btw good luck for the project.
Ill try this, thank you for help
Wait, what? So are provinces a small number of pixels each? When you click, how do you determine what pixels make up a province?
If it’s a small number of pixels you could use a shape painter object to draw over the pixels making up a province.
Remember Command and Conquer map?
From how he explained it on discord i think he believes there is some way to determine portion of province by ID variable (JUST ID and NOTHING determining shape/size/dimensions/edges/borders)
Not realizing they in fact are separate objects
I have an ID map, every province has own RGB color. And I get the ID with help of ReadPixels
I have thought quite a bit about your project/issue…
Trust your community, that there is a good point in showing your events (and/or related data structures). People trying to help you are playing a guessing-game here.
Eager to help - sounds like a cool project ![]()

