Category Archives: Learning

Use a Sharpener

While reading through Clean Code today, I was surprised to reach the end. Even though there were 80 or so pages left in the digital version of the book, they were all appendix and index. So today is the “what have we learned day.”

Keep It Sharp

One of the most common stories about self improvement is the story of the man felling a tree. Usually this man has a saw or an axe and is working very hard but making little progress. A friend comes by and notices the tool is very dull. When this is pointed out, the man felling the tree usually says that he does not have time to sharpen his axe because he has to get this tree down. Most people can see the irony that if he would spend a little time keeping the axe sharp, the tree would be down quicker.

This is the point of reading books and doing other forms of continuous education. As creators and designers we need to keep our skills sharp so we can be more effective.

Fragrant Code

The essence of Clean Code is summarized nicely in its last chapter called “Code Smells.” It gives a list of heuristics of “smells” that, if you find them in your code, can be warning signs of poor code design.

Importance of Clean Code

One of the most beneficial things that I have gotten from learning how to write cleaner code is being able to come back to code I wrote a week ago and more easily pick up where I left off. Sometimes life happens and I don’t get the opportunity to work on my games every day. And one of the things I noticed as I was reading this book was a lot of the time as I tried to make games quick and with my limited time, I sacrificed a lot of code cleanliness.

And this is ok. But what I did not do, and what is very important to do is go back and clean up or refactor that original code. Otherwise your pace will start to slow down as you dig through to find what that function does and have to rewrite that other one to handle some new case. You will be trying to chop the tree down with a dull axe.

So Sharpen Yourself

Knowing that you need to stay sharp doesn’t do a whole lot. You have to actually take the time to read, to watch and to learn. If you write any code at all, I would recommend reading through Clean Code if you haven’t already. And if you have, read it again.

Even if you never plan on writing code, just the principles that help keep code clean will help you keep designs clean.

10/10 Would recommend reading.

July 2016 End of Month Goal Review

It’s August already. Where has this year gone? Lets take a look at how I did in on my goals in July.

Goals

  1. Write 3 Blog Posts Per Week and Publish 2 – I wrote and published exactly 5 posts in July. The writing goal was 12 and the publishing goals was 8. This is why it is important to check the numbers every so often. I am clearly not hitting my writing goals.
  2. 1 Game Designed, Created, and Released Per Quarter – The rough draft of a card game was made (Design) but no further work has been done on it. I have been steadily working to finish multiplayer for Drone Tournament (Game #2 of 2016) instead, and I have been making good progress. Some of the server side code could be cleaner but it is almost an MVP for play testing.
  3. 1 Book Read Every 2 Months on Game Design – Still making my way through Clean Code, in fact I just read a few pages before writing this. On page 340 out of about 460 pages so 75% done. Making good progress actually and the principles in it have been invaluable in improving my code for my games and also for my day job.
  4. 1 Article Read Or 1 Video Watched About Game Design/Creation Per Week – I don’t actually remember July that well as far as this subject goes. I do remember listening to some podcast episodes on a new podcast I found, but other than that not much.
  5. Get 100 People Reading Evolving Developer Per Month – I have noticed a couple people have followed links from a forum post I did linking to a tutorial on how to handle a certain camera interaction. Maybe more of these kinds of tutorial posts that teach something useful and actionable and that deal with specific problems are what I need to be doing.

What Went Right

Drone Tournament multiplayer is coming along steadily and is almost done. My code is getting cleaner and I am on track to finish reading book #2 of 2016 on the schedule I set for myself. I am getting a tiny, tiny bit of traffic to a certain article that solves a specific problem. Bonus thing that went right is that Monkey-X full version dropped its price to about $40 instead of $100. I was already thinking about getting it and this makes it an even easier decision.

What Is Not Perfect Yet

My writing volume was at less than half of my stated goal per week for July and my publishing of that writing was only slightly better than half. Game #2 was not released on time and is not yet finished. I did not keep track of the articles and videos I watched on games and game design so I don’t remember if I hit my goal or not. And still don’t have even 1 daily visitor to my blog.

Corrective Measures

In order to keep writing volume up, instead of starting every day with coding on the current game for the quarter, I will start everyday with at least 15 minutes of writing. In order to get Game #2 finished, the writing will be followed by at least an hour of designing and coding the finishing touches on the game. I start keeping a list of every article that I read and video that I watch on game design in Evernote to refer back to later to see how I am doing. And finally, I will begin writing more tutorial type posts and sharing them in the Monkey-X forums for people to use.

More Progress Mixed With Difficulty

Game Devs Like You

One of the many things that my studies in success have consistently directed me towards is forming a Mastermind. The word may sound fancy but it is simply the idea of 2 or more people who meet together to share advice and ideas.

In game development especially, a mastermind would be extremely helpful. Sharing resources, pitfalls, and ideas in something so complicated is extremely beneficial to all involved.

So a few months ago I started looking into this a little more seriously. I have not found or formed a mastermind as yet, but I did find an opportunity to join one remotely.

Gamekedo

Gamekedo is a game development club organized by Chris DeLeon. They work mostly in Unity and work together to make games.

The club has monthly dues but for someone just starting out in game development it sounds like a great opportunity (especially if you are interested in Unity).

Game Devs Like You

In addition to the club, Chris also runs the Game Devs Like You podcast in which he interviews people in game development. I have only listened to the first couple episodes so far but they are fantastic. The first episode is with a game dev who is only 12 years old (what’s your excuse?).

It is an encouraging and informative podcast and I will be adding it to my Ultimate List of Game Development Podcasts

If you don’t already have a group to discuss games and game design with, consider looking for one in your area or online.

Web Design – the Skeleton Framework

This week we are taking a small break from our regular theme of games and looking at web design, specifically at using the Skeleton framework. Something that I learned from The Art of Game Design is that learning better design principles from any kind of design will help your game design.

Why Are We Talking Web Design?

I had my phone out and was looking up a certain kind of local businesses around my area and found that there were only a couple. When I clicked the link to their websites I found that they were not ready for phones. I had to pinch and zoom and scroll around the page. The information was there and the navigation was clear but it was just not designed to work on a phone.

Since I had been meaning to learn better responsive web design in an effort to increase my value as a web based programmer (my current day job), I decided I would take one of the sites on as a project. So I completely redesigned the whole site and made it mobile responsive. I was proud of my work and asked the opinion of a coworker who is very good at design.

He made a simple suggestion that took the redesign to another level.

Adding a Skeleton

My coworker suggested that I add a CSS Grid system to the site and recommended Skeleton. I had never heard of it before and decided to check it out.

One of the most common CSS grid frameworks is Bootstrap. Many people who have looked into modern web design can pretty quickly identify a site that uses one of its templates or something like it. I have tried learning more about Bootstrap in the past but always found it a little murky and never made much headway in understanding what it was trying to do.

Skeleton is a very light CSS framework that allows you to get started applying a grid system to your website design with just a few classes. It is pretty clear what it is trying to do, and it sort of self documents by example on their site. I found it extremely easy to get started with.

The grid is basically rows and columns. You then use these 2 building blocks to create a cohesive design that is more aesthetically appealing. Additionally it helps organizes the information that is being displayed to be more easily consumed by the user.

After applying Skeleton to the site, it looked 1000% better (in my personal opinion).

Lessoned Learned

Many of the principles of grid systems, such as cohesion, can apply to games and most importantly to the part of the game that the player interacts with, the interface.

Every game has some sort of interface that the player uses to play the game. We as game designers should take things like grid systems and learn to use the principles that they are based on to improve our games and their interfaces.

Don’t forget to look for inspiration in all design.

10 Things Analysis: Texas Hold’em

It’s been a while since I did a game analysis and since Game #3 for 2016 is going to be a card game, I decided to take a look at one of the many card games I enjoy, one that is been around for a while and played worldwide. The game I chose is Poker, specifically the Texas Hold’em style.

How I Know the Game

I had seen some Texas Hold’em played before on TV during the World Series of Poker (WSOP, which incidentally has been going on for the past few weeks), but had never played it myself and didn’t really understand it until a couple years ago.

Some guys at work where having a little home poker tournament and a friend of mine invited me to come play. I didn’t know the rules so he taught me the basic rules and then I proceeded to watch the coverage of the prior 2 years of WSOP on Youtube before the tournament to prepare.

I didn’t do all that well. And although I lasted longer than my friend, I did not have a strategy for how to win.

About 8 months later I happened across a Twitch streamer named Jason Summerville who was streaming poker of all varieties every evening and I began to watch and listen. After a couple months of watching him and about a year after my first time playing Poker, the guys at work scheduled another tournament.

Again I watched WSOP, continued to watch Jason, and played some practice games with a Poker app or 2 on my phone. This time I ended up coming in 2nd place out of about 20 guys after some real close calls. It was often and I am smiling now just thinking about it.

On to Analysis

Many of these things will actually apply to all kinds of Poker but I am mainly looking at the Texas Hold’em, tournament style.

Goal

The goal of the game is simple, win all the chips. In a tournament, typically all the players will start with a similar number of chips and if you lose all of your chips you are out.

Rules

You play the game with a standard deck of playing cards. You can play as long or as short as you want and in a tournament this is usually until one player has all of the chips. The game is played in hands and each hands has several rounds of betting. Whoever wins the hand gets the chips that where bet by the various players.

You can find a more detailed description of the rules here.

Interaction

Players have 2 basic ways to interact with each other. The most obvious is through betting. When you bet it forces your opponents to make a choice of whether to fold (let you win), call (match your bet to continue playing), or reraise (force you into this decision by putting more chips in). Also the size of your bet gives your opponents information about how strong you think your hand is, or how strong you want them to think it is.

The other less obvious methods of interaction is through table talk and nonverbal communication. Good players can read body language fairly well and can even fake body language giving their opponents false information.

Catchup

One of the things about poker is that you can come from behind and win. This is usually done from “doubling up” or doubling the amount of chips you have by going “all in” and betting all of your chips that you will win. However like all catchup features, it has risk. If you lose the hand when going all in, you are out of the game.

Inertia

Each hand has 2 blinds, a big blind and a small blind. These players have to bet certain amounts each hand. This responsibility rotates around the table by one seat after each hand. The blind is also usually the minimum amount of chips you have to raise by if you want to raise. Most tournaments have the blinds increase every so often to move the game towards completion.

Surprise

Poker is full of surprises. This comes with any game that has randomness and hidden information. For Texas Hold’em you are surprised by the cards that are revealed each round and by the cards your opponents have.

Strategy

Despite the randomness inherent in a game like poker, it is full of strategy. How else you several people consistently make a living at it? Most of the strategy comes down to playing the odds and playing the other players. There are books and websites dedicated to how to play poker well. One of the great things about poker is that it is unlikely that you will ever be able to play perfectly.

Fun

There is a ton of fun in poker. Every time you put the pieces together of whether you can beat your opponent or not based on the limited information you have it is awesome. It is like one puzzle after another and can be kinda rewarding.

Flavor

This one is tough. I am not sure that poker has a flavor and that is OK.

A Hook

In a word, money. This is what gets most people into any sort of gambling game to begin with. It is a powerful hook and can lead some people into spending too much money on the game.

Final Thoughts

There is actually an interesting crossover between people who play Poker and people who play Magic the Gathering (like me). And like MTG, Poker is a very fun game and there is a lot of strategy to be found in it. It has most of the elements of our 10 things list and is not surprisingly very popular. If you have never played before, I recommend giving it a shot. Although I will add that you probably should not play for real money (at least not at first and never more than you can afford to lose).

Have fun making games that stay popular like Poker.

Book 2 for 2016 Revealed

The second book I have decided to read to help further my goals with Evolving Developer is not a game design book. It is a book about design however.

A Programming Book

The book I have decided on is Clean Code: A Handbook of Agile Software Craftsmanship.

Clean Code

Why This Book?

I Make Games

While I want to get better at game design, I also am currently the only one making the games that I design. And since so far all of them have been video games (and will mostly be for the time being), I need to get better at building them.

The majority of the work that I do is writing code. If I can write it better and cleaner, not only will my games work better and be better, but also when I get to teach other people, they will be able to read the examples that I create and understand them easily.

Game Design Borrows From All Design

Additionally, Clean Code is about design. Naming things, when to include things, when to exclude things. These concepts are useful in both writing code and designing your games.

Time Leverage

There is an old saying “Kill 2 birds with 1 stone,” and that is what I am doing here. I have several goals with my day job in addition to goals in making games that Clean Code will hopefully help me accomplish better. One of those is to provide more value. If I can write better, cleaner, more easily readable code, I can provide more value.

Already 20% Done

I actually started this book a week ago and have already read over 100 pages in (out of almost 500). It should not stretch out over 5 months like The Art of Game Design did.

Remember, ideas about good design in general can help you with how you design your games.

How To Calculate If Line Segments Intersect The Easy Way

I am currently working away at Drone Tournament, Game #2 for 2016, and started implementing combat into the game. In order to make combat happen, each little drone unit in the game will be able to fire their weapon every so often, and if they hit an opponent it loses armor and can be destroyed.

The trick is how to figure out if we get a hit.

Previous Collision Detection

At the beginning of 2015 I made my first game Prism Ship with Monkey-X and it implements a little ship that shoots blocks. The collision detection there is not pretty but fairly simple because everything is kept square and straight.

Projectiles go straight up and the things they hit are coming straight down so no real fancy math is needed. I simply checked each of the corners of the projectile to see if they were inside the squares you are trying to hit.

A New Challenge

In Drone Tournament however, things can turn when they shoot which means that bullets go off at weird angles and their potential targets are not always moving directly towards them. Additionally I did not make the projectiles in this game as large as in Prism Ship. They are basically line segments.

It Has Been Solved

This problem is common enough that it has been solved before, and in a most elegant and simple manner. Here is some Monkey-X code that I derived from an implementation of the solution in Python. I will explain what is going on below. I even borrowed a picture that shows what is going on really well.


	Function LinesIntersect:Bool(pointA:Vec2D, pointB:Vec2D, pointC:Vec2D, pointD:Vec2D)

		Local abc:Bool = CounterClockwise(pointA, pointB, pointC)
		Local abd:Bool = CounterClockwise(pointA, pointB, pointD)
		Local cda:Bool = CounterClockwise(pointC, pointD, pointA)
		Local cdb:Bool = CounterClockwise(pointC, pointD, pointB)

		Return(( abc <> abd) And (cda <> cdb))
	End

        Function CounterClockwise:Bool(pointOne:Vec2D, pointTwo:Vec2D, pointThree:Vec2D)
	        Return ((pointThree.y - pointOne.y) * (pointTwo.x - pointOne.x) > 
                        (pointTwo.y - pointOne.y) * (pointThree.x - pointOne.x)) 
        End

For those of you not familiar with Visual Basic, "<>" is its way of writing "!=" (Not Equal)

Explanation

If you remember from your geometry class back in high school, line segments have a slope which just measures the change from the beginning point to the end. If you have three points A, B, and C, and the slope of the line from A to B is larger than the slope from A to C (meaning it changes more) then the points are in Clockwise (CW) order. If the slope from A to B is less than that of A to C then they are considered Counter Clockwise (CCW).

borrowed_diagram_ccw
Image borrowed from here (article 1 in reference below).

So we test the two points of our particle to see whether they are CW or CCW to each edge of the Drone hit box. If 1 point is CW and the other is CCW to an edge, then we know that the lines intersect because you have a point on either side of the edge of the hit box.

Special Case I am Ignoring

There is a special case where the 2 lines lay across one another called Collinear. I am ignoring this special case because for the purposes of the game it would not really be a solid hit and is not that important. If you would like to know how to handle it you can read more about this solution at the following articles.

References

  1. Line Section Intersection Algorithm
  2. How To Check If Two Line Segments Intersect?
  3. Stack Overflow: How Can I Check If Two Segments Intersect?

Book 1 of 2016 Review – The Art of Game Design

I wrote an initial review over the first few chapters of the book earlier this year, then quickly realized with the types of notes I was taking it would take forever to finish the book. Well it took 5 months anyway with everything I had going on. I suspect if I had focused on it bit more I could have finished it in 1 month no problem. This is a very brief set of notes with a thought about every chapter.

Rating 10/10

This book is fantastic. It is essentially 500 pages of great ideas and questions to ask yourself when making a game. This may sound overwhelming and it is a little, but just get 1 or 2 of the ideas at a time. In fact, there is a separate little deck of cards that can be bought (or you can make your own) from the “lenses” in the book. Highly recommend anyone who is interested in games creation, game design, or the game industry read through this book.

Notes and Thoughts

The only way to be a game designer is to design games (and make them). So if you want to be a game designer say “I am a game designer” and go make games.

There are several important skills every game designer can have but the most important is the ability to listen. Not just listening to what people say, but also to their body language and other non verbal communication.

As a designer, you are really designing an experience that the player(s) of the game will have. Then you design a game that will deliver that experience.

Games are made for players. Who is your player? Ofter written as, who is your target demographic?

Even though people usually interact with the game through some sort of interface, the experience you design actually takes place in the player’s mind.

Games are made up of different elements. Only one of those elements is the game’s mechanics. This includes rules of the game and the playing pieces and interactions.

Balancing the game’s mechanics is very important to the experience.

The mechanics of the game support puzzles in a game. By this we mean that there is some sort of problem solving in the game caused by the mechanics.

All games have an interface so you can play them. It is a loop. Player puts inputs into interface, game interprets and gives an output, player interprets the output and gives a new input. The ideal design is to have the interface add to the experience that is being designed.

Interest curves are very important for judging experiences. One of the most effective interest curves is well known and is basically a short period of rising action at the beginning, a small drop in action, then a longer period of rising action to the climax of the story. However the best interest curves are fractals of this curve so that a small arc of the story along this larger interest curve will also follow the same pattern.

Stories are one type of experience. The dream is to have a completely interactive story with open endings. This is both difficult and impractical for now (see this post I wrote about branching explosion of story writing). There is good ways to design story into the game and the book has several good tips.

The game and the story can be merged together with “indirect control.”

Stories and games take place in worlds. Some of the best worlds are those that people actually want to visit and even pretend to visit and translate into other forms of media well.

There are characters in our worlds. We want to create compelling characters.

Worlds contain spaces, we usually call them levels. You can use the design of the spaces to create a better experience through giving visual clues the players may not even notices but react to and follow.

The aesthetics of the world define its look and feel. Sound, art and the technology used to create the world all work together to help get the experience where you want it.

Some games are played with other people. This can sometimes get a little tricky.

Sometimes communities form around games. It is important if you are designing a game where you hope a community will form to build in support for a strong community. The author gives several good suggestions and examples of ways to build a strong community.

Game designers usually work with a team (even if it is only a team of 1 other person). Getting buy in from everyone on the team is super important. Keep communication levels good.

Sometimes the team communicates with documents. Make sure to not let them get stale.

Playtesting is the key to a good game. You can never playtest enough. You need to ask the playtesters: Why, Who, Where, What and How?

The team builds the game with Technology. Technology can be tricky, especially on games that are being developed over a multi year cycle. Choose carefully.

Games usually have a client. By this we mean someone who is financially backing the game.

The designer usually gives a “pitch” to the client to get them to buy-in to the idea of the game. There is a list of tips for how to give a successful pitch.

Most of the time, the client (and you as the designer) want to make a profit from the game. You should spend some time learning the lingo of game sales and figuring out the business model of the game.

Games actually change the people who play them, the book uses the word “transform.” Games can be both good and bad for you.

Because of the affects games can have, game designers have certain responsibilities.

Every game designer has motivation, what’s yours?

The End

Seriously, go get this book and read it. Even if you don’t want to design games, it still has valuable ideas for anyone wanting to get into design or creation of software.

If You Are Having Trouble Finding a Topic to Write About, Do Something Intersting

The title basically says it all.

One of the reasons people give about why they don’t write a blog or don’t keep it going consistently is they can’t think of things to write about. Many times, I am having trouble thinking of something to write about. But if I am being honest, it is usually because I have not been spending my time doing interesting things. I have actually usually been wasting time.

But as soon as I start taking action on making games or learning something new, all of a sudden I have ideas shooting through my mind on topics to write about. There has never been a week that I did spent at least an hour working on a game or reading a good book that I did not also have an idea for a topic to write about.

Now go find something interesting to do and write about it.

May 2016 End of Month Goal Review

Last month I said it wasn’t pretty, well it got a little uglier there for a minute.

Goals

  1. Write 3 Blog Posts Per Week and Publish 2 – Two things happened in May that I let derail me pretty hard from my writing. I went to Texas for a week for OSCON and immediately upon coming back I moved to a completely new state. Instead of writing 12 posts and publishing 8, I wrote and published 3 posts. Not gonna lie, could be better. Looking on the positive side, I did get a few ideas for things to write about.
  2. 1 Game Designed, Created, and Released Per Quarter – Even though I did not get much writing done, I did get some work done on Game #2. The mechanics of movement have been kind of tricky and still had some bugs in them which are now thankfully removed. It still needs polish but I feel like a minimum working version of the game will be ready by the end of the June.
  3. 1 Book Read Every 2 Months on Game Design – Finally completely finished reading the Art of Game Design. What an elephant it turned out to be. But like all elephants, just eat it one bit at a time. It is a fantastic book and I will be writing a final review post this month as well as choosing a new book.
  4. 1 Article Read Or 1 Video Watched About Game Design/Creation Per Week – I was actually hoping there would be a talk or 2 at OSCON about games and game design like last year, but there was not. I did get to meet the guys who gave the talk and they said that they submitted a follow up and it was rejected. There was however a few games in the Expo hall at the convention that I may write about.
  5. Get 100 People Reading Evolving Developer Per Month – Last month I said I planned on telling 20 people about Evolving Developer at OSCON. The actual number was 1 person. There was a 5k run on the first night and afterwards while talking with one of the other runners, I found out he worked for a university and that he knew a professor who might be looking into setting up a game design course. This was a fantastic opportunity to provide value and I almost let it slip away. On the last day of the conference I caught him just before he left and got his contact info so I could send him some things I had learned. No other conversations I had really opened an opportunity to bring it up, and I failed to create any opportunities.

What Went Right

  1. I was able to provide value to someone and sort of tie it in to Evolving Developer.
  2. Once again I am having fun making a game and learning new things about games, game design and funky math.
  3. Book 1 for the year has been read completely.
  4. I have a list of at least 15 topics I want to write about.

What Is Not Perfect Yet

  1. If analytics is to be believed, I have exactly 0 readers of this blog.
  2. Writing volume is still well below what I would like it to be.
  3. I don’t yet have what is described in The Art of Game Design as “lack the fear of ridicule” for telling people about Evolving Developer.

Corrective Measures

I did some studying in March about how to get more readers and the March Madness Marketing notes need to be reviewed and applied. In addition, I need to embrace the fear of talking to people and possible ridicule and rejection and just tell them about what I am doing. Now that my daily routine is being less disrupted, I need to get back into consistent writing so that when I do have readers, they will have something interesting to read every week.

Possiblity mixed with difficulty.