Queuing Up Travel

Small update this week for So Play We All, I spent 2 hours of our 2-6 hour budget. Mostly I was reacquainting myself with the complicated way data feeds back and forth from the iframe showing the worldview to the game.

First, I got some little stuff out of the way:

  1. updated to Rails 3.1.0rc6 for security fixes
  2. awarded some missing badges for signups
  3. write tests for signup badges, as I’ve fixed them twice already :p

Then I worked on letting players travel between cities. I gave all existing players a day of stored travel time and capped players at storing three days at a time.

Next, I added a simple calculation of how how long travel time is between cities. Right now that’s manhattan distance times a constant fudge factor (so the longest trip between cities takes a day or so). This will get more complex in stages: A* pathfinding cost, pathfinding between plats, pathfinding based on equipment (different wagons will be suited to different terrains).

# Here's a quick look at the travel time in seconds between all cities and the first one
> City.all.collect { |c| c.travel_time_to City.first }
 => [0, 32775, 16725, 96975, 73800, 65475, 59475]

I tweaked the worldview to show the player’s current x and y, then spent the rest of the time kicking the tires on the worldview js making sure I understand how it works. I didn’t immediately see how to show the player the travel cost to various cities or know how to add it to the UI, and as I write this I remember my game design notes include planning navigation by routes, so I think I’ll move that off to its own page rather than cram it into the main view of the world.

This was a solid little week. Couple tweaks and updates, and I made a decent start on letting players around the world. Even if the budget is 2h next week (I’m good for up to 6), I’ll think I’ll be able to get that working.

Please vote for Oaqn’s progress towards gameplay in this week’s poll.

No comments yet.

Leave a Reply