Skip navigation

Category Archives: Progress

Last week, I left off with a sprite on on hex tilemap. I didn’t feel this really entailed “The player starts in the center of hex field“. There was no actual concept of a player or any other sort of entity in the code. Well, this week I have accomplished just that and this task is done. I’ve decided on a three-part model of any given agent in the game.

  1. The entity: A collection of transient and intrinsic properties that contain the data of an agent.
  2. The controller: The brains of the agent. A player controller interprets input from the player to control his agent. A controller issues high-level orders, like move-there and shoot-that, to the agent.
  3. The actor: Takes orders from the controller and translates them to alter the data in the entity, like position, facing, animation, and whatever else it takes.

This structure gives a strict rules in who owns/modifies what. The entity only contains data and no logic. The controller only reads data and issues orders (temporal data only) and contains minimal state. The actor modifies data and only contains only enough logic to carry those orders out. It does no real decision making. The arrangement is fairly object-oriented, but if I wanted to do a data-oriented design, I think this could swing it later.

Next up is “The player can move to adjacent tiles“. This should be pretty simple and is rated a one-point task. Seeing I have a controller and actor for the player, it’s just a matter of getting input from the player and making and interpreting those orders. I’m also going to take a crack at “The player can see that different tiles have different aether densities“. It’s already mostly much done because I have a tilemap being displayed. This task will just be a matter of iterating through the tiles and building an array of tile info. It is also just a one-point task.

This week I did not make a lot of progress. I probably only got 3-4 hours in and most of that was spent struggling with Xcode. Somehow, the project got corrupt? My Hello World compiled and ran last week and this week I try to get a simple tile map running, and the program would never run. It would compile, but whenever it tried to send it to the iPad simulator, it would sort of hang. This is apparently a known issue in the Apple dev forums, but no solution presented worked for me. So, I updated the Cocos2D branch, installed their templates, and made a new project based on one of them. It works now.

I also made a hex tile map and I can load the game with it showing. There isn’t a concept of a “player” yet; no representation on the screen or in the code, so I can’t say the next task is complete. That’s going to be next week. I’m also going to push “The player has a homebase” back to a later sprint. It’s not an intergral part of the gameplay loop to have one, so I’ll focus on that later. That means the next task up to bat will be “The player can move to adjacent tiles“.

Week one, I hope, will be the least exciting of weeks. I got my GitHub repo set up (sorry, I’m keeping this closed source for now), added a clone of the Cocos2D git repository as a subtree of my main project, and got Xcode set up to build Joyride and run a simple hello world. It’s not much to look at, but it scratches “The Player can start the game” of the list. Look!

Hello World!

With Cocos2D sitting in my repository, it should be easier to pull down patches from them, which was a huge pain last time. I’m a little worried though. I made a change to one of the Cocos2D files to remove a warning in Xcode and pulling the latest changes from the Cocos2D git overwrote those changes. I’m hoping it is just because it was binary file and the diff’ing doesn’t work in those cases. It’s something I’ll need to look out for. I think I might also need to look into getting a visual client for git. Working on the command line hasn’t been too bad, but I could see it getting annoying.

The next task is “The player starts in the center of hex field“. This will probably take a full week or two. I have to make some assets in Tiled using hexes. Last time I tried this, support wasn’t 100% in Tiled or Cocos2D for hex tiles, but I’m hoping the last year saw some improvements. There is sample code that has hex tiles, but I remember making some changes to the underlying engine to get it to work the way I wanted. This task has 3 points, just because I expect there might be a lot of little gotchas along the way.