Creating movement path displays in a top-down 2d RTS

Posted by nihohit on Game Development See other posts from Game Development or by nihohit
Published on 2012-05-13T20:56:56Z Indexed on 2012/06/12 22:49 UTC
Read the original article Hit count: 173

Filed under:
|
|

My game is a top-down 2d RTS coded in C# using SFML's libraries. I want that during unit selection, a unit will display it's movement path on the map. Currently, after the path is computed as a list of directions ({left, up,down, down, down, left}, as an example), it's sent to the graphical component to create it's UI equivalent, and here I'm having some problems. current, these I've checked three ways to do it:

  1. compute the size of the image (in the example above it'll be a 3*2 rectangle) and create an invisible rectangle, and then go over the directions list and mark each spot with a visible point, so as to get a continous line. This system is slightly problematic because of the amount of large images that I need to save, but mostly because I have a lot of fine detail onscreen, and a continous line obstructs the view.

  2. again, compute the size of the image, but now create several (let's say 4) invisible images of that size, and then instead of a single continous line I'll switch between the four images, in each will appear only a fourth of the spots, in a way which creates a path animation. This is nicer on the eye, but here the memory demands, and the amount of time needed to compute each such image-loop is significant.

  3. Just create a list of single markers, each on a different spot on the path. This is very quick & easy on memory, but too sparse.

Is there a simple or resource-light system to create path-animations?

© Game Development or respective owner

Related posts about c#

Related posts about rts