Monday, May 2, 2016

Sea Trading Game- Wiring up the Captain

This week has been a behind-the-scenes work, while I've been adding new features, they aren't as showy. Specifically, I've been focusing on the abilities of the crew. These have proven to be more challenging than I thought they would be, but have resulted in a more robust system overall.

The first thing I've focused on is the ability to fish. This falls under the attribute "scavenge".  Scavenge simply put is the ability to use the resources of the land to make ends meet. What will happen is the food will occasionally be increased as one moves. Eventually some tiles will have more fish than others, but for now all tiles are the same. Eventually there will be a land scavenge ability, which will primarily be for water, some for food, and possibly even for goods, but I haven't gotten there yet.

Next I added a crew salary. No longer can one take a ship around the world without some consequences. There is no penalty for negative cash, but it is possible.

Lastly I've focused on the navigation ability. In doing so, I found a few bugs. One was that there was a memory leak such that after moving around for a while, the game would slow to a crawl. That issue has been addressed. Next I've added less than perfect navigation. I'm still tuning it somewhat, but the effect is comical. This is one of the better examples, I've seen instances where the ship essentially goes around the complete board just to go a relatively short distance.


In adding this feature, I noticed a small bug in my pathfinding navigation that was compounded by the abuse that I added in my navigation code. I'm still working on resolving that issue, but when it's done I expect the pathfinding to be smoother. I also plan on adding a preview of the path the ship is expected to take prior to starting the pathfinding. Lastly I added the ability to traverse over land, although it takes a considerable amount of time. This is realistic, as ships are sometimes ported across land to maneuver a small channel.

No comments:

Post a Comment