Monday, November 3, 2014

Checking In

It's been quite a while since I updated this thing. Not much has changed since my last post, but I did say I'd check in occasionally, to affirm that I continue to exist. Work is still keeping me super busy, though I'm glad to say that I enjoy my job and get along with my coworkers. One reason that I haven't been more active since starting (aside from lack of time) is that my contract has a fairly strict non-compete clause. Unfortunately, the game project I was working on is very likely covered by this clause. That's disheartening, to say the least, but c'est la vie. I can't be too angry with the people handing out my paychecks. I should be safe to work on some other things, so long as those things don't make me money and are thoroughly unrelated to what I do at work. In particular, I've been thinking about getting back to work on the programming language I've been designing. Anyway, that's all I got for now. Back into the shadows I go!

Tuesday, September 23, 2014

Slowing Down

I am starting to realize just how little free time having a job has left me with. I haven't worked on my projects at all this week. I think for now, I'm going to switch from regular updates to occasional updates. Which is to say, I'll update this blog when I have something to write about or show, rather than every Tuesday. Even if I don't have anything, I'll try to at least check in every few weeks.

Tuesday, September 16, 2014

Busy Week

Between the new job and moving, I haven't had any time to work on my project. Unfortunately, that means no post this week, and possibly next week as well.

Tuesday, September 9, 2014

Cutting Corners

Couple of things. First, I've officially started my new job! I've never had to clarify this before, but this blog is strictly for side projects and personal ramblings. I will never make posts about anything I do professionally. While I'm happy and excited to be working again, it does mean I'll have significantly less time to work on side projects. Thus, the already infrequent updates are likely to become even less frequent. I'll also be moving this week, cutting down on my free time further.

Second, I don't think I've ever put out this disclaimer: I did not make the textures currently in use. I took them from the Dokucraft texture pack for Minecraft. The skybox I found with a Google search. These are obviously not the final textures, and I fully intend to make my own some day.

Now to reveal what I was working on last week. I've modified the game to support more block shapes!

Before
After
The new scheme includes all the old shapes, plus some new ones like like half-blocks and half-slopes, as well as many more complex shapes. This change forced me to rework how textures are applied, which is why everything is dirt rather than grass. I had already planned on switching to decals for grace, but that'll require me to modify some art assets.

Tuesday, September 2, 2014

PAX and Life Updates

This week, I went to PAX! It was great fun, and also tremendously exhausting! Before that, I made some more progress on my project, but I'm gonna keep that under wraps until I'm done. Additionally, I received word today that my background check finally went through, and I'll be starting my new job within a week! This also means we'll be able to move into our new place!

I started writing a post with more depth, but didn't like where it was going. Now it's late, and I'm still tired from the convention, so I think I'm just going to let it go until next week.

Tuesday, August 26, 2014

Water is Fancier Than You Think


Progress? On my project? It's more likely than you think. As you can probably see from the above picture, I've been working on water. While it may not look that impressive, this actually involved several significant changes. To get to this pretty scene, I had to do the following:
  1. Deal with having two blocks in the same spot (for water intersecting the shore).
  2. Add support for transparency.
  3. Remove internal faces from between world chunks.
  4. Add support for non-solid blocks (so that the player could walk through the water).
  5. Add support for animated textures.
Lets cover each of these in detail:

1. Deal with having two blocks in the same spot (for water intersecting the shore).

Allowing each cell to hold two different blocks would double the memory I'm using, so that wasn't a feasible solution. And if I ever needed three in the same spot, I'd be back where I started. 

The obvious answer was to use extensions (the same technique I'm using for vegetation and decals). However, I wanted the water to look like one large body, rather than a bunch of cubes. This meant eliminating internal faces. Unfortunately, extensions don't take adjacent cells into consideration during the mesh building phase.

So I introduced a new extension type for blocks. The meshing algorithm was modified to handle these the same way it handles normal blocks.

2. Add support for transparency.

For those unfamiliar with game programming, properly handling transparency is actually quite difficult. To get it looking right, you have to render the faces from back to front. Unfortunately, the most optimal way to render non-transparent things is front to back (and with blending turned off). Thus, the best solution was to create two meshes, one opaque, and one transparent. The opaque meshes are rendered first, front to back. Then blending is turned on, and the transparent faces are rendered back to front.

I also had to modify the meshing algorithm to account for the fact that transparent faces don't hide opaque ones. There are also still some problems that can arise from having multiple layers of water in the same chunk that I have yet to fix.

3. Remove internal faces from between world chunks.
Until I made this change, the meshing algorithm only took into account blocks in the same chunk. Unfortunately, this lead to underwater walls being generated between chunks. I had to modify the algorithm to take neighboring chunks into account. This also meant waiting until all those neighbors were loaded before running the meshing algorithm in the first place.

4. Add support for non-solid blocks (so that the player could walk through the water).

This was relatively easy. I simply added a flag to each material indicating whether it was solid or not (likewise with transparency). This flag could then simply be checked in physics, and non-solid blocks could be ignored.

5. Add support for animated textures.

I spent a long time thinking about ways to accomplish this. The solution I settled on ended up being stupidly simple. I simply built a table of animation info. that corresponded to each texture. This info is passed to the shader, which does some simple math to figure out which texture to draw each frame.

This did force me to start using array textures, but that also got rid of some aliasing, so it was a good move all around.



I also did a few other miscellaneous things, including some minor optimizations and bug fixes. All in all, it was a very productive week!


Tuesday, August 19, 2014

Sex Talk

So heads up, gonna talk about sex (and rape) in this post. If you don't want to read about those, turn back now.

The idea that sex is bad is something that permeates our culture so thoroughly that it's difficult to even see it as a cultural idea. However, it's not hard to find examples of cultures that were/are more permissive. Many went so far as to promote it as an important part of human life, and not just as a means to procreate.

However, sex is far from a riskless behavior. So what are some legitimate reasons to avoid sex? Unwanted pregnancy is an obvious one. In general, contraceptives are highly effective, but not perfect, and unexpected pregnancies do happen. The second obvious problem is STDs. Again, contraception can go a long way to prevent transmission, but there's always some risk. There's also the danger of physical harm when sex is done improperly or forcefully, especially in the case of anal sex.

So if sex is so risky, aren't we justified in tabooing it? Well, first of all, it's not that risky. Even though bad things can happen, the vast majority of (consensual) sexual encounters are completely harmless. Furthermore, there are plenty of benefits to having sex, both in the short term and the long term. And it's not hard to think up other risky behaviors that receive comparatively little scrutiny.

And yet it becomes a historical controversy when a woman's nipple is exposed for a few seconds. It's considered inappropriate because it reminds us of sex, and sex is bad. And if you think nipples are scary, let me tell you, they have nothing on penises. Nudity is completely harmless, yet society is outright frightened of it.

A little while ago, an idea struck me. It occurred to me that people might be sensitive to sex and nudity because, well, people are sensitive to sex and nudity. That is to say, people get nervous about sex because they live in a culture that tells them (implicitly and explicitly) to be nervous about sex, and that nervousness they feel tells other people to be nervous, and so on.

Sexual assault is, of course, highly traumatizing, but I can't help but feel that it's made even more traumatizing by this attitude. Rape should absolutely be taken seriously, but could it be that taking it too seriously actually makes it harder for survivors to move past it? Even the term survivor, while probably better than victim, puts rape on a level comparable to death. For survivors, it may feel that way, but how much of that feeling is a result of the culture we live in?

Tuesday, August 12, 2014

Diversity

Diversity. It's something you hear about a lot. Specifically, about how we need more of it. And while I don't disagree, I think we sometimes lose sight of why we need diversity and why a lack of it is a bad thing.

In my opinion, diversity isn't a goal in and of itself. The real goals are equality and representation. When you have those, diversity should arise naturally in a way that mirrors real life. Worth noting is the fact that some mindfulness is required to make this happen. Even in the most egalitarian circles it's easy to under-represent minorities simply because they're less visible.

Which is precisely why representation is important in the first place. When a group has low visibility, we tend to ignore it, often unintentionally, making the group even less visible. This effect is even more pronounced in media, where appealing to the largest group of people is often advantageous. This process also isn't limited to literal minorities. Women are terribly underrepresented in media despite making up half the population.

Additionally, not all representation is equal. The presence of minority characters is not enough if those characters don't receive equal treatment. When representation is done wrong, you get token characters.

There is a unique challenge when it comes to representing queer characters. Unlike race and sex, sexuality and gender identity often aren't obvious. On the one hand, unless it comes up, we have no way of knowing if a character is queer, and hence no representation. On the other hand, overplaying a character's sexuality/gender identity can reduce that character to a single trait. It's a fine line that can be hard to hit, even for writers with first hand experience.

There are similar challenges when it comes to religion. However, religion is often correlated with race and can sometimes be inferred from a characters clothing (a cross necklace, hijab, etc) and speech.

Anyway, the bottom line is that characters belonging to group should appear at least as often in media as they do in real life. This isn't a moral fact, just a statistical one.

---

In other news, I have a job offer! I have not officially accepted it yet, as I was still interviewing with another company when I received the offer, but I will be making a decision before the end of the week, with proper employment following soon after!

Tuesday, August 5, 2014

When Life Moves Quick

It completely slipped my mind that today was Tuesday! I don't have much of an excuse. All I can really say is that life's been moving quickly lately! Last week was both fun and stressful. We went on a trip to Tahoe to spend a few days with friends in a cabin we rent every year. However, our car started acting up right as the (700+ mile) trip was coming up. Additionally, I had an interview scheduled for the day after we got back. There wasn't really time to do anything about the car so we had to do some contingency planning. Fortunately, everything ended up working out. I think the interview went well too, but I'm holding my breath until I hear back.

Wednesday, July 30, 2014

Story of a Failed Indie Dev

I've been posting on this blog for about ten months now. There's a summary of my story in the about section, but I haven't told the whole thing.

The story starts while I was still in college. I majored in Real-Time Interactive Simulation; a fancy way of saying video game development. A friend of mine introduced me to a game called Dwarf Fortress. In Dwarf Fortress, you oversee a colony of dwarfs as they work the land and build a city. The map is divided into a 3D grid, and any space can be mined out or built upon. The game is insanely detailed, to the point where you can examine what kind of nerve damage your dwarfs have suffered. This detail combined with the flexibility of building however you like makes the game incredibly engrossing, but also daunting. Dwarf Fortress is also rendered in ASCII characters, like an old Rogue-like game. This is nostalgic and charming, but one can't help but imagine a full 3D version.

Just as I started to entertain the idea of making such a game myself, Minecraft appeared out of nowhere and quickly rose to fame. I quickly abandoned the game ideas that had taken root in my mind. Minecraft had beaten me to the punch, and spawned countless rip offs hoping to cash in on the trend. I, myself, was a huge fan of the game, despite how it had dashed my hopes. So while I would sometimes daydream about the game I'd like to make, I focused on finishing my education.



One year, I had the opportunity to attend GDC. While there, I had the opportunity to meet the creator of Minecraft (Notch) and talk with him for a while. I conveyed my story to him, including both my appreciation for his game, and how I envied that he had beaten me too it. Notch, being the incredibly cool guy that he is, took it all in good stride and encouraged me to pursue my own ideas. Something along the lines of 'there's room in the world for more games like this'. Don't quote me on that though.
Eventually, I did finish school. I was fortunate and managed to land two job offers right before graduation. One was a fairly typical, entry level, game development position. The other was from a company that makes slot machines. The second job hadn't at all been the sort I'd been looking for. The manager that had come to recruit people was looking for fresh young talent to bring his company's technology into the 21st century. It was also in Reno, Nevada; somewhere I had never imagined living. Especially so because I have a hard time dealing with hot weather. Give yourself a biscuit if you're genre-savvy enough to figure out which job I picked.

I enjoyed my time in Reno. It was my first time living on my own and I relished the freedom. The heat didn't bother me at all, much to my pleasant surprise. One time, I biked into the desert to watch an eclipse. My job afforded me freedom as well, for the most part. Perhaps just enough to be frustrating. I had neigh unlimited freedom with the code I wrote, but practically none when it came to integrating that code with what the company already had. But despite frustrations, I still enjoyed my job.


However, after a little more than a year, I began to feel restless. Reno is a nice town, but the days seem to blend together there. The frustrations I felt in my job were reflected in my life as well. I had more free time than I had ever had, but it wasn't enough. It was almost enough, and somehow that drove me crazier than not having time at all. I began to think about what I wanted to do with my life, how I could get more time without becoming a hermit. I concocted a plan: I would become an indie dev.

The idea was simple. My job was high paying, so I saved up money for several months. I would use that money to leave the working world for a year. In that time, I would make a game. If it succeeded, I would use the profit to fund my next game. If not, I'd simply return to normal working life no worse for wear. I started designing a game that sounded interesting. A game where you'd colonize Mars with self-replicating robots. When the time for my break drew near, I began telling people about my plan. I got a lot of people excited, received lots of encouragement, and a fair share of (justified) doubt.

Part of that break was moving back to Washington. I missed my home, my friends, and my family. While in Reno, I met my current boyfriend. He, too, wanted to get out of Reno, and Washington had been one of the places he was considering. And so it happened. We packed up our things, took a nerve wracking drive across three states in a 20 foot U-Haul with a car in tow, and embarked on our new lives.

Settling in wasn't easy. It took my boyfriend a long time to find a job in the area. Having him at home when I had been looking forward to eight hours of isolation per day... well, it wasn't exactly how I had pictured things going. There was a lot of tension in our relationship at that time, and the only thing really deserving of blame was the economy.

I soon became stressed in my work as well. Progress was slow, which only made me determined to do better the next day. Worrying about it made me less productive, and lacking productivity, I became more stressed. The cycle built upon itself for nearly three months. It was at this point that I finally admitted to myself that I was no longer invested in the game I was working on, and allowed myself to explore other projects.

The transition was hard. I still worried about finishing a game, even if it wasn't the one I had set out to make. I was worried about wasting the opportunity that I had made for myself. I didn't want it to be for nothing. And ironically, it was this fear that had been slowing me down all along. The worst part, I think, was that on some level I understood that the whole time. But it's one thing to understand a fear, and another to conquer it.

It wasn't until only recently that I really managed to do that. In part, I think it was because I had given up on my original plan. My time was up, and I needed a job. Perhaps also because I was starting to fear real problems, like running out of money. But whatever the case, I started moving forward. I realized once and for all that I had known the game I wanted to make all along, and it was time I let myself make it. Who cares if it's dismissed? Played by a handful of people and written off as another Minecraft clone. I'm not making it for the approval of others. I'm making it because I want to. Maybe I won't even finish it, but I won't know if I don't try.

And that brings me to now. I made more progress in a week than I had the last few months. Job prospects are looking good, and I'm hopeful for the future, if somewhat cautious. Tomorrow will bring what it may, and I'll do my best to keep on moving.

Tuesday, July 22, 2014

Nothing Today

No blog post this week. No particular reason other than that I didn't have anything I wanted to write about today. I've been working on the block game some recently, in addition to the job search. Both are going well.

Tuesday, July 15, 2014

Mindful Thoughts

Minds are tricky things. We spend our whole lives with complete access to one, and yet their inner workings remain mysterious. I'm going to talk about some of my thoughts on what makes up a human-like mind. Wikipedia lists several mental faculties found in minds. These include:
  • Thought: the ability to process and manipulate ideas. Includes reasoning, problem solving, and decision making.
  • Memory: the ability to record thoughts and experiences. This includes both long and short-term memory.
  • Imagination: the ability to think about things that aren't real and to create such thoughts at will.
  • Consciousness: the ability to do these things while simultaneously observing that one's doing them. Being aware of one's own agency and forming an identity.

So how do all these things fit together? Well, that's the million dollar question, isn't it? It's not something well-understood by anyone, let alone someone with only casual knowledge like myself. However, I do have some thoughts. Common coding theory says that perceptions and actions are linked. Supporting this, mirror neurons fire both when we perform an action and when we witness it. I think this is the link between perception, thought, action, and imagination.

When we observe an action, we also observe the effects. If we can figure out how to duplicate the effects ourselves, the observed action becomes an imaginary action. Actually executing the action makes it a real action. The idea is that all of these are essentially the same thing. They all take place in a sort of mental play space.

Observation loads information into this play space in the form of short term memories. Here, we can think about what we've observed and, knowing our own capabilities, simulate doing it ourselves. Note that this step can go awry, as happens no matter how many times I see this trick. However, if you aren't completely mystified, you can then replace the memory in your play space with a simulation of doing it yourself. If and when you decide to actually perform the action, it's simply a matter duplicating the imagined action in the real world. If our understanding of the action is incorrect, this step can also go wrong, as it does when I actually try performing the shirt trick. But if it doesn't go wrong, then our understanding of the action is reinforced.

Here's the kicker though. The mental play space isn't limited to physical actions. We can also observe/imagine abstract actions, like addition and multiplication. Sympathy/Empathy would correspond to imagining/performing emotive actions. Doing these things is essentially just a simulation of things we've previously observed, modified to suit our current thoughts.

You can imagine eating something that you've already eaten. You can also imagine eating something you've never eaten, because you can use the first experience to simulate the second. There are lots of studies that indicate that video games make you smarter. I would argue that video games fuel the process I've described. They let you observe novel actions that you can't normally perform, tell you how to execute them, and let you practice doing so. By observing simulations, we literally improve our own abilities to run simulations in our heads.

All of this makes the human brain sound awfully marvelous. How can it figure out how to simulate nearly any situation, even ones brand new to it? Well, to be honest, I don't think it goes quite that far. I think the mental play space is more of a general purpose simulator. The effects of simulated actions are drawn from approximated observation rather than any real, deep understanding. You might be able to figure out the trajectory of a baseball using physics and calculus, but your brain is probably not actually doing that when you catch it.

So where exactly do emotions and sentience fit into this model? I have some ideas for those too, but this post is already much longer that I intended it to be, so I will leave those for another day!


Tuesday, July 8, 2014

Potato Salad

So in case you haven't heard, a man recently created a Kickstarter campaign to raise $10 so he could make some potato salad. In the first week, he has already raised $40,000.

People seem to be divided into two major camps: those who think the whole thing's hilarious and awesome, and those that think the whole thing's terrible and unfair. While I can definitely understand the frustrations of the latter group, I think I ultimately have to side with the former. That said, I have no intention of actually backing potato salad.

First, let's talk about why this is so frustrating. It's not fair. It's like somebody won the lottery without even playing. What's worse, this injustice was facilitated by thousands of people who should have known better. He did nothing to deserve this money, and has no obligations to do any good with it. Hell, he's outright forbidden to even donate it to charity.

But ultimately, he did nothing wrong. He put a joke on the internet, a joke he probably never thought would pay off. If you want to get mad at anyone, get mad at the backers. Potato salad might even be a good thing in the long term if it incentivizes Kickstarter to tighten up it's recently loosened standards before more malicious exploitations crop up.

He might be doing something wrong depending on how he ends up spending this money. If he simply took the money and spent it on himself, then yes, that would be pretty terrible. But from the look of the campaign page it seems like he has every intention of giving back to the people who supported him. Between hats, shirts, an internet party, and possibly a full blown recipe book, good things are coming out of this. Sure, they're frivolous things, but still good.

Furthermore, potato salad is probably not actually taking away from other, more serious projects. Perhaps there are a handful of people who literally backed potato salad instead of something else, but my guess is that for most it's had little to no impact on what other projects they back. Kickstarter's public stats show us that there are very few projects that almost succeed. 80% of projects that make at least 20% of the way eventually meet their goal. Bottom line: if a campaign isn't already going down in flames, it'll probably succeed regardless of how much attention people pay to potato salad.

There are a lot of lessons we can learn from this whole thing, but I'm going to mention one in particular. The value of something is not always proportional to the effort put into it. Potato salad highlights this in a blatant way, but it's nothing we haven't seen before. It's why Cow Clicker has probably made more money than your favorite indie game. However frustrated you are doesn't change the fact that lots of people genuinely enjoy Cow Clicker.

The thing that both potato salad and Cow Clicker have in common is that they don't require investment. Once you get the joke, you've already gotten the value. Actually playing the game (or backing the campaign) is simply going along with the joke. Most projects do this in the reverse order. You invest time/money/emotions first, and may or may not get a return on that investment later. There's an inherent risk to those projects that simply isn't present in potato salad.

In the end though, fairness and equality are not the same thing, and we can't enforce one without constraining the other.


Tuesday, July 1, 2014

Let's Talk About Culture

Hey all! I spent the whole day working on job applications and didn't leave any for blogging, so this will be a short one. Also, wish me luck landing a job with Planetary Resources!

A few days ago on Facebook, I saw a comment along the lines of 'the GOP doesn't have culture'. I'm not gonna go into the politics of that statement, but it did get me thinking about something. I was originally going to do a full article on it, but I think a short PSA is enough to get it across.

All people, and all groups, have culture. And culture is not always a good thing.

Culture can, and does, lead to discrimination, inequality, and even human sacrifice. It also leads to many good things, but the tricky part is that, generally speaking, those immersed in a culture have a hard time separating out the good from the bad. This goes for American culture too and not just the GOP.

This is why Westernization is worrisome. It's not because the West doesn't have culture, or that it's culture is better or worse than any other. Letting any one culture dominate the world leaves us blind to the negative aspects of that culture. Without other views to challenge what's normal, we get mired down in the status quo.

While this is particularly threatening on a global scale, it can be harmful on smaller scales as well. I have more than a few things to say about the Queer community in particular. Someday, I might write an article focusing on just that, but for now I'm winding down.

Tuesday, June 24, 2014

Pigeons

First and foremost, this blog is amazing and you should check it out. While checking it out myself, I was reminded of a simple, but cool concept. The Pigeonhole Principle. I'm going to use an example similar to the one on the blog.

Suppose there are 11 pigeons trying to roost in 10 pigeonholes. At least one of those holes is going to end up with 2 or more pigeons. Sounds obvious right? What if I told you there are at least two (non-bald) people in Seattle, Washington with the same number of hairs on their head? Doesn't sound so obvious, but that's exactly why the pigeonhole principle is cool!

Most, if not all people, have fewer than 200,000 hairs on their head. There are more than 600,000 people living in Seattle. There are more people (pigeons) than possible numbers of hairs (pigeonholes). The same is true for any city with enough people.

Tuesday, June 17, 2014

Time to Find a Job

Whelp, it's been nine months since I left my job and moved back to my favorite state. I've used up most of my savings, and it's time I got back into the working world. I'm going to write a new resume, set up a website, and start filling out applications.

It's been fun while it lasted, but I can't go on forever without an income. It'd be a lie to say my time away from work turned out the way I'd hoped. I didn't accomplish as much as I had wanted to, and I spent too much time worrying and feeling guilty for one reason or another. However, I don't regret the experience. Perhaps the timing of it, but not the experience itself. I learned a lot and got to enjoy life for a while.

I intend to keep working on my various projects, even after I get a job. I also intend to keep up this blog. It's become almost like a journal for me. Obviously, I'll have less time to devote to these things, so I might have reduce the updates to once every two weeks.

It's still too early to do a post-mortem on the experience, but that might be something I do at some point. Until then, I'm going to focus on the job hunt and enjoy the remaining free time I have left!

Tuesday, June 10, 2014

My Experience as a Man

I've been putting this off for far too long. This particular train of thought was sparked by a friend's personal response to #YesAllWomen and by this blog post.

First of all, I think the #YesAllWomen campaign is a good thing. I think that hearing these stories from people they know is hitting home with a lot of people, men in particular. I know it did so for me. That said, I'm not going to say much more about it. I'm a man, so I'm only equipped to give a man's perspective, and it's men that I'm going to be talking about primarily in this post. Please bear with me if I begin to sound like I'm dipping into asshole playing devil's advocate territory. That is honestly not my intention.

I think we need to focus more on men. That's not to say we should stop focusing on women, and it's not to say that the problems men face compare to the problems women face. However, it is my opinion that in focusing on women we tend to treat the symptoms of sexism more often than the causes. This is a good thing. We should be treating the symptoms. But unless we treat the causes, those symptoms will keep showing up.

It's my opinion that a lot of those causes can be found in men's culture. And contrary to what I've heard a lot of feminists say, I think it has less to do with how men see women and more to do with how men see themselves. Men spend their entire lives trying to prove themselves to the world, and more importantly, to themselves. Part of that includes proving themselves sexually, and despite the fact that this leads to absolutely horrible consequences for women, it's really not about them. For the men preying on women, and even for the men who aren't, it's about building up and cementing an identity.

I remember when I lost my virginity. It was good, and I was happy to be moving forward in my relationship with my girlfriend at the time. I was also hugely relieved. Relieved because I had felt so... inadequate for having not so much as kissed a girl until I was in my early twenties. Paradoxically, I felt also guilty for feeling that relief. I was afraid that perhaps part of me had only sought out the relationship so I could say I was no longer a virgin.

Men don't say this often, but many of us are deeply afraid of being like that. I think that fear has a lot to do with so called 'nice guys'. Fear sometimes has a funny way of turning you into exactly what you're afraid of becoming.

If I could, I would tell my younger self, and other young men, the following: It's okay if you want sex. You're allowed to want it. Wanting it doesn't mean you don't care about the other person. If you get turned down, you're allowed to feel disappointed. But it's not the end of the world. Don't take it out on the other person. They didn't do anything wrong, and it's not okay to treat them badly for your own hurt feelings.

I also remember when I came out as bisexual. I'm sure some people still suspect that I'm secretly just gay. I myself still worry that I might be holding on to the label as a way of preserving my male identity. In any case, the experience was awkward, but hugely relieving. For comparison's sake, the relief from losing my virginity didn't even come close.

I no longer had to pretend I wasn't interested in half the people I'd ever been interested in. It was also relieving in another way that I hadn't expected. Men are trained from birth to avoid behavior that could even be construed as feminine. Like most men, that fear was always in the back of my mind, even when I was alone. After I came out, that fear started to go away.

I suppose I figured that even if I slipped up on being manly from time to time, I'd still fall short of the usual stereotypes. Even so, my behavior didn't really change; I didn't suddenly turn into Jack from Will and Grace. I remember one time shortly after I came out, my mom, in an awkward attempt to be supportive, made some joke about being one of the girls. I think when she saw the confused look on my face she understood that I was still the same person, and I am happy to say that that one small thing was also the last.

When I started dating men, I noticed how differently I treated them. I was always more careful with women. I was worried about being too forward, about making them uncomfortable, or forcing myself on them. I didn't worry about that so much with men. In fact, I basically felt as though anything short of violent assault would be taken in stride. If they were uncomfortable, they would stop me, because they could.

I have since realized how warped both those views are, and have been trying to find a happy medium between them. It's not easy reversing years of psychological conditioning, and my view of men is still hurting my current relationship, but I feel that I am slowly making progress.

I didn't expect this post to turn into a confession of my own experiences, but it seems to have done that. But I'm still going to wrap up with what I originally intended. If we want things to get better for women, we have to think about the experiences of men. We need to stop telling boys how to be men, and start telling them how to be people. Because that voice in the back of our heads isn't just hurting us, it's hurting everyone.

Tuesday, June 3, 2014

Thoughts In Progress

Hey there internet. This week I decided to depart from the usual progress report and do an opinion piece. However, it's taking me longer than I expected to finish so I'm going to post it some time tomorrow. As far as actual coding progress goes, I departed from the terrain generation again. I'm starting to realize that it becomes a time vortex if I work on it for too long. Instead, I decided to work on the GUI code I started way back last year. Anyway, I'll have more to say tomorrow!

Edit: I'm still spinning my wheels on the post I wanted to write because I'm a horribly indecisive person who can't figure out what he wants to say. I think I'm just going to hold on to it until next Tuesday.

Tuesday, May 27, 2014

Chugging Along

Still working on the terrain model. I managed to root out a few sneaky and terrible bugs. Aside from that there's not much else to report; progress is slow, but steady.

Tuesday, May 20, 2014

Two Steps Forward, One Step Back

I went back to working on my other project this week. I've made some good progress. I changed my erosion model and things were looking up, but they weren't quite right. So naturally I continued working and mucked everything up. Things went

From this:


To this:


Okay I'm kidding. The second picture isn't actually fire and brimstone; it's just color coded. The red shows how much sediment is in the water and the green shows how fast the water's flowing. That said, things are still off. The sediment should dissipate smoothly through the ocean and slowly build up coastlines. Instead, it seems to gather in pockets, which leads to strange looking pits everywhere.

There three things, at minimum, that I definitely want working reliably before I use this data to generate actual in-game terrain.

First is natural valleys and coastlines. Otherwise the player will spend all their time on 45° inclines. This is something I've had a lot of trouble with. Some of my recent models have almost produced good coastlines, but not quite. This is because I'm now modeling sedimentation better. I think the results will be really good, if I can improve the current model. They aren't too smooth or too jagged and are really starting to look like actual mountains.

Second is stable rivers that are a least a meter deep. The blocks in-game are a meter wide on each side. My plan is for any surface water less than a meter to result in swampland. However, rivers aren't swampy so they need to be at least a meter deep to avoid this. River sources, on the other hand, tend to be either underground or swampy. Ideally, rivers will begin in swampy areas and transition smoothly to proper rivers.

Third is good mountains. It'd be boring if everything was grassland. There are a few things that go into this. They can't be too steep or too shallow. The amount of vegetation should be lower near the top. There should be some rocky outcrops. I'm really pleased with shapes of the mountains in the recent models. They aren't too smooth.

Those are the minimum that I want before using the algorithm in game, however, there are plenty of other things I want to include eventually.

Temperature and humidity. I would love to model these things. They would be super useful for creating natural biomes. However, I imagine they'd also be really finicky and hard to get right.

Snow and ice. While it would be really easy to simply make things freeze above a certain altitude, it'd be nicer to have a little natural variation. These things would also affect river formation, so it might take a lot of work.

Implied features. One thing I did with the new model was remove a lot of complexity. I decided that instead of trying to get everything to form naturally, I would dumb things down and use the results to generate extra features. For example, beaches should form wherever soil meets the ocean. Deserts would form in areas of low humidity. Waterfalls could be created anywhere rivers go over a steep drop.

That's it for today, folks!





Tuesday, May 13, 2014

Parser Finished

I finally finished the parser! It can now parse a text file and produce the appropriate syntax tree. The next step will be to produce actual machine code from that tree. I think, however, I will leave this task for the future. Right now, I'm itching to get back to my other project. Not much else to report, hopefully I'll have new screenshots next week.

Tuesday, May 6, 2014

Parse All the Things


Packrat Parsers are interesting things. They basically try every possibility everywhere. Surprisingly, this turns out to be fast because they only do it once. They get away with this because they record every single thing they do. In recent years, computers started having enough memory that this idea is no longer completely ridiculous.

Been continuing work on the parser I started. The first stage is more or less complete. That is to say, I can give the parser a file, ask it if that file is valid, and get a yes-or-no answer. However, it's going to need to do a little more than that before it's useful. Ultimately, I will need a syntax tree representing the file. There are still a few more grammar rules that I need to add, but I'm going to cross those bridges when I come to them.

I've also been playing Skyrim in my spare time and getting a lot of ideas for things I could add to my other project. I got an idea for how to better organize possible features so I don't get inundated with all the possibilities. If I get burnt out on the parser, you might actually see some progress being made on that project someday.

Tuesday, April 29, 2014

Blar

I didn't have anything of interest to report about my projects this week, so I tried to come up with something else to write about, but ultimately came up with nothing. I tried to write something about the philosophical implications of the statistical nature of society, but couldn't find the words. In retrospect, the idea sounds kinda pretentious anyway. I hate to have yet another empty blog post, but frankly I'm burnt out on trying to come up with something at the moment.

Wednesday, April 23, 2014

Parsing Problems

Last week I mentioned that I'm going to be working on a parser for the programming language I designed. I've been trying to refine and simplify the language's grammar before starting that. For the most part, the language is C-like and most of the grammar can be summed up with a precedence chart. However, a few of the operators work strangely and throw a wrench into that.

The best example I can give is the colon operator. The colon operator fills the roles of both constructors and type casts. It is typically used like this:

foo int: bar + 10,

Which declares a variable, foo, of type int and initializes it to bar + 10. When the colon operator is used for casts, it might look something like this:

foo = bar + int: baz + 1,

Which is parsed like this:

foo = (bar + (int: (baz + 1)),

Basically, everything to the right of a colon 'belongs' to it. However, this creates a problem. It doesn't fit neatly into the precedence chart. The left side of the colon has a different precedence than the right. This makes the language's grammar more complex.

The behavior of the colon operator is usually pretty intuitive when actually writing code. Likewise, it's not particularly hard on the parser. However, it does substantially complicate learning the language. Instead of a simple precedence chart, I have an unwieldy spreadsheet.



The colon operator is not the only thing complicating the grammar. Right now, I'm trying to change things to reduce weird parsing rules. It cases like the colon operator, I would like to preserve it's general usage without making the user type a lot more.

Tuesday, April 22, 2014

IOU

I've been pretty distracted this week. That might have something to do with Zero Escape: Virtue's Last Reward. I'm gonna be lazy right now and instead write up a post tomorrow. In the mean time, I'd highly recommend the Zero Escape series. The games are engaging, well thought out, and occasionally funny to boot. Definitely start with the first though; the second builds on the first.

Anyway, I'll have something more interesting to say tomorrow!

Tuesday, April 15, 2014

A Brief Interlude with Virtual Brains

Last week I spent some time playing with an older project that I haven't touched in a while. It's an evolution sim where virtual creatures are controlled by artificial brains.
Virtual creatures. The white lines are trails.
In my senior year of college, I took that concept and turned it into a game. The idea was that the creatures would evolve as you fight them to get better at avoiding you. It was a fun little shooter, however, the evolution aspect never really played out well.
Virtual brain.
In my opinion, it wasn't a failure of the concept so much as a failure of my models. It turns out it's actually quite difficult to design a system that evolves well. Someday, I would like to make a spiritual successor to that original game once I've settled on a better model.
Selection. My senior game project. © 2011 DigiPen Institute of Technology
For now though I'm going to move on to other things. I recently discovered packrat parsers, and was inspired to work on the programming language I designed. If all goes well, I'll probably dedicate a few weeks to the task.

Tuesday, April 8, 2014

Making Me Crazy

I actually got some stuff done this week! Unfortunately, that 'stuff ' was overhauling my make files, so I don't have much in the way of pretty screenshots to show off. However, it's something I've been wanting to do for a while now and it feels good to get it done. The system is now a lot more modular. For example, the large scale terrain simulation I was working on is now properly separated from the game, whereas before I had to comment/uncomment code just to switch between the two.

I've never actually described my work environment in this blog before, so now seems like a good time to do that. I had to learn how to work in Linux at my last job. Having been spoiled on Windows my entire life, it was a trying experience. However, in time, I learned and got comfortable with it. Eventually, I got to the point where I actually preferred it. Currently, I have Fedora 20 installed on my home computer with the Xfce desktop environment.

I discovered something else during that time. A friend introduced us and it was love at first sight. I am of course talking about Sublime Text, the best text editor on the face of the planet. I tried it out one day and never looked back.
I've been using C++ for just about a decade now. It's actually kind of mind boggling to me that that's true. Needless to say, I'm comfortable with it, and that's what I'm programming my projects in. The compiler I'm using is GCC.
Editing my code on the left with Sublime, compiling it on the right in a transparent terminal, occasionally with a video playing in the background.
One of the biggest problems I've had with my personal projects over the years is that I tend to break them and then forget about them. The result is that I had little to show for all the tinkering I did. To mitigate this, I started using a personal Git repository. Now I can revert to earlier builds and show them off.

That alone wasn't enough though. I have some common code that is shared between projects. All too often, I'd make changes to that common code while working on one project and end up breaking all the others. This would lead to me avoiding those broken projects until they were long forgotten.

The first step I took to fixing this was to clean up my make system. Until now, each project had it's own makefile that was nearly identical to all the other ones. Now I have one common makefile that is used for all my projects (although each project has a small makefile for project-specific settings).

I also created a simple, but good dependency system. Each project can depend on any number of other projects and specify how the code for those projects will be linked to create the final executable. The three options are:
  • Direct Linking - Object files from the dependency are linked directly into the executable.
  • Static Linking - The dependency is built into a static library (.a / .lib).
  • Dynamic Linking - The dependency is built into a shared library (.so / .dll). 
The list of dependencies is recursively expanded, with duplicates and circular dependencies removed. The order is preserved to ensure everything is linked in the correct order.

Build targets are determined by two factors. The mode (debug, release, etc) and the platform, which is a combination of things like OS and architecture. Corresponding preprocessor defines are passed to the compiler for when target-specific code is needed.

The plan for the future is to create a Git branch for each project. This way, I can change the common code used by one project without breaking all the others. I will need to occasionally update projects to reflect changes to the common code, but I'll be able to do this when it's convenient, rather than being forced to do it whenever a change is made.

Tuesday, April 1, 2014

Reaching Hidden Depths

Still feeling kinda stuck. I decided to play around with normal and parallax mapping a bit as a change of pace. I took the lazy approach with parallax mapping so it looks pretty bad at extreme angles. I'll implement a better method if I decide to revisit these things more seriously later on.

I also started cleaning up my makefiles. Hopefully my workflow will be a little more streamlined when I'm done.

I would really like to add some actual gameplay to this project. I had a lot of plans for how I was going to use information from the large scale terrain generation to create gameplay, but putting that on the back-burner also blocked my gameplay plans. I might just have to force myself to hack in new things for now and revise things later.

Tuesday, March 25, 2014

Another Day (Blog Post) Another Dollar (No Dollar)

My apologies to Tom Siddell for stealing your joke for my post title.

Sorry to say there's yet again nothing to show this week. I seem to be in a bit of a rut. I think it'd probably be a good idea for me to set aside large-scale terrain generation for a while so I can make some progress.

I honestly can't really think of anything else to write about at the moment. I might update this post if I get an idea later today, but no promises.

Tuesday, March 18, 2014

It's a Small World After All

I'm still working on large-scale terrain. I decided to try a hexagonal grid rather than a square one because it seemed more natural. Plus, it avoided the awkward question of whether or not I should have water flow diagonally. Here's a screenshot. The terrain itself looks more natural, but lakes and rivers no longer form quite as easily, which I have to work on.


Here's a screenshot showing the hexagonal cells. Each vertex is one cell. The lines show the connections between them.

One thing that's changed is that the different layers can now mix together to a degree. I'm not sure if this was a good move. It's more realistic in some ways, but the results aren't quite as interesting. Feels like two steps forward and one step back. There are still a lot of things I want to add (temperature, humidity, snow and ice, plants, etc), but I'm trying to get the parts I have now working as well as possible before adding more complexity.

Interesting fact: the area I'm simulating is roughly four square kilometers, but this can be scaled up.

Tuesday, March 11, 2014

Building a Legacy

No update this week. I hit a bit of a wall on the project. Then I bought Rogue Legacy and kinda got sucked into that for a few days. I'll try to have something more next week!

Tuesday, March 4, 2014

Large Scale Terrain Generation


This week I worked on large scale terrain generation. The plan is run an environment simulation for some amount of time to create large scale structures (such as lakes, rivers, and mountains). The actual game will then use the large scale features as a guide for more detailed generation.

I'm using a different algorithm to generate the elevation. Specifically, I'm using the idea described on this page. I like this algorithm a lot because it's very simple and produces good results. Compare a planet created with Perlin noise vs. the spherical landscape algorithm:

Using Perlin noise.
Using spherical landscape.
Perlin noise tends to be more uniform resulting in a planet covered in lakes. While this can be overcome by adding multiple noise layers together, there are a lot more variables that need adjusting to get it looking good. With the spherical landscape algorithm, on the other hand, you need only to adjust the number of iterations. It tends to produce more varied results, which look more like oceans and continents.

Currently, the environment simulation works by iterating on several layers of 'fluid'. I use this term loosely because what I'm doing is not at all physically accurate (and I'm applying it to soil and sand in addition to water). The bottom-most layer is rock. Rock doesn't flow at all, but it can be eroded, which results in sand. Sand resists flow more than water, and soil more than sand, which creates flat-lands and beaches. Rain is simulated by evaporating water from every point and redistributing it equally.

The environment simulation is pretty bare bones at the moment, but it's already producing good results. I'll probably continue working to make it better for a few weeks before using it to generate actual game terrain.

Tuesday, February 25, 2014

Please Save This For Me

I'll come back for you, love, I promise to.

This week I've been working on saving and loading the world as you move through it. Until now, the world has been procedurally generated as needed. You could make changes to the world, but if you left and came back, the terrain would be re-generated.

A simplest way to handle saving and loading is to divide the world into parts and save/load each part to a file. However, this can incur a lot of hidden overhead. File reads/writes are very expensive. They're pretty much the most expensive thing a computer program can do short of accessing the internet.

So I decided to (once again) take a lesson from Minecraft. I originally implemented a format that was more or less identical to the Region file format used by Minecraft. After doing all that work, I suddenly realized that the Region format wouldn't work for me, and there's one important difference between my project and Minecraft that makes this a problem: Minecraft has a fixed height limit.

My project, on the other hand, does not. The game world extends infinitely in all directions, including up and down. The reason this is a problem is because the Region file format stores world chunks in vertical columns. This is fine in Minecraft since moving up or down can never trigger loading/saving. This is not the case in my project. If I used the Region format, I would have to store twice as much data when the player is straddling a vertical boundary.

So I decided to modify the format to suite my needs. Instead of working with columns of the world, I'm working with large cubes. I chose a size that was large enough to take advantage of compression (using run length encoding), but small enough not to incur a huge memory overhead. I ended up settling on 64 x 64 x 64 block areas.

Unfortunately, this change created a problem. In the Region format you're unlikely to get an entire column compressed down to significantly less than 4096 bytes. This number is significant because most modern computers read from hard drives 4096 bytes at a time (it's more efficient to have a few large reads than a lot of small ones). Region stores its data in a way that minimizes the number of reads/writes.

When you store the world as large cubes, you end up having cubes of solid air or rock. After compression, these only take up a few bytes. Basically, this would mean using 4096 bytes for something that requires less than 10. This wouldn't be so bad if these sort of regions were few and far between, but they actually make up the majority of the game world. My solution to this problem was to store multiple small chunks in a single 4096 byte area. Large chunks are still stored the original way. The end result isn't quite as elegant as the Region format, but it did, inadvertently, result is a larger maximum chunk size (255 MiB vs Minecraft's 1).

I finished all the code for this, but I still have to fix a few bugs before I can say it's done.

Tuesday, February 18, 2014

Vegetation


Another short post this week. I added some vegetation! Importantly, I can use the same code to create other objects. Although, for the time being, I have to hand write object meshes, so I probably won't add many more until I have a way to import them. I added a minimap. This is just for testing purposes and will eventually be taken out. I also did some more optimization that allowed me to increase the render distance quite a bit.

Tuesday, February 11, 2014

Snow Stickers


Gonna be a short update today. You can now create and destroy blocks (look, I made a castle!). Additionally, I added decals. This lets me slap additional textures on blocks. I could even layer several on a single block. In the above screenshot you can see me experimenting with snow decals. This will cut down on a lot of work that I would otherwise have to do by hand, and opens up a lot of possibilities. I was pleasantly surprised to find that the decals didn't impact performance, even without any optimizations. There's also some water visible, but this is purely for looks.

Tuesday, February 4, 2014

Grounded

I've been making progress on my project! I finally got some basic physics implemented (after three days of debugging), so you can walk around the world now. I also did some optimization; things are running a lot faster now. Sections of the world are now generated on demand, so you can walk around indefinitely. I'm not saving or loading sections yet though. I also added in some variation in the terrain, so now there are patches of snow and snow capped mountain peaks.


This week I'm going to talk about how I'm generating the world.

Tuesday, January 28, 2014

All Aboard the Tangent Express

So, when I began working on adding 'simple physics' to last week's project, it got me thinking about rigid body dynamics (a.k.a. game physics) and how to apply geometric algebra to it. Not surprisingly, I ended up on a tangent. You'd think I'd know better by now.

Tuesday, January 21, 2014

Perlin Hills

This week has been unusually productive. I've been working on terrain generation. Already the results are much better than previous attempts of mine. Thanks to researching the topic, I've finally come to decently understand Perlin noise. For generating and storing pieces of a massive world, I plan to adopt some of the methods used by Minecraft. Specifically, I'll be using a file format similar to the Anvil file format, which Minecraft currently uses.

I've spent some time reconsidering the previous block shape scheme I planned on implementing. For the time being, I've largely given up on finding the 'perfect scheme'. Every system I've considered has drawbacks of some kind, and all would have been a huge headache to implement. So, for now, I'm using a simplified scheme. The shape of a block is simply defined by which of the eight corners are present (256 total block shapes). In the future, I will likely consider more complex schemes, but until I find a better one, I'm just going to move forward with what I have now.

As an optimization, no hidden faces are included when the meshes are generated. This is done simply by checking if two adjacent blocks have matching corners on the touching sides.

Here are the next few things I'm going to be working on:
  • Adding textures to give the world some color.
  • Saving and loading sections of the world dynamically so you can move around.
  • Some simple physics so that you can walk around.



Tuesday, January 14, 2014

What I Want in a Survival Game

A few weeks ago I found myself wishing for a first person survival game. So when I heard about Rust, I decided to give it a try. So far it's not exactly what I was hoping for, but it is definitely fun. It's also early in development, so it's likely to get better with time. In any case, playing it got me thinking about what I want in a 'survival game'. I'm using that term loosely; my ideal survival game would have a lot of elements that aren't strictly about survival. Two of my favorite games that I would group into this category are Minecraft and Dwarf Fortress (again, using the term loosely). Throughout this post I'm going to compare and contrast what I like and dislike from Rust, Minecraft, and Dwarf Fortress. I might also mention few other games that I have less experience with.

Tuesday, January 7, 2014

To D or Not to D

This week I decided to try out the programming language, D. For those unaware, D is basically an updated version of C++. It fixes some of the problems that C++ has and introduces a bunch of modern concepts. The biggest drawback of D seems mostly to be that everyone's already using C++. In any case, I decided to get my feet wet so I'll talk about my first impressions here.