I moved to a new URL! Check it out!

posts tagged with: otter

Dev Log: Snakes and Skeletons

Dev Log: Snakes and Skeletons
The struggle of building creatures out of skeletons and bones continues this week as I try to finish up a Snake class for Otter! One of my other goals with enemies is to be able to construct enemies out of "snakes" of entities. Basically have a series of pieces all following the next piece like a slithering snake.

Image


I already had the ground work for this laid out last week, but today I dug into it some more so that I could actually have each piece of the snake be an entity with a skeleton. Now I can build crazy enemies and objects out of snakes composed of skeletons all animating! The next step is going to be going back to the game project itself and plugging some of this stuff in, as well as cleaning up the code as much as I can in order to have it be useful for people other than me.

Dev Log: More Skeletons!

Dev Log: More Skeletons!
This past week has been spent working on some Otter technology for implementing my own skeleton and bone systems.

Image


But Kyle why aren't you using Flash or Spine or Spriter or some other way to implement bone animation!?

Well in regards to flash, I've seen what is necessary for writing a flash file interpreter and I am totally not interested in going down that path at all. Flash is already a giant pain to use for just frame by frame animation, and I've used to create animations way back in my flash cartoon days of college, and that is something I don't want to relive. I wish Flash got an overhaul in regards to its UX, but that'll never happen, so I don't want to rely on it.

In regards to Spine and Spriter, I already use Spine for pure art based skeletons. The thing about Spine is that I actually cannot include the Spine runtime for Otter by default -- it has to live in a separate repository. This is because it is a violation of the Spine license to distribute the runtime to users who may not have purchased the full version of Spine. That is the main issue there, and also I have no idea how to use the Spine skeletons for what I want to do, nor do I know how to create Spine skeletons on the fly at runtime. I would use Spriter, but so far I have not seen any C# runtimes or APIs that don't have major issues.

Image


I ended up just creating my own since I felt that takes less time than learning how to use another tool, and since I have a very simple use case for this I can just jam out my own solution in a relatively quick time. I don't have any need for complicated animation files or animation blending or anything like that. This system is mostly designed to manipulate Entities in Otter, so that I can create big bad enemies built out of multiple pieces.

Also it may end up being the case that these enemies will be created at run time procedurally. If that is the case, I would have no idea how to implement that using Spine, Spriter, or Flash's systems.

Dev Log: Skeletons

Dev Log: Skeletons
This past week I've been chipping away at some general changes to Otter as well as doing some quick experiments with some things that I eventually want to include in my bigger game project.

The most recent of these experiments is setting up a general purposed skeleton system. The main idea is that I want to be able to make up enemies and other objects with a bunch of individual pieces that move around and animate. Normally I could say just using something like Spine or Spriter is good enough for this, but for this I wanted something of my own creation.

Image


The idea is that there is a Skeleton Entity in Otter that contains bones that all move, rotate, and scale based on their parent. Typical skeleton bone behavior. The difference is that each bone can hold an Entity on it. Each individual Entity on the bone can then have its own logic, so for example the first thing I want to have is the ability to destroy individual pieces of the skeleton. I can do that by having the Entities on each bone have logic for taking damage and being destroyed.

Image


So far I have one early iteration of this working but I'm realizing that the math that programs like Spine and Spriter do might be slightly different, and I'm trying to figure out exactly how they approach their transformations. It's a little difficult to find any articles or tutorials on how to code this stuff up yourself, as most people assume that using Spine or Spriter is what you want to do. I could potentially go back to using Spine and try to figure out how to wrangle its data format into loading a Skeleton into my custom format, but sometimes just making something yourself from scratch ends up being more straight forward!

Dev Log: Bezier Curves

Dev Log: Bezier Curves
This week has kinda sucked for game development stuff. I'm not really sure why, but I just haven't really felt super inspired to work on anything lately, and when I do try to work on things I feel like everything I make is just terrible so I procrastinate. It's a vicious cycle! So I tried to think of maybe something I can add to Otter because that should be easy enough.

I decided to try and just learn about bezier curves in more detail. I've never used them in a game, but it seems like they would be handy in a lot of aspects of game development. I found this quick tutorial and got started with recreating the example code in Otter.

Image


Although... I'm not sure if this is looking quite right. I'm pretty sure I'm doing the same exact code in the example, but for some reason every curve on my bezier path has sharp end points with the next curve on the path... so for now I'm going to have to look into this further, but the current source is in the Util class in Otter's dev branch if anyone wants to give it a look!

Otter Updates

Otter Updates
Some quick updates to Otter in the dev branch!

* Added the Polygon class: For the Polygon collision stuff I created a quick helper class to keep track of the points in a polygon. This class also has some neat functions that are used in the Collider class to figure out polygon collision stuff.

* Added PolygonCollider: Now there is an actual PolygonCollider in Otter! You can use it to check for collisions with any other type of collider too. I expect there to be some bugs so be on the look out when using it.

* Various Collider Updates: Some of the colliders had some minor bugs so I squashed all of the ones I could find.

Dev Log: Polygon Collisions

Dev Log: Polygon Collisions
I never thought I'd be able to get polygon collisions working in Otter but this past week I managed to jam out a quick prototype of an overlapping polygon test that seems to be working.

Image


Probably not the most exciting image in the world, but it's pretty dang cool to me. I found this tutorial on the Separating Axis Theorem. This tutorial specifically has some great images, and amazing pseudocode with explanations that allowed me to finally understand what the hell to do. I still don't understand some things, like what exactly projecting a vector onto an axis means, but right now I think I have the core of it working.

I'll be working on getting the PolygonCollider integrated into Otter properly over the next few days. That means I'll have to get it working with each other Collider type which shouldn't be too crazy, but we'll see if I end up getting stumped by something!