Wednesday, July 20, 2016

Old School Graphics Lesson (Binary and Pixels)

I'm doing some programming and computer classes at a local library for kids and I'd had a cool idea from watching a video on how graphics worked on the Commodore and Nintendo. My intent is to teach the idea that computers use pixels to render objects and sort of define what that means. Also, we'll be looking at binary and it's relationship to pixels and data storage. This is for kids so we'll keep it as simple as possible.

First, an explanation of binary or base 2 numbers is required. We'll have a few places represented by square cards with powers of 2 written on them like so:
____ ___ ___ ____ ___ ____
| 32 | 16 |  8  |  4  |  2  |  1  |
----- ----- ----- ---- ----- -----

We can move these cards up and down to show what value is being represented. By counting the values of the numbers that are "down", we can figure out what the base 10 value would be. All cards up would equal 0 or 000000. The rightmost card down would equal 1 or 000001. The leftmost and ''8" cards down would be 40 or 101000. Once we establish the basic idea, we'll ask the student to make the day month and year of their birthday using binary.

Once we understand binary, we can draw a picture using the grid paper. We'll only use 1 of the 3 defined columns to keep it easy. By filling in a square, we're marking the binary value of that row as 1. So if you filled in the leftmost block only, the value would be 128. In this way, we can draw using the grid and then convert the values to binary, then to a numerical value that's 0-255. 

Once the student draws their picture using the grid, they can use this program that I wrote up to input their numerical values for each row. Once they fill in all the rows they'll the image they made on paper.

Hopefully this will provide them with an understanding of binary, how it can be used to store data on computers, and how early pixel graphics displays could work.

Monday, May 30, 2016

Ludum Dare rankings are in!

No top placers but we did pretty well, especially considering it was our first jam.
#125    Theme(Jam)    3.94#128    Fun(Jam)    3.68#148    Audio(Jam)    3.68#260    Mood(Jam)    3.48#276    Overall(Jam)    3.53#287    Graphics(Jam)    3.79#811    Innovation(Jam)    2.72
2712 Total Games were entered so not bad. Theme Fun and Audio were in the top 5% and the Mood Overall and Graphics were top ~10%. I'd like to see the numbers for total games entered in a given category as I'm sure they're much lower but I don't believe that information is available. Pretty happy with this.

Friday, April 22, 2016

Ludum Dare 35 (Shapeshift) - Shapetrak

Ludum Dare 35 just passed and this time I'd decided to participate with my friend Brian Thuringer (designer). Check him out he's got great work.

First of all here's our game: http://ludumdare.com/compo/ludum-dare-35/?action=preview&uid=55791





After spending a night trying to hash out an idea, the theme, "Shapeshift," proved to be harder than we'd first thought. Having have been on more than a few overscoped projects, I'd really wanted to get a solid game out more than anything. I've been researching "game feel" recently, having had read through the book with that title (available here) and taking notes on the many available talks. After the first night, we were in a bad place, we had nothin'. We'd gone through at least 3 ideas, followed the trail to the end and realized it was a stinker. Demoralized, we packed it in. The next morning, after some back and forth, Brian threw out a rehashed version of a previous idea, far simplified this time. Shift a shape to fit through the walls; an infinite runner crossed with a rhythm game. This would be the basis for the current design. I said, "Y'know what, it's day 2, lets go for it."


At first we'd considered going 2D but given how simple the shapes were I'd suggested it'd be quite easy to do in 3D. We settled on it and he pumped out a few models. I got the mechanics together as well as the cool chromatic tile system you see in the game. About mid-day we had the basis for gameplay established. At this point I threw together a custom shader to hue cycle the background to be the opposite of the ground tile in the center of the camera. This was looking good.


The next day I went to work on some polish and game feel items like screen shake, screen flash, particles, and tweaking difficulty and gameplay values. I got a few sfx from Brian, a music track I whipped up and some UI elements in. A few custom and boxed screen shaders later (desaturation shifting, screen bending, noise, bloom, contrast, ect) and it was getting ever nearer to the final vision.

Monday arrived and after work I thought I had until midnight to polish off the changes. I'd planned to use FMOD to increase the tempo of the music (but not the pitch) and to have the spawning of walls to line up with the beat. Well that was the day I'd learned that 6pm MST was the cutoff and man was that intense. As fast as humanly possible I nuked FMOD to get the game to compile correctly and polished some final values, barely (if at all?) eeking by the deadline. At that point I saw it, "Submission Hour! Get them in!". Relief and are-you-serious washed over me all at once. I checked chat to see Brian's words of encouragement and inquiries of "did you make it?". In this last hour I wrapped polished off some values and fixed a bug or two and got the build off.

Overall, I feel like this game is quite fun and although there are many games that are similar in their own way, I would say ours feels the best. Game jam games usually feel sort of stiff and unpolished but I feel like this game managed to shake that. Feedback has been awesome so far (thanks everyone!) and I hopefully await the final judgement of best games. I'd reviewed quite a few other great games and through this our game has received over the number of reviews required to be in the running for its various categories. A few streamers even played our game live at my request which was a great feeling.


I learned a fair bit, had a lot of fun and made a game I'm proud of. Check it out and let me know what you think. Can't wait for the next one!

Saturday, April 18, 2015

So much to do, so much to see

I have gotten an occlusion culling system implemented into Unity Free! It uses a combination of realtime and baked modes for optimal results. Check out the video for more details. Download the source + an example scene via the link below. It is worth noting that Unity 5, which came out this previous week, includes occlusion culling, LOD and all of the other previously restricted-to-pro engine features. I've additionally done some low level research and done an occlusion culling presentation at work! (Slideshow here)

I've also done some further testing with markerless motion capture tech. iPi Motion Record / Capture yields some satisfying results for simple animations. More complex animations require an additional Kinect to be placed perpendicular to the current camera. Any frames where an arm or leg is occluded (which is rather often) requires manual placement of the limb for each frame. The best option would seem to be using 6 PS Eyes.

The behavior tree has gotten some work as well. I've put in the back end to start setting up the logic and am working toward getting a character moving around with it. I've been dividing time between this and playing with tasty new Unity 5 features, though I've also had my eye on Unreal Engine's freeness too! I've gotten a Google Cardboard VR headest I've been playing with. I'm intrigued by the possibility of using HRTFs for accurate 3D audio response with VR. I've gotten a test scene working with some custom assets I'd made (learning my way around blender a bit too!) to further work with the VR tech.

In the immortal words of Smashmouth's Steven Scott Harwell, "So much to do, so much to see." -MB


Progress
  • Polished occlusion culling script
  • Added baked version that creates cells with mesh information
    • Can be used with realtime scanning or on its own
  • Generates bounding volume of mesh renderers
    • Can define unit size for grid in each dimension. This is the maximum size a given grid cell will be before an additional cell is added in that dimension.
  • Buttons to disable LOD, culling, baked, realtime, or both
  • Created example scene and uploaded with source, avail above.
  • Behavior Tree logic progress
  • Structure of tree logic using event based system
  • Starting creating action logic
  • Primitive data passing through tree
  • Further motion capture research
  • Got a solid walking animation, took a bit of work
  • Tried for some other animations with poorer results
  • Created a test scene for Google Cardboard VR


Goals

  • (Behavior Tree) Make AI character execute GotoGameobject behavior
    • Add arguments to BT nodes
    • Add inspector panel to VBT
    • Write action
    • Make VBT connect to and implement BT logic
      • Write composite and decorator logic into VBT
  • Dig in to Unreal Engine with startup tutorials, using C++

Wednesday, February 4, 2015

Occlusion Culling + LOD Progress (Video)

I've been working on getting an effective occlusion culling solution implemented and have come up with a raycasting based one after a few iterations, in addition to an integrated LOD solution. I'm going to optimize further and then move on to finish the VBT editor.



Progress
  • Occlusion culling script functioning
  • LOD script complete
  • Added new house models, improved model importing workflow
  • New leather armor created
  • Redid character armor equipping method, which will result in far less clipping and easier animations
  • Gameplay flow outlined more thoroughly in GDD
  • Overhauled test town level
  • Added new guard tower model
  • Added new trader post model
  • Added new tavern model
  • Added new town hall model
  • Further research into optimal behavior tree implementation (Node/Task)

Goals
  • Fix time slowdown on framerate drop
  • Further optimize occlusion culling via precalculation (baking)
  • Publish Occlusion Culling + LOD solution to Asset Store
  • Improve lightmapping + lighting
  • Make AI character execute GotoGameobject behavior
    • Add arguments to BT nodes
    • Add inspector panel to VBT
    • Write action
    • Make VBT connect to and implement BT logic
      • Use node / task structure to avoid redundant allocation
      • Write composite and decorator logic into VBT?
  • Improve motion capture importing. Try to not apply root motion on export.
    • Make test capture to debug skeleton mapping

Tuesday, January 27, 2015

Abomination with ragdoll throwing action!

In this and future posts I'll be giving a short description of the work in progress and then list the changes from the previous post, future goals for the next and maybe some screenshots and/or videos at the bottom.


Progress
  • Added Abomination character with a few animations 
  • Added animation to human of being picked up and thrown by abomination 
  • Correlated human and abomination throwing animations, so that they work together and the human is ragdolled and thrown away 
  • Added camera tracking so that camera will now automatically track the player model when it goes ragdoll 
  • Added new version of wealthy town house 
  • Improved model importing workflow 
  • Reorganized repository

Goals
  • Fix time slowdown on framerate drop
  • Look into writing rudimentary occlusion culling for optimization
  • Improve lightmapping + lighting
  • Make AI character execute GotoGameobject behavior
    • Add arguments to BT nodes
    • Add inspector panel to VBT
    • Write action
    • Make VBT connect to and implement BT logic
      • Write composite and decorator logic into VBT?
  • Improve motion capture importing. Try to not apply root motion on export.
    • Make test capture to debug skeleton mapping








Tuesday, January 20, 2015

Mo'cappin, VBT Updates

In the past few days, we've gotten some new motion capture tech working! We're working out a solid workflow currently, but this should do well for the quality of animations.

Amongst the havoc of motion capture, I've made some pretty updates to the Visual Behavior Tree (VBT) Editor. New icons, as well as some additional functionality (scraping the directory to get node types and listing them out). This bad boy will be ready to go after a few more tweaks.


(Some slick new icons in an example tree structure)

Next up is hooking up the VBT for use and refining the mocapped animation workflow to start pumping them out. Be well!

-MB