Pages

Thursday, February 21, 2013

Visualization of A* Algorithm - Final Version

Actually, I finished this project nearly a month ago but since I'm so lazy lately, I can write a post and put the program here at this moment. You can find more information about this project here my previous blog post.

Since then, all of the improvements were about GUI, adding load maze property and fixing bugs. As a GUI, I added radio button set which is used to replace starting and destination nodes and put obstacles.

After making some tests on the map, I encountered a problem. Since the algorithm can spread on every direction, the scenarios like in the image can create unwanted situations. Technically speaking, this is caused by diagonal search of neighbor nodes.


To avoid that, I added a radio button which enables and disables diagonal movement. Here is the new result of the same scenario. In this case, neighbor search is done only horizontal and vertical directions.


Other than these, I wanted to add an extra property which is loading maze to the map. With it, users can choose predefined mazes according to their difficulties. These are easy maze, medium maze, hard maze and dead-end maze. To do this, I used the idea of tile maps. I created txt files which includes numbers which are 0, 1, 2 and 3. Each of the numbers has its own node type. 0's are the normal nodes, 1 is the starting node, 2 is the destination node and 3's are the obstacle nodes.

0 0 0 0 0 0 0 0 0 0 0 0
 1 0 0 0 0 3 0 0 0 0 0 0 
0 0 0 0 0 3 0 0 0 0 0 0
0 0 0 0 0 3 0 0 0 0 2 0
0 0 0 0 0 3 0 0 0 0 0 0
This is an example of a txt file that includes nodes' information.

On the Java side, I'm going through all numbers in the file with two for loops and prepare the new state of the nodes according to the number that is read from the file.

In the class that I made this project for, as a difference, our professor wanted us to write software design document before starting project. Also at the end of the project, we wrote unit tests and user manual. I have to admit that I really didn't like writing these documents. Also, writing tests for the code that I wrote didn't sound meaningful to me. Maybe the idea for writing tests for others' code would be more meaningful. But, in a very limited time that couldn't be possible.

And of course images of the program:





You can download the executable jar here. Loading maze is not working in this version. Because it is using another folder which has maze files.

Before finishing the post I would like to share the links that gave me idea about how I should set up the GUI and choose colors.
http://www.ccg.leeds.ac.uk/people/j.macgill/xaStar/
http://www.youtube.com/watch?v=FNRfSQDF7TA

Wednesday, February 20, 2013

Game and gamedev websites

In this post, I will write some of my favorite web sites about indie games and game development.

News websites about indie games

Articles/Blogposts
(You can find extremely technical to the very high-level posts in altdevblogaday.)
(Most of the articles requires premium. There are free ones as well.)

Subreddits about games and game development
(There are very useful and awesome posts in these subreddits.)

Friday, February 8, 2013

My first attempt to mobile game development - Crazy Tic-Tac-Toe

There was  a mobile game development conference which was given by the creators of Gideros Mobile. Gideros Mobile is a platform that allows you to make Android and iOS games. And it uses Lua as a scripting language. 

After this conference, I wanted to make something and play it on my phone. That would be a different experience. And I chose Tic-Tac-Toe to start with. Because it doesn't require so many detailed sprites and relatively easy to code. Also it is really convenient to be played in touchscreen devices. Because players just tap on a square that they want to put an X or O.

After I started to develop, I saw that Gideros has a really nice documentation and forum. If you want to start mobile game developing, you should give it a try.

Here are the screenshots of the game: 


In-game images that shows the proceeding of the game.