Monday, February 24, 2014

Zity - Items and Equipment

I know I talked about how the inventory was coming along with weapons and bullets. Today however, I've started streamlining their creation through the use of 'Item Factories'. These classes hold all the data of every item and will return new items as requested, streamlining code and making it much more readable.

On to the interesting stuff - While I was working on these factory classes I realized that I hadn't set in stone the way equipment (and stats) were going to work in Zity. I originally had planned to simply use the old Strength, Intellect, Dexterity, Agility style stats and derive specific stats from them. For example a character with high intellect and dexterity has increased lock-picking and increased car-jacking. A character with high agility and strength would have increased melee damage and run speed. You get the picture. While implementing this I realized I really didn't like it. These stats were too base, too simple, and they didn't give enough control and clarity over what each one does. So I got to thinking and came up with the following:

There will be specific stats for specific actions, similar to professions in World of Warcraft (Skinning, Mining, Fishing, etc), skills (Skill with guns, melee), and attributes (Strength, Cold Resistance). The compiled list I have so far is as follows:

Stats:
Lock Picking
Car Jacking
Strength
Cold Resistance
Guns
Melee
Armor

With these stats I'm able to vary each classes starting attributes to (semi)correctly match their theme. For example:


Hobo ~ ++ Cold Resistance, + Melee, - Armor, - Strength
Geek ~ + Car Jacking, + Guns, - Strength, - Armor, - Melee
Doctor ~ + Cold Resistance, + Lock Picking, + Armor, - Melee, -- Guns

You get the idea. In this way each stat is easily accessible and understandable and tailoring your character to the kind of play you desire is simple. This list of stats (and the examples) is definitely not complete. Some characters may get special stats that only apply to them. I'm still brainstorming all the ones I'd need in the game but I may just start with these and add others as things move on. Comments/Suggestions are welcome.

(Sorry, no picture today)

Friday, February 21, 2014

Zity - Small Update

Not much to mention today. I worked on the inventory system, guns, and bullets and managed to get simple firing and bullet creation/deletion working. The bullets are full, physics-enabled, objects which will be fun if I implement a ricochet gun or other weapons like it. The inventory is coming along nicely. I've landed on having a list of all the weapons the player is carrying and you can scroll through them to swap which one you are currently using. Then there are two support-slots which can hold any consumable item.


There are a few reasons behind this design choice. My initial impression was to make an item bar (like Terraria) and have the user put whatever usable items he wants to in it. Then I realized I really didn't like the way it would play. I wanted something akin to real life where you have a backpack full of stuff and a few pockets and things slung over your shoulder. So my second notion was to take the old 'primary weapon, secondary weapon, consumable, consumable' approach, where the player chooses which items he wants in those slots and has to swap them out each time. This sounded pretty good to me at first (and I may test it out once things get underway) but I wanted it to be easier to access weapons quickly instead of having to check the inventory every time.

My current implementation means that it will take time to switch between weapons and each weapon has to reload while equipped so managing ammunition is important. As far as Ammo goes, I'm currently sticking with just bullets, rockets, nails, etc. I thought about individual bullets for weapons but that would fill up the inventory quickly and might add a frustrating scenario of 'hey I found bullets to a weapon I don't have, I guess I'll wait and hope I do find it'. Again that might change in later releases.

For the next few days it's inventory, inventory, inventory. Streamlining the item process and getting equipment and consumables up and running. Also I need to work on the GUI for the inventory still and the weapon/consumable list. After the items I'm going to head back to the map generation and get to work.

Wednesday, February 19, 2014

Zity - The Island



Procedural Content Generation. The words alone send shudders down my spine. I have spent the past 5ish days working on getting an island generated. Not a full blown, tile based, streets-and-all island; but simply an image of the island that I'll use to create the previously said features. I wanted a land mass that was surrounded entirely by water and had an interesting coastline and possibly smaller islands nearby. Sounds easy. It's not.

I've trawled through dozens on dozens of sites and forums and blogs looking at different methods from complex polygon ones, to cellular automata, to perlin noise and gradients, and finally to perlin noise and particle gradients. There's a lot of information in a lot of different programming languages using a lot of different methods. Needless to say, my brain melted a little. I flip-flopped from gradient, to particle gradient, to polygon (hahahaha, no, I'm no genius), to automata, and finally settled back on particle. I'm happy with the results.


(The right picture is of the images that combine to form the picture on the left, each island has these)

Basically what this means is that I'll be able to control how the world will look like and can generate new worlds on the fly with only a few parameters. Another huge bonus to this method is that the amount of data the map needs to save is minimal since we can regenerate the map procedurally from it's parameters every time instead of saving the data to the disk.

I had wrote a draft of a blog post yesterday outlining how I was becoming frustrated with PCG (Procedural Content Generation) and basically had given up and moved on to the inventory, but after taking another crack at it today (I'm glad I did) I've finally made some progress.

Next up - Lakes/Rivers (or a break to work on the inventory)

Monday, February 10, 2014

Zity - Physics and Lights

Hello anyone and everyone. Things have been moving a little quicker now that I'm back into my normal routine. I've worked on some of the physics and lighting a bit more on the main menu and thought I'd share. As of a few minutes ago I've implemented vehicles using the wonderful Farseer Physics Library (Almost a direct port of Box2D). I had been using Farseer for awhile but this is the first major structure I've created. The vehicle has four functioning wheels (until I work on Semi trucks) and headlights and physics governing it's movement and collision. Below is a screenshot:
(Zombies are all gathering around the mouse, the car is controllable)

I've also added lighting to the main menu in the form of random colored lights speckled around the screen, a light that follows the mouse, and the headlights. The car starts out positioned so you can see the menu in it's lights. So far the whole thing runs 60+fps on my decent-enough laptop (and in debug mode) so I'm not concerned with anything yet except a few physics glitches with the zombies colliding with the car. My plan is to finish up the vehicle class by adding brakes, player capacity, turning on and off, and switching gears (going to drive, park, neutral). Then I'm going to work on making it flexible enough that to add a new car I would simply create the image of the car, figure out where I want the lights, tires, etc.. and then use those values to initialize it.

All-in-all I'm very excited about this. This has probably been the most content that I've crammed into the game in a long time and it's starting to turn from a bunch of systems and code libraries into a game. There's going to be a lot of fiddling and tweaking along the way but I'm still very much a believer in the end product of Zity.

Monday, February 3, 2014

Zity - Progress Update

These past few months have been busy. Sadly not too much in the way of Zity. The Christmas season left me with little time to develop and January saw me taking a trip to NJ to take care of some relatives for a bit. But throughout it all I've managed a few things and did a substantial amount of research and thinking, so here it goes.

XNA:
I knew XNA would be an amazing framework for my game as it is easy to pickup and maintain in a one-person studio. I also new that Microsoft was no longer supporting it. Months ago I looked into Monogame, an open source implementation of XNA that would make it easier (and possible) to target different platforms and operating systems and would be updated frequently. Recently I decided to start switching over my code and found it very quick and relatively painless to do so. From now on my game will be utilizing the Monogame framework and hopefully this will give me some extra drive to complete Zity knowing it won't be obsolete on release.

Zity:
So moving on to the state of the game. I spent my trip to NJ thinking about and prototyping parts of my game. I would go from notepad to notepad writing down thoughts and ideas and coding in between. What I came away with was a basic framework for networking. It is still in progress, but I have reached the point where it would be possible to connect to a server hosting Zity and to host a game of your own. I'm still porting my single-player code to the networking scheme so as of now there is no real information sent between server and client but that's next up after menus. MENUS. I hate menus. I spent two days or so revamping my main menu screen from a small list of navigable buttons to this:
(A swarm of zombies follow the cursor (Cursor is invisible currently))
My menu system uses events and currently leads through a few different options before dead-ending. This is simply because I'm still working on the networking game and I'm planning on using the same screen for both networking and single player to save on code reuse and make it easier for someone to host a game. Currently I'm using the menu screen as a sort of benchmark to see how the game will most likely run with all the lights, zombies, bullets, and physics running. If the menu screen is laggy the game will be laggy.

Other Thoughts:
Programming is tough. In a mental, rather than physical, way. It takes motivation, determination, and a clear understanding of the amount of work involved to progress. I find that some days my mind just can't grasp what I need it to and the thoughts just pass through my brain without reaching my mind. Other days code slips out of me like a waterfall and everything clicks. The key is to work on ANYTHING instead of working on nothing. In the days when I can't wrap my head around the code, I take to the notepads and start prototyping other systems or art or design. On days when I'm pounding out code like a machine I focus on completing sections instead of following rabbit trails. It can be so tempting sometimes to work on the fun things and ignore the issues but in the end it is substantially more satisfying patching up the issues and knowing that everything is working right and you won't have to go back and change things later. That's the thing that keeps me going, those moments where everything is working right and you can see the goal clear in your mind again.

In conclusion:
The next few months should see a lot of polish on the game engine side of things and after that: content.