Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Is there a simple way to add terrain modifiers?

I want to add cover and terrain bonuses to my game, but I really am lost on how the best way to approach this is. My main idea was just to make some invisible nodes in the play area and just assign them a terrain type that can then be parsed into an integer based on the name value of the "tile." Sounds like a lot of work so I thought I would ask for suggestions.
1505167846
The Aaron
Pro
API Scripter
Can you enumerate the types of terrain and cover bonuses you have in mind?  That would make it easier to think about...
I just add ?{other modifiers?|0} to the macros and tell them "That guy has 75% cover so go with -4."
 Too disruptive to the flow of combat. Rather just not use it than devote time to it, even if it is seconds. That is the whole point of what I am doing is eliminate tedium from "the game" so we can focus on the actual game.
1505402954
The Aaron
Pro
API Scripter
So, assuming you're doing DnD 5e, there would be: Cover: None 1/2 3/4 Full Terrain: Normal Difficult Impassible Terrain would be a function of the square you are in or trying to move across, so you'd need to detect the position of the token, or the route it's attempting to follow.  Look at "It's a Trap" for some similar operations.  You'd then adjust the available movement, or the position of the token based on how far they did move vs could move, etc. For Cover, it's more difficult.   Cover is really a function of the path between the attacker and the target.  You'd need a way to mark those things and a way to check them.  The easiest marking is probably drawing lines on the GM layer.  Let the color denote the type of cover.  When you need to calculate cover, use a ray-casting method to find all the lines that are intersected by a line drawn between the source and destination, then consult their colors for the types of cover.  Then you have to decide on rules for combining them. The simplest would be to just take the highest cover encountered, but you might like to have multiple layers of 1/2 cover add up to 3/4 cover, and multiple layers of 3/4 cover add up to full cover.   The REALLY hard part is that you need that information to be available before an attack is considered.  Probably the way you'd do this in Roll20 is by calculating it for all tokens that are in the turn order from the token at the top of the turn order, then add it as a bonus to the AC of each of those tokens until the turn order changes.  If you're in control of all the macros and character sheets, you could add it as an additional attribute that gets added into the token, and you could do some caching based on location so you don't have to recalculate between two tokens that haven't moved. Hope that helps.
I think you will find <al e.>'s suggestion by far the simplest way to do this, the more you play the quicker the estimation will come to you. It doesn't have to be perfect every time, just suitable to the story you are trying to tell.
1505762572
Lithl
Pro
Sheet Author
API Scripter
The Aaron said: When you need to calculate cover, use a ray-casting method to find all the lines that are intersected by a line drawn between the source and destination, then consult their colors for the types of cover. A winding number algorithm will be more correct than ray-casting (winding number will correctly handle a token within the overlapping section of a complex polygon, and a token on a polygon's edge, while ray-casting won't), and there are implementations of winding number that are as fast as or faster than ray-casting.
Yea, too complex to implement. I will just use parse another mod into the script and tell them the modifier the target has. It will more often be null so its no biggie, just an extra click in combat.