Advertisement Jump to content
Sign in to follow this  

Mines here and there

This topic is 856 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


In my RTS project I am trying to put roads which the enemy should use extensively. Moving on roads is always better so the player may prefer to use them too. There are several reasons for that but one of them is the pathfinding which is not very good and enemies are "confused" before they leave their base. Also roads can be used to set some attacks from behind. 

But here is another problem - mines. They can be put on the road (and everywhere) and the enemy always will hit them.  Another problem is that many mines means many objects and I dont want too much of them but the roads are the main problem. I was thinking of limiting the number of mines that can be build by the player. The roads are many and is hard to guess where the enemy will pass but once the player is sure it can put a lot of them. Another option is to put enemy sapeurs cleaning them or randomly appearing skill "avoid mine". 

Another thing - when players saper is removed from the region mines will start disappearing. But in that case the enemy may guess there are mines somewhere.

Any other ideas?

Share this post

Link to post
Share on other sites

If an enemy gets killed by a mine on Road X, have enemies avoid that road and use alternative routes.


Here's some ideas: (I'm just making up behavior and probabilities)

70% of the time: use   the best  road to get to the objective
15% of the time: use second-best road to get to the objective
15% of the time: use   a random  road to get to the objective

IF an enemy was destroyed by a mine AND the mine was on a road...
    A) All enemies wanting to use that road need to:
    70% of immediately diverting to other roads.
    20% chance of waiting where they are for N amount of time, before proceeding (giving time for a minesweeper to come)
    10% of going down road anyway.
    And then: B) 
    60% chance of sending a minesweeper and two additional units down that road.
    40% chance of remove the road as a viable enemy AI route (marking it as "dangerous") for N amount of time (instead of sending a minesweeper)
    (no more than two roads should be marked as dangerous at a time)

Share this post

Link to post
Share on other sites

You can make it such that stepping on a mine doesn't necessitate stetting it off.

First, there might be an 80 or 90% chance of setting off the mine by stepping on it unaware, but if the mine is marked the chance of setting it off could be reduced to 10% or something... then you could have enemy units that are able to have a chance of detecting a mine and marking it for other units...


Another choice that could be used to get through mine infested areas if for the enemy to send a mine resistant unit in the front.



You could also mark areas as dangerous when a mine goes off to trigger units to weigh the use of roads in that area less heavily...


If you set it up such that mines that explode nearby mines you could reduce the effectiveness of  clustering large amounts of mines.



I don't know how Dwarf fortress implements it internally, but some units have a tag that allows them to dodge traps and I think most units are able to safely bypass known traps...

maybe you could look into how that system works. 

Share this post

Link to post
Share on other sites

In a human-versus-human game, how would the humans handle it?


Would humans continue to use the road and accept a few random casualties? Would humans find an alternate route? Would humans send an army of cheap disposable troops to trip all the mines?


The AI should probably do the same thing the humans would do in a similar situation.  Whatever makes sense for the game is for that game the AI should be doing.  If there are multiple strategies that are good in the game, the AI should pick between them roughly as players will.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!