Thursday, April 28, 2011

Hallelujah!

(Grab some popcorn, this is a long 'un, but I've provided enough pictures to keep you all entertained, I think..)

It works!  After a day and a half of coding blind (meaning I had absolutely NO idea what I was doing the past few days, basically just trying whatever ideas I could come up with and praying about them) I have succeeded in getting SOLID 2D OBJECTS.
This is mah Coding face.  There are many like it, but this one is mine.

Yes, that's the look I've had for about the past two days.  Disheveled hair and all.  Kids, this is what happens when you are away from home (and a nerd)
All of the stereotypes become true!  I guess that means I need to start watching my weight now or I'll never have another girlfriend...!

 Paralyzing self-doubt aside (loljk) I have made a breakthrough!  Well, okay, so this has been done before, by countless people for countless games and engines, but somehow I managed to meddle my way through the entire ordeal!
...and I may have gone a bit crazy in the process
Its not much to look at... but under the hood this this is... well a big huge mess, but it works
What I've miraculously managed to achieve is 2D solidarity (as in, being solid)  I had previously spent all my efforts on 2D pixel-based collisions, which you can see at the start of this puppy (I think I talked about it anyway) which means I know when a pixel of my bad guy, and a pixel of my good guy are on top of each other, then I know that they are touching!  (A pixel is just a single unit of color, your screen is made up of a LOT of pixels just in case nobody knew that)

Well that was all and dandy, but with things flying across the screen (Like bullets and robots n' stuff) knowing when my player was literally on top of a robot was great, but how to solve the question of keeping my players and robots FROM being on top of each other?  What if I wanted them to bounce?  Well, bouncing is easy enough, check for a collision, if there is one, adjust the two dude's velocities...

But here is where you have to think like the computer.  A program of any given type (unless someone's been lying to me here) is a linear processor.  It's just a ridiculously fast linear processor.  It computes everything, movement, drawing, creation, destruction, in one pass and then goes back and does it all again.  So following this logic, if the player is moving really fast, he could not be colliding in one frame, in one pass of the computer's logic, but in the next he could be halfway on top of the enemy I specifically DON'T want him to look like he's on top of!  Which means that, for one frame, the player of my game sees the intersection that I want to avoid.

Well this was a two-pronged approach, and I'll try to be brief  in description but...

First I found out exactly how many pixels in width and height the collision occurred at.  The original method I used for checking collisions stopped at the first collision, which is great, but I needed to know just how far away to put the player once he overlapped my bad guy so that they would be JUST BARELY touching, but not overlapping.

Pixel checks go row of pixels by row of pixels, from top to bottom, so...

So instead of stopping at the first overlapped pixel, I checked the rest of the row of pixels for more overlapping occurrences, and then for each occurrence in that row, I checked the y column of that row for pixel collisions too.  In the end I took the greatest of each number (the widest and tallest row/column of overlapping pixels) and used these numbers as an "offset" to move my player back, so they were just touching.

TOO MANY TECHNICAL DETAILS!! GET TO THE POINT!

So that ended up working (not yesterday when I put all that time into it... this morning, when I should have been studying for class!) which was sweet, but there was still that ONE MEASLY FRAME where my player would overlap, which didn't look very cool.
Computer's don't understand English, though...


This solution ended up being much easier than I thought.

I just took the velocity of each object, and then checked the collisions AS IF the images were one step ahead of where they actually were in code (I just used a temporary variable that had one extra boost of the velocity, but didn't change the actual position of the image)
And then I got the same pixel-offset method to STOP the velocity of the object by that certain offset.  The next frame, the image would still move, but it wouldn't move into or onto my enemy!
This is a picture of a Gnome flipping the bird. I just want to see if you guys are still with me at this point.

Now velocities change from frame to frame, but this solution, while not exact or precise, is good enough to prevent an obvious overlap from occurring, and essentially...
I now have solid sprites!
Huzzah!

I will now retreat into seclusion for the next few days, nursing my victory over machine before the next one hits me like a ton of bricks like I know it will!
Just kidding, I'ma study, and hopefully meet up with David at some point this weekend, and get to the fun, gameplay programming I so desperately long for! (Kidding again, that stuff can be hard!)

But, at this point, I can't think of any more technical details or kinks that need to be worked out, I just need to go through my code, comment, clean-up, and get started (FINALLY) on the stuff that makes this sucker fun!
(If this doesn't turn out to be fun, I will shoot myself)

Artist's Rendition
In the foot guys, geeze!

- Kev

Wednesday, April 27, 2011

Artsy Fartsy Fail

Sprite Sheet!
This is the updated sprite sheet.  Today I decided I'd rather go for the "blocky" style of characterize drawing, unfortunately I also decided I'd go in for solid-collision checking!  The basis is, I've got pixel-per-pixel collision down (thanks to a healthy dose of ze-interwebs) but now I want to make sure my sprites are "solid" and that they cannot pass through each other.  FAT. CHANCE. OF. THAT.

This is what the universe just did to me
I've been bending over backwards all day long trying to figure this one out, but at long last I'm giving up for the night.  I did absolutely no homework today trying to wrestle with the idea of finding the correct dimensions with which to reset the 2D position of my sprite (the image) when it collides with another object so it LOOKS like they never actually collided and are just touching.

What is so frustrating is that I know there's a way to do it, I just don't know it, and I'm not smart enough to figure it out on my own.  Odd, hmm?  I get depressed/frustrated over not being able to manipulate images on a computer.  I know, I know, I'm a nerd.
It hurts my... feelings
I've also googled the nuts out of this one, to no avail.  I'm at an utter loss.  I've come across a few methods that are CLOSE, but don't cut it, and I want to do this right.  I've thought about counting the pixels at the interaction of collision (taking all the colliding pixels in a row, and the height of all the colliding pixels at the tallest column of that intersected row... this is my current project, but only out of desperation, I have no idea if this would even work in theory, esp. when you factor in scaling and rotation... eff me) but nothing seems to work.

This is why I quit programming in the first place, and I'm very discouraged.  I'm really excited for this game and I want it to get up and running as soon as possible.  I can move around, shoot bad guys, have them fall out of the picture and have new one spawn, but I can't get this solid collision, and because I've been focusing so much on that I haven't implemented a HUD (Head's up display), interesting enemy patterns/movement or even different kinds of weapons.  This just hasn't been my week.
Do the robot.  I know, it doesn't look like a robot.  I never said  I was a GOOD artist
So... yeah.  I promised an update, here it is.  EVERYTHING IS FALLING APART AND I HAVEN'T SLEPT MORE THAN FOUR HOURS IN THE PAST.... well who knows what.  The lack of sleep was for a very, very, VERY worthy cause so I'm not complaining about that, but I do tend to get a bit frayed around the edges when I don't sleep much.  I'm already 30 minutes past my self-ascribed "bed time" so without further ado...
Pie'ce de re'sistance - Google it, but don't criticize me for not having the accented E's
Kthnxbai
-Kev

Monday, April 25, 2011

I Should be studying for a midterm right now...

And I am! ...kinda, I'm just multi-tasking.  Yeah! That's it, multitasking!
Pictured: Multi-tasking (?)
So after Easter weekend (which started out kinda crappy but ended well) I did a bunch of studying for my midterms, including the one I'm (supposedly) studying for now.  Ironically this midterm is for History of Games, which I would find a really interesting class if I wasn't worried I could potentially bomb the course.
I'm just gonna keep reusing this one for effect
While I really like the teacher for this course he's a little atypical, and as such I'm not even entirely sure what he wants to study or know for this midterm... even after posting a review sheet. Doncha' just love school?  I may have already said this in a previous post, but i find it very ironic that my schoolwork for completing a degree in video game design is getting in the way of my game design!

Speaking of game design, what progress has been made?

Comparatively little, I'm afraid to say.  David, being the brave soul that he is, is charging into the matter of C# garbage collection. to enable us to actually delete things when we want, as opposed to leaving tons of memory on the heap at a time until  C# feels it's an appropriate time to dump huge amounts at a time.

[LAYMANS TERMS: When I create new things in C#, bullets, enemies, etc, memory gets allocated to the "heap"  basically memory on your computer/phone/console that is free to be dynamically given out and taken away to objects.  In C++ managing your memory can be a pain in the butt, since every time memory is created on said heap it has no calling name (you must assign it a calling name) and as you are juggling these no-named objects around, you can be bound to lose a few in the code, resulting in memory leaks and eventually crashing of your lovely program/game.  C# does all this for you with something called a Garbage Collector which does a lot of fancy complicated stuff to make sure that you don't encounter memory leaks and the like and makes your program a better place]

So Garbage collector == a good thing, but not if i'm creating a bunch of objects at a time (and I am with bullets) so instead of dumping large amounts of memory at a time and possibly slowing down my game during the dumping phase, we are trying to dump the memory as the bullets are "deleted" in the game and delete them "for realz" at the same time.  We'll see if it's faster or just more of a hassle.  Hopefully faster, because I'd hate for David to go to all that trouble for nothing.  Though to be honest he is getting a much better sense of the underlying systems than I am!

What am I doing?  Fiddling, mostly.  I've made it now so that the enemies keep spawning and you can kill them (finally!), and tweaked some of the movment/shooting mechanics.  My next goal is to have enemies be able to bump into each other/the player and cause damage, and to upgrade the AI/movment.  Once I get my tablet (Tomorrow! I'm so excited!) I'll go back to the literal drawing board and animate the sprites some more and then add functionality onto the game that I had originally planned.

Oooh, I know, I know, what is it?  Well since you hardly even know the premise of the game yet, it wouldn't make a whole lot of sense to tell you.  I'll have a post sometime this week that lays out the basics without giving too much away!
This is not the premise of the game, but it would be awesome

I know this update is rather short, but I really have to go study now! I'm down to an hour and a half left of my evening out of 3-4 that I had!  Tsk tsk, tsk, I know, I know.

I'll get better at this, I promise!

Hmmmm... History of Chess... and Calculus.  Deep stuff man.

If anyone reads this, feel free to comment, ask questions or yell at me via teh interwebs and the comment thingy below!  If you feel compelled too, that is.  No pressure or anything.  I'm just looking for means to distract myself.

- Kev

Friday, April 22, 2011

Busy Friday = not enough homework finished, and no games

Let's not
So, I present you with my reserve of doodles!

Blowhard
I'm sorry, internet, I'll post tomorrow, I promise!
-Kev

Thursday, April 21, 2011

Twiddle Dum and Twiddle Dee

Now offered at a CC near you
I'm plagued by lethargy today!  No bueno!  I'm just tired.  I don't have the energy to do much work aside from twiddling lazily on my game (enemy movement added.  Pretty dumb movement but it's at least been added) and I'm staring down the proverbial barrel of a very real, menacing creature of the dark...

Midterms.

Neigh has such a black word been uttered in my brief existence on this isolated oasis in space (well... it was one. Can't speak for it in the current environmental circumstances)

Okay, So I have three midterms coming up, its just that all of these classes put a huge emphasis on the final and midterms in terms of the end weight of the grade (which I'm not to fond of, turns out, much rather have homework be a bigger but more spread-out grade influence)

I'm just tired.  Really tired, I need a good nights rest and a day where I don't have to worry about getting my homework done.  I come back from class every afternoon and get homework done... then burn out and go on the internet which is a self-ascribed bad habit I need to kick, but regardless at the end of the day I'm just exhausted.  All I really want to do is make headway with the game!  Ironic, I'm here to work on video game design and programming, and my schoolwork gets in the way of me making games.

And Ironic, don't forget that

At least it is finally the weekend, at least I can sleep in tomorrow, and worry about the mountains of reading, writing and studying I have to do then.  Blah.

I think I'll just leave you, dear internet, with a few more doodles and get to bed.  Assuming you like and/or don't mind the doodles, this can be a good thing.  Otherwise, well, my apologies.  I know it's not art, but usually my friends enjoy looking at them, or at least glancing at them, so I hope you do too, interwebz.
Everybody, everybody
Just imagine if he DID have a suit

The bringer of midterms, in robotic form
And this is to Emilie, my dear friend back home, I promised and I have delivered!  I know its not much, but it's something!
First day of training as an air-traffic controller.
- Kev
There's no place like home, there's no place like home...

Wednesday, April 20, 2011

Of mice and midterms

ACTIVATE FLAMETHROWERS?
Minus the mice.  Today has been  a slow day for any sort of game development, unfortunately, and instead has been spent on homework (programming, math, and some reading) and even this weekend is shaping up to be quite the insane workload.  I have three out of four midterms next week on Tuesday and Wednesday.  Not even nice enough for a smooth spread in the week!  At least math isn't until the third of next month, that's a relief.

So since I haven't done much in the way of development, besides make some adjustments to the enemy class in terms of movement and creation, this blog may be rather short, and/or rambling in nature.  Then again if you know me I'm quite prone to rambling on about a tangent subject and never finding my way back to the point.

I've done so much math that talking about tangents and points is making me picture lines and graphs.  This can't be good.

Regardless of my temporary foray into insanity right there, this week hasn't been too bad, but next week will be nuckin' futs (keepin' this blog child-friendly)
Or not.

But I make this as a promise to myself as well as anyone interested that I will keep working on the game!  I'll probably work on it tonight instead of studying the reading for tomorrow.

Don't give me that look, I already read all the required material, but our teacher gives us pop quizzes at the most random times... and despite having done the reading the quizzes are worded somewhat ambiguously.  I'll study them again, but not tonight, once I'm done writing this I will most likely go back to the game and try and get more functionality imparted onto my enemies.

Now what to write about?  Well lets see... aside from midterms I've managed to land myself a job as a Lab Moderator at the DePaul gaming labs!  Not a dream job by any stretch of the imagination but extra money is greatly appreciated where it can be found for me or any other college student whose parent's are ludicrously rich (or Ludacris aka. Christopher Brian Bridges, no wonder the guy took a stage name!) and it also fulfills a DePaul-specific requirement known as the Junior Year Experiential Learning Experience which is supposed to be reserved for an internship.  I still plan on pursuing an internship somewhere either this summer or the next, but I'm not taking any chances on not having such a requirement of my graduation lacking, especially considering I want to be out of here in a year and a quarter!

Hm, what else?  Well Sensei has let me know that he might try and have me entered in the Tohkon tournament coming up in June.  I'll have to get my behind ready if I want to go, and I do!  So stay posted on that, I guess?

Until next time, interwebz.

Oh, and Joan, this is your shoutout! At least, that's what I think you were talking about.  My Spanish is awful.  I can count to 10, say please and thank you, and ask where the bathroom is.  Actually, I'm not sure I know "where" I can just say "bathroom" with a very confused/urgent look on my face.

-Kev
I'm not one for fast food usually but... I really miss In-N-Out

Tuesday, April 19, 2011

I don't use spell check

It's a toaster.  Get it?
Okay so that's not entirely true, but for the most part I don't spell check, I just write right into the blog.  Luckily I'm an avid firefox user and it usually does the spell-checking for me.  Fact of the matter is, I'm absolutely terrible at spelling and have been for a very long time.  From about the time I learned how to spell (or rather, what spelling was and not necessarily how to preform it well)
I don't use spell check.

I rely on spell check.

Two very different concepts there.

Its rather similar to what I do when I code (at least for now, before I take all of my higher-level classes)
I look at something, don't understand it and play around with it until I either a: understand it, or b: get it to work like I want and then pray that it holds together.
I did that on a final last quarter working with my friends David (you've heard of him before, awesome, bearded man) and Brian (also awesome, not so much bearded though) on a game that wanted to do more than use standard FPS (first-person-shooter, or first person perspective in this case) controls so I set about trying to figure our what made the camera tick.  Turns out the camera used a mathematical concept called Quaternions, which to this day I still have no real idea what it is.  I googled them, read the Wikipeida entry (thoroughly) but am only more confused than I was originally.  I know it involves sets of four points, and imaginary numbers.

(If anyone is a mathematician or math major, I'd really appreciate if you could bestow understanding upon me!  I'm only in Calc. 1!)

Anyway, I had to figure out how to control the camera using math I had no clue about, and I managed to do so (with some rough patches here/there) and as it would turn out our professor was so impressed with our attempt at camera control (apparently nobody thought to ditch the first-person-perspective before, or at least with as great a degree as we did) that he went back and, understanding Quaternions, overhauled his game engine for the next class to come along based, somewhat, on what we had done!
That's good, right?

Sidenote: we did our games last quarter in Iridel, if you have XNA and wish to tinker around with it, by all means go ahead, the documentation isn't to bad!

I still base segments of my game's code on how our professor set up the engine.  Goes back to that idea of relying on spell checker instead of using it.  I rely on the core Iridel components to conceptualize how to achieve a certain goal in my games sometimes.

But it's as good a way as any to learn, I guess, if nobody else is teaching you at the moment.  Another great way to learn, as I have come to see, is to teach others.  Even if you don't entirely understand it, try to teach it to others, and you may come out with a better concept of what you are trying to accomplish on your own end.

I do it for Judo, I still suck but I can see where a throw goes wrong, and apply it to my own throws.  At least in theory, I still get slammed every once and a while.
Ah, yes, I forgot to mention, I'm an avid martial artist.  Please don't try and find me and challenge me to a ninja fight, I'm no Bruce Lee, I just happen to love martial arts!  Side note about my self, hope you didn't mind.

Look ma!  GIGANTE EXTRANJERIA!
I don't know why I included that, I was just going through my old stuff seeing if there were any game screens I wanted to post of any of my old projects.  Internet, I still don't know if we are friends enough to run the embarrassment of seeing my old games (nah, I just couldn't find any screens) so here's a 3d rendering I did a while back instead.  I just like pictures!  Probably a side-effect of my hard core addiction to the Chive. Check it.  I may have just made you Chivers.  Its awesome, don't look back.

Well, I think that about does it for today.  I just ate half a can of peanuts.  I probably shouldn't have done that, I meant to eat in moderation today... nuts.

Well hopefully I can work that off tomorrow.  Well see...

So long, and farewell my internet-based friends,

- Kev

P.S. - DAVID CLEANED UP SOME OF MY CODE AND IT LOOKS SO MUCH BETTER!
100+ lines have been removed.  If you code, you know that's kindof a big deal.
You don't code? Why are you even here?

Monday, April 18, 2011

Daily Dedication




Word Reaches Pluto
Well this is the end of day two of "having a blog" so I might as well update this sucker before I head off to bed.  So far I think all of three people have read but that doesn't matter too much!
Oh yes, and...
It works!


The game is up and running!  I know it doesn't look very exciting at the moment, but after three weeks of developing the graphics "capabilities" I want in the game (Including rotation, animation, scaling and pixel-by-pixel collision) it runs!  Soon the game will be in a demo-able stage, and I'm excited for the development!

My job as of now in the game is to work on enemy attack patterns/appearance patterns and to manage the health of the player.  Eventually this sucker will end up on the Windows phone (provided nothing I did was too CPU-intensive!) and the horizontal alignment you can make out in the picture will be vertical.  But I won't divulge much more about the game at the moment.  Rest assured when the time comes I'll be sticking all of my friends in front of this puppy and observing their reactions to the gameplay to see where I need to improve.  If I've learned anything about game development in my design classes, it's that watching a person play your games, uninstructed and unassisted, will give you the most valuable feedback about your game - Is it fun? Is it too easy/hard?  Is this part of the game as obvious as it should be?

If any of my friends are reading this, yes, you will be guinea pigs.  But don't worry, its for the greater good.  Just pretend you are doing science!

Hmm, what else?  Well, I purchased a factory-refurbished Bamboo tablet!  It was cheaper than the $200  version (well out of my price range) but at the same time it was still a pretty penny (around $120) so I'll be starving towards the end of the quarter, but it will be worth it.  I don't know if you can see from the image, but that's all my "artwork" and it looks pretty crappy.  I'm no fantastic artist, but as you might be able to tell I do better with a pen/paper than I do with a computer mouse.  Hopefully getting a tablet will boost my art for my games considerably, at least to the level that my doodles are at!  And no, I don't plan on those being the "final graphics" in my game, that would be too unfortunate.  Those are mostly stand-ins at the moment.

So that was the future of the game, what I need to do in the near future, and what I've done to make it a bit brighter (getting a tablet!)

What else?

Well, my friend and co-conspirator David shaved.  He looks a lot different without a beard, but my main complaint is I wish that I could grow a beard such as he had!  All that bearded goodness and he shaved it.
Nope. Nuthin'
 With that, teh interwebs, I think it's time to bid you adieu!  Stay classy.  Or, you know, not.

-Kev











Sunday, April 17, 2011

Hello World

(pictures at the bottom!)

#include <iostream>

using namespace std;

int main()
{
cout << "Hello world!" << endl;
return 0;
}



I know, I know, how cliche' of me.  I've come a long way since my very first hello world program, and yet at times it still feels like I know little more than what you see above.

Well, let's start with the basics, shall we?  A little Q 'n A never hurt.

Q: Who are you?

A: My name is Kevin, I'm a student at DePaul university in Chicago, IL.  I'm studying Video Game Development there, with the hopes to one day make really awesome video games that people will love to play!

Q: What is your background in games?

A: Glad you asked! When I was about 12 and still about as white-'n-nerdy as I am today I received a "Game Programming For Teens" book from my aunt and uncle, and well let's just say I never looked back, though I did hop around for a bit.

First I coded like crazy for about two years in a language called Blitz Basic (I highly recommend it, if it is still around that is) and basically the whole ordeal was me trying to teach myself coding.  Blitz Basic is a fairly easy language but for an easily distracted twelve year old it was still rather difficult to get the hang of.  I made a number of small games in Blitz that never really saw the light of day, either because I'd encounter a bug I couldn't get rid of, ran up against a math barrier, or just because I got bored and had a new-and-better project I wanted to move onto.  Eventually I wanted to become a "Big boy" and tackle C++.  That's where my coding efforts took a nose-dive.  C++ is much more complicated than Blitz Basic, at least from the perspective of a game developer.  Blitz was made for game development, it had it's own graphics capabilities and many other nifty tricks for games, specifically. C++ is a tool for any multitude of jobs, and as such if you want graphics, you either need to code it yourself, or use a third-party graphics library.  Both were, when combined with trying to learn the more complicated syntax of C++, too much for my then-fourteen year old mind and I essentially gave up coding for a number of years.
Then I dove into the world of computer animation, with both flash and using 3d modeling programs like 3DS max that my local community college had (I took a few classes at the CC while still in high school)
Long before that I had attempted to write a novel-at the age of about ten- that needless to say did not go well, but six hundred pages of attempted character/story development later I had learned much about the craft of story telling.
Individually I am an far from expert in anything:
My coding works, it's not pretty but it gets the job done.
My artwork is alright, but its not of consistent professional quality
My animation is smooth but I cannot animated for extended amounts of time before I get distracted
My 3D work is so-so, but passable.  At the very least I can build a model and UV wrap it somewhat neatly.
My writing is at times dis-jointed but on the whole pretty solid
Combined however, these skills give me a great background to become a game designer one day, who has to be a jack-of-all trades to be able to communicate the needs of the game to the rest of the team.

And for those of you who criticize me for not becoming an expert in a given field, I kindly request you hold your tongue, for that is what I am going to college for. I will graduate in about a year with a degree in Game Development, concentrating in Game Programming.  I'll become an expert in one area (notably the most essential area of game development) and then tackle games from there.

Q: Why are you creating a blog?  Why would I want to read it?

A: Honestly you don't have to read this and I won't hold it against you if you do.  I feel that if I manage a development blog that will, by some strange happenstance, motivate me to keep going with my development, even when the going gets rough or I get stuck.  Besides, as a developer (or a hopeful developer) it's always good to be able to look back on the process at the end of creating a game.  This may one day be a better resource for me, than it ever was a good read for you.

Q: So what are you working on? Show me your games!

A: Not yet!  Rest assured a game is in the works, for the Windows Phone (possibly android) and I am in the process with a good friend of mine, David.  The game is close (but not yet) at a demo-able stage known as a "vertical slice" -- essentially one-to-two minutes of final gameplay and nothing beyond that (no menus, no level 2, etc.)  When that happens I will reward you my loyal reader(s?) or if nobody reads this I will reward nobody in particular with some demo reels and screenshots of the game.  I have some older games I may dig up and put up on the site for play (.exe's so PC's only, and even then only for those whose anti-virus software will permit running a random .exe, so probably not many)
If I'm willing to face the embarrassment that is.


Q: (like anyone cares about a college dev. wanna, be, but...) How often will the site be updated?

A: I have no idea, I'll aim for once a day, if nothing more than a daily doodle from my infamously-doodled-upon notebooks. (Figure A)

Figure A.

non sequitur

Duces, Internet,

- Kev
Guess Who?