I moved to a new URL! Check it out!

posts filed under: general

Dev Log: Drawing Lines

Dev Log: Drawing Lines
My to do list continues to grow shorter with my framework! Today I finished getting my draw line utility functions working. Check out these beautiful lines.

Image


Being able to draw things like rectangles, circles, and lines on the fly can be really useful for prototyping, debugging, and even effects for a game. The regular old line drawing using OpenGL results in just a one pixel thick line from point A to B, and that's no good for most cases.

For the red line I'm converting the line into a quad using some vector magic that doesn't really make sense to me yet but it works. The ends of the lines are hard edges, as it's just a quad. But the blue line is where the true magic happens. It's a line with rounded ends, WHOA! It took me awhile to figure out, but I'm drawing it using similar logic to the red line but adding a bunch of points to go around the outside of each end point of the line. It's using a TriangleFan to draw, whatever that means.

I've also been spending time attempting to document things in the code to prepare for a public "beta" release of the framework. It's coming very soon!

Dev Log: Quick Prototype Testing

Image


Just playing around with things today -- I figured it would be a cool test to implement some Offspring Fling stuff in my C# framework. It was surprisingly easy to pull off and only took me about 2 or 3 hours to get to this point (and a lot of that time was spent debugging some errors I made in my Ogmo Editor helper class, WHOOPS.)

Right now I'm working on the ever so annoying bug of the game rendering once before it updates once. It's proving to be pretty difficult to hunt down even when I wrote the damn thing myself (FlashPunk had this problem too.)

Oh and if anyone out there listening wants advanced access to my framework before I publicly release it then let me know. I'm looking for a handful of people that will tinker around with it! (You can use the form at the bottom of my site to contact me, or send an email to hi@kpulv.com.)

Dev Log: Ogmo and Reflection!

Dev Log: Ogmo and Reflection!
One of the things that is super important to me when working with any framework is how fast it is, especially in a game jam type scenario. I spent the weekend working on more utility stuff for my upcoming C# SFML framework, including more handy ways of loading up Ogmo Editor levels.

Here's what my current Ogmo Editor project looks like for my example game:

Image


And here's what it looks like after I just do a simple init with a few lines of code:

Image


OgmoProject = new OgmoProject("assets/Example.oep", "ExampleGame", "assets/");
OgmoProject.ColliderTags.Add("Solid", (int)Tags.Solid);
Game.Color = OgmoProject.BackgroundColor;

And for loading levels, all I have to do is this!

OgmoProject.LoadLevel(source, this);

That code snippet is from my Level class which extends Scene (which is sort of like Flashpunk's World class.)

This is pretty awesome for game jamming since the OgmoProject utility classes uses reflection to figure out which stuff to load into my levels. With reflection I can just create any entities that I need to from the Ogmo level files. Back in AS3 land I had something similar to this, except I had to register each entity that I wanted to have loaded in the level, but now with magic in C# I can just look up types to create based off of strings. AWESOME.

I only really do this kind of stuff for loading and initializing things though, as doing something like this during a game's update loop could be pretty costly in the performance realm. Reflection is awesome but I gotta be careful about it!

Dev Log: Setting Up UI

Dev Log: Setting Up UI
I've been stuck on this for longer than I wanted to be, but one of the main things that I want to get working for my C# framework is easy to use UI stuff. I'm talking about super basic UI though. Right now I'm not even considering mouse input, only keyboard and controller input.

Image


Basic menus are the only thing that I'm after right now. Eventually I want to have something that will allow for rapid construction of more elaborate stuff, but just organizing this code in a way that keeps it easy to use and generic is proving to be pretty difficult! My whole goal with any framework is to make to super fast for the purposes of game jams -- game jamming is the true stress test of any game development software or framework in my opinion!

I just trashed a bunch of code that I wrote over the past couple of days, and I'm changing my approach a little bit. I ran into a wall when it came to having menus inside menus and only wanting one of those menus to have focus, so now I'm reworking it so that each time I want to make a menu system I have to load it all up inside a base UIManager class. That class is a Component that can be added to any Entity in the game, so all I have to do is have an Entity in a Scene with that Component. Maybe that sounds a little complicated... but I think I'm on to something here! I haven't been able to find many resources on how to go about doing this though, so I'm just flying blind.

Not the most exciting update in the world, but it's pretty hard to make UI coding exciting.

I Defeated King Yama

I Defeated King Yama
Inspired by the wise Paul Hubans I finally picked up Spelunky for the PC. I played the XBLA version for a little while but I never got very far past just beating the game normally without shortcuts.

At PAX I witnessed Spelunky Video Armageddon in which Colin Northway unleashed secret technology involving robbing shop keepers. His technique has spread like wildfire and it was just the spark I needed to get back into the game.

I've always played the game by not robbing shop keepers because I feared them waiting for me at the exit of each level, but little did I know all it takes is a day's worth of practice to develop some shop keeper murder methods. With my new knowledge on how to viciously murder every shop keeper in the black market, I finally made it all the way to the end of the game and defeated the king of hell after just starting to play the game again 2 days ago.

Image


I even did it without sticky bombs!

Anyway, that was a much needed break from constantly coding and working on stuff. Another reason I started playing Spelunky again was to study how they did tiles, because I'm discovering once again that making tiles in a high resolution is a giant pain. Back to work!

Dev Log: Example Game Arts

Dev Log: Example Game Arts
For my upcoming 2d framework built with C# and SFML I'm building an example game that at first was going to be a super quick project, but when it comes to art I'm still a little stumped on what the best workflow is going to be.

The game is going to be a little simple platformer, and if this were pixel art then I would have no problem just jamming out a bunch of pixel art for it... but with high res comes all kinds of problems.

I usually have used GraphicsGale for pixel art and animation, but now with high res Gale is no longer a very viable option. There's animating in Photoshop but it's horrible for animating. I really wish the animation options in Photoshop were better. There's tools like Spine and Spriter, but they're more for 2d bone animation and don't really help at all when it comes to frame by frame hand drawn animations.

There's also the problem of tile sets. With pixel art comes a very limited canvas site and color set per tile so making tiles line up with each other is a relatively simple task. When the resolution of color and canvas size increase then it becomes more and more of a pain to make each tile line up. I tried this with Snapshot but eventually I gave up and just faked using a tile set by making a bunch of independent images about the size of a tile and just stamped them on top of each other. Unfortunately right now that isn't an option for this game since I'm using Ogmo Editor as my level editor and strict tiles is probably my only option.

Here's a quick sketch of what I want the game to sort of resemble and I can already tell the tile set is going to be a nightmare because of the bleed of certain tiles (like grass, even stones have bleed, argh!)

Image


So that's where I'm at right now. I'm continuing to chip away at code somewhat as I think about how to possibly solve these art pipeline issues, and I expect to be done with the example game sometime next month along with the first public release of the framework.