Categories
Geek / Technical

Calling CMake commands within CMake with execute_process

Hypothetically, you’re using CMake and want to do something that CMake documents as one of its list of commands it provides that can be used across different systems:

-E: CMake command mode.

For true platform independence, CMake provides a list of commands that can be used on all systems. Run with -E help for the usage information. Commands available are: chdir, compare_files, copy, copy_directory, copy_if_different, echo, echo_append, environment, make_directory, md5sum, remove, remove_directory, rename, tar, time, touch, touch_nocreate. In addition, some platform specific commands are available. On Windows: comspec, delete_regv, write_regv. On UNIX: create_symlink.

Ok, so you know that you can use the -E command line argument, but you’re not running this command from the command line. You’re trying to run it as part of the configuration step of your build.

That is, you have a CMakeLists.txt file, and within it, you want to add a command to do something at configuration time, such as create a symlink.

So, how do you do so?

Well, it’s not clear from the documentation, but it turns out that the way you are expected to do so is by using execute_process. Here is an example in which I link to my project’s resources directory from my Android project’s assets directory:

EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E create_symlink “${PROJECT_SOURCE_DIR}/resources” “${PROJECT_BINARY_DIR}/android-project/assets/resources”)

Hopefully this tip helps you save some of your hair from being pulled out.

Also, if you would prefer it to happen at build time instead, use add_custom_target.

Categories
General

WordPress Removing End Tags? Here’s Why

So I was writing a very large post recently, and I found that when I checked the preview that there was a huge section of the post in a blockquote.

I checked, and I found a missing </blockquote>. I figured I missed it when I originally wrote the opening tag, and instead of quoting a few lines, I found the remainder of my post quoted, which is not what I wanted.

So I added it after double-checking the quote to see where it ends and where the rest of my post starts, saved, and refreshed the preview.

It still looked wrong.

And when I checked the editor window again, I found that the </blockquote> was missing again!

What’s weird is that I was using </blockquote> successfully in a number of other areas of my post, so what’s different?

It turned out that I had copied and pasted some output from my terminal earlier in the post:

[armeabi] Compile thumb : main < = SDL_android_main.c

See that less-than sign? Apparently it was being interpreted as an opening to a tag. Maybe. I’m still not sure.

But everything worked as expected once I replaced each instance of

<

with the HTML code

&lt;

And now I can blockquote the appropriate text and not worry about having the end tag automatically removed without explanation.

And now so can you. You’re welcome.

Categories
General

Merry Christmas

It finally snowed here in Des Moines, so there is a lovely blanket of white on the grass, but not enough snow to cover the streets and driveways, which is courteous of the winter, when you think about it.

I’m looking forward to a day of games, classic movies, and food enjoyed with my wife and her family.

I hope you’re spending time with loved ones and getting a chance to reflect on the things you are grateful for.

Merry Christmas, readers!

Categories
Games

Snobbery in Gaming

Someone mentioned the word “games” at a party I was at, and my radar picked up on it. Unfortunately, I was really annoyed by the conversation that followed.

Me: “Did someone say games?”
The Other Person: “You wouldn’t have heard of it.”
Me: “Uh, ok. I’d LIKE to hear about it.”
The Other Person, dismissively: “It’s an indie game.”
Me: “…and I’m an indie game developer. Which game?”
The Other Person, still dismissive: “It’s an indie BOARD game.”

What a jerk.

Obviously this person decided I wasn’t cool enough to know about some new game, not knowing anything about me or my interests.

And the idea that somehow I would lose interest in the conversation if it was a board game versus a computer game? How ridiculous! I love games, no matter what medium I play them in. I almost wanted to continue pestering this person just to annoy them, but I decided to take the hint and stop trying.

There are people today who think that games grew up with them, that “The Past” consisted of Sony Playstation and the CDROM versions of The Oregon Trail.

I fall into this trap as well. My childhood was spent playing games on the Apple II c+, Atari 2600 and NES. When I say, “Remember when…”, I know I make some people feel old when they think about their childhoods being defined by games played on the PDP-1, at the arcade during the golden age, or hosting a BBS.

But even before, there were games. Games have been around for almost as long as humanity has existed.

That people decided to make games on computers as soon as the computers were capable shouldn’t have been a surprise.

But no one should pretend that video games or computer games are all there is or that they are somehow superior to board and card games.

My childhood was also spent playing card games and board games. Scrabble and Battleship and Monopoly were played regularly. Some games held my interest more than others, but video games always seemed more diverse and fascinating.

My Playing Settlers of Catan

When I was introduced to some very cool games in the last 10 years, I learned that it wasn’t just Uno and Monopoly, that there is a lot of entertainment to get in traditional, non-computer games. Settlers of Catan is typically seen as a gateway to Euro-style board games, and I was fortunate to have met people who could introduce me to it and to some of the other games in their collection.

I got a late start, but I’ve been really interested in playing card games and board games beyond the standards that Hasbro keeps publishing. I enjoy perusing the massive collection of games at my local comics and gaming shop, talking with the workers there and getting their recommendations. My most recent purchase was Mage Knight after someone tweeted about the game designer Vlaada Chvatil. After talking with someone at the shop, I got a few recommendations for some of Chvatil’s games, and walked away with this super complex game that also lets you play by yourself if you can’t find anyone willing to play it with you.

So, The Other Person, you can keep your snobby, secret conversation about a game I supposedly wouldn’t have heard about. There are plenty of games to go around, and I’m sure I won’t miss it.

Categories
Games

Chicks Dig Gaming: A Celebration of Gaming by the Women Who Love It

Chicks Dig Gaming: A Celebration of Gaming by the Women Who Love It is a book I have been waiting for ever since I first learned that my friend Lars Pearson was interested in publishing a book about women and games.

Mad Norwegian Press is known for their Doctor Who-related books, including the Hugo-award winning Chicks Dig Time Lords. Their “Chicks Dig” series features essays from female fans of Doctor Who, comics, Joss Whedon’s creations, and now games.

Lars didn’t ask me to write this post, but I wanted to let people know about this book because I think more women should have their voices heard in the game industry.

You can learn more details about the book at the Chicks Dig Gaming page at Mad Norwegian Press.

Categories
Game Design

How to Handle Losing When Designing Games for Young Children

Ruined Game

Most grown-ups can learn to play a new game without too much difficulty, and when they play, losing is understood to be a perfectly expected occurrence. That is, if someone loses, it is entirely possible that person still had fun playing the game.

Young children being introduced to games, on the other hand, sometimes have difficulty with a loss. They may pout or throw tantrums. Some sessions might end with these sore losers tossing the board or cards so that no one can play.

Even before it gets to this point, you might encounter a child trying to win at all costs. You might notice the child being really obvious when slipping a specific card in the right position in a deck before dealing.

Or if you are winning a game, you might be accused of cheating yourself. This accusation is especially ridiculous when playing a video game in which you can’t cheat.

Do you let the child win? He or she might be obnoxious about it. If you thought trash talking was annoying online, play against a cocky kid.

Of course, an inconsolably upset and angry child isn’t a great way to end family game night.

But how do you teach a child that losing isn’t the end of the world, that you can always play another game, that there’s such a thing as sportsmanship and dignity in defeat?

While researching this issue for educational games I want to make, I came across the 2012 Psychology Today article Winning and Losing by Dr. Kenneth Barish. He argues for playing often together and letting the child win, but only sometimes.

It is also important for us to keep in mind that, from the point of view of child development, the philosophy of Vince Lombardi (“Winning isn’t everything, it’s the only thing”) is profoundly wrong and teaches exactly the wrong lesson.

By winning and losing constantly, the child gets to practice dealing with disappointment and learns about his or her own limitations.

Eventually, children should start to understand that games involve agreeing to rules and restrictions. If you start a game of checkers, you can’t just walk away before the game is finished, and you definitely don’t throw the board in the air after your opponent’s piece is kinged.

In the meantime, is it possible to design games so that learning how to play by the rules is less stressful? Where losing isn’t as prominent?

Or is it wrong-headed to try to make a game in which everyone is a winner and so overly-protected children never learn the lessons they need to interact with others when they get older?

Games have always been a safe place to learn life skills. Whether you are running and jumping on the playground or calculating an opponent’s potential moves in chess, you learned how to navigate complex social interactions through play.

Now, there are games that can be played that don’t feature victory or loss, and recreational sports tend not to keep score for very young children. Are these games hampering anyone’s learning? The good news is that “games without winners and losers will have little effect on the desire or ability of children to excel.”

So it seems that you can choose to design a game without the ability to lose and not worry about damaging anyone’s upbringing. The key seems to be to focus on helping players get better, which is something games with their feedback loops are great at anyway.

Categories
Games

I Want Tiny, Adorable Consoles to Play Slow Games for Christmas!

Wired reported on Ishac Bertran’s experimental game consoles that let you make only one move a day.

Slow Games from Ishac Bertran on Vimeo.

From his Slow Games page:

I’m using Slow Games as a platform to experiment with low pace, long lasting gameplays, and explore game mechanics that keep players engaged throughout weeks of play with simple rule variations

At first, I thought, “Apparently Bertran hasn’t played games such as Diplomacy or chess by mail.”

Recently I started playing Neptune’s Pride after a long break, and I was telling a coworker. He hates the idea of a game that doesn’t resolve for weeks. And he hates the idea of even slower action games such as what Bertran’s consoles provide.

So, as actual games, they’re not for everyone.

But this project is meant to explore our relationship with technology. We expect instant feedback, and if that feedback mechanism was slowed down dramatically, how would it change our interaction?

Focusing so intently on the technology only gets you so far for these games, so would we start paying attention to our surroundings more? Or would we get antsy?

No matter what, these consoles are tiny, can fit next to anything on my shelf or desk, and I want one for Christmas. I don’t see any indication that they are going to be for sale, though. B-(

Categories
Game Design

Thoughts on Wind Waker’s Miniblins

Remember when I said I’m playing Wind Waker for the first time? I still am.

Well, not still. I put it down for almost two months. My last save was in September. I finally played it again.

I’ve been busy.

But I was playing it again, and I was in Forsaken Fortress trying to sneak up to the top of the middle tower to find my sister.

That’s when I encountered the Miniblins again, and I have to remark on how amazing they are as enemies.

There are a variety of moblins in this game. Some sniff around and search with lanterns, and if they see you, they’ll throw the lantern and cause a fire hazard to appear before attacking. Smaller moblins might stand guard with menacing weapons, but they tend to fall asleep if you wait long enough.

But miniblins are obnoxious.

You can hear them before you see them. And you never hear just one, but you can’t be sure. It’s this cute sounding “deh dank, deh dank.”

And then you see them. There’s usually more than one. And they are small. You think, “Ok, these guys look adorable. I’m sure I can defeat them easily.”

And it’s true.

But then you find out one is walking on the wall above you, and one had walked up the wall below you, and suddenly you realize that you’re surrounded.

And when you swing your sword at one, another one hits you with its pitchfork, knocking you down to the ground.

And he laughs. As you lie there while the others “deh dank, deh dank” around you, he laughs at how he made you fall.

From a mechanics perspective, miniblins are simply weak enemies who are quick, capable of moving in places the player can’t, and tend to show up in groups.

They are dangerous because there is going to be more than one, and they knock you down rather than merely hurt you, and you tend to encounter them in places where being knocked down can mean falling to a lower level and needing to traverse the dungeon to get to the same area again. And again. And Again.

But that’s just the mechanics. The sounds they make and the giggling after they hit you?

So obnoxious.

And that piece of aesthetics make them one of my favorite enemies in this game. Without that taunting, miniblins could have been a boring new variety of moblin.

With it, they become bullies who seem to enjoy bothering you for sport.

Categories
Games

Back This Project: That Dragon, Cancer

I haven’t backed many projects on Kickstarter, but That Dragon, Cancer by Ryan and Amy Green is one of those projects I can’t see passing up.

We created That Dragon, Cancer to tell the story of our son Joel and his 4-year fight against cancer. Our desire is to craft an adventure game that is poetic, playful, full of imagination and of hope. This is how we choose to honor him and his memory.

– Ryan and Amy Green

That Dragon, Cancer is a heart-breaking game for any father to make. Ryan Green calls it a “love-letter to his son” with a goal of encouraging the people who play it to love one another.

God at Play‘s Josh Larson worked with the parents to create this game, which is fitting. Josh hosted the Meaningful Game Play Game Jam back in 2011, which had the purpose of developing prototypes to explore deeper experiences in games.

Ryan Green participated remotely and submitted Giga Wife, which explored the idea of being a good husband. I remember him reading the introduction and talking about how much he loves his wife, and you can tell he has a big heart. The game was humorous at times, but also deals with the very real complications that a relationship can have.

I know Josh personally, and he is a very deliberate and conscious person. He’s a game developer I admire because he is always pursuing impactful experiences. And now Josh and Ryan are working together on a game that is very meaningful to not only the Greens but anyone who has had to fight the battle against cancer.

Please consider backing the project. I backed That Dragon, Cancer on Kickstarter because I want to support their efforts and see them succeed.

I also support the idea that a game can be the chosen medium for something such as this tribute to a beloved child. A game with an agenda of love is something I want to say I helped make available.

As of this writing, they are 57% funded after an initial burst of media coverage, but most Kickstarter projects hit a slump soon after. I would hate for this project to miss its goal. Pledging even just a small amount helps.

Categories
Game Design

Making Non-Random Games

When I start designing a game, I tend to try to avoid adding random elements. That is, I don’t want luck to enter into the course of events so that they can be repeatable. One thing follows from another, always. I like my game rules to be the physics of my world. I want the apple to fall from the tree at a constant rate. It shouldn’t be faster or slower on rare occasions, nor should it turn into an orange.

Also, I want the player to have as much agency as possible, and a die roll or draw of a random card seems to take it away. You might have been able to skillfully get yourself into a winning position, but because your opponent got a random boost this turn, your hard-earned advantage is completely lost. Sounds like frustration rather than entertainment.

On the other hand, not having random elements means more often than not that the game is solvable, which means that the benefit of the events being repeatable is also a problem. Once you figure out how to beat a challenge, you know how to ALWAYS beat that challenge. The game becomes boring very quickly.

It’s not impossible to make a non-random game that is relatively unsolvable. Chess fits the bill, but it has the advantage of being developed over thousands of years. I’ve only got months to make a game, or maybe hours if it is for Ludum Dare.

Dice

So, I turn to adding random numbers to my games eventually. It adds variety so that each play session isn’t boringly identical. And depending on how you implement random numbers, you control how much of an impact it has on the events of the game versus the actions of the players. For example, in Lemonade Stand, weather forecasts help inform the player. If it is likely to rain, you might not want to spend as much on advertising and supplies. Of course, the forecasts can be wrong. If it doesn’t rain, you lost an opportunity if you didn’t spend any money.

As another example, the dice rolled in Settlers of Catan dictate the flow of resources into and out of the game. Players might not get the resources they need from the random events, but they can still trade for them. And the robber getting invoked on the roll of a 7 encourages players to spend their resources while they have them.

There is a lot of variety in how luck can be applied. Poker, for instance, is a luck-based game. That is, for any given hand, it’s the luck of the draw that determines the winner. Yet the skill in poker isn’t in winning hands. It’s in knowing when to bet and when to fold. The real game is in managing your response to the luck over the course of many hands.

Luck in Games: Why RNG Isn’t the Answer by Elyot Grant breaks down the roles of luck in games and argues that it is possible, if difficult, to address those roles with non-random solutions.

His goal was to fix the problems with competitive games that randomness introduces. When you play a card game and draw a bad hand, your chances of winning are near zero. Similarly, getting a dominant hand almost guarantees the win. Skill and player agency are effectively nullified, and in a competition, it’s never a good feeling to know that you might still lose very badly despite being the best player.

I am not familiar with Hearthstone, which Grant mentions a lot by way of examples, but his analysis of it’s intrinsic problems related to the role of randomness led to the development of Prismata.

I do like how he breaks down the supposed benefits of randomness, arguing that each be obtained without luck. But then, I’m not sure if some of these arguments are applicable in all situations.

With modern online matchmaking and rating systems, any player of any game with a sufficiently large audience should be able to quickly find a match against an opponent that they can beat 50% of the time. There’s absolutely no reason to deliberately increase the role of luck in determining who wins.

But what happens when your game doesn’t have a “sufficiently large audience”? Or if you’re not interested in playing with strangers, which effectively shrinks this large audience?

Are luckless games necessarily competitive? That is, do skill levels need to be comparable between opponents to make a non-random game enjoyable, or can you have a non-random game that is cooperative or single player and still find it compelling?

Luck in games is a major topic. I’ve written about randomness in game design in the past, and there are plenty of books and articles centered on its role. Understanding it means you can leverage it better in your own designs.

I still enjoy challenging myself to design games with no random elements to see how far I can get before I encounter major systemic problems with the game. Grant’s article indicates it can be done. I’d be interested in hearing about other examples. If you know of any, let me know in the comments section below.