Week 6 Game Engine Progress

Grass And Sand Details
Image showing the detail tiles for the grass and sand

Game Engine Work:

This week I continued working on the generation of the 2D map for the game. I decided it was a lot of extra work, working out all the special cases. So, I decided to simplify the map and make a smoothing algorithm. I basically am checking anywhere on the map where a tile is surrounded by another color tile or where 3 sides are surrounded by another color tile. If that is the case, then I replace the tile with the color around it. As far as I can tell this seems to eliminate some of the special cases and allows me to make less tiles. It basically removes any areas where there was a single tile jutting out into another color. It also eliminated areas where a single tile was inside another area. For instance, one sand tile in the grass area.

I also did some work on collision detection. I added the code for collision detection of tiles by adding a Boolean variable to check if the player is moving into a certain tile. For now, I tested it using water tiles. So, the player could not walk into the water. I disabled it for testing the rest of the map generation for now. But, in the future I will use the collision detection function to test entities on the map like trees, rocks, stumps, etc. I plan on working on implementing some of that work this coming week. I will also be working on an entities class that will use similar collision detection to the tiles.

Game Art Work:

Water Tiles Animated Separated
Image showing the different tiles that would be used for the water tile animation

This week I decided to work on some Animated Water Tiles. I was able to get them very close to the way I think I want them. The only thing that is bothering me is that the water would only animate in one direction. This can be seen below. If the image is not animated click on the image and you should be able to see the animation. I may want to change that in the future.

Animated Water Tile Animation
Animated Water Tile Animation

I also worked on adding some grass and sand details. If you look at the map image at the top, you can see some of the grass and flower detail tiles. I only worked on details that would not need collision with the player. In the near future I will add animated grass and other interactable tiles. I added a few sand details, but I would like to add some shells or other objects to make it look better and have the player be able to interact with these as well. For now, the details are just picked at random from tiles that are not edges. But I will probably work on a different algorithm for placing these better and in clumps. More than likely I will need to use an algorithm for a cellular automata for this.

Work Planned for the Upcoming Week:

I want to work on coding the Animated Tile Class. Then I should be able to implement the animated water tiles to the map generation. Additionally, I would like to work on elevation change tiles that I can use to change heights on the map. I would also like to create an entities class that can be used for interactable objects like stumps, tall grass, etc. In order to accomplish this I believe I need another rendering system for these as they will be above the map tiles. I have a lot of coding ahead of me and probably a lot of error checking, but I am hopeful that I can complete this work this week. Until next time.

Leave a Comment

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