Wednesday, October 1, 2014

New Record!

Hi again, it's been 2 weeks since my last confession post. I know this is a record and hope to keep this as close to a weekly update as possible. I feel like we don't talk as much as we used to. Let's put the past behind us and move on to this weeks post. So lately life and work have been draggin me, and my attention with me, away from my oh so (not very) comfy computer chair. My last post had a bunch of progress and goodies for exposé: Real game time, layers, new graphics, new gui, and even revelations. This week... I bring you.... eh not much...
-__-;

I know that's not the best way to keep your attention but I've been very focused on only one thing really. SPEECH BOXES!

OMG!

Before you start calling me a procrastinating asshole (which I am) please be aware this was not easy. I tackled many features of Unity and programming that were not clear to me before. Originally I was hoping Brandon, my right hand programmer, would tackle this but he's left the task to me in lieu of map and world design. So what's so hard about Speech boxes?? Well, they are complicated things and in my game they must be very flexible. The speech box system is totally modular and controlled directly by the NPCPrefab controller. NPC Control Scripts will send function calls to NPCPrefab, which compares message objects base on priority level and decides whether to send a call to the Speech Box script. If there is a button that script will Send a message to all scripts of the GameObject with the response. This was the most direct answer for the plug and play nature of the scripts. It was a challenge well conquered I believe.

So now, any NPC should be able to drop in and say hi. Remember last post I made a prefab for NPCs? This week their back with custom control scripts. What do you mean by that bro? I mean this: Drop in an NPC prefab, give him a little color, some basic parameters, then write a script of how he affects the story line. Done. That's one in the bank. He can interact with the player, talk, give options, etc. Check out the vid to see it in action. At this point the Speech Box is almost done. I'm not sure how done but if I'd guess 98.75621% I just need to build multi-button constructors and a few other small things.

And now is the part where you're like WOW that's cool! Go ahead, email me at fansofkevinmiller@madeUpURL.com and tell me you love me. OR you could be asking what I can do with said Boxes of Speech. Again, check the vid for a demo. I've built in a few functions for controlling and checking the Stink Level of my hobo. There are a couple NPCs on the street here that will run when my hobo gets too stinky. Watch as my NPC "Stand Around Jackson" will offer free beers and chat it up until the Stink Level hits 50% While an NPC "William Welltodo" will turn his nose up until it's filled with hobo stink.

It's been a hard couple weeks grinding on this code in between work, social life, and everything else. However, this is a significant step forward! Basically it means I can now drop in storyline! As in: I can make quests, story lines, stuff to do, challenges, hookers, a beginning and an end, alpha and omega, Optimus Prime and Megatron, and everything in between. So watch the short clip already. See it in action. Got questions? Hit me up already. Tell me what I should add to it, or even better, what you can add!!

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:






Wednesday, August 27, 2014

One man's trash is a headache to program

Hi folks! This is my second post on the game Dog's Day. I have been pouring over tutorials, UnityScript API and junk posts about Objects and Classes. The end result is a well crafted and scalable inventory system.

Woooooooooooooow this was a weird one.

So in Unity you don't just add an array for inventory. No, it can't be that simple. Screw you. How Dare You Assume it! But seriously, it's a little tricky to get this concept. So the inventory must live somewhere. I chose to tag it on the player object (just like I did with sticking the game controls to the HUD object.) This works well for me. I found an inventory system to model after in THIS POST, but found lots of bugs. I tore out a few chunks I could use and scrapped the rest. I won't bother salvaging the GIU, but the basic item class was useful.

Then cam time for adding items. Again, I ran into a slight headache conferencing between scripts. It's something to get used to I guess. Write a script, then write another script, then make a variable by the name of the first script, then in unity, drag the script over, then in the latter script, reference it by another name.

sigh.

Not a big deal, but it feels clunky and foreign. All said, I spent a whole night hammering the keys and, 123 lines of code later, came up with a cool inventory script that updates the HUD, cycles items, and can add them; I also created a loot prefab that can be reused as any item to be picked up.

This may seem like a whiny rant but I can assure all that this is no less than a leap forward toward a completed game. I still need an artist (and lots of artwork) and several game mechanics, but hell, there's almost something to do in this game! Haha!

Until Next time,
Cheers!
mmmmm cheap beer

Tuesday, August 19, 2014

Dogs Day Log 8.19.2014

8-19-14
Today marks the first day about a blog about an adventure.
First log. Been working on this a few days. Noticed that world coords and screen coords are very
different. Makes me yearn for java programming. Oh well. I programmed a scalar tracking script in case I need to use it later.
Gonna have to reconsider how the artwork looks. Dumb down details, focus on building generic animations all human sprites will have access to. This will allow crowds and individuals to all have reusable movements.
Today's work includes building a test HUD that dynamicly displays all the hobo's stats. This was a bit weird in Unity. Not intuitive at all. I used public functions instead of static as most have suggested. Also the line "var GameControl : GameControl;" seems alien. Again, missing Java.
A quick word on instantiating variables: when you want to start a new object in Unity you define the variable name, then use a colon ":" and the type, rather than the type followed by variable name then possibly equals "=" and value. JS+Unity...not a fan. Oh well.
Oh, also, mono script's auto correct has pissed me off for the last time.