Monday, September 15, 2014

The list/saga continues

Hi again! It's been a little longer than usual, but check out where we are... This last week and a half I've added Drinking/getting drunk based on a blood alcohol content (BAC). Basically if the GUI says 8% it means 0.08% and legally drunk. This is how the game will work with drunkenness!

 But how, you ask, can you get drunk without consuming items? Shiiiit I programmed that too! Now loot items will work with 4 generic parameters (damage, rate, ammo, value). When the player uses an item the inventory script scans the item type and sends the parameters to Game Control and runs the appropriate function. So you're thinkning that's awsome d00d! What the hell does that mean? I just means some of the code is done and now I can just drag and drop items in!

And then?....Well, I learned that float types must be explicitly casted every time even in expressions. Type casting has been the source of some frustration for me.
OH! And you may notice I added a Hunger Meter?! Yes I did. Currently you run empty at five hours, that may change. The rate is also a public variable so I can slow or speed it up (devious grin) Imagine drinking a coffee to kill your buzz quickly then needing food in half the usual time!

Also: One more reason why Brandon is right: dynamic array initializing is the way to go. I haven't tried finding game assets with code but maybe it can be done. The thing is, it's super easy when you can just drag and drop them!!! Hey Wanna hear more techie crap? YES? ok I love enums. The way unity handles these is great, they become dropdown menus with real words that you can edit in unity instead of hardcoding or working in integer values.

Also: I found a quick easy solution (sometimes the best solution right?) for flipping sprites 180 degrees. Wanna know the secret?
localScale * -1
hehehehehehehe yeah... I made a note to mention good comments in source code but I think it's pretty self explanatory So one thing I really need to figure out is: what do bums eat? So far the list is half eaten garbage food, chips, deli pickles, and ketchup packets. Any other cool ideas? And while we're on the subject, I'm keeping a growing list of things I need in this game. It's in the dropbox folder for anyone intersted :)

 The biggest thing I need to tackle right now - which anyone is welcome to assist with - is level design and story boarding. The first major quest is outlined briefly but needs fine details, and the map.... well needs a map... *ahem*

So what else is new? um...... not much, lots of clicking and typing, oh and animated NPC prefabs with customize-able color schemes that can be directed with enum lists in the editor and will eventually populate the entire game. Yeah, just that. Just a little thing I've been busting my butt on. It also happens to be mostly responsible for a late post. BTW who reads this crap? Any-who, not NPCs can be dropped it, colored in parts and assigned to meander around or stand in place without ever touching code. mmmmmmm I feel progress!

AND OF COURSE A VIDEO TO SHOW OFF THE GOODS!!!!


Thursday, September 4, 2014

Third Log 9-4-14

Ooooookay!

Hi everyone! This is my third post. I'm starting to get pretty excited about working on this project! So far I've been lucky to work on Unity half as much as I'd like to. Whatever the reason, I'm sure no one else in my close circle will sympathize. Family life, work, and school are supposed to come before coding and beer apparently. Meh.

So what have I got for you this time? Integration bitches! The inventory system hasn't changed much but now loot objects will be displayed on a loot layer, allowing them to keep their collision boxes separate from the player! They will include the option to be lootable or not which will determine how the Game Control handles them (integration!) Game Control now can alert the player when he picks up an item, send him a message when his inventory is full, or describe a non lootable but clickable item! 

You want more? How about a progressive game calendar? Yeah, deal with that idea! So the game promises to pass time - in game anyway! The clock is ever ticking away in real time but some activities that take a long time will cause time to pass quickly. Montages, cut scenes, black outs, and, eventually, sleeping will all push the clock forward. Soon to come: sunset/sunrise.

Isn't that enough? No? Okay, well, check out my new character sprite. He's fat and lousy, and Animated! I'll continue making my own art until I find an artist. Please ask your friends btw! Animation seems well integrated in Unity but still lacking. There seems to be no logic or conditions, also not all the game object properties are available for all items (GUI for example) so some work will always remain in scripts.

So the big take-aways from this week are:

  • Game objects should rely heavily on main scripts for flow control between object and scripts.
  • deltaTime is not related to real time. It's just not.
  • You don't always need a bunch of variables and new objects.
  • An alpha channel can act as a useful boolean flag for graphic objects that don't use it for display.
  • transform Vectors can be a huge pain in the ass.



So that's what I have for you....That, and this video of actual gameplay!

Play the actual game from the dropbox: