It's been a bit longer since my last post than usual. I recently got back from a short trip to Texas to escape the ridiculous Minnesota weather we've been having. A few days both before and after my trip I managed to get absolutely nothing done which I'm not to happy about. Today though, I decided to fire things up again and set some goals for each week. This week's goals involve vehicles and zombies.
First thing first, I don't believe I mentioned this in past blog posts, You can now run over zombies and kill them! It's not as exciting as it sounds (since there isn't any blood or corpse yet) but the zombies do die when hit at a sufficient speed. Later on I'll be streamlining this to include more interesting animations and blood spatter.
Next up is what I completed this morning, namely player states and vehicle controls. I had planned to work on entering and exiting and controlling vehicles right off the bat but I ran into a fairly decent problem. My player wasn't programmed in a way where he wouldn't fire a gun or move around while in a vehicle. this may sound dumb but it was actually quite a hassle. Previously my player would simply move every frame depending on what keys are pressed and fire if the mouse is pressed. This is all well and grand but when the player is in a vehicle I don't want him able to fire or move himself, only the car. I could've simply hacked in a flag saying whether the user is in a car and use that to determine if the player should move or fire but I realized there are quite a few more scenarios such as picking a lock, using an item, talking to npc's. All these things needed to be organized in a way that they wouldn't overlap or interfere with the others. An example would be if you went to pick a lock and pressed the mouse down and started firing while lock-picking. While this behavior would be pretty awesome, it is not intended. My solution is to make the player a State Machine. What this means is that the players change their state depending on what they're doing and some actions cannot be taken while in some states. This separates driving from shooting and lock-picking from looting and is very easily expanded to new states.
Now on to the interesting stuff. You can now walk up to a vehicle and a message will display prompting you to press the E key to enter it. this only occurs near any door to the vehicle (not just by being near the vehicle). When you press E you enter the vehicle and take control over it. The vehicle control scheme goes like this: WASD controls turning and moving forward and backward but not your actual speed. That is controlled by the scroll wheel. For instance if my desired speed is currently 50 then when I press W I will attempt to accelerate to 50. If I want to go faster then I simply scroll up a little more to set the desired speed to 75 and keep holding W down. I found this scheme works better then simply holding down W to accelerate and S to brake/go backwards. The later tended to force the player to tap the W key continuously to maintain a steady speed.
Also the user can toggle the lights, and would be able to honk the horn (if I had sound effects). The other features vehicles will have is an On/Off state, Passenger seats, Damage, Locked doors, and the requirement of hard wiring a car to start it up if it didn't have a key. Some of these features I'm working on now, others I have planned for later weeks.
The other elements of the game that I intend to finish this week are adding corpses in where zombies die, filling them with randomized loot, and allowing the player to loot the corpses. I'm not entirely sure if I want corpses to have any valuable loot or simply scraps and maybe some coins or something. I don't want the game to turn into a zombie-kill-fest where you find lots of awesome gear by slaying millions of zombies. I want it to be a tense survival atmosphere where you are afraid to run into zombies since you will then have to waste bullets and try to escape and lose the loot you were trying to find. Hopefully I can get it to that point.
Sorry for no pictures again. There really isn't much to SHOW of the new features but a lot of background components and game play. I'm hoping to get a speedometer up and some more graphics for the GUI soon.
And before I forget I actually switched the inventory system around again. Instead of the weapon list I opted for the standard primary weapon, secondary weapon method. The reasoning behind this was that it was causing issues with looting from zombies and while I could've implemented it again I thought I'd try this method first. After working with it I find that it adds more to the survival element by not being able to rapidly switch weapons. You can obviously still fairly quickly open the inventory and right click a new weapon to exchange them but this takes a conscious effort and time where zombies (or players) can get the upper hand.
I hope to continue developing Zity the way I am this week, with clear goals and direction every week/day. I realized I'd become lax with my routine and the vacation really through things off so I hope by motivating myself to reach goals each week I can plow through a lot of the tedium and start making things fun.
No comments:
Post a Comment