T2G Update : Portfolio Project 2 – Update #1

Hello Blog. It’s been a while since I’ve posted anything on you. Sorry to be away for so long. Lots has happened since I last posted. I’ll start with a post about my studies and the Train2Game course I am doing, at the end of which I plan to be a games developer!

I have been working on Portfolio Project 2 which has proven to be a little trickier than originally thought. Since September 2011 I have come to a finishing point for two of the five tasks. Sprite Blitting and Pathfinding.

I tackled Sprite Blitting to start with and really had to get my head around what it was that was being asked of me. I decided that it was to create a class that could take one image of sprites all various sizes and split them up as required, for example the image would be 100 pixels wide and 20 pixels high and within that would be 20 by 20 pixels of character animating making 5 animations. The code would split the big image up and put the smaller images in to an animation sprite. I had about three attempts at getting the starting point right, but in the end I managed to identify the necessary classes that needed to be created and the files I needed to make the sprite blit animations work successfully. I guess this means a cut down on the number of separate images that need to be supplied for an animation, and the amount of processing required to access the files and store them in memory each time. But I got the code to function and run and now I have four images appearing on screen where only half that amount is image files. The documentation still needs fleshing out a bit, but I felt it was time to move on to the next task.

Pathfinding was the harder of the two so far. I had an understanding first off of what was required, it was how to get the desired result that was the problem. I created a map file that would be loaded and then displayed. At points on that map were start and end positions along with obstacles in the way, and then the player character would be loaded and go from start to end positions avoiding obstacles. Easy!? hahaha.
Getting the Tiles mapped out in to a text file and then having them load to appear on screen was easy enough. The start and end position images were loaded correctly, the player character was loaded and animated just fine. Getting the player character to move from start to end checking for collisions and avoiding obstacles was also fine without any path checking, just trying to go the .x+1 and .y+1 route. What was tricky was implementing the A* algorithm to then work out which tiles the character was best to use to get to the start and end with the least cost involved and avoiding obstacles. I don’t think I had thought hard enough in to the tiles and how they are stored/referenced so I had to do addition workings within the A* code to figure it out. At first I managed to get the character to work out the route, but that was a simple go down three tiles and right 5 tiles. Anything more complex seemed to make the character wander off in all sorts of directions without stopping! I eventually worked out that the heuristics were causing problems and working things out the wrong way round. Values were lower when they should have been higher. So I changed from a Manhattan heuristic to a Euclidian heuristic and managed to get the right result, the character would go from start to end avoiding obstacles perfectly on a semi-complex map. But when you add in major path finding obstacles and paths then the character just seemed to go up and down until it got stuck and then jumped to the goal over everything. Since I had spent a long time getting to this stage I put it on hold with comments in the document of all the improvements I want to make if there is more time, but the overall algorithm works fine.

I’m now on to the third task of Data Serialisation. At first I thought this would just be a case of using the example code supplied and getting it to save as binary, but there seems to be a lot more involved with creating a serialiser and a serialise aspect to the whole thing. It gives examples of XML, YAML and JSON as file type examples that are read and written. I understand what it is saying with regards to these files but I need to research a bit more in to what it is I am to create.

That’s it for now on my studies. The Portfolio Project 2 is coming along (somewhat slower than I’d have liked) but at least I have a schedule in place to help get me back in to the flow of studying more and more. Usually 2 days a week uninterrupted as well as a few evenings.


Warning: count(): Parameter must be an array or an object that implements Countable in /homepages/12/d118927167/htdocs/shadowpuma-afts-blog-v2/wp-includes/class-wp-comment-query.php on line 405

5 thoughts on “T2G Update : Portfolio Project 2 – Update #1”

  1. Hey nice work mate, glad you are making progress!

    I am currently studying the Dev course with T2G also, I have just reached the end of Section 2 Part C, and submitted the last TMA of the section.

    My next steps are tackling the first two portfolio projects, Can I ask kindly if you have any pointers, resources, good links and advice to point me in the right direction for Portfolio Project 02, as at a first glance it looks quite scary and daunting, and I just can not think of how I will tackle these 5 tasks.

    Anyway keep up the good work man, looks good 🙂

    Thanks

    David Gunner Jnr

    1. Hi David. Thanks for reading my blogs 🙂 The first Portfolio Projects can look a bit overwhelming when you first see them, but take your time, read and re-read the project PDFs carefully. My advice is to keep it simple yet detailed.

      So for Portfolio 1, pick a simple idea and go from there. I’m not sure if the projects have changed since I did them, but my document explained how a simple pairs puzzle game would be made. The downside to the Train2Game course is that there are no direct suggestions on resources to look at and use for this. The basics have been covered in the materials supplied but you have to work hard to make sense of it all. The T2G forums are a good place to start but the information is just a guide.

      For portfolio project 2 the task was to create a 2D game. It didn’t have to be the game described in portfolio project 1, but since I’d put all that effort in to creating a game idea why not create it!? So that’s what I did.

      If you are after an example of work from an actual Train2Game student then feel free to look at my work supplied in my (work in progress) Portfolio found at http://games.shadowpuma.com

      I have since finished the Games Developer course and awaiting my certificate of qualification, so if you have any further questions then please let me know.

      Good Luck.

      1. Thanks mate, I will definitely take a look 🙂 I just realised I was actually talking to you at the EuroGamer on the Thursday, I was the one there with my baby 🙂 haha small world. Well done on finishing the course mate hope I can too 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *