Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I am a total convert to the "don't break the chain" idea. I started writing a book on game programming[1] about four years ago. At the time, I was working at EA, miserable, and highly motivated to have the book done so it could help pad my resume. I got a book deal (O'Reilly) then, when that fell through, another (Apress). I had a real writing schedule, and a very supportive wife, and I would work on it for hours at a time.

Then I left the game industry, moved across the country, and had another kid. Suddenly, motivation and time were scarce. I backed out of the book deal and basically put it on hiatus for two years. I still really wanted to finish it but it just wasn't happening.

About a year ago, I realized that if I didn't finish it soon, I never would. My familiarity with the domain was fading every day. I didn't want the project to be a failure, so I decided to try writing every day.

I didn't have a set goal each day, but I try to do around 30-45 minutes. That ends up being ~500 words of first draft, ~1,000 words of later revisions.

In the past 309 days, I've finished 12 chapters. That's 59,568 words, plus a few thousand more for intro sections. I've redesigned the site twice, set up a mailing list, gotten a business license, and a bunch of other grunt work.

I'm about halfway through the very last chapter now (!). In less than a month, I should be able to say the book is done. (Though what I mean is that the manuscript is done, I'll be doing ebook and print versions after that.)

I absolutely could not have done this without working on it every day.

    [1]: http://gameprogrammingpatterns.com/


[HabitRPG](http://habitrpg.com) is totally awesome for this, a great motivator. You can setup "Dailies" so that when you're done writing your daily 500 words, you just check it off. Or set it up as a habit and give yourself a "+" whenever you get a new chapter done.

I use it all the time for just these purposes.


Yup as silly as it looks like, HabitRPG is helping me a lot to fight procrastination.


This is brilliant. Thanks!

Are there any other similar apps out there?


For Android, I like Habit Streak Pro [1]. You give a list of things you want to maintain a daily streak on, and then it asks you at the same time every day how you did.

My longest recent streak was a 5+ month one on sticking to a restricted diet. The power of that was amazing; any time I considered straying I'd feel like I would be throwing away months of work. (I finally broke the chain on day 3 of the flu; I was miserable and wanted comfort food.)

My tips: Have it ask you the daily questions first thing in the morning, so you start your day with a reminder of your streak. And try to keep the number of goals very low, 1-3. More than that and I find it too hard to build good habits.

[1] https://play.google.com/store/apps/details?id=uk.amimetic.ha...


Depends what you're looking for exactly - I use http://www.joesgoals.com/ to track multiple goals, which is a more complex variant on http://dontbreakthechain.com/.



I like the simplicity of chains.cc. The only downside is that there isn't an Android app.

https://chains.cc/


You can use RescueTime to automatically track how you're doing against goals you can configure like "spend at least 1 hour in Sublime Text"



I use an app called goalstreaks.

Far more minimalist. Just a calendar and mark, but I can set reminders and view my overall progress.


If you need more motivation than the other apps, you can try beeminder.com which will fine you (!) if you don't achieve your goals.


My favorite is 42 Goals.


The "don't break the chain" rule is brittle: if you do break the chain, your motivation can crater. I think [Beeminder](http://beeminder.com/) has a clever solution to this problem; it gives you a way to track and enforce your goals while being robust to the occasional lapse.


I haven't found this. Because I can still see a calendar that shows all the days I hit my goal, my motivation doesn't suddenly evaporate if I miss a day. One of the keys I think is setting goals that you can't fail at. So rather than "go to gym" which is a hard habit to form, you could start with "do 10 pushups". Eventually once the habit has formed you can step it up, but it's far more valuable to win/succeed every day than it is to accomplish lots on one day then laps for 5.

EDIT: for example here are my current widgets for the My Chains app on android: https://db.tt/pYRrrPZs you'll notice they're pretty quick and easy, but there are quite a few of them. This gives me a tremendous sense of achievement and progress which has been invaluable in the quest to form better habits.


Another side note - where is the "My Chains" app? The app store doesn't know it...



On a side note... neat skin... what is that?


You mean the wallpaper? Just one of the default things on the old xperia sk17a :)


Well, I thought the whole corner groupings was neat. Novel compared to stock android, which is what I've been running for a couple of years.


Oh yeah the corner groupings are rad. best thing about the xperia is the keyboard though... I can't stand touch screens!! Although my ideal form factor is candybar the only other phone in existence that does what I need is the Motorola Pro+ which is really fragile. I currently have like 4 xperia sk17a's ... Stockpiling them like a survivalist.


Another way to structure the chain is a chain of unbroken weeks, instead of days, especially for actions that stand a pretty good chance of being derailed by life. Like going to the gym. Mark a week as "checked off" if you hit the gym for at least 3 of the 7 days. That way you've got several "buffer days" to act as a cushion.


This is the sort of thing Beeminder effectively automates.


That has to be one of the most interesting monetization ideas I've seen in quite some time. Pretty genius (I'm assuming the money if you go off track goes to them) :D


I worry about that a lot. But I think that brittleness may be what makes me work so hard to not break it.


I agree, that's what happened to me. Now I have a rule to not go 2 days without working on one of my coding project, so if I miss a day I don't get discouraged.


Congratulations! This is a thing of great beauty. I would like to write an iOS-centric game development book; this is truly inspiring.

Just curious... what are your self-publishing plans (if you don't mind discussing them)? What software do you use for writing?


> what are your self-publishing plans (if you don't mind discussing them)?

The book will remain freely available in web form in its entirety. When I put up the last chapter, that will include a nice redesign that should hopefully make it pleasant to read across most devices.

Soon after, I'm going to start working on an eBook and print version. I'm not sure how I'll do the eBook yet, but I'll do some investigation. The book is written in markdown, so it should be fairly straightforward to eBook-ify it.

For the print version, I'll be laying it out by hand with lots of love in InDesign. I was a designer before I turned to programming, and I've always wanted to typeset a full book. I didn't think I'd have to write it first to get the opportunity!

Sometime soon, I'll also contract out for a proofreading pass over the book. Each chapter has gone through a few revisions already, as well as numerous bug reports from eagle-eyed readers, but there's always mistakes. I'll pay out of pocket for it.

I'm purchasing my own ISBN. I'll put the eBook and print-on-demand version up on Amazon. I'm not sure if I'll sell it through other channels yet. I still have to look into it.

The best thing I did was start a mailing list when I was about halfway through the book (using MailChimp, who are swell). It's got over 2k subscribers now, so when the eBook and print versions are ready, I have an audience I can tell.

> What software do you use for writing?

Sublime Text. The first thing I did when I started the book was set up a very simple workflow. I have a Python script[2] that takes the markdown, transcludes the code snippets (which are in separate source files so they can be compiled and tests), and converts it to HTML.

I write in Sublime and then run the script to see the resulting output. I find seeing the prose in two different forms (markdown and styled HTML) helps me during the editing process. It's serves as a proxy for a fresh pair of eyes.

[2]: https://github.com/munificent/game-programming-patterns/blob...


I'd recommend Leanpub[0]. They accept markdown and their workflow is pretty easy and non-exclusive.

For my book[1] I just used pandoc and Makefiles, but once the school year ends and I turn my attention back to the book getting it up on Leanpub is a priority.

[0] https://leanpub.com/authors

[1] https://learnjavathehardway.org/


Yup, leanpub is one of the things I've started looking into. :)


> The book is written in markdown, so it should be fairly straightforward to eBook-ify it.

I put my "toolchain" to do this up on GitHub, which really is just a Makefile that feeds things to Pandoc: https://github.com/steveklabnik/words


Thank you! I'll take a look at this when I start digging into the mechanics of the conversion.


No problem. One quick thing I learned: pandoc is sooooooo much better for this than anything else. I was originally using Calibre to generate stuff, and their epubs don't follow the spec, and so don't work correctly in some readers. I was _this close_ to writing a Ruby script that would unzip, s/foo//g, rezip it back up, before I found pandoc.


That's good to know. Calibre was on my list too.


I use the "don't break the chain" idea as well and it has helped me out tremendously. I currently have three separate calendars for April taped next to my computer so that I can see it every day/all day as a reminder. I will not have any leisure time until I mark an X for the day on all three calendars. The three calendars are for improving myself professionally/career (coding every day), physically (gym), and mentally (reading 1 hour).

I highly recommend that methodology for anyone trying to build a [productive] habit.


Hey I'd just like to tell you that your site is an awesome resource and was useful to me as a student when I was talking my OO design courses. As someone with a gamedev hobby background your site made learning about patterns much easier for me. I will be sure to buy the book when it comes out. Thanks for putting in the hard work and making it available.


Thank you!

> As someone with a gamedev hobby background your site made learning about patterns much easier for me.

This is really reassuring to hear. One of my hopes with the book was that framing architecture in terms of games (which are graphically and conceptually very concrete) would make it easier to understand the more abstract concepts it's about.


Hey, I just wanted to sign-in and comment to say that at some point in the past, I found myself reading your book website. I do recall back then it had way less chapters, and I remember hoping that it'd find its way to completion eventually. I see a lot of new chapters. Great work! Very good resource, too.


Thank you!

Sometimes I look at the table of contents and see how all of the chapter links are filled in and working and it surprises me too.


I've been learning game dev recently, i'm a web dev by professions so it's acting as a nice refreshing change to code at night. It's been difficult to find quality resources for someone who is an experienced programmer but unfamiliar with the principles of game development. I had stumbled across your site numerous times, noted the quality of the work and finally bookmarked it few weeks back.

In case you're ever lacking motivation, just think that the work has been invaluable to someone like me coming to game dev for the first time. It's a truly excellent resource and i will surely buy the book when it's released. I'm signing up for the mailing list now.

Thanks again for your hard work

EDIT: I even just noticed that I even had the site open already, right at the back of my massive stack of open tabs :)


Very good discipline in the article, and very good discipline in your plan too.

If you don't mind me asking - what's the point in writing a book about an area that you used to work in, but didn't want to going forward? (I assume you moved out of gaming if the domain was fading)


I'm not keen on working in games professionally right now (though I wouldn't rule it out forever), but I'm still quite into game programming. I don't spend much time doing it these days though, since most of my limited free time lately is either on writing or programming languages.

But I'm still really passionate about the subject material (games and software architecture) and I think the book could be written, and I could write it. I also just really want to finish something for once in my life. Getting email from people asking me to keep working on it for two years didn't hurt either. :)

One little secret about the book is that it's not actually game-specific at all. Almost all of the patterns in it are equally useful in non-game software, but I think games are a much more interesting motivating example than yet another accounting application with EmployeeRecords and PaymentAccountTypes.


Thanks for sharing. Yes - games are a much more interesting subject matter than accounting records. :-)

I think it's a worthy endeavor no matter how it ends for you. You're contributing to the broader base of knowledge in the world, and clarifying your own thoughts in the process. Even if there isn't tangible immediate benefit to you, it's still a good thing to do.


I like the "don't break the chain" method as well. I actually designed a calendar that displays the whole year at a glance. Mine is printed out and placed on a wall that I will see every day. I use it for the "don't break the chain" idea, but it is also really good at reminding me how short a year is. Really drives home the idea that every day is important.


Did you work on Madden at EA (since you mention it in the intro)? If so I'd love to read more about the architecture of that. I've always wondered how offensive/defensive line interaction and AI worked -- among a million other things. And the book looks good!


> Did you work on Madden at EA (since you mention it in the intro)?

I did, though I didn't really touch gameplay. I was a UI programmer on Madden PC 2002 (Oh God that's over a decade ago now, what happened to time?) and I worked on the first version of Madden for the X360 doing mostly animation and tool pipeline stuff.

I'm not the best person to ask about it, but the part that blows my mind is that the "AI" for the game is deeply tied into the animation system. Madden has hundreds (thousands?) of individual player animations: runs, tackling, blocking, catching, you name it. The AI works roughly by searching for an animation that lines up with what it wants to do.

For example, if the ball is coming towards a receiver, it looks for a catch animation that will put his arms in about the right place and that stitches together well with the animation he's currently playing. If it finds one, then it transitions to that animation and makes the catch.

This means the producers who are building and tuning the gameplay do much of it by tweaking animation: changing timing, deciding to add more animations of certain types, etc.

As far as I know there is no holistic set of data or code that says, "this is the AI of Madden". Instead, it's just the sum of all of these animations.


Fascinating. I personally would love to see more written about Madden, if you were so inclined.

That is probably the code I'd pay the most money to get a walkthrough of.


> I've redesigned the site twice

I chuckled to myself at this bit because it's the type of productive-but-utlimately-unnecessary task I'd find myself doing if I were trying to write a book.

Not trying to be a downer, that's an impressive streak and I hope your book does well!


Yes, I have to work hard to limit my non-writing tinkering, so I timebox the design stuff pretty harshly.

I started the book four years ago, so the first design was unreadable on mobile devices (fixed position navigation will do that!). After a number of complaints, and the creation of Google Web Fonts, a mobile-friendly better design was a necessity.

I just finished another redesign that will launch when the last chapter is done. It's even more mobile friendly and has a front page that reflects the completed status of the book. It also just looks a hell of a lot better. :)


I've read a few of your chapters and I think you're doing a great job. Keep it up!


Yes I read one of your chapters as well, very well done and I'll be buying the book when it comes out.


Thank you and thank you!


The first pattern book without a mention of Christopher Alexander (:


Oh god, how did I omit that? A Pattern Language is seriously one of my all time favorite books.

Filed a bug: https://github.com/munificent/game-programming-patterns/issu...


Are you still in the game dev field? Great job on the book by the way.

Edit: Oh, are you the one whom Herb Sutter used his benchmark in the Build conference talk about C++ a few days ago?


> Are you still in the game dev field?

No, I left EA about four years ago. I was hoping to stay in the game industry but somehow snuck into Google instead. I'm working on Dart now and couldn't be happier.

> Oh, are you the one whom Herb Sutter used his benchmark in the Build conference talk about C++ a few days ago?

Yup!


Interesting, how did you end up in Dart team? I mean that "famous" Google-way of randomly assigning employees to projects. And is there any way to apply directly to Dart (or any other) team?


> Interesting, how did you end up in Dart team?

My starter project at Google was working on front-end UI code for what eventually became Hangouts in G+. Lots of JS in a very large JavaScript application.

I really like UI stuff (that's what a lot of my background is in), but I wasn't at all interested in the domain (videoconferencing) and trying to do an app-like user experience in the browser is not something I would wish on my enemies.

Through total random chance (we took a one-off improv class at work together) I met someone who was spinning up a small team working on tech to try to push the web forward. This was right around the birth of my second kid, so I got my manager to agree to let me switch teams when I came back from paternity leave.

I worked on that for a short while before the project ended up getting reshaped. My little team then basically spent a week or two interviewing teams at Google to see where we'd go. It was awesome: we literally had teams coming to us pitching themselves.

Since I love programming languages and open source, the Dart team (which was still in it's very early days) was a great fit.


He works on Dart for Google. I also find him an excellent critic (inclusive of dart) in forums. Some of his insights have cleared up things for me that are expressed vaguely elsewhere in comparison. I would like to see him do something more expansive on the tradeoffs between objects and ADTs (hint hint). Maybe he has done but I can't find it.


> I would like to see him do something more expansive on the tradeoffs between objects and ADTs (hint hint).

I'm probably not the best person to answer that. My knowledge of real academic theory isn't as strong as I'd like, especially around type systems.

I assume you've read William Cook's paper on the same topic ("Object-Oriented Programming Versus Abstract Data Types")? I skimmed it a while back and felt like it clicked for a while but it's sadly unclicked since then. It's on my (interminably long) list of paper to try to grok better.


Well it was worth a shot anyway (you made some comment in that area before that I thought was good). I need to go back over that Cook paper myself. Thanks for reminding me.


Sounds like a great book, congrats man! I'll for sure buy it when it comes out :)


How do I donate something to your cause to say thank you for the work you've already done (and for putting it online for free)? Paypal/Bitcoin would be easiest, but anything will do. :)


A thank you alone is enough!

If you want to back that up with cash, the best way will be to buy a copy of the print version when it's out. Part of the magic of self-publishing is that I get a very large cut of the sales of that, so it's a good way to say thanks. (And you get a physical book out it!)


Your book is awesome, I was reading it a while back. Great stuff!


I've been looking for a resource like this for awhile! Thanks for posting.


I really love this. Great job.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: