Jump to content

  • Log In with Google      Sign In   
  • Create Account

Journal of dbaumgart


Learning 2D Unity

Posted by , 10 January 2017 - - - - - - · 514 views

So I've been doing lots of reading up on Unity & tutorials to get a grip on how it works. I felt like rambling about a few thoughts and observations about Unity in the process of doing this, so here goes.


When a pixel isn't a pixel


Although I've worked in a 3D pipeline, my skillset is 2D art. If I'm making a game, it's going to use 2D art. Here's the thing - let's throw a texture into a default Unity setup for a 2D. Texture:


Attached Image


Here it's dropped into Unity - an admirably simple process! - and I hit "go".


Attached Image


I've taken a screenshot and put it into Photoshop to show that the texture now appears to be 360x360 rather than 512x512.


And oh man does the simple fact that a pixel isn't a pixel by default ever drive me crazy. After some calm breathing and doing a bit of reading, I did figure it out. Given context, what is going on here makes sense: Unity was built from the ground-up as a 3D engine, its underlying assumptions work on those principles. The game is based on arbitrary units of measurement, let's call them Unity Units or UU. You must set the number of UUs to a measure of half your vertical screenspace. So by default it's something like this:


Attached Image


That's a "Size" setting of 5 on the default orthographic camera which sets the vertical distance from center to edge to 5uu. I'm assuming here that the screen is of 16:9 ratio, the most common desktop monitor ratio. I cannot assume that this will be 1920x1080 like my monitor and that most used for PC gaming. Maybe it'll be 1366x768 -- super common -- who knows!


What's a 2D game-maker who wants control of pixels to do? First: come up with a standard pixels-per-uu when importing art. Second, set your camera size up so that one pixel is one pixel. Third, you're going to have to write a script that changes your camera size setting based on what resolution the game is initialized with. Thankfully like a million people have solved this problem already and solutions are easily discovered via search. Plus any artist worth their pixels should know the theory required to make this happen anyway, so it's a worthwhile cause.


There's also a question of figuring out what you want the game to do when it hits an unexpected width:height ratio. You may end up shows more or less of the gameplay area than intended...


Anyway that was fun.


(Aside, I was discussing the animation system with my former animator. He observed that it's pretty clearly a 3D animation system being adapted to handle 2D animations. Just so with everything here!)


Edit: A 2D game can of course be made without 1:1 pixel ratio between art and display. (It just bothers me.)




I've been doing tutorials! Not only for Unity, but for C#. Much of my experience has been with pretty free-wheeling languages like Python and Lua so it's educational to move to C#. Anyway, been doing pretty well with that, now working more on applying it via Unity.


I appreciate what a pain it is to keep tutorials up-to-date with the latest version of the engine. It's also an unfortunate experience to be doing a tutorial and discovering that something isn't working as intended due to version differences. On the upside, you can usually count on lots of other people running into such problems and complaining about it online, sometimes with constructive results.


The official 2D roguelike tutorial was particularly applicable to the 'learning project' I'm planning to undertake (more on that in another post - it's not a roguelike!). It feels .. overwrought? to use raycasting and rigid body colliders to do collision detection in a simple step-based 2D grid world game, but I think the point is to demonstrate working with Unity's built-in components.


Few more thoughts


Following up on that, wow does Unity come with a lot of neat stuff! It makes it deceptively easy, perhaps, to make a shooter or platformer (with physics and all that fun!). And a bit harder to make the sort of thing I tend to be interested in. I should emphasize that this isn't meant as a disparaging comment; it's a great toolset. Just that there is a clear path of least resistance. Still, even the path of greater resistance in Unity is a heck of a lot easier than the easiest of some of the alternatives I've used.


In particular, I love the UI system. It's so liberating compared to my experience coding my own from scratch and using a very limited custom system in the last few years. I'm finding it easier to dump debug info to an output on the screen than using the debug console output (which I concede contains vastly more information than the string logged).


I'm excited to carry on with this. The learning project is proceeding apace, but I'll leave it with "don't hype until you've got a working prototype".

A review of works from 2011-2016

Posted by , in Starsector, Clockwork Empires, Gaslamp Games, Dungeons of Dredmor 15 December 2016 - - - - - - · 760 views

So it's been five, almost six years since that last entry. I was busy for a bit there it seems, eh? Let's do a quick review of what happened to catch up to the present.


2011-2012: Dredmor


With two other guys I founded Gaslamp Games. Being "the artist" I got the grandiose corporate title best-met-with-skepticism of "chief creative officer". I don't actually think it quite accurately described my role, but we'll get there. Technically this happened in 2010 when we were collectively working on Dungeons of Dredmor which finally released in July of 2011. And it did rather well. An order of magnitude or two down from "other prominent commercially successful roguelike/likes of 2011", but successful nonetheless.


A few words on the success of Dredmor:
In hindsight, we had no bloody clue what we were doing. There were a couple things we did well enough, however, and that was 1. have a funny, cute, and/or easily appealing aesthetic 2. be accessible-enough (though painfully awkward by any of today's standards) but this may largely be 3. have a solid, quick couple game loops that worked nicely. There were also a few interesting, critical flaws which I can see in hindsight, but they're not supremely relevant to our story here.


Actually, I'm getting ahead of myself. Dredmor wasn't a success for any of those reasons. It was a success because it showed up on Steam in the year 2011 and was vaguely competent. Remember, this is before the floodgates opened. You only got on Steam in 2011 because you talked to Valve and they set you up. Indeed, for those handy with their backend, there was no backend in 2011. You sent them the assets and they set it up for you. Isn't that crazy? And the new releases per week -- oh, between what, 3 and 8 across all genres? Simply appearing at all in that market got you boatloads of impressions. Provided you didn't suck, you were good to go. So we were nobody, but we knew a biz-dev guy who was in the business and found that Valve was pushing the idea of Steam for MacOS and was looking for games that happened to be on MacOS. And some dude on the newfangled YouTubes named TotalBiscuit or something did a feature on Dredmor -- and Gaslamp was in. Luck and circumstance, man.


Making a pile of money off an indie game is pretty sweet - no, not that much, but a good amount. It's a very strange experience stumbling into success. You think you're brilliant and awesome and have important things to say. Other people think you're brilliant and awesome and have important things to say - and special wisdom that can be acquired through contact. Load of bollocks of course; we were young and stumbled into it. Looking back, I think it served largely to reinforce some pretty bad ideas in our heads about why it happened.
(I like to think my natural cynicism acted against this a bit, but it was still a baffling couple years.)


A couple expansion packs later, coming up on 2012, we decided it'd be great to move on to the next thing and make it stunningly ambitious. I will note for the record that my vote was to do a 2D take on revitalizing the Master of Magic genre, but the steampunk Dwarf Fortress idea won out. Thus: Clockwork Empires.


2012-2016: Clockwork Empires


I don't want to talk much about CE right now. It was released in October of this year after roughly 2 years development and 2 years early access. The broad points of this story are in the public record. I'll write about various aspects of the development more in the future. I will however make a few personal career points:


On Dredmor, my role was effectively principal artist/art director/game designer/writer. I made most of the art, contracted out that which I didn't, as well as implemented and iterated game content. On CE I was art director, concept & promo artist, 2D game artist (for UI, environment textures), did marketing content, did admin/accounting/paperwork, gameplay programmer, game designer, writer (marketing and content), and handled (some) testing procedures. Probably more to it than just that, but it felt like the jobs of 3 or 4 ... or 5 people. The key thing I also did was management.


Hiring contractors is one thing. You find someone, then they do their job or don't and you deal with it and go on your way. (Well, there's a lot to handling contractors which would be valuable and interesting to write about, but save that for another time.) Hiring and managing employees is another thing entirely. I knew not a damn thing about it before ramping up the CE art team, and management is not my natural inclination due to being a rather introverted kind of guy, but I dove in and hired three completely green artists - no previous employment experience in the industry - and molded them into a team. It was a difficult and rewarding experience. I learned tons, they learned tons, we did some really good work shockingly fast with the tools we had. I've got some stuff to say about what I learned doing that for another time.


One of the hardest things I'd had to do was firing my art team at the start of 2015. The required set of art was basically done, though the game was not. Not an ideal situation, that. I gave some nice recommendations and I think my artists were given a good start to their careers. And it's weird saying it because two of them are older than me, but I'm really proud of what they accomplished. (Just remembered another thing I'm proud of: the art team never crunched. Never.)


So, one way or another, it's done and shipped. Those were the most frustrating years of my life. In contrast with Dredmor where I learned a few easy lessons and missed the rest, with CE I learned a lot of the hard lessons.
(Makes for great blog fodder, mind you.)


2010-(ongoing) : Starfarer Starsector


Yes, this is still in development! And throughout my time at Gaslamp I still did freelance work on the game now called Starsector. (It had to change its name due to reasons I'm sure you can imagine without much work.)


And hey, Starsector is great. Still drawing spaceships, doing content implementation, and Alex gave me the job of writing game content. I'm a huge nerd about science fiction, so I just love being able to do this.


Not much else to say here; the game iterates slowly but surely and gets better and better with each release. I could get back into reposting stuff I write for the Starsector Dev blog which, not just to plug my own work, is legitimately really good.


And from here?


Now that we're caught up, well, I'll have to write about what happens next in future posts as it happens. Or as I feel compelled to write about old stuff. A few ideas:

  • I daresay I'm having a pretty good time putting random art on the Unity Store; it's giving me lots of time to draw those tilesets I love so much. Will show off some of the thinking going into that when I release the next one, perhaps.
  • Speaking of Unity -- and good lord, use Unity, don't make your own engine unless you're in it to find a hobby -- I've been learning it and C# for a while now. Once I have something worth showing, you gotta know that I'll show it off.
  • I'd like to write a series on the art direction of Clockwork Empires, both the strategic creative decisions made and perhaps the nitty-gritty of taking art from design to implementation.
  • ... and game development lessons learned in general, 'cause I got a couple.
Right, now let's get on with it.

Starfarer: Celestial Spheres

Posted by , in Starfarer 03 March 2011 - - - - - - · 764 views
Starfarer, planets, 3D painting and 1 more...
The world of Starfarer has lovely 3d planets which roll beneath whatever chaos you are sure to wreak out in space. It is only right, for what good is space without planets to fight over?

Below: Flying an absurdly over-armed frigate past a jungle-covered planet.

Posted Image

[This was written to promote Starfarer for Fractal Softworks], so please read the rest of this post on the Starfarer development blog!

By the way: Alex, the coder/designer/mastermind of Starfarer, is being interviewed on theImmortal Machines podcast tomorrow, so if you catch it in time you can leave him questions in the associated forum thread. The finished show should be posted sometime next week.

Gaslamp Games on the Immortal Machines podcast, posted!

Posted by , in Gaslamp Games 19 February 2011 - - - - - - · 680 views
interview, podcast and 2 more...
Nicholas and I were interviewed on the Immortal Machines podcast (an affiliate of Colony of Gamers) last week by the good bunch of guys there who were far too patient with certain Gaslampy ... excesses. Now you can listen in to learn dark secrets about the Dungeons of Dredmor -- about the unnatural habits of Thrusties, why Nicholas should not drink a pot of coffee on an empty stomach, and how much Dredmor isn't going to cost. Here's the link:

Immortal Machines episode 47: Gaslamp Games and Dungeons of Dredmor

Much thanks to the Immortal Machines guys for letting us on and to Colony of Gamers and their wonderful community for all their support!

The real question now is if they will ever make the mistake of letting us back on.

[re-posted from the Gaslamp Games blog.]

Gaslamp Games on Immortal Machines podcast

Posted by , in Gaslamp Games, Dungeons of Dredmor 03 February 2011 - - - - - - · 719 views
interview, podcast and 2 more...
So Nicholas (brave code-wizard) and I are going to be interviewed on the Immortal Machines podcast. Here's the entry on Colony of Gamers where people can post questions for us to get asked.

This will be our first official interview as Gaslamp Games! And, really, my first professional interview.

I'm excited and a bit nervous but I think it'll be fun. Hopefully we don't screw it up, heh. Naw, we'll do well. *I* think we're interesting people, at least.

January 2017 »

151617 18 192021

Recent Comments

Recent Comments