Looks like its time to take a trip towards optimization land.
I knocked one of the items off of my list, which was adding some directionality into the path finding to help it out. Then I attempted to process a small pond. This didn't go so well, as it ground to a halt. The problem I was having is that during debug I was saving each image I was processing. 800 tiles produces 200,000 images in a single directory which was a major source of the slowdown.
After fixing this issue, I will still need to increase the performance. I don't want to spend 4-5 hours building the map of a small lake. So far, I have followed the advanced rule of optimization which states
Don't Optimize Yet
You see, I have not done much performance tuning up to this point, although I did optimize the actual process of processing the tile. I think its important to know when to optimize. I'm now to the point where I need to start processing larger maps, so it makes sense to address this issue now. I could have made these changes earlier of course, since I understood where the bottleneck was occurring, but there were more important things to work on.
I may have touched on the optimizations that I need to perform, but what it comes down to is processing the edge tiles at the largest magnification, and processing everything else at a much smaller magnification.
Currently, I am processing each 256 tile at the largest zoom setting into 256 tiles. Each of those tiles is having its borders processed as well. A good first optimization would be to only break a tile down into smaller tiles if it actually has an edge on it. Add in zooming out a few levels, and the performance should increase several orders of magnitude.
Currently it took about 6-7 minutes to process 1200 tiles which was about 1000x1000 feet. Given that even a fairly small lake hear my house is 52,800x 26,400, you can easily understand why this is so important.
On a final note:
After the second run, I had approximately a 4% failure rate. Now I have something to shoot towards beating.
Monday, May 2, 2011
Sunday, May 1, 2011
DotNetFish - A* PathFinding First Pass
It took me a full day to implement, but the map builder can now find a path to an unconnected edge.
The map builder is coming along nicely. I have a few more issues to iron out with the path finding in general that need to be fixed. Once that is done the generation part will be finished for now. Maybe next week I'll be able to hammer out the rest of the path finding.
Current Items of interest
The map builder is coming along nicely. I have a few more issues to iron out with the path finding in general that need to be fixed. Once that is done the generation part will be finished for now. Maybe next week I'll be able to hammer out the rest of the path finding.
Current Items of interest
- Double edge connections. Loops need to be implemented. For example, is tile A has 2 connections on the same side but nowhere to go, then the tile next to it needs to have a loop added to it,this will require some new tiles.
- Need directionality for finding potential matches when looking for target tiles to pathfind to. It should travel away from the starting side first. Only if no potential matches are found should it look behind it.
Friday, March 25, 2011
Appfabric Caching Admin Client
http://mdcadmintool.codeplex.com/Been doing some work with appfabric. One of the things I don't like about it, is the lack of a way to mange the cache with a GUI. Currently, you can only manage your cache and clusters with powershell. One thing that I haven't been able to do is visualize the items inside the cache. But I did find a great solution to this.
http://mdcadmintool.codeplex.com/
The client seems pretty stable, although there are still some issues with it. I hope that the guy that wrote it continues to improve it. Maybe in the future MS will provide a easy to use client but until then, this will have to do.
http://mdcadmintool.codeplex.com/
The client seems pretty stable, although there are still some issues with it. I hope that the guy that wrote it continues to improve it. Maybe in the future MS will provide a easy to use client but until then, this will have to do.
Saturday, March 12, 2011
DotNetFish - We've got MVVM
Just a quick status update. Implemented MVVM pattern for the TileBuilder Project. It was the most time consuming of the WPF projects to do. The other ones should fall quickly now. Won't be able to work on it this weekend, as I am going to do some research(IE real fishing). Real fish taste better anyways.
Sunday, March 6, 2011
DotNetFish .01 and .02 Road Map
.01 roadmap major tasks left to complete
This should give you an idea of what I plan to tackle first. Improving performance of the level designer will probably be the most challenging part of .02. Then again, when you are building stuff that doesn't have any sort of reference, it always takes longer than you think.
- Refactor the WPF projects to use the MVVM pattern (http://msdn.microsoft.com/en-us/magazine/dd419663.aspx) Damn you Billy, and your insistence that I learn patterns!
- Complete the processing of Error tiles in the level designer
- Implement the ability to set a spawn location on the level
- Create the WPF Game client
- Integrate the Physics engine into the project
- Get Boat movement working
- Improve the performance of the level designer
- Implement the fish and fish related behavior
- Implement Lake Depth
- Implement the first fishing method: Casting
This should give you an idea of what I plan to tackle first. Improving performance of the level designer will probably be the most challenging part of .02. Then again, when you are building stuff that doesn't have any sort of reference, it always takes longer than you think.
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
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.
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
- Go to the next error tile
- Check to see if this error tile is actually an edge tile, if not then set it to water or land
- 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.
- 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.
Subscribe to:
Posts (Atom)
