Sunday, March 6, 2011

DotNetFish - Horseshoes and Hand Grenades

I've been able to make a little progress this weekend. To start with, I changed the datatype of the edge points from a Point, to a list of bytes. This was necessary because eventually you might see tiles that have mroe than two edge points, and it was also needed for the next change I made, which was the edge tile will now check the surrounding tiles to see if they have any edges it needs to line up with.

This change makes the map look quite a bit better, as most of the tiles connect properly. However, I still have quite a few tiles that are showing up as an error tile. This is where the old saying that close only counts in horseshoes and hand grenades. I'm close, but that's not good enough for me. I really would like to have 99.999% of the tiles be correct. This calls for me to implement one final feature of the generator process, and that is pathfinding.  Here is what I plan to do


  1. Go to the next error tile
  2. Check to see if this error tile is actually an edge tile, if not then set it to water or land
  3. If it is an edge tile, find a path from the edge connector around it to the closest edge tile that has an open edge. 
  4. Convert the tiles along the path into edge tiles 

Before                           After


Orange Tiles are Edge Tiles, Red lines are edge connection points


I ran a test this morning, and I think that this is the last large change I need to make in order to get the map looking good.

I also sat down for a few minutes, and thought a bit about the road map for release .01 and release .02. I made a significant change to .01, in that I moved the ability to cast for fish into .02. I did this because there is a whole host of logic that needs to be implemented related to casting, such as fish and their behavior, lake depth, etc. I'd rather be able to get .01 out without those features.

Tuesday, March 1, 2011

DotNetFish - Quick Update

Got the color matching to work now, so the correct tile should be selected in that regard. Next on my list is working on getting the rest of the tiles to line up properly.

Sunday, February 27, 2011

DotNetFish - Status Update

I was able to get some work done with DotNetFish over the weekend. This was the first weekend in almost a month that I was able to work on the project. If you remember from my last post, I had a short bucket list of items that I needed to implement. First on the list is getting the edge tiles land/water orientation to be correct. Here is how I planned to implement this.

  • Each map graphics tile would need to know if its edge was water/land or contains both.
  • when determining which tile to place, I need to check the edges to determine a match
Its funny how something that seems simple, takes so much longer. After modifying the client to accept the new graphics tile I needed to re-write the .csv file to inclued the edge type information. This proved to be an repetitive task. After fiddling with it for a bit, I decided that using an xml file would work much better. After thinking about it even more, I decided that having a program generate the xml file would work even better. So, I wrote a new application called maptilebuilder that processes a .png file. It steps through each tile in the image and allows you to manually set the edge points as well as the edge type. A future improvement would be to have it generate the xml file with minimal input, but that can wait.

So, even though I only got step 1a finished, it still is progress. I've got all of the changes in place for the second step, I just need to finish the code that chooses based on the edge type. 


Thursday, February 10, 2011

DotNetFish - When Progress Hurts

Spent some time working on the project recently. I was able to implement the following features

  • Level editor now displays the map properly
  • You can use the arrow keys to scroll around the map
Its great to be able to finally visualize how the map actually looks. The downside, is that now I know how bad the map actually looks. Being able to view the tiles has brought several problems to my attention. Here are the things I need to get fixed.
  • Need to get the land/water on the edge tiles to orientate properly.
  • Need to figure out why the tiles don't match the area I selected
  • Need to improve the tile selection process
Those are the three pressing issues. Hopefully next time progress wont hurt so much!

You can grab the latest from https://github.com/aaronmell/DotNetFish/

Friday, January 28, 2011

DotNetFish - Lack of Motivation

Its been hard to get motivated to work on the project lately. I was sick with the stomach flu at the first of the month, and that really took the wind out of my sails. However, I was able to get one more thing working. Maps are now saved after creation, and can be loaded.

Here is a short rundown of the most critical tasks I need to finish
  • I need to get tile rendering completed on the editor. Once I have this done, I will be able to view the map.
  • I need to create a way to define a spawn point on the map.
Once I finish those two tasks on the editor. I will be able to commence work on the client. Here's the short list of what I need to do there.
  • Get the rendering completed
  • Get the boat to move
  • Get the boat to be able to fish
Once I've got that done, I should have a minimally viable product for testing. This means that I will have a full tool chain, and can start implementing features. There are a few other things that I need to work on though

  • Need to refactor the tile creation process to take into account the start and end points of land
  • Need to refactor all of the WPF projects to use a pattern for the UI. Will either use MVP or MVVM pattern
The game solution will probably not be refactored to use MVP or MVVM, because I plan to use it from the start, and it should be simple to go back and get the others done. Its just a bit tedious, and that sucks the motivation right out of you when things are tedious. 

Hopefully February will be a better month.

Sunday, January 9, 2011

DotNetFish - Progress is being made

You just can't see it yet. I got the first iteration of the tiling process push to github. However, it is still rough. I added a few safeguards to show a red tile if there was an error, just so I could get some other work done. The initial map tiler does the following logic to assign a tile to an edge. I have a csv file that defines the edge points for each tile in the tileset. 1. check the edges for changes between water and land. 2. take these points and convert them to the 12 possible points that can be used on a tile. 3. find the tile that matches those 2 points and assign that tile to the arraylist There are a couple of problems with this that I have found. 1. It might be possible to have more or less than 2 edges. This can be an issue with really small streams having 2 edges, and also some tiles with water on the edge only have 1 edge depending on the color. So any tiles like that will be red. I will probably need to add some 2 edge tiles, but that can be a future improvement. Dealing with 1 edge tiles is more tricky, and I haven't figured out a good method to deal with them yet, other than expanding the range of colors that count as water. 2. Edge tiles might not match up properly. The next iteration needs to do things differently. Right now it doesn't check the surrounding tiles to see where its edges are. It needs to do this, and if a surrounding tile has an edge, it needs to use it first. This should prevent any issues with tiles not lining up properly, as long as the CSV file is correct. (I probably need to write a small program to generate the CSV automatically). The next step is to get the Editor to save/load the map, and get it to show the map in the editor. Once I get the tiler finished, I'll try to put up another post showing how that works in code.

Saturday, January 1, 2011

DotNetFish - A Change of Course

Last night I was looking at some data. My goal is to provide a map that is very close to the actual size of the lake. I came to a very cold and clear realization, that the map tiler as a stand alone piece of software will never work in that regard. This holds very true when you look at larger lakes in the US such as Sam Rayburn in Texas. Don't even ask about how big lake superior is(huge!). I always thought that it would be nice to allow the user to be able to import a map they draw into the program, but I don't think this is feasible. Besides, if I want this game to be as realistic as possible, then I want to be able to fish on real lakes. So, with that being said, I'm going to remove the MapTiler project completely, and integrate it into the Level Designer, where is should have been all along. I hope, and this is a big hope, that the Gmap controls for WPF are just as easy to use. The work I posted yesterday won't be lost though. I will reuse nearly all of it. The only different is that I will remove the black to white step, and no longer be saving an image. So I am removing a step here, which is always good. It has been said that it is hard to design a simple solution. I can definitely agree with that. Hopefully, the solution I have now is 1 step simpler than the last one. *Update* If you check out github, MapTiler is now gone, and all of the code has been integrated into Level Designer. It compiles, but that's about it. By the end of the day tomorrow, I should have level designer sorted out, and have it actually outputting some useful data.