Categories
Game Design Games Geek / Technical

Learning New Old Games

Card Games

Last night, my wife taught me a card game she played with her grandmother earlier that day.

Hand and Foot is a Rummy game similar to Canasta, but it apparently has no standard rules. It was hard for us to look up what is allowed in certain situations. For instance, I was at the end of my Foot, and I had drawn two cards and now had an Ace and two Jokers. If I play them, I have no card left to discard. Am I allowed to do so, or do I have to discard at the end of a turn, meaning I can’t play my hand and must either give up a valuable Joker or an Ace.

It occurred to me that I’ve never played many card games. These days, I play Four Point Pitch and Up and Down the River with my in-laws, games I didn’t know a few years ago until they taught me. When I was younger, I played Solitaire, Kings in the Corner, and Thief with the Italian playing cards my parents always had on hand.

But as a game developer, shouldn’t I be more well played than I am? There are centuries of games out there, but if I limit myself to the popular video games of today, aren’t I also limiting my source for inspiration?

Granted, many are thinking that today is the Golden Age of Board Games. Between Kickstarter and popular cons, people are creating and playing games that aren’t the usual Scrabble and Monopoly. I’m participating in a few board game nights these days, whether it is at the day job or with friends, and I’m learning quite a few games.

But I’m sure I can stand to learn a wide variety of card games. We even own a copy of the book Bicycle: 100 Years of Timeless Card Games, and I’ve never read it.

I’ve seen similar books on card games that are larger and probably more comprehensive, but 300+ pages of card games with their variations is a good starting point.

When playing Hand and Foot, I noticed a few self-regulating aspects of the game that were pretty clever. For instance, if you want to pick up the discard pile, you had to pick the entire pile up. If it was full, it meant you suddenly had a lot more cards in your hand, which means you can create melds more easily, but the discard pile might include multiple dangerous red 3s, and you can only get rid of each one once per turn. Have a red 3 in your hand reduces your score by hundreds of points. It’s a risk you might be willing to take if you have been struggling to complete melds, though.

Similarly, you might play all the cards in your hand until you have almost nothing left. That’s great, because you are close to getting rid of the cards in your hand, which allows you to pick up your foot (Oh! I get it now!), but it also means you have a harder chance of creating a meld and actually getting rid of those cards.

So just exposing myself to this one new old game got me thinking about game design. What if I spent time learning more such games in earnest? I wrote about consciously consuming information daily, and reading and listening to a variety of information is beneficial. I’ve been thinking about how important it is to also play a variety of games.

The great thing is, I already own a deck of cards. I’ve paid the expensive part. It can be quite the investment to get a new board game or video game, but a trip to the library might be all I need to do to find books on card games I could play with my existing deck.

Heck, I also have a bunch of dice, and I’m sure there are plenty of dice games out there, too.

It’s time to make a conscious effort to learn some new games. Got any recommendations?

Categories
Geek / Technical

Why std::sort Crashes on My Collection of Objects

I’m working on the physics of my game, and I’m trying to sort the collidable object data on the X axis, then on the Y axis. Sorting should help my implementation of Sweep and Prune work faster, and so I wrote my own less than operator.

bool CollidableObject::operator<(const CollidableObject & rhs) const
{
    bool lessThan = (this->m_position.X() - this->m_radius) < (rhs.m_position.X() - rhs.m_radius);
    if (!lessThan)
    {
        lessThan = (this->m_position.Y() - this->m_radius) < (rhs.m_position.Y() - rhs.m_radius);
    }

    return lessThan;
}

Yet, when I call std::sort(beginIter, endIter), I get a seg fault in the bowels of the sorting algorithm.

Looking online, I find that the problem other people are running into is with their custom comparators. std::sort requires a strict weak ordering, meaning that if a < b, then you can't also say a == b, or else the sort algorithm's assumptions are invalid. Ok, but what was wrong with my code? It must be something else...oh, wait. I wanted to sort on the Y axis only if I couldn't sort on the X axis. My implementation checks the X axis, then if a.X() is not less than b.X(), it checks the Y axis, which means if a.X() == b.X(), or worse, if I know for sure that a.X() > b.X(), then I’m doing further sorting when I don’t want to do so.

I made this change:

if (!lessThan && this->m_position.X() == rhs.m_position.X())

And now everything is sorting properly and without a crash.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

LD#32: A Giant Weapon Development Time Lapse #LDJam

I created a time lapse video of my development of “A Giant Weapon”:

Once again, you can find the game, albeit incomplete, at http://ludumdare.com/compo/ludum-dare-32/?action=preview&uid=251.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

LD32: Submitted but Disappointed #LDJam

When I started this weekend, I thought, “I’m going to make a complete game that’s enjoyable to play.” I wanted the Button Masher Bros to play my game and enjoy themselves.

Towards the end of the deadline, I was thinking, “I might be able to get the bare minimum of something that could be called a game in.”

And by the end, I didn’t even have that.

I submitted my project, A Giant Weapon, which you can find at http://ludumdare.com/compo/ludum-dare-32/?action=preview&uid=251

LD #32 A Giant Weapon

You click to tell your soldier to move, and you try to avoid the monster. There’s a game over screen when you get killed.

You can attract the monster’s attention by clicking on it.

Unfortunately, I didn’t add the reason why you would want to do so: to destroy your enemy’s camp.

Fighting bizarre and non-bizarre bugs slowed me down, but I did not do anywhere near as well as I would have liked.

I wanted to get something controllable by 12 hours in, and it took me almost 25 hours. Then I didn’t have anything resembling playability until the last couple of hours, and then I ran into trying to figure out what AI bugs and graphic offsets issues I had.

I watched my timelapse, and I can see that I didn’t take my own advice about not spending too much time on the art. I think the majority of my efforts involved getting the sprites right.

Oh, and the weird bug that caused bizarre issues with the buffer not updating? I think it turned out to be a glitchy system. Once the computer crashed, and yeah, I needed that to happen near the deadline, everything ran fine for the remainder of the compo. I should have rebooted right away. That problem cost me way too much in time and stress.

I’m pretty disappointed and deflated. It’s been two years since my last Ludum Dare compo, and I feel like I’m not any more capable as a game developer than I was then.

I know I have another 24 hours for a Jam entry, but I planned to dedicate only the past 48 hours to Ludum Dare and I will not be able to do much more.

All that pity aside, I did like my idea, and I think the game in my head would be enjoyable if I could have developed it. A bumbling giant monster that gets easily distracted is chasing the player who is trying to lead it to the enemy camp without getting killed in the process. Part of the game play was to get the giant to move in one direction while looking another, causing it to trip and fall. If it falls on top of a building or other enemy structures and units, they would get destroyed.

The monster and the player would each be able to pick things up and throw them. The player would throw things to attract the attention of the monster, while the monster would be aiming to kill. This feature got cut.

Towards the end, I even created quick art to create a building, including rubble, but it never made it into the game.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

LD32: I’m 12 Hours Behind Schedule and Have Bugs #LDJam

I wanted to have something playable or at least controllable within 12 hours. I did it within 25.

LD #32 - Controllable Character

You can now click on the ground, and the soldier will move assign itself the goal of moving towards that point.

The monster is still just placeholder art with basic AI.

There are bugs, though.

For some reason, when I run my game, the loading screen gets inconsistent for me. The mouse cursor freezes on the screen on the main menu screen, in both of these cases, I see the screen look like it is locked, or flickering between two images that should not be on the screen. For instance, my loading screen says “Loading resource 8 of 14”, and it bounces back and forth between 8 and 9, which isn’t happening in my code, which makes me think that there is a problem with rendering.

Animation looks weird once I enter into the game, and so I have to restart the program and hope that I don’t see the issue again.

I tried it in another game which has more or less the same code, and it seems to work fine, so at least that rules out an expensive hardware issue.

But the bad news is that I have a ridiculously difficult to diagnose bug in my Ludum Dare project, and there is less than 24 hours left in the compo. There’s also a weird rendering issue in which my terrain is showing gaps behind it as I move about the world. B-(

And I still have a ton of work to do.

Also, I realized that with all of the struggles, I have been forgetting to commit my changes. Here’s the complete commit log:

$ git log
commit 35fabffff77407ce6a66a146ff297df254c5626e
Author: Gianfranco Berardi
Date: Sat Apr 18 20:29:47 2015 -0500

A lot happened; can control player character, have basic AI framework.

commit cc662aa500df16c01dae56ac3a419a64e0448c22
Author: Gianfranco Berardi
Date: Sat Apr 18 10:32:08 2015 -0500

Fixed camera; added grass, monster placeholder, and boulder.

commit 4656623ca6dfc9fc2e68620a7ec5056e171276e1
Author: Gianfranco Berardi
Date: Fri Apr 17 23:27:09 2015 -0500

Initial commit for LD#32.

Early on, I realized that my efforts were all over the place. I wanted to work on adding a playable character, and I ended up making some terrain instead. Nice, but not as important.

So I actually put together a quick design document, inspired by Hybrid Mind’s Ludum Dare 29 timelapse.

Holy cow, it made a huge difference! I was able to dump everything out of my head, realize there were some gaps, recognize that I had a scope issue, and also prioritize whenever I identified a new problem or bug to fix.

It also helps me see my progress. It’s easy to get demotivated when the clock keeps ticking, but seeing all of the completed work reminds me that I’ve made a dent, and it also helps me keep focused because I want to get more of those planned tasks crossed off my list.

Of course, I’m always realizing something that needs to be added, so the list will get larger. I’m not sure if more planning or more doing would have revealed that information to me sooner.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

LD32: Breakfast and Even More Design #LDJam

Good morning!

I had some oatmeal with peanut butter and raisins, with some cinnamon and nutmeg. I also had a small glass of orange juice and the smoothie my wife made.

LD #32 - Breakfast the First

When I drank the smoothie, I noticed that the side of the glass had this very neat texture:

LD #32 -Potential Texture

I might tweak the color and turn it into the landscape in my game.

I decided that there will be a player character represented in the game. It adds risk, because if the monster catches up to you, you lose.

So, who are you? I originally envisioned some spoiled brat who wanted to get revenge on the people in his town. Maybe that cool neighbor with the better treehouse will think twice the next time he brags about how much better it is than yours.

But then I took a shower, where we often have our best ideas, and I thought of an outnumbered military unit desperately seeking a way to tip the balance in their favor. Finding a monster to do their fighting for them seems like a good alternative to dying and losing the war.

Which also gives the player a reason to worry about the monster getting killed before it can do its damage.

There’s 34 hours left in the compo. I better start planning.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

LD32: Art for “A Giant Weapon” #LDJam

After I got a working build of my project, which didn’t take too long, I started doodling some monster faces.

LD #32 Giants And Ogres

I love how goofy the faces are. I want the monster’s face to be expressive so that it can give clues to the player about what it is thinking.

But just how giant is this character going to be? It can’t be so huge that you can only see its feet. I suppose it would cut down on asset creation, but I envision a very emotive monster which requires a visible face. I want it to be seen as a huge monster, so being merely a head taller than all of the other characters in the game isn’t enough.

But what if there is no player character? That is, the player can interact with the world without having a representative in the world. Then the monster can fit on the screen, and any characters can be incredibly tiny. After all, their faces aren’t as important as the fact that they are running from a marauding monster coming through town.

Maybe they are very tiny stick figures in comparison.

I’m not completely sold on the idea of having no player character. I like the idea of the player running around, trying to get the monster’s attention while avoiding the chaos and destruction.

LD #32  Moving Monster On Screen

That mock up image of the monster now moves about the screen on its own, although the AI is basically “bounce off the walls” and will need to be replaced.

I realized I was falling asleep as I was coding, so I think I’ll go to bed.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

LD32: Weapon Ideas #LDJam

Ok, it’s two hours later. I had leftover green olive and onion pizza for dinner:

LD #32 First dinner

And my wife came home from an event with a red velvet cupcake for me:

LD #32 Red velvet cupcake

I came up with a number of ideas for this theme, especially as people on IRC bounced quite a few around:

  • The Bourne Identity: remember that scene when Bourne used a rolled up newspaper to hit the other guy? And then he stabbed him with part of a pen that was lying around? A game with a lot of random stuff that requires the player to be resourceful and clever.
  • Infectious Agent: a restaurant owner is trying to poison the right spy without killing customers.
  • Kite a Giant: lure a large monster toward a city/castle/friend’s cooler treehouse/etc, while ensuring it doesn’t get bored or killed.
  • Sunlight Focused: kill a neighbor’s flowers with beams of concentrated sunlight in order to win the local horticultural contest.
  • Food Fight: a cafeteria featuring students with ridiculous weapons, such as mashed potato guns and banana missiles.
  • Toys: inspired by the Robin Williams movie, in which wind-up toys fight (I recall this is a multi-decade old game already).
  • Information Warfare: choose which important papers to shred in order to leak secrets.
  • Books: check out books from a library before your coworker does to prevent him/her from learning and getting that promotion.
  • Excruciatingly Severe Body Odor: your odor is repellent. Make use of it!
  • Numbers vs Letters: it’s a battle between the higher level and abstract thoughts!
  • Shapes: an RTS inspired by the different shapes in Flatland.
  • Monopoly: use market pressures to defeat your competitors.
  • Avalanche/Cave-in: cause a disaster to trap other people.
  • Cactus vs Balloon: inspired by some art in my room.
  • Nanotechnology: tiny invaders that destroy your enemies from the inside out.
  • Mind Control: make your opponents do self-destructive things.
  • Fear: scare people towards disaster (for them, obviously).
  • Vampire Hunter: use blood disease to kill vampires.
  • Eggs: birds hatch and peck at opponents.
  • Plunger: you’re a plumber, and you have to save the day.
  • Hopes, Dreams, Aspirations, and Fears: you work in HR at Large Corporation, Inc.

I also tried to come up with a list of potential weapons:

  • Gravity Wells
  • Vacuum cleaner
  • Air guns
  • Summon beings, such as demons
  • Weather
  • Ever increasing mass
  • Sex appeal
  • Paper cuts
  • Bullying
  • Embarrassment
  • Candy
  • Innocence
  • Music
  • Laundry (dirty or otherwise)
  • Humor
  • Banana peels
  • Kisses

Out of all of them, Kite the Giant is the one I keep thinking about. I like the idea of indirectly influencing a destructive force.

I think I’ll go ahead and call it. That’s my game idea, and I’m moving forward with it.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

LD32: An Unconventional Weapon #LDJam

The theme has been announced, and it’s An Unconventional Weapon.

I think I’ll start by exploring that theme quite a bit, and I’ll get back to you about what I’ll do. I’ll think about this theme over a quick dinner.

My goal will be to have something playable, or at least controllable, before the first 12 hours are up.

Since I’m not using something like Unity or Unreal Engine, I won’t be able to whip something up in mere moments, but I know I’ll be able to leverage some of my own code as I have in the past. Each Ludum Dare gave me something new to make use of.

My strategy for this Ludum Dare is to doodle a lot whenever I’m not programming. I’m not very good with digital art programs, but I can put pencil to paper decently enough, and I can just digitize it after the fact.

Categories
Game Design Game Development Geek / Technical Linux Game Development Personal Development

Ludum Dare #32 Is About to Begin #LDJam

I’ll be participating for the first time in two years, when I made a simpler-than-I-would-have-liked game for Ludum Dare #24: Evolution.

Before that, I participated in #11 (Minimalist), #12 (The Tower), #13 (Roads) #14 (Advancing Wall of Doom), #15 (Caverns), #18 (Enemies as Weapons), and #20 (It’s Dangerous to Go Alone. Take This!). I also have a number of MiniLDs under my belt. I’ve gained enough experience to attain Veteran status, so I get +1 to the category of my choice, I think.

I’ll be using libSDL2 and related libraries, NFont, Gimp, Audacity and SFXR, C++, vim, and my Ubuntu system for a development environment.

My past self posted a handy checklist on my blog: https://www.gbgames.com/blog/2012/08/pre-compo-checklist-for-ludum-dare-ld48/ Thanks, Past Self!

As always, I’ll try to cross-post my progress both on the Ludum Dare website and on my own blog.

Oh, and here’s my office pic:

My Office for LD32

Good luck, everyone! I’ve missed you.