Being crazy and the effects on productivity…

I’ve posted in the past about my mental health issues, depression mostly.  This past weekend was Labor Day weekend.  I was looking forward to getting some coding done, but didn’t have the motivation.  It wasn’t for a lack of energy or even depression itself.  For some reason I was avoiding it.  To the point that I was about to get started and my mind said “Hey!  Look, your room sure could use some picking up!”

Seriously.  That tells you I had a serious avoidance issue when cleaning my room happened in order to avoid programming.

At the start of the weekend I had gone to get refills of my prescriptions and they weren’t able to fill them.  I can do a day or so without, but then after that long, I get adverse effects (an increase in anxiety, generally).  This happened.  It put a damper on my ability to concentrate and focus.  I like the energy involved, but it was diffuse through the body so it wasn’t like I could take the energy and focus it towards production it was just all over nervous energy and the slightest thing could set me off.  So yay I’m crazy and need meds to function.  I did sit down and attempt to code, but I just stared at the screen blankly, feeling utterly stupid and unable to comprehend.

I played a lot of Hearthstone.  That was easy.  Early in the weekend I had attained a rank of 15, my highest ever.  Mid-range hunter which I had just discovered on my own then read about while trying to say “hey, what’s up with the strength of this deck” then I started hitting my skill limit, even with a deck that’s claimed to be good.  Anyways, I dropped over time (I think due to my lack of focus), and by the end of the season was down to 20 (I usually hover between 20-17)…

Anyways, the last two nights (you’ll notice those are the nights before I have to go back to work!) I started coding at like midnight or so.  I had received my meds and they were kicking in finally…  Frustrating that the pharmacy couldn’t do a temporary refill, because you know, 3 day weekend is a GREAT time for programing if you’re not crazy in the head from lack of meds!

So I started to create my “levels” for Automute.  I can’t recall if I posted about it or not, but in Unity there’s this thing called an “inspector” it’s nice.  You can drag and drop things to and from it.  So I can create a blank array of gameobjects, and then, instead of having to code up something like:

vehicleList[0] = file.load(“copcar.prefab”);

I just create a vehicleList array in code, then head over to the Unity interface and drag the copcar frefab directly into slot 1 and there it is.  No need to code a whole bunch of unique statements to load.

The problem here is that each level is a prefab, which means, in Unity, you can’t work with multidimensional arrays when working with the inspector.  You can only work directly on a single array.  So this means, with my “levelManager” script, I can’t then say something like:

Level[0][0] = copcar (by dragging the car into it).  That means the simplicity is somewhat reduced because i can only access that first index which is really the level number.

In my ideal world it’d be “Level[levelnumber][vehicleListIndex]

Instead I have to create a “level prefab” which contains the vehicleList array.  Then I load the LevelManager with the level prefab.  Then I access the prefab and can drag the objects I want into the vehicleList array there.  Then to access it I have to use the specialized “getcomponent” code to access the prefab and then the array elements.  It’s a lot of unnecessary complexity, IMO.  But at the same time, there are so many other things that make complexity reduced that I guess I can’t complain too much.

Since it had been a while since I coded, I had kind of forgotten how to use getComponent.  The fact that my brain was dead meant I kinda sucked at first.  Then after the next day my meds really kicked in and I was back to thinking a bit more clearly and able to focus, so I worked on it more.  I sort of have it working.  There’s some logical condition in the loops that I need to correct.  Basically I check to see if a vehicle exists where I’m going to place a new one, and if it does, then get a new location to spawn the new vehicle at, but I think I’m not doing the loop properly, so I’m also generating a new vehicle, and thus the old one that should be placed int he new position is discarded, which means I am generating fewer vehicles per level than I am designing the level for (i.e. the number of vehicles in the vehicleList array).  I tried a while loop last night, but the logic was wrong and locked the program.  I think I had placed it outside a for loop and used the wrong conditional.  Tonight I’m going to try to place it inside the for loop and then negate the conditional and I believe it should then seek a proper position and once a free spot is found, spawn a vehicle there and go to the next vehicle and run the loop again.

Once I get that running and see my cars are spawning correctly, I think the code is actually not done well, and is a good time to refactor now.

The next question I am debating is whether or not to create a “generator” function in the level prefab (not the best term, as I don’t think it’s a real generator function in the technical sense), that would, upon loading the level, take the array for that level, shuffle it; then the levelmanager will request a new vehicle from the level prefab when it’s time to do so.  The level will then call it’s generator which will basically pop the vehicle off the array/stack and hand it over to the level manager, which will then place it onto the screen at a random coordinate.

Once that’s done, I believe I’ll work on implementing a timer element so I can vary the spawn rates/times, similar to how I do with my asteroids in Killing Horizon.  Right now it just spawns as fast as it loops and if it hits a random threshold (right now I have a “if random value is less than 2 (out of 4), spawn a car) so you have a 50% chance at spawn each time the loop is run.  I think adding a timer to this and then I have to factors to play with regarding vehicle spawns: time and chance to spawn.

Then I have to create the level-loading code.  When all the vehicles in that level are no longer active, time to load the next level.

Once that’s done, I’ll have to add a point system and score display.  Then I have a functioning prototype without the load screens or much else, but it’d be something to play with and test.

The next part will be altering my current vehicles.  I think I’ve decided to go with photos of cars, not bitmap art or whatever.  I’ve got more vehicles lined up to play with, not just the same like 6-9 vehicles I currently have.  Once I get those made and ready, I’ll work on balancing the basic levels in terms of  overall levelspeed, points, spawn rates, and vehicle speed.

Once those are done, the “special” levels will be made (frogger style, police raid, frog raid and more), and then interstitial story screen stills to give the basic plot, title screen and score screen test test test and then release. LOL.

“48 hour game jam” my ass!

Automute: Slow Jam

Well – It’s now about 48 hours since I started this jam, and after naps and other issues, well, I didn’t accomplish as much as I’d hoped.  Of course, part of that is me being a bit more perfectionist than I should have been.  Slopping on some placeholder art is something I wasted too much time on trying to get things “right”.  Hell, just pasting blocks of colors without actual graphics would’ve been good enough, IMO.  That said, it seems there’s a variety of jam lengths… Some are 2-3 days compos.  Others are a week or two.  Others are a month long, and then, it seems an Interactive Fiction jam is a year long endeavor.

So upon this first attempt, my view is: If you’re not particularly experienced at coding, and want to try a gamejam, go for a month long jam or at least a week or two.  I think the 2-3 day ones are for super simple things, less perfectionist-y things and people who know what they’re doing, and that’s fine.  I certainly see this as a learning experience, and in fact, have decided something.

Killing Horizon is still a project I will be working on, but for releasing my first product, I am definitely more of the conviction that I will be releasing Automute on the Google Play store.  It won’t be ready for release for a while, but I already have a decent start after two days.

Now that almost all placeholder assets for the main gameplay have been created (just a motorcycle sound is needed, yet, and maybe a little added pickup truck sound to go with the barking dog, and then some low level auto sounds for the non-enemy vehicles that you won’t be shooting;  menus and titles and exit screens and options and all that are necessary as well, but that’s not main gameplay)…  I am starting to work on the vehicle spawning system.

I’m copying some code from Killing Horizon (yay!)

One issue is that my method of spawning enemies is going to be less ‘random’ than KH.  I need to work a little more on planning the system for spawning rates, types…

So, you may ask:

What have you accomplished so far???

Well, I may answer:
Currently, I have the ability to spawn multiple buses in random positions, at their proper starting points (which is really 8 starting points; contextual based upon side of screen they’re spawned on (due to drivers needing to be on the right hand side of the road), so the Y value of a car on road 1 spawning on the left side of the screen is different than the Y value of a car on road 1 spawning on the right side of the screen, even though they’re on the same road..

So now that I have a single enemy type spawning, the next trick will be to make that enemy move via using the iTween addon.  In theory, this should be damn easy.  I already did it once using Playmaker… However, there’s too much to learn in Playmaker for me to dig in with the gamejam (which is something I should’ve known, and even read: Don’t try to learn new technology when doing a gamejam.  Use what you know… Otherwise you’re wasting time trying to learn and not actually creating)

Once I get the iTween motion working, I will add the ability to spawn more random enemies from my list.  Then I will add in non-enemy vehicles.  I’ll have to have a spawnrate system working, which I’ll steal from KH as well, YAY!  I love stealing my own code (which some of is stolen from others in forums and such).

I have a feeling at some point before I work on proper level design I’m going to want to throw in my pew-pew laser to see how fun it is.  In fact once I get some enemies spawning and non-enemies spawning, I think that will be my next goal, and set up a small “score” system while I’m doing that so I have a little playable prototype.

Maybe at that point I can even convince an artist to help me out, or at least get an estimate on a payrate to have art made, then again, that might be too early in the game to get an estimate, but I may be able to get an interested party curious nonetheless.

I actually have some interesting concepts to make this more than just a simple tap tap game (though the main system will be tap tap).

-FROGGER!
-POLICE RAID!
-PROTECTING CHILDREN
-DRUNK DRIVERS
-HORDES OF FROGSPAWN
-GHOSTS OF DEAD INNOCENTS AND DEAD POLICE IN THE FINAL LEVEL!!!!!!!!!!!

I think that would be really fun to slowly build up from the base concept of the game of silencing vehicles to ending up with a sort of vertical shooter, preventing hordes of ghosts of all those you’ve killed from coming to stop you, the rabid AI, driven mad by all the noise you’ve had to endure for hours upon endless hours trying to make them just SHUT UP, but they wouldn’t, and now, it’s your last stand…

 

Automute: Sounds added to vehicles and Logo/Title made

Well – after another rough emotional afternoon thanks to my current midlife crisis, I was able to buck up at almost 10pm to get cracking more on the game.  I added sounds to most vehicles (still need motorcycle sound IIRC).  I still don’t have any code yet.  A bit intimidated to dive into that aspect, but that’s the part that makes it a game, right?

I also made a Logo/Title screen.

automute title