Get Rect II: The Rectening (Recterrection)
Sander Sats
A 2D sidescrolling platformer game about the adventures of a Jolly Rectangle trying to survive in a basement of crazy calamities. Ofcourse the adventures themselves probably won't be so jolly. The game will be developed in Unity and ideally the world will be procedurally generated with maybe some handcrafted boss fights but we'll see how that works out.
Milestone 1 (20.09)
- Set up unity project (1h)
- Create initial world for development (1h)
- Create main character with basic movement (3h)
- Create one placeholder enemy (2h)
Setting up the project was pretty easy - I tried to do some reading on what type of initial project I should choose, but there were a lot of opinions so I just went with the defautl 2D project.
For the assets I chose Free Platform Game Assets package from the asset store. The world is created through a tiling grid using those assets.
The player and enemy sprites are also taken from that asset package.
I implemented basic movement and jumping for the player character and a very simple AI for the enemy which starts following the player if it gets close and otherwise just stands there staring.
Build file: Attach:build-m1.zip
Milestone 2 (04.10)
- Add attack animation for the player (2h)
- Add attack animation for the enemy (1h)
- Create player health display (2h)
- Investigate how to do skeletal animation (and implement walking for player if possible) (2h)
My life went a bit wild for the past month (plenty of excuses, not gonna count them here) so I haven't worked on this project for a long time.
I spent a loooot of time trying to get the skeletal animations working, but all the documentation I could find was for some older versions of unity or some importing from Photoshop etc. So I spent a lot of time on it but got nowhere and went back to the regular unity animations.
I implemented attack animations and attacking, also added the player health display.
I also added temporary invulnerability period for the player after getting hit (turns blue).
Build file: Attach:build-m2.zip
Milestone 5 (15.11)
- Add procedural world generation (7h)
Implementing procedural world generation turned out to me quite a bit more difficult than I had anticipated. I tried multiple approaches - initially I tried to do it with random walk algorithm, but quickly discovered that while this works really well for top-down 2D games, it's not great for side-scrollers as you can easily end up with a world that is not traversible.
Then I tried to do it with binary space partioning. This approach was more fruitful as there is more control about the size and shape of the platforms but I still had to write a lot of after-handling code to make sure the world is traversable (and sometimes it still isn't).
Another huge issue turned out to be the sprite mapping - getting the correct textures on the world. A lot of issues arose from converting world position to cell position. Without the conversion, the map looks better, but other things get funky. When doing the conversion, the other game stuff runs nicely, but the sprite mapping gets screwy.
I also tried with custom rule sprites to fix this rendering issue, but somehow my grid doesn't match the sprites (though my current tilemap does) and ran out of trial-error time to figure out what is wrong.
So this is how the generation works: when the player walks to a specified distance from the rendered world, it gets destroyed. And when there is not enough distance between the player and the world, then another section gets generated through binary space partitioning (the space gets split and floors get drawn). After the space partitioning, the rooms are connected through slopes (as the platforms will not be on the same level mostly) and the lowest level gets the gaps filled in.
Milestone 6 (29.11)
- Add two more enemy types (4h)
- Add projectile weapon for the player (3h)
- Fix tile rendering
All of the things that I had planned took longer than I anticipated. At first I tried to look for some sprites in the unity asset store, but it was slim pickings. I tried this package: https://assetstore.unity.com/packages/2d/characters/free-2d-fantasy-characters-easy-to-rig-214009 as it used bones for animation, which I tried to do myself but failed in previous milestones. Messed around with for a while but couldn't get it to work with monstrosity of spaghetti code that I have created. So in my despair, I turned to my old pal Paint and quickly threw up some simple sprites. Created one long ranged immobile enemy and one fast but very short range. Spent a lot of time fidgeting with the angles to get the ranged enemy to fire correctly because the movement controller script I got from the internet has some weird character flipping which messes up all the angle functions (for example, when facing right, the character would shoot 180 degrees in the opposite direction, but everything would work perfectly when facing left) so had to manually correct them.
Also added projectile attack for the player - more hassle with angles (but this time it was off by 90 degrees) when I tried to make it shoot where the cursor is. Then I spent another huge chunk of hassle trying to get the projectiles to disappear whey they hit the ground or enemies but not hit the players own collider. But in the end I managed to get at least something done.
Here is picture of the whole gang hanging out. Overall I spent around 11 hours on this milestone. Most of it on mindless googling and trial-and-error trying to fix small simple bugs.
Also the build file: Attach:build-m6.zip
The Expo
Well, like last time, I was struck with time troubles on this project, too, which made me miss a lot of milestones. However I managed to pull another allnighter sprint which improved the result quite a bit.
I added enemy spawning, a bunch of animations for the player (attack, move, jump etc), fixed the map rendering, added menu, scoring, score table saving and a minimap (probably something more but I forgot). And here is a picture of the beaut:
Initially I had also planned to add some boss fights but I barely managed to do the random spawning.
Overall, comparing to the initial plan I at least managed to make a procedurally generated world where you can endlessly run around and kill monsters (if you can survive - pretty hard without health drops). So I think I managed to do the MVP but there are still a lot of things to add. For example: more weapons (area damage weapons, melee weapons etc), weapon powerups (multiple projectiles, faster firerate etc), health power ups, occasional boss fights, sounds, more animations, more complex level production etc etc.
I didn't have time to make it like an actual game but I at least it has some similarities to a game now - you can be scored and compare your score to others. You can run and jump around killing monsters.
Here is the introduction video (had to zip because it is too big for the 100 MB filesize limit here): Attach:introduction.zip
And here is the build: Attach:expo-build.zip
And also a link to the github page