"Paper Cowboys" personal Almost-Game-Jam: Hours 25-36
Pretty much dedicated this hour to the rocket launcher. Time can just melt away when you're fiddling with particle animations; but it was time well spent. The rocket now has a smoke trail, and if it collides with something it will explode. I was almost done making the camera violently shake when my hour expired.
Finished the rocket launcher (though I may amp up its damage after my next runthrough) and made a little demo video of it. I also added my first weapon drop: The Winchesta. Now when I shoot an enemy, it will drop a Winchesta; and I can pick it up and it will "zoom and disappear" into the character (little visual effect).
I was inspired by Diablo 3's weapon drop concept to do it here. A good development team can spend hours discussing the optimal way to implement a drop system for their project; I only spent 10 minutes on it and I'm sure I'll find currently-unforeseen problems with it later on.
I decided to create a scene object that catalogs the available drops for the level, and weights that determine the likelihood of each drop. It's editable from the Unity inspector, so I can fine tune the values easily and do so per-level. There are three kinds of drops: weapons, ammo and accessories. When an enemy dies, the player has a 50/50 chance of getting any drop. From there it's a chance of weapon, ammo, or accessory drop...the less weapons you have, the more likely it will be a weapon drop. An "ammo" drop has an 85% increase all your ammo across the board, and a 15% chance of being a "belt" that will give you ammo and increase your ammo capacity. An accessory drop has no effect on enemies; it can either be a hat or a mouthpiece (cigarette or bandana).
Two more things I need to do besides actually making all the different drops work over the next few hours:
- Make drops disappear after 10 seconds.
- I might take a lesson from the SNES Castlevania game: If you pick up an accessory drop, your present accessory will appear as a drop behind you. Maybe that hat you wanted doesn't look as good as the one you have; maybe you accidentally picked it up in the heat of battle and want your old one back.
I got the other weapons to drop as well as the cowboy hat. I also fixed the remaining bugs of enemies respawning when they shouldn't, the respawning text color, and a bug where I incorrectly managed how players synchronize their active weapons (only found it while analyzing code). Now I just need to make the rest of the hats and face gear, and do the other two things I listed in my previous entry.
I got the rest of the head accessories to drop except for the cigarette; I gave up after being unable to find a good particle effect. I decided not to do the Castlevania method of dropping your existing accessory for now, either. I'll probably do some additional tuning to the drop system over time. The biggest flaw right now is that, other than you getting a drop for a weapon that you may already have, that the client instance decides what drop they get. The server is not the status dictator of a player's munitions or accessories. What's important to me is that it "basically" works, so I want to move on to the next big thing.
It's time to get down to brass tacks: What is stopping me from telling people that Paper Cowboys is a side-scroller worth playing? I think the biggest thing right now is game control. The control needs to be fluid -- sure you should be able to crouch, but you should be able to slowly walk while crouching. Sure you can go onto a ledge, but you can't jump up and down.
With 20 hours left and two more levels to make (not counting improvements to this one), controls need to take priority now.
I changed the Jump button from the W key to the Spacebar, and restored freestyle jumping after increasing gravity a bit more. Then I made it so you can jump onto ledges by pressing W + Space together, and go down from ledges by pressing S + Space together. Then I made it so you can move left and right while crouching; I just refer to it as crawling. I burned what remained of the hour by making terrible animation frames for the crawling.
This hour was spent brainstorming the final version of level 1 and the existing class hierarchy for interactive scene objects like players, barrels and enemies. Level 1 needs to have a little bit of everything: requiring the player to use every control maneuver (crawling, ledge jumping), barrels that roll and hit enemies, enemies that respawn, walk around, and even try to sneak up on the players. As for the class hierarchy, I refactored the code into more classes so that each has a more specific purpose and can be reused for the new objects I'll be creating.
I also need to make sure incoming players see the control instructions when they enter a game.
I created enemies that crouch and also walk in one direction. I had to do additional refactoring of the enemy scripts when I came to realize the way I did it the first time was not friendly with the network library I'm using (I won't detail it here, but if you have questions about how I used the Photon Network library, drop me a line!). I also had to refactor the enemy spawning points -- I retrofitted them to support spawning another enemy if the one they spawned before was destroyed (which wasn't too simple considering the master client can change at any time). Also took a shot at creating a reward sign in MS paint to reveal the level 1 boss, but none of my drawings looked good.
The animations are the same as the player, so I didn't screen cap anything.
Did more enemy spawn customization: Now spawn points can respawn enemies, and I can specify where a player must be for a spawn point to do anything. I also made it so drops disappear in ten seconds. The rest of the hour was spent trying to make it so when a player touches an enemy, the player dies. I need this for knife-wielding enemies to be effective (plus it's a norm in side scroller behavior). It sounds simple enough; but to my shock, I could not find a built-in way for a Unity Character Controller to detect if it collided with another one. I came up with three different ideas that I thought were in the spirit of the engine's design, but none of them worked.
A quick reflection
After a long Memorial Day holiday where I did very little work on this project, I came to realize that not doing a 48 hour contiguous game jam has its own challenges. I started this project over two weeks ago; and I'm already starting to feel that "I don't want to work on this anymore" feeling that usually spells the doom of many casual game projects. However, when I recall the designs for level 2 and 3; and remember that I'm well over half done and that this will be fun to play with friends, I find the drive to work on it again.
Got a lot done in this hour. Finally got it so players can detect if they run into enemies using a raycast in every update (I dislike using raycasts in update loops but the cast criteria is very narrow; only 1 meter in either direction and only for enemy layers). I also created knife-wielding enemies (95% existing code really), enemies in windows (they're just crouching enemies with a different texture), made it so enemies flash when you hit them, and multiplied enemy HP based on the number of players when the enemy spawns.
Now I can finally place the level 1 enemies around. I'll start with some open space and standing enemies, then some barrel stacks. When the first building is present, there will be shooters on the roof and the ground. After that, enemies will start coming from behind with knives to surprise players. The second building will have more shooters and force players to learn how to jump onto and off of ledges, and have a few enemies walking around afterwards. The third building will demonstrate some physics fun as the player shoots a support beam to unleash some barrels onto unsuspecting enemies. After a few more barrels and walkers, the final building will have the boss and some respawning allies.
Hopefully by the end of hour 35 I'll have the level laid out.
Got the first two halves of the level 1 enemies placed. Though I was planning on having them respawn, I decided it was too early in the first level. I also lost a third of the hour to a bug where enemy crawling animations weren't working, but that's fixed now. I was in the middle of implementing the "weak plank" that would prop up rolling barrels when my hour elapsed. When that's finished early in the next hour, players will be able to shoot a weak plank on either side of the rolling barrels. If they shoot the right plank, the barrels will fall on the enemies. If they shoot the left plank, the barrels will fall on the players.
I still haven't forgotten that I must put keyboard command instructions somewhere for the player to see, and I need to have a Game Over sequence (I haven't even thought about level transitions yet and sound effects yet! I may not have time to do level 3!)
Got the oil drum physics set working (or as I call it, the "drum set"). I'm rather pleased with out it turned out except for the drums moving slowly. I also moved the boss hitpoint bar to the bottom of the screen so it wasn't overlapping the boss. As I had hoped, Level 1 is now laid out. The next step is to be able to go to level 2 after defeating the boss, and to support a "Game Over" screen for when a player dies and nobody is left alive at that moment. This means single player will be hard, but eight people shouldn't be so bad (except for when you consider the enemy hitpoints multiplied eight-fold).
Unfortunately I seem to have run into a bit of trouble: I can't seem to connect to the Photon network servers anymore. This is a known issue that the diligent Photon team is working on right now; so instead of network play testing, I fixed some bugs where the main menu not only improperly reported version numbers, but didn't gracefully handle the Photon downtime. I spent the remainder of the hour getting instructions working and surfing AudioJungle.com for some western music.
I found music for each level on AudioJungle. Then I did a single player run-through of level one and fixed a few bugs. I also started the framework for level 2 where you ride a horse. That required some refactoring of the player component and camera control, but it looks good. Then I made a recording of the cleaned up playthrough and some of level 2, and made a video for my hours 25-36 blog update .
Remind me to put in the in-game chat feature as soon as the Photon servers are back up!
Coming soon: Hour 37-? out of 48! Thinking posting again as soon as level 2 is done or at hour 48; whichever comes first.