# How to store NPC movement data?

In my 2D tile-based game, I have NPCs that move around on a fixed path. I am putting the information about the NPCs in a .plist file that is loaded on startup. The thing is, I'm not sure how to format the data specifying the path that the NPC moves on. What I was thinking was to have an origin property, a horizontalMovement property, and a verticalMovement property, so when the starts at its origin, then walks right the number of tiles specified by horizontalMovement, then walks the number of tiles down specified in verticalMovement, etc. However, this doesn't seem like the best approach. Is there a better way to store the movement data?

• If it doesn't seem like the best approach, what does? There's nothing wrong with that unless you've identified problems. Do what works and don't worry about making things overly complex until you have to. :) – Richard Marskell - Drackir May 23 '13 at 1:33
• @RichardMarskell-Drackir - But my point is that what I am doing may be overly complex and there may be a simpler solution. – pasawaya May 23 '13 at 1:40
• Seems pretty straightforward to me. I suppose a "simpler" option would be to just store all of the tiles on the path individually and move from one to the next. But, that doesn't seem necessary when you can just do what you said in your question. – Richard Marskell - Drackir May 23 '13 at 1:42
• Sounds less like storing and more like implementing. – Caleb Woodman Dec 18 '15 at 0:06