How can i make the player able to paint terrian and make ai prefer certain material?

hi so i wanna make a rts game i want the player to be able to paint the terrain like the city builders games and such and the player can paint like asphalt material on terrain and the ai will prefer it when pathfinding so they walk more on it