Radius Indicators / Drawing Simple Geometry

So this isn’t the first time I’ve posted this kind of question. But I’m really hoping that this time I get some good feedback.

In some tactical games, it’s important that the player be allowed to draw an arc - usually this kind of command does something like “shoot a bad guy if one shows up within this arc” - the old combat mission series did this, and IIRC frozen synapse also did aim arcs.

Visually, this looks something like: http://i224.photobucket.com/albums/dd194/vinnart/180arc2.jpg where the user can drag to expand/contract the size of the arc.

My current understanding of the unity engine leaves me thinking that the best way to achieve something like this would be to generate an arc mesh and apply a transparent renderer to it. Is this really the best way to accomplish something like that?

Also: http://media.pcgamer.com/files/2010/06/CIVLIZATION-V-E3-2010-BattleLine.jpg

Drawing some kind of ‘border’ marker on the ground - this would be accomplished by generating a spline mesh right?

At this point, I’m capable of doing both (finally) - but I’m hoping there is some easier way to represent simple semi transparent polygons.

I don’t know of an easier way, but creating an arc mesh should be relatively straightforward if you know the Mesh class.

–Eric

Perhaps relatively straightforward. I think it starts to get ugly once you start getting into interacting with terrain and stuff.

But thanks for the confirmation that the ‘correct’ approach to this is mesh generation.

If you want the arc mesh on a terrain, then it would be easier, but not necessarily faster, to create an arc texture and use a projector.

–Eric

would it be possible to control the size and shape of an arc using a projector and texture? how would you go from covering 45 degrees to covering 180?

You’d adjust the arc texture on the fly as needed.

–Eric

you mean to literally redraw the texture? Is that really a reasonable possibility at 60 fps?

Thanks again Eric, you’re always helpful.

Also - whats the preferred method for highlighting squares/hexes in a tactical game? Is that generally done purely with projectors or?

Something like this: http://www.blogcdn.com/news.bigdownload.com/media/2010/05/kingsbountysept15.jpg

would just be a set of projectors over each highlighted hex with another projector setting the outlines?

I’m thinking that with hex/highlights it’s probably easier to just have individual hex meshes rather than apply a visual ‘overlay’ to the unity terrain engine.