I moved to a new URL! Check it out!

posts tagged with: otter

Flippy Flop

Flippy Flop
Apparently there's a game jam going down soon about a recent mobile game sensation. I had a few hours to spare today and I wasn't being productive on my big game, so I decided to whip something up in Otter.

Image


Download Flippy Flop 1.0 (Windows, 1.6mb)

Not really a game jam game, but more like a game doodle.

Dev Log: Cooldown Drawing

Dev Log: Cooldown Drawing
Been a little bit sickly feeling these last couple days so I haven't been too active on the dev side of things. It's been super tough because I've been laying down the ground work for these systems that I want to be part of the game, and since I have no idea what I'm doing progress is a little bit slower than I'd like it to be. Maybe I should start working on a platformer on the side so I can at least dip my toes into familiar space every once in awhile.

One of the tasks on my to do list was to figure out how to draw those cool spell cool down graphics you always see in action RPG, and a lot of RTS games. When you have a spell or ability represented as an icon on the screen, one of the most common ways to show it's cool down before you can use it again is an overlay that slowly erodes with a radial wipe.

Image


There are a lot of different ways to do this, but eventually I went with this simple method using a triangle fan. I had written down an idea of using geometry before, but this implementation is waaay simpler than the madness I wrote in my notebook with using four quads or a triangle fan with way too many points. Here's the entire implementation, also available right now to use in Otter as SquareClock.
public class SquareClock : Image {

VertexArray vertices;

/// <summary>
/// Determines the fill of the clock.
/// </summary>
public float Fill {
set {
fill = Util.Clamp(value, 0, 1);
NeedsUpdate = true;
}
get {
return fill;
}
}
float fill = 1;

public SquareClock(int size, Color color) {
Width = size;
Height = size;

Color = color;

NeedsUpdate = true;
UpdateClock();
}

void UpdateClock() {
if (!NeedsUpdate) return;


if (fill == 1) {
//draw box
vertices = new VertexArray(PrimitiveType.Quads);
Append(vertices, 0, 0);
Append(vertices, Width, 0);
Append(vertices, Width, Height);
Append(vertices, 0, Height);
}
else {

vertices = new VertexArray(PrimitiveType.TrianglesFan);

if (fill > 0) {
//draw center
Append(vertices, HalfWidth, HalfHeight);
//draw middle top
Append(vertices, HalfWidth, 0);
if (fill >= 0.125f) {
//draw left top
Append(vertices, 0, 0);
}
if (fill >= 0.375f) {
//draw left bottom
Append(vertices, 0, Height);
}
if (fill >= 0.625f) {
//draw right bottom
Append(vertices, Width, Height);
}
if (fill >= 0.875f) {
//draw right top
Append(vertices, Width, 0);
}

// get vector of angle
var v = new Vector2(Util.PolarX(FillAngle, HalfWidth), Util.PolarY(FillAngle, HalfHeight));
// adjust length of vector to meet square
var l = (float)Math.Max(Math.Abs(v.X), Math.Abs(v.Y));
if (l <= HalfWidth) {
v.X /= l;
v.Y /= l;
}
// append the vector
Append(vertices, HalfWidth + (float)v.X * HalfWidth, HalfHeight + (float)v.Y * HalfHeight);

}
}

DrawableSource = vertices;

NeedsUpdate = false;
}

public float FillAngle {
get { return (fill * 360) + 90; }
}

void Append(VertexArray v, float x, float y) {
v.Append(x, y, Color);

}
public override void Update() {
base.Update();
UpdateClock();
}

}
The downside with this implementation is that I'm pretty limited as to where I can draw the original angle from. Since I've made this into a Graphic type in Otter I can actually flip it, scale it, and rotate it in any way I want, but I won't be able to change where the start and ending angle end up. That's okay for now since I won't be needing that functionality myself, but maybe if I have some time I can implement a more advanced version of it soon.

Otter Updates

Otter Updates
As I work away at my next project I'm also pushing some changes to Otter, which is my 2d game making framework that runs on SFML 2 and C#.

I didn't get to make many updates during the holidays, but now I'm back in the swing of things. Here's some of the latest stuff that's been updated:

Better mouse locking.
You can now lock the mouse to the center of the screen and use the delta mouse positions to track the cursor position. If you use this option you can still just use Input.MouseX and Input.MouseY normally.

Debugger fixes
The mouse unlocks when the debugger is opened, and I think I fixed some bugs with hiding and showing the debugger. The log will now look nicer when using Log to print multiple lines. Added quit to do the same thing as exit.

Session construtor public
Just in case you want to extend session, but I'm not sure if I want to keep it this way.

Updated SFML dlls
I found that someone made new builds of SFML so I was able to update the dll files to fix some bugs (like only being able to click on the title bar to gain focus)

Image shake property (still weird now though)
Images can now shake but this doesn't make too much sense because the shake is updated at every render call (instead of update)

Rich text documentation
Added some more comments to rich text

More Rand functions
Rand.Float() can use a Range now, and there's a method for generating a point inside a circle.

Util additions
Added some stuff to Util that may or may not be useful.

AutoTimer added
A utility component class that might be useful for some stuff.

Linux, OS X stuff
Merged in the .csproj file from Ventero for hopefully Linux and OS X support with Mono? I'm not totally sure how this stuff works but Linux and OS X should be easier to build with this new .csproj file and Mono.

Dev Log: Shootin' Stuff

Dev Log: Shootin' Stuff
As I spend most of my time visiting family in the cold north east of the U.S., I still have some down time to work on my next project. I've been trying to flesh out the feel of the moment to moment game play which will involve a lot of enemies, shooting, and explosions. Eventually there will be a system to build islands and structures, and then some kind of overall goal to complete for each challenge, but for now I am just focusing on the details of combat.

Right now this is what it currently looks like in animated gif form:

Image


Image


I've been playing around a lot with hit freezing the action for when enemies are hit and destroyed, and still not totally sure if I like it or not. I think I might reserve it for larger enemies and more significant events and explosions, but it is kinda cool. I also threw damage numbers onto stuff just to see how it would look and surprisingly it makes shooting things magically more satisfying. In the final build of the game I'll probably have the option to turn it off.

I've also been updating some things in Otter as I work and I'll most likely save a lot of it for one big push with a lot of changes. It doesn't look like I'll be able to get any video tutorials recorded, so it may be a little while before I make another one of those.

Trying to keep up with my usual 15ish blog posts a month, but I'll have to go double time from here on out to hit my goal!

Dev Log: December Madness

Dev Log: December Madness
December is looking like a pretty slow month for me as far as development and blog posts go. I spent a lot of last week getting ready to travel back to the cold north east, and spent all day on airplanes yesterday. I'm slowly grinding away at some stuff.

I managed to push a new build of Offspring Fling to Steam for both Windows and Mac. The controller support for the builds has been vastly improved thanks to AIRControl. Achievements are now also working for both versions of the game which is super cool, thanks to FRESteamWorks. Currently the only way to get the new build is through the Beta branch on Steam, which you can access with the password iwannatestosf.

Some small updates are coming to Otter as well, and if I can manage to record a video or two while I'm traveling that'd be pretty neat, but right now I don't think I'm going to have much time for that. As I start to chip away at the project tentatively titled Gaiaden, I'm making a lot of minor tweaks to the engine. I'm still playing around a lot with the exact order of updating and rendering stuff, so we'll see what happens when the dust settles.

Also check out this blurry cell phone photo of a crazy mansion in Albany, NY all decked out for Christmas.

Image

More Otter Updates

More Otter Updates
Whoops! I really let myself go on the blog updating schedule. I've been still cranking away at some updates for Otter.

Image

The latest update that I've pushed includes some new stuff for rendering Images. Images can now be drawn by using only a specific source rectangle from the Image with the function Draw.ImagePart(). This resulted in me also making Draw.ImageWaveX() and Draw.ImageWaveY(). You can see those two functions in action up there in that image. Yeah, I know a shader can also do this, but I thought it'd be fun to do it an old fashioned way as well.

I've gone through and fixed some bugs in the new StateMachine<>() class as well. The new StateMachine<> lets you use any key you want to keep track of states, and if you use an enum for the states then it will automatically populate the states from the names of the enums and the matching names of functions. For example, if you have an enum with the name "Walking" the StateMachine will look for functions named "EnterWalking" "UpdateWalking" and "ExitWalking" to correspond with that state. This means less boilerplate code for getting a state machine up and running.

There's been some other minor clean up of bugs and I've been tinkering with things as I chip away at my next big project. The latest version of Otter is always available here. I wonder if anyone will use it for the upcoming Ludum Dare! That would be super cool.