I moved to a new URL! Check it out!

posts tagged with: programming

Otter

Otter
For the past couple of months I've been working on a little framework using C# and SFML, and I think it's time to finally release it (in beta form) to the public!

Check out Otter!

Image


Right now Otter is only officially working in Windows with Visual Studio, but if anyone wants to figure out how to get it working in other programs and operating systems then let me know! The SFML dll files should be able to be used with Mono for Mac and Linux, but I don't know how to do that yet.

It's important to know that this is a beta release of the framework. There's still no official documentation, so you'll have to fumble around on your own for now if you're planning on using it. I also would advice against tackling any huge game projects for now unless you're comfortable digging into the source and changing stuff around yourself.

I'll be posting updates about Otter here on my web zone, and the latest version and updates will be available on Otter's website.

Dev Log: Using the Debug Console

Image


I think I've finally got this debug console working the way I want to for the time being. Right now I'm able to push log messages to it, and send commands that have been registered from the engine. The more I think about it, the more I don't really want to go all out on using reflection to invoke any method that exists in the program from the console, just because it doesn't seem to really match what I want the console to be used for.

One of the main purposes of this console will be the ability to debug large content games, like metroidvanias or something along those lines. Debug commands can be set to something like giving the player items, warping them to a specific location, and even summoning enemies or NPCs into the scene to test.

I also added the ability for the console to advance the game frame by frame, or however many frames the user wants. I can type "next 1" to advance the game one frame, or "next 60" to advance it 60 frames. This should come in handy for figuring out weird timing issues and making sure things are happening on the exact frames they should be.

I'm getting closer to the release of this framework as the last couple of things come into place. The last thing I'm looking into is better shader support, and after that I think all I have left to do is a lot of bug fixes and polish, and finally an example game to go along with it.

...but first I'm going to mess with shaders for awhile!

Dev Log: Debuggin Stuff

Dev Log: Debuggin Stuff
I'm trying to now take care of the last couple of things on my checklist before a public beta/release of my framework! This includes the elusive debugging and command console.

Image


This is the quick first pass of the debug console running in my Offspring Fling mock up using my framework. Right now all I can do is just type into this box, but eventually what I want to do is have commands being run from this console, as well as debug output being sent to it.

I'm also toying around with shaders as well and I think I'm starting to get a grasp on it, or at least fragment shaders, but I still have a lot to learn. Exciting!

--

Hey I'm editing this blog post to show the progress! Here's the console as it looks after working on it for the whole day:

Image


Still no fancy reflection, but for now it has cool enough stuff to debug a game, I think!

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.

Dev Log: Atlases

Dev Log: Atlases
Getting ready to head back home to Phoenix today after two weeks of being in the Northwest! I went to Seattle for PAX then up to Vancouver/Richmond to hang out at Indie House, and now I'm back in Seattle for a little bit and I fly out tonight.

During the week I was in Indie House I got a lot of work done on my upcoming 2d framework. One of the major features that I managed to get in is texture atlas support. Texture atlasing is pretty awesome and I'm surprised SFML doesn't have any cool built in support for it, but basically it's a way to pack all of your image assets into as few textures as possible to use in the game.

Image


I'm not super well versed on this kinda stuff, but apparently one of the most expensive things a video card has to do while running a game is switching which texture it's using to draw. So if you have a game that has 100 different sprites on 100 different textures, that can get kinda rough for the video card. However, if you can pack all those sprites into one texture and use just that one texture to get all the sprite data from, the video card only has to render that one texture (hopefully) so the performance is greatly increased.

This task had been on my to-do list for awhile but it wasn't until Saint requested it that I felt motivated to actually get it working. He was working on a little game in the framework as a test and it was super motivating (and also scary) to see someone using the framework! Right now the framework only supports the Sparrow/Starling export from Texture Packer. I'll leave support for more formats up to individual users after that.

I'm still busy working on my example game for my framework that will hopefully be done in a week or two. The major tasks for the rest of the game are just art, so I just need to buckle down and draw a whole bunch of stuff. Once the example game is done I'll be taking one last look at everything and then I'll make it public for anyone to use. There are some parts of the framework that are a little weird since I learned better C# programming practices as I coded it, so some of the earlier stuff probably needs some revisions, but aside from that this thing is almost ready to go!