Brian Crick

Blog

Mainstreaming

A couple years ago, I got a new computer. It was my first computer with a discrete graphics card. And I was all excited, because I’d finally be able to play graphically intensive, visually stunning, modern PC games as they were coming out, rather than always playing games that were several years old that my friends had all already finished and forgotten about.

Every game I played on this computer was bought on Steam or Amazon — so I can see all the games I played, every one.

And looking over my list of games here there’s maybe one game there that I thoroughly enjoyed, start to finish, that I thought was worth the time I sunk into it.

One.

Just one, out of a couple dozen critically-acclaimed games.

There were, of course, fun and memorable moments in every one of those games, but I think I’m kind of done with modern, mainstream PC games for now.

The last one I played was Alien: Isolation. I’m not sure how to describe the feeling I had playing it, but… for lack of a better word, I found it rather alienating. Like it was designed for someone with way more experience with games than I had and wasn’t really interested in training up new people.

(Yeah I’m not touching Bloodborne with a 10 foot pole.)

I have nothing against mainstream stuff in general. I love summer popcorn movies, listen to the local ‘adult hits’ radio station and even look forward to the occasional meal at a chain restaurant.

And I really have nothing against mainstream games, their existence or their themes or their fanbases, in general. But I’m pretty sure mainstream games are not for me.

I think part of it is competition. Not competing with real live other players, but, like, a competitive mindset.

I don’t really have that.

I’m not at all interested in maximizing the combat strength of my character or solving particularly devious puzzles or leveling up or leaderboards or achievements or, in general, beating games.

Saying you beat a game implies to me that you saw it as a competition. Player one, game zero. I’m more interested in the experience. You don’t beat a movie or beat a trip to the park.

There was this official Braid walkthrough which wasn’t really a walkthrough, but a thing encouraging people not to use walkthroughts. It said the following.

“Some of the puzzles will be hard. But when you manage to solve those hard puzzles, you will feel very good about it. The game will feel very rewarding. Don’t rob yourself of that feeling by reading a walkthrough!”

And, you know, I finished Braid and didn’t find it very rewarding. I’m all for challenging myself, but the challenges in games just aren’t things I find rewarding. Not everybody feels that way. I like to challenge myself in other ways.

(I recognize that there are people who could take up the challenges I set for myself and find them completely empty, upon completion, and that’s fine.)

Thankfully, there are a lot of indie games I like. Sure some of them are differently alienating, but I like shortness and simplicity and overall sense of fun I get in many indie games I’ve played.

So I’m going to try harder to find indie games out there that I like, and see where that takes me.

Someone once suggested that maybe I’m just using the wrong platform; I might prefer games made for platforms like 3DS or Wii. And they’re probably right; that’s something to try as well.

I’m not giving up on games. I’m not even giving up on big-budget games; I’m just taking a break. In a year or two, maybe I’ll check back in and find something there that I find really worthwhile. I’d like that.

Call me shallow, but I really like cutting edge graphics in my games.

I am not Robin

Of my lead character in Tinselfly, I have often said, well, she’s basically me.

And while that is still true in many ways, it’s time to start thinking about how she’s not me. It’s said that you can only understand things in opposition to other, similar things; in this case, I will gain a better understanding of my character by asking myself how she and I are different.

And as long as I’ve been defining the character as me, it’s been too easy to blithely ignore any criticism that I might not treating the character with respect, saying, or thinking, of course I understand her experience; her experience is my experience!

And that’s just not true.

It’s time to remove that safety net.

* * *

I thought it would be useful to express this as a handy-dandy Venn diagram:

Robin…

is somewhat physically active

is not afraid to get self, clothes dirty

likes dressing up on occasion

occasionally drinks

thinks about career (later in story)

might enjoy a discussion about which comic book character would win in a fight

doesn’t mind being called nerdy or geeky

self-identifies as a woman

went to public school

Both of us…

are shy and quiet

don’t use profanity

like soda pop

like sci-fi stories

grew up in small town where many people (including one parent) worked in air/space-craft type industry

spent lots of time stuck in air/space-ports

remain somewhat childlike well into adulthood

like fixing, creating things

like exploring new places

I…

like creature comforts

don’t like touching my food, much less getting dirty

go out of my way to wear plain clothes

can’t stand alcohol

think fandom is frequently obsessive and silly

find this whole idea of binary gender identification kind of weird

wore uniforms to middle/high school

don’t really have career goals

* * *

Well, that was fun.

So what does this get me?

Anything in the blue Robin-only section is stuff I’ll have to be extra-careful about. They range from behaviors I simply don’t engage in, to mindsets I find outright alien.

So, moving forward, what I should probably do here is start thinking, not about how Robin’s individual behaviors are different than mine but about Robin’s overall mindset and how it’s informing those behaviors.

As I type this, the following example comes to mind:

behaviors root cause
likes dressing up on occasion

is not afraid to get self, clothes dirty

Robin sees that there are times when looking nice is important, and other times when it doesn’t matter even slightly. This is a sharp contrast to myself; I want to be clean, but casual all of the time if I can help it, even if nobody is looking or cares, and even if the situation demands more formal attire.

So… from my point of view, the first two behaviors listed here seem contradictory at first glance, despite my gut feeling that both belonged in the list. But I know many people who exhibit those behaviors, and thinking about it some more, it makes perfect sense — one you get to the single root cause of those behaviors.

Similarly:

behaviors root cause
thinks about career

self-identifies as a woman

doesn’t mind being called nerdy or geeky

Robin has stronger concepts of social, gender and sexual identity than I do. She consciously sees herself as a member of a variety of groups and will work (consciously or not) to preserve her feeling of membership of said groups, and will, if only in a small way, conflate herself with the group as a whole.

Et cetera, et cetera.

Well, I think this has been a useful exercise. Looking forward to doing more of it, but hopefully you get the idea. 🙂

Some thoughts on planning

This is a box.

cube-face

This is also a box.

cube-isometric

Which is to say, they’re both equally awkward representations of a simple cube. This is slightly less awkward:

cube-angled

But they all really represent the same thing.

* * *

So I’m working on this game called Tinselfly. It’s a big, big project, and I’m just one person. While I have a decently good sense of the overall shape of the project, nailing down specifics has been really, really difficult for me.

I’ve been trying for years to make one, unified project plan so I can wrap my head around this project.

At first, my project plan was going to be a written story, which I would then adapt to the medium of games.

Then I tried mind maps.

Then it was going to be a comic book.

cover

Then I started filling out these odd forms, one for every scene.

form-filled

Then I ditched planning entirely, letting my game environment be my plan.

Street-24-September-2013

I stuck with that for a long time, with a no-formal-design-document approach to planning, but still couldn’t wrap my head around my own story. So I tried to express my story as a graphical timeline sort of thing.

Story-26-March-2014

That’s been really helpful. But still, I don’t feel like I have my one, authoritative story bible.

But…

…I don’t need one.

* * *

It’s all about multiple points of view.

This is a plan for a house:

house-top

And so is this:

house-front

And so is this:

house-side

Here’s an angled view, which makes things a lot clearer.

house-isometric

This view is great for getting a sense of the overall shape of the house, and the relationships between the parts. But it’s not very useful if I want to know the angle of the roof, or the exact dimensions of the sides. The top, side and front views are better for those kinds of precise measurements.

No one view of the house is going to give me everything I need to build the house, but together, then can give me a clear mental picture of the house.

I can’t reproduce that mental picture here, or anywhere.

* * *

I’ve been looking for one, giant, comprehensive project plan, and I’m never going to find one. But that doesn’t mean I’ll never have a clear mental picture of where I’m going. In many ways, I’ve already got what I need in terms of Tinselfly planning tools. I’ve got ways of broadly sketching out the themes of my story, and I’ve got ways of homing in on specifics.

And all these ideas exist in multiple documents.I need to use all my design documents, because they all represent different points of view, different ways of looking at my story. Some are very dry and technical, and some give me a broad sense of what’s going on. Some make me feel like I know what’s going on, while others, if I’m being totally honest with myself, are much more useful in terms of giving me my clear mental picture.

And all my planning documents are useful.

Global Game Jam 2015 Postmortem, Part 4: Great Unknowns

(Last in a series. You’ll probably want to check out Part One, Part Two and Three first.)

Yay, more things going wrong!

So now I’m going to go into more things going wrong with our Global Game Jam entry, specifically the sort where I was doing things I’d never done before.

Level Loading

Marie and I always talked about our game as being something with multiple levels. And yet, it didn’t occur to me until I started implementing level switching that I realized I’d never done anything with multiple levels before — most importantly, I didn’t know how to persist information (in this case, what item you’d picked up previously) from level to level.

I think the proper way to do this is with SerializedObjects in Unity… but that’s not what I did; I didn’t know about those during the jam. Instead, I made it so the player object wasn’t destroyed on level load.

It was a hacky solution, but it worked.

If I were doing this on my own, I probably wouldn’t have done multiple levels. I wouldn’t have thought of in in terms of, ‘oh, I haven’t done this before, so it’s too risky’; it would have just been an instinctual avoidance of this. So, once again, I was very glad to have Marie around here — much better to run into this kind of roadblock during a game jam than to run into it during a real project.

Page Flipping

Going back to the book for a moment… you were supposed to start with just a couple pages in your book, and as you went to new places, you pages would be added, giving you clues about where to go next.

Didn’t implement that at all.

There’s not too much to say about that, really; the book system wasn’t, well, a system. It wasn’t the sort of thing where you could add pages at runtime and have the book game object be updated for you. Just a bit of poor planning there.

Wrapping Up

I can’t emphasize this enough: I’m really, really glad I went to the Game Jam with a partner this time. What I learned this time around wasn’t a new algorithm or modeling technique; what I learned was the value of partnership. It’s great to have another person around, using your building blocks in unexpected ways, questioning your assumptions, and taking you to places you wouldn’t ordinarily go.

We’re already talking about doing Ludum Dare together when the next one comes around. 🙂

Global Game Jam 2015 Postmortem, Part 3: Words and Music

(Part of a series. Check out Part 1 and Part2 if you haven’t already.)

And now I’m gonna start talking about some things that went wrong.  🙂

Music!

There, uhm, is none.

I figured I could, pretty quickly, crank out something kind of like what I did for the last Global Game Jam: something kind of mysterious and atmospheric. I got a decent beginning… and my music software crashed.

I opened the last auto-save, and it crashed again. And then I started to panic. I’d installed a new version — not a point release; a whole new version of my music composition software months ago, and this was the first time I’d used it. And it wasn’t working.

So I decided to move on, and not do any music. Any at all.

After the jam I installed the latest patch, which had been out for some time, and that solved everything. And I felt rather silly.

So, lessons learned:

  • Test new software once you get it, even if it’s just a quick smoke test.
  • Keep your software up to date, even if you haven’t used it in a while.
  • Don’t panic. Crashes happen. And so do software updates.

The Book

So as I mentioned in Part 1, before the jam even started, Marie and I decided that making a Myst-like game with a journal or journals to read was a possibility.

And before the jam started, I was thinking about how I would implement a book with animated, turning pages. Not testing anything, mind you… just thinking. Leisurely thinking.

I implemented by book animation system as I planned it out, but it took most of forever to do it.

book1

There are times when planning can actually hurt. I had a system in mind, that I knew in advance would work, and that seemed good enough. By the time I started implementing the system, I didn’t bother to ask myself if it was the right system.

This was a system planned in a vacuum. I wasn’t thinking about the time it would take to implement it, because I wasn’t under any time constraints when I planned it. I was in the completely wrong mindset for a game jam.

Furthermore, while the system worked, it was overly complicated to use. If I was thinking about Marie’s time using what I’d written, I would have realized very quickly that what I had in mind was overly fussy and error-prone; the act of adding pages to the book involved adding real objects to the scene at precise locations on specific layers in the real game scene, with multiple cameras filming them.

book2

I could have just done something where you plopped textures into an array in the book’s properties pane, without any extra cameras and pages sitting in the scene. And it would have been easier to make books.

Marie found the system annoyingly cumbersome, though she tells me it made her feel more valuable as a member of the team, relieving me of the need to do all that tedious layout myself.

Guess that’s it for Part 3. In Part 4, I’ll talk about scaling issues we ran into.

Global Game Jam 2015 Postmortem, Part 2: Building Blocks

(Part of a series. Check out Part 1 if you haven’t seen it yet, where I talk a bit about pregaming.)

So Marie and I had come up with several approaches that might work for a game jam… all we needed to do then, was wait for the theme announcement and come up with an appropriate game idea that fit both the theme and one of our chosen genres.

The theme was ‘What do we do now?’.

I was not feeling particularly inspired by this theme.

Luckily Marie was coming up with story ideas so quickly I could hardly keep track of her:

  1. A driving sim where you were tweeting about events happening outside the car, while simultaneously trying to maintain control of your vehicle, a commentary on what we, modern society, do now.
  2. A Myst style puzzler where the world is destroyed by aliens and you have to collect artifacts from your lost civilization, using your own journal entries as a guide to finding collectibles.
  3. A platformer where you play a tin soldier and ballerina doll who get fused together.
  4. A post-apocalyptic platformer where you’re a Cleveland steel worker.
  5. A dating sim that starts after a video game hero has rescued a princess and realizes the princess just isn’t into him.

I found #1 a bit mean-spirited for my tastes. #3 and #4 would have involved character modeling and animation, which I wasn’t at all confident I could do in the time we had.  So after much debate, we decided on the Myst puzzler, since it seemed to have the most interesting narrative possibilities and best distribution of labor. We would go with a hybrid of our pre-selected genres: it would be Myst-like, with journals written by Marie, but instead of having me do all the level assembly, we’d do it tile-based. So I could make generic building blocks and Marie could assemble them.

Blocks!

I started modeling blocks immediately.

blocks

Like our test project, my goal was just to get some basic shapes out quickly, so Marie could get started on level design as soon as possible. I did the large cube and stairs seen above, plus some flat ‘street’ pieces. Then I moved on to texturing, and Marie started placing blocks in her level, which was a bit sloggy.

Thing is, I was looking at all this the wrong way.

I was thinking in terms like, what are the most generic, useful pieces I can make? when I should have been asking myself, what sorts of things will Marie find fun and exciting? The thing with blocks is, blocks are for playing with. For exploring ideas. They’re not just generic pixels, and they shouldn’t be overly specific, either.

Later in the game jam, Marie asked for a half-arch piece, and once I made that, she was much more excited about level design. It was a fun piece to play with. It added tons of interest to scenes. And Marie was able to use the arch piece in ways that I wouldn’t have expected: in building details, broken bridges and this one really cool aquaduct-like structure.

rusted-embers-arches

Texturing

I was very nervous about texturing because, as a post-alien-invasion Earth, you’d expect lots and lots of junk. Rubble. Rebar sticking out of things. I had no idea how I was going to do this. But I started out trying to make some realistic asphalt and concrete textures for my street tiles.

It was kind of boring work, and people walking by seeing what I was doing didn’t exactly find it exciting.

And then I realized that it didn’t have to be realistic. I could make blocks that expressed a feeling of a burned-out city, without being a burned out city.

rusted-embers-scrapbook

What I ended up doing was using the same, totally procedural texture on every single building block, a sort of glowing wood-embers texture. This turned out to be a great idea. It gave the game unique look, while simultaneously reducing the amount of work I had to do.

Overall

I’d say the whole building blocks thing worked well — once we had the right building blocks. And on future projects, whether I’m working with someone else or on my own, I think it’s good to remember that sometimes it’s best to make building blocks without thinking too much about how they’ll be used — sometimes, the way they can be used can surprise you.

Global Game Jam 2015 Postmortem, Part 1: The Approach

A couple weeks ago, my wife and I participated in a game jam. It was my sixth (I think), and her first.

So it’s time for a postmortem. Since I have lot to say (as usual), this will be broken up into multiple posts.

* * *

You can download PC and Mac versions of our game here. (Note: the goal is to collect objects by clicking on them, and then click on the rocketship. Sadly, that’s not explained anywhere.)

* * *

Like all game jams, I wanted to approach the jam with a mindset I hadn’t tried in a jam before: this time, I was going to go in planning to work with someone else — that someone else being my wife Marie.

Marie and I have been married thirteen years. Our first date was in 1996. Which is all just to say, we’ve been together a very long time and are already a working team of sorts. There was no question in my mind that we would get along as game jam partners. (Not that I didn’t occasionally imagine big scary robots coming to destroy us if we were not an effective team.)

The big question to me was, could we figure out the logistics of completing a project together?

I’m happy to report that the answer is yes. 🙂

Pregaming

A few days before the jam even started, we tried to come up with ideas for projects we could theoretically work on together, regardless of theme. I started by looking at the skills we were likely to use, the skills we each use on our own side projects: I do modeling, programming and music composition; Marie is a fiction writer.

My first thought was, we’d do a text adventure. I’d write an engine and parser in HTML/Javascript or something, and Marie would do the story planning, written scene descriptions, dialogue and wiring… it seemed like a perfect fit; Marie is a writer, after all…

…and then, much to my embarrassment, I realized I was underestimating Marie. We could do something more ambitious than that.

Marie is a software developer.

Just like me.

She doesn’t program for fun like I do, but Marie is a professional unix sysadmin and web programmer. And while I think of Unity, the game engine I use,  as something you use by yourself, it is very well designed for shared, team projects. So we could collaborate on a more modern 3d video game here. With that in mind, we came up with the following options:

  • A text adventure. Still an option, as mentioned previously: I could do the engine from scratch and Marie could do the story and writing.
  • A Myst clone. I would produce a level — models, set up in Unity, almost everything visual — and separately, Marie could design puzzles and write the text of the clue-filled journals you get in Myst games.
  • Something tile-based. I would produce generic ‘building block’ type assets for a game world, with settings and wiring points that Marie could adjust. Marie would then do the level design, set-up in Unity and any writing/dialogue that was needed.

With all of these options, the workflow (from my point of view) would be similar:

  1. Marie is in charge of game & level design.
  2. Marie requests new assets or changes to existing assets.
  3. I produce assets in a sandbox level in Unity.
  4. As soon as they’re remotely functional, I share new assets with Marie. (And any previously existing assets I’ve updated in my sandbox get automatically updated in Marie’s real game level.)
  5. Marie uses the assets to construct the real game level in Unity.
  6. Repeat 2-5 throughout the weekend.

So we set up a free SVN repository on Assembla and started on a simple maze test project just to get used to the workflow.

By the time we were done, it looked like it was going to work. Marie got to lead the project, and I got to make pretty things without worrying about level design. We could work on our separate laptops, in separate Unity levels, and update to or from SVN whenever needed. It was simple and pretty frictionless. I was very excited about our options — and more excited about doing a game jam than I’d ever been before.

Four French Meals

Last weekend, my wife and I went to London and Paris. It was my second trip overseas, and our first trip ever to a non-English speaking country where we didn’t have someone along who was a native speaker of the country we were going to.

I was excited about seeing museums and eating yummy food and checking out the architecture of these places of course… but mostly, I was excited about trying to speak to the locals in Paris, in French, as much as I could.

* * *

The first thing I notice when I get to Paris is, I’m not thinking in French. Of course I’m not thinking in French; I’ve got nothing but three months’ worth of free online classes with a computer voice as a teacher.

But I kind of feel like, if my French gets better and I go back some day, I might expect myself to start thinking entirely in French.

Some day.

* * *

We get to the hotel, and I’m nervous because I don’t actually know how to say I’d like to check in. So I say to the hotel clerk, in very, very quiet French, ‘I have a reservation?’ She asks if I speak English, and everything proceeds in English from there.

Which is fine. Yes, I have set myself the goal of trying to speak French. But this is not about me. This is about us. This is about communication, in whatever way is going to be the most efficient, and, if the situation demands it, whatever way is going to be completely error-free. In a restaurant, I could mispronounce the word for ‘chicken’ and get served scallops for dinner, and it wouldn’t be a big deal, for me, anyway. But when checking into a hotel, understanding exactly how things work is pretty important.

Any clerk or waiter or shopkeeper in Paris will certainly speak better English than I speak French. So English is the way to go here.

* * *

Our first meal goes spectacularly well — not a word of English is spoken between the waiters and us.

It probably helps that I’m pointing at the menu as I order.

What’s odd about the whole affair is that I’m understanding little of what the waiters are saying. It’s all context. If you’ve just sat down and the waiter asks a question, he’s probably asking for your order.  French waiters generally don’t stop by and ask you how things are going or if you want anything else unless you flag them down first… so if you wave at a waiter after your meal has arrived, he’ll probably come over and say something like ‘what can I do for you?’ and you can ask for whatever it is you want without entirely understanding the question.

When I’m watching a subtitled film, I frequently just… don’t read the subtitles. With many movies you can get a good chunk of the characters’ meaning just from context, their body language, inflection, stuff like that.

Doing that while interacting with real-life people? That’s a really interesting experience.

* * *

After lunch, we go shopping. The first store we go into has a big, chatty American in it, who starts talking to us in English as soon as we walk in, and we respond in kind, so the shopkeeper knows immediately we’re English-speaking Americans. I’m a little relieved. I don’t know how to say ‘can I try this on?’, and while I can ask ‘how much does this cost?’ I wouldn’t understand the response as I don’t know French numbers.

After having been in London for a few days, and then Paris, I’m shocked at how flat the big American’s speech sounds. It’s almost like a monotone in comparison to French and British English.

* * *

DSCF0394

* * *

Our second meal goes almost as well as the first. I make a point of not pointing at the menu when I order my crepe celtique and jus banane, and the waiter seems to understand me fine.

Thirsty later on, I can’t for the life of me pronounce the word for ‘water’, so Marie says it in English. And later on, Marie wants more tea, but we don’t know the word for ‘another’. So after calling over the water and some gesturing at the teacup, the waiter says, ‘another’?, and we nod and say ‘yes’ in French… and then the waiter tells us how to say ‘another one’ in French.

We’re surrounded by three other tables of English-speaking people, all of which are speaking to the waiter entirely in English.

I start to feel a little smug.

* * *

The next day, things do not go so well. Oh, they start well enough.

The waitress comes by to take our order, but I say, ‘a moment please’ because Marie and I are having trouble deciding.

The waitress comes back in a couple minutes and she asks if we’re ready to order now. I actually hear the French word for ‘choose’ this time and am totally thrilled. I order, having trouble pronouncing the name of my meal, and I ask for some fruity tea, and I’m feeling reasonably good about the whole thing —
— and then the waitress informs me, in English, that I’ve ordered a drink that isn’t on the menu. Oops. I’d misread the menu section describing what teas and juices were available. The entire meal proceeds in English from then on.
It’s at this point that I realize that this is all very exhausting, which I didn’t expect. It’s not just about how many words I knew when I got to Paris; I have to be alert and focused, or my recall and comprehension will be terrible. All this trying to find the right words and listen carefully to French speakers has me a bit fried, and it’s starting to show.
* * *

When dinner rolls around, Marie and I are completely drained. We’re staring bleary-eyed at a menu outside a brasserie when a very enthusiastic waiter comes out and asks us point blank what language we speak. We say we speak English, and not a word of French is spoken at our last meal — expect when Marie asks for the check in French, which earned us a thumbs-up from the waiter.

* * *

DSCF0437

* * *

In many ways, I find language to be a bizarre thing. The sounds we make with our lungs and throats and teeth and tongues have no intrinsic meaning; they’re just sounds. Wind. Scratching. Popping. Musical tones.

Learning a new language and practicing speaking in real-world situations has been a little like starting with these arbitrary sounds and watching them, right before you, transform themselves from noise into something meaningful and beautiful.

It’s kind of magical. I consider myself very lucky to have had this experience, and I look forward to experiencing this more.

Writing Unity Surface Shaders: Diffusion and Dot Products

In my first post about Unity surface shaders, I’ll explain the basics of lighting and vector math.

What is a shader?

A shader is a small program that tells you what color any given point on the surface of an object will appear on screen.

It’s mostly about angles and distances. The color will probably vary based on the angle of the surface relative to the light, and frequently the angle of the surface relative to the camera and the distance of the point from the camera.

So let’s start with some simple lighting.

Reflections

When light hits a surface, different things happen to it based on the nature of the surface being hit.

When light hits a mirror, it reflects in a very predictable way; every incoming ray of light bounces off of the mirror, like a rubber bouncy ball hitting a smooth surface.

mirror

For other surfaces, the light can — and will — go off in pretty much any direction. It’s kind of like bouncing that ball off of a rocky surface: it’s going to be harder to predict where the ball will go.

You can think of the light as bouncing off the surface in all directions simultaneously. This is called scattering.

scatter

For our first shader, we’ll make a scattery sort of surface — because writing that will be simpler than a shiny surface. Since the light is being reflected in all directions, it doesn’t matter where the viewer is.

Diffuse Reflectons

To write this shader, we just care about three things:

  • The albedo of the surface. Albedo is the color a surface is, regardless of what color or intensity light is shining on it.
  • The normal of the surface. You can think of a normal as an arrow pointing straight out of a surface, telling you the orientation of the surface.
  • The direction to the light source we’re interested in.

diffuse1

The way this lighting model works is, if the normal is pointing in the same direction as the arrow going to the light, the surface will appear bright; if the normal and the arrow to the light are perpendicular or pointing in opposite directions, the surface will be dark.

But how do we measure how similar two directions are? That’s where vector math comes in.

Vectors!

A vector represents a direction, and it can have a magnitude — a length — associated with it.

Like numbers, vectors can be added together.

vector2

Note that vectors don’t represent a line going from somewhere to somewhere — vectors are just about directions. Where you started from is irrelevant.

For everything — absolutely everything — we’re going to do with vectors, we don’t care about the magnitude. Or, rather, we want to work with unit vectors: vectors with a magnitude of 1.

So back to that similarity problem: what makes one vector more or less similar to another? We can say ‘if they’re pointing close to the same direction, they’re similar’, but how do we define that precisely?

For this, we need a dot product. A dot product is an operation you can do on two vectors, the way you can add numbers or multiply numbers.

But unlike addition, dot products have no clear analog to numbers. And the dot product of two vectors is not another vector — it’s a number.

Mathematically speaking, the dot product of two vectors is equal to the product of the lengths of the vectors, multiplied by the cosine of the angle between them.

For unit vectors, then, the dot product is just the cosine of the angle between the vectors. So for identical vectors,  with an angle of 0, the cosine is 1, and for vectors at a 90 degree angle to each other the cosine is 0. This is the relationship we’re looking for.

To express this in more visual terms you can think of it as ‘dropping’ one vector onto another.

diffuse2

So here we’ve got normal and light direction vectors.  The dashed line goes through the endpoint of the normal vector and is perpendicular to the light vector. At the point where the dashed line and light vector meet, I’m making a new vector. It’s sort of a projection of the normal onto the light vector.

The length of this vector is the amount of light we see on our surface.

So there are some basic lighting concepts. In my next post. I’ll show you how to translate these concepts into a real shader.

Empty Vessel

Been working on deck plans for the Wisteria, a spaceship in Tinselfly where you’ll spend like 1/3 of the game.

When I started these plans, I just went in trying to design a realistic ship. Not a level, not a game… a ship. Where people can live and work and relax.

Before, I had no idea what that 1/3 of game would look like. And now I kind of do. This is starting to feel like a real place to me, without any modeling or level design yet. I can imagine people running around this blueprinted spaceship, and it helps me think. It’s a playset in my head.

This is an empty space. Some people like coming up with game and ideas and building a container around them. That doesn’t work for me, and I have to constantly remind myself of that.

Me, I want an empty container that can be filled… and you have to have that empty container before you can fill it.

Wisteria-Deck-Plan-12-May-2014

* * *

What started all this was discovering the existence a government-run organization called NOAA that runs a fleet of research ships. And… it was a real epiphany sort of moment; Tinselfly is all about its heroine dreaming of (and getting into) this sort of Star Trekky touchy-feely navy, and it’s all supposed to be like patriotic and stuff, but the whole idea of a government-run fleet of ships that go out and do science and explore just seemed like pure fantasy. So now I’ve got something to base this space fleet on, some sort of precedent. And every aspect of this universe is starting to feel more real to me, and I have a strategy for filling in the details I don’t have yet. I can watch NOAA recruitment videos. I can look at deck plans for NOAA ships. I can read years worth of NOAA blogs.

So here are some revelations I’ve had, since starting my research of NOAA.

  • Research: NOAA ships have a handful of naval officers on them, but most people on the ship are civilians. From what I can tell the atmosphere is fairly casual. My take: I couldn’t write a realistic Navy story with strict chains of command if I tried. And I wouldn’t want to. Your character Robin in Tinselfly needs a lot of independence, but still be on a career path to being a Navy captain, her being a video game character and all. I feel more confident now about selling the idea of having the Wisteria be a sort of casual environment, but some some Navy officers and enlisted-type people onboard.
  • Research: NOAA ships exist to do science. There are modular, interchangeable labs. Half the population of the one ship I’ve studied in detail so far is scientists. There’s a ton of sensing equipment on board. My Take: Initially, the Wisteria was a cutting-edge warship, that never saw combat, that inexplicably existed in a propaganda-filled world that was almost entirely at peace. Again, I like that there is a precedent for a government-controlled fleet of not-for-warfare ships with not-so-regimented ship life.
  • Research: One the big things NOAA ships do is all about fish. They keep track of fish populations, guard against overfishing, and make sure the water in the ocean is good for fish. My take: Similarly, the Wisteria can protect tinselflies, which in this universe create materials used in the production of spaceships — which makes said eponymous alien bugs even more well integrated into the plot. (Like how silk is made from caterpillars.)
  • Research: NOAA ships also create maps of the ocean floor, which are available to the public. These maps help other sailors steer clear of shipwrecks and shallow areas where they might run aground. My take: In the beginning of the game, the Wisteria can be on a routine survey, find routine shipwrecks, and at some point find one that’s not so routine, which kicks off the plot. With the Wisteria as a survey vessel, it’s perfectly reasonable for them to be out there looking for wrecks.
  • Research: While NOAA locates wrecks, to my knowledge, they do not clear them. My take: Robin is an engineer. Since the derelicts wouldn’t be decaying tons of water, it seems reasonable that in an outer-space-based version of NOAA, you might send an engineer onboard derelicts, just to get them moving out of harm’s way, or to salvage yards, under their own power. I have have the player learn about the engineering mechanics by having Robin repair successively repairing ever more damaged ships before finally having to take care of her own.

* * *

Imagine that you own some Legos, and you want to design a spaceship. Not any particular spaceship, just spaceship. So you gather up your Lego sets. You find that one set that got stashed waaaay up high in a closet for some reason. You find miscellaneous pieces in couch cushions. And you start throwing pieces together, and some things you throw together will fit that vague requirement , and some won’t. You’ll get fond of certain pieces; you’ll say to yourself, this would look really good as part of a spaceship, but I don’t know where it would go.

Eventually, you’ll find something you like.

But you’re not done.

The spaceship is not incomplete because you can’t find the right piece to fill in a particular gap. It’s not because you didn’t find all your misplaced Legos. And it’s not incomplete because you didn’t work in every cool-looking piece you wanted to work in.

It’s incomplete because you’re still working with Legos.

Because your goal was to design a spaceship, not a Lego spaceship. So you’ll go to pencil and paper, or clay, or your favorite modeling program, and rough out your spaceship in there. And now, you can smooth out the blockiness of everything. You can precisely balance things that were a little off before.

Right now,  I’m still gathering up my Legos. This is the way I’m most comfortable working. I’m going to make my self some building blocks — doing research on NOAA or anything else that sounds interesting, sifting through my favorite stories and finding my favorite bits, keeping up on new games and their new mechanics — and then I’m going to play with my building blocks. Not all my blocks will get used. Not all deserve to get used.

I have a vague sense of the shape of the story I want to make. I’ll eventually have something that fits, that I made with my blocks… and I’ll start rounding out its edges. But I’m not there yet.

Until then, things are going to be a little blocky.

Copyright © 2017 Brian Crick.