Sunday, December 28, 2014

My greatest enemy was my "Enemy.cs"

Tell me, what does this line mean to you?
probably not an awful lot. Well to me, it means the very source of a lot of pain and frustration over the past few days. Let me explain:
What I tried to do was spawn some random enemies in my rooms. Well that went perfectly well, enemies spawned in my rooms without a problem. Then, I let the enemies follow the player around which I had working quite quickly. So, the only thing left was for the enemies to remember the last position they were when the player leaves the room.
So basically, I tried to save the enemy position into the class that defines the 'room' the player left. BUT.... I discovered that this position wasn't only saved in the room the player left, but also the new room the player entered. In other words, the enemy was at the same coordinates in every room somehow. I was completely sure that I modified the right enemy and the right room so that wasn't the problem. So what could it be?
Well that question bothered me since christmas, until today. That brings us back to:
Because what I thought is that I could use this line to load new enemies into my game. So basically, every room had a list of these randomly loaded enemies. But what actually happened was that every room basically pointed to the same exact enemy, namingly the one that I loaded in the line of code above. In other words, if I changed the position of the enemy in one room, that position would be changed in all the other rooms as well because they all basically pointed to the same exact enemy!

And like that the days of insanity ended and I finally figured out why nothing worked like I expected it to work...

So, the progress I made this week was:
- add a key and a locked door to each dungeon floor
- add enemies to the rooms in the dungeon
- export the project to a mobile phone

doesn't seem like much, but trust me... it was quite some work to make it work properly. Hopefully I'll have a fighting screen ready by next week.

For questions, feedback or requests I can always be reached at:
indiestepsblog@gmail.com

Monday, December 22, 2014

A good start so far

First of all, this blogpost is a day late because I... kinda... forgot.
Anyway, I did make some good progress this week. For the coming two weeks I'll probably be able to make some good progress because I have a few weeks off for the holidays. Speaking of which, I wish you all a merry christmas!

So... what's new? Well first of all I found an artist willing to make some artwork for my next project! So stay tuned for some concept art in the coming weeks. On the technical side of things, I managed to make an algorithm that generates a dungeon of connected chambers. These chambers are randomly picked from a selection of predefined text files from which the program can build the levels and the logic behind them. In other words, a chamber is nothing more than a text file in which I can define different kinds of tiles.
Well getting all of that to work on the PC proved relatively easy. I had it working quite quickly without too much trouble. But when I tried to port it to a mobile version using Unity, the real trouble came.

Where the program worked perfectly on the PC, the mobile version didn't do anything all of a sudden. It was supposed to draw the level the player was in, but nothing appeared on the screen. I spent pretty much the whole day yesterday trying to make it work on my phone. The trouble was basically in the reading of the files. Apparantly on PC you can access all the folders without a problem to read files or load data. But on mobile, things have to be in a seperate Resources folder to work. That also meant that I had to use a different method to read my files. Where I could read the file line for line on PC, I had to load in all the text in the file at once on the mobile version. This caused trouble it seemed. While in theory it shouldn't really make a difference, in practice it was the bane of all my troubles. Because apparantly in one of my text files the linebreaks were saved differently! Note that you can't actually "see" what kind of linebreaks are used in a file(yes, apparantly there are differences). So what happened was that in one of the level files the "linebreak" was defined as '\n' which is pretty standard in programming. But in another the linebreak was defined as '\r\n' for whatever reason(maybe because it was saved in a different program?). This caused a lot of trouble because all of a sudden I had all these weird '\r' characters in my lines which caused the program to crash on my mobile phone. To find that little mistake cost me pretty much the whole day yesterday... But the good news is that I got it working on my phone! This first build only involves you moving the character through a randomly generated maze. No objectives or obstacles yet, I'll be working on that later this week probably.

For questions, feedback or requests I can always be reached at:
indiestepsblog@gmail.com

Sunday, December 14, 2014

Path of Vision

This blogpost I'd like to talk a bit about my newest project. I want to make a mobile game this time around since I feel that I have nothing worthwhile to play on my phone. So the only way to fix that is to make a game myself!

The idea for this game came to me in a whim really. It's strange how ideas sometimes just pop into your head randomly. But as I thought about it and shaped it into form in my head I started to love the idea so much that I decided to make it into a reality. So what is this idea? Well, on the surface it's nothing new really. I want to make a roguelike game which is completely focused on mobile devices. I wanted it to be easy to pick up and play and moreover you shouldn't have to feel impaired by playing on a mobile phone. The game had to fully embrace the tiny screen of the phone and its features.

The game is completely grid-based. This means that every step you take moves your character one grid square. You can move your character around by swiping in the direction you wish to go. On every floor you need to find the exit and the key to open it. But in your way stand several monsters which chase you around. If you collide with a monster you are taken to a different screen, the combat screen. The layout will be someting like this:


And really, this is where the game is gonna shine I feel. If your enemy attacks you a blue shield appears with a timer in it. If you press that shield before the timer runs out you successfully block an attack. If you fail to press the shield in time, you take damage. Now this may seem easy, but imagine if many shields appear all over your screen and you need to press them all within about 2 seconds.
To perform an attack yourself you need to press that red attack circle in the bottom-right corner. Different weapons you have equipped could result in different ways to attack. Think for instance that for a two-handed weapon you would need to press two buttons simultaneously, thus needing two fingers to attack.

This is just a brief description of what I would like to do next. I am already working on the framework behind it and the basic workings are there. Hopefully I can show you some screenshots next week.

For questions, feedback or requests I can always be reached at:
indiestepsblog@gmail.com

Sunday, December 7, 2014

A new project!

I decided to finish off Cube Blast for what it's worth. I found some great sites for free music and sound effects, so I managed to find and add some decent sound to the game! I haven't changed that much since the last update really. Aside from the audio I added some bonus rounds in there which double your score to make the game a bit easier. I am quite pleased with the result, Cube Blast came out to be a fun waste of time but most of all it made me understand the workings of Unity. Thanks to Cube Blast I'll be able to do a lot of my future projects in the Unity engine which allows me to port games a lot of different platforms.
The final version of Cube Blast can be played here:
http://gamejolt.com/games/arcade/cube-blast/36412/

So what's next? Well I'd like to try and make a mobile game this time. I feel like I don't really have any fun or engaging games to play on my phone, so I decided to make my own. I plan to make an easy to get into roguelike/roguelite (whichever you prefer) game for mobile devices. Later this week I'll get into more detail about the idea.
As for this coming week, I'll be doing a bit of research on some subjects I'll need to use for my next game(procedural generation mainly) plus I'll try and finish the design document.

For questions, feedback or requests I can always be reached at:
indiestepsblog@gmail.com