The hits keep on coming

I passed 300,000 site visits today! Not too bad for less than a year, so approximately 1,000 a day on average. Probably more like 2,000 a day for the last 6 months. Video games and certain “geek oriented” (and proud of it!) topics are the most popular of course.

Spread the word!

So you want to be a video game programmer? – part 5 – The Method

…CONTINUED from PART 4. Or start at Part 1.

This post is presents an algorithm of sorts for learning to program. It applies not only to the fundamentals, but to all aspects, including the acquisition of small component skills. Thirty years after learning, I still follow the same basic procedure. To tell the truth, modified, it works for leaning most things.

Step 1: Goal. Invent some manageable goal that excites you (in a later context as a profession “excites” is often replaced/supplemented by “need”). My first program was a text-based dungeon master (see here). If you want to be a video game programmer, there’s nothing better than a game. If it’s one of your first programs, make it damn simple. Copy some REALLY REALLY old and simple game like anything from before 1981 (PongBreakout, etc.). Truth be told, using text only for a couple weeks/months might not be a bad idea. Graphics just complicate matters. They’re awesome — and you’ll need them soon enough — but first the fundamentals, like variables, flow of control, scope, etc. Any individual task should take no more than a few days. If your goal is bigger than that, subdivide.

Step 2: Environment. All programming is done in the context of some environment, and you must learn about it. You need to start with a simple one. In my case it was mostly AppleSoft BASIC. For learning interpreted is good. Some decent starter environments today are Python, Ruby, Flash, Lua. DO NOT START WITH A LANGUAGE LIKE C. I will elaborate on this environment question in a separate full post, as it’s a large topic and highly religious for programmers.

Step 3: Research. This means reading. If you don’t like to read, either learn to or find yourself a new career. I’m serious. Reading separates the Neo Cortexs from the gibbering marsupials. I’m serious. Be a New Cortex. Your love of reading must be so extreme that you can stomach slogging through 900 page Library Reference Manuals (maybe not at first). Programming is full of details.

Step 4: Theory. Get out a pad of paper, a text file, Evernote, or whatever. Design what you are going to do. Later, you might or might not skip this step (and do it in your head), but it’s useful for the beginning programmer. You don’t need to write out the entire program, but you should design your data-structures and modules or functions. If it’s one of your first programs, you should hardly HAVE data-structures. You might instead write down the modes and loose flow chart between them.

Step 5: Code. Actually try coding your program. This is best done in an iterative way. My advice is generally to start with creating your core data-structures, and then the functions or methods that support them. Test each of these individually. Interpreted languages with a listener are the best because you don’t have to write test suites, but can just test the components as you go at the listener. Time spent debugging individual functions and groupings (say all the methods that belong to a data-structure) pays for itself 100-fold. I still do this. The less code you are testing, the easier it is to spot and find bugs. If you know that your functions are reliable (or semi-reliable) they provide robust building blocks to construct with.

Step 6: Debug. See above in “code” because they are heavily intertwined. Coding and debugging happens together in small loops. Again. The less NEW code you have to debug, the better. Debugging is hard for novices. Do not write an entire big program and debug it all at once. If you are using a language that syntax checks, check each function after you have written it. Fix the syntax errors (typos) and then test and debug the single function (or component of a program). Baby steps. Baby steps.

Step 7: Iterate and improve. Just keep adding things to your program to get it to where you want. Add a new feature. Improve an old one. Rip out some system and replace it. Add graphics. Upgrade them. Try to keep each of these changes as small as possible and test after each change. The longer it has been since it ran, the harder it will be to make it run.

_

I can not emphasize how important baby steps are. They are the key to avoiding fatal frustration. I have a law that helps define the size of subtasks: DO NOT EVER LEAVE THE COMPUTER IF YOUR PROGRAM DOES NOT RUN. You can take a piss or stretch. That’s it. I lived by this rule my entire programming career. You can’t always follow it, but try. Get your ass back in that chair. Mom wants you for dinner. Shrug. Your co-workers call you for a meeting. Snarl. I always think of a program like a car engine. You can sometimes merely tune it up, but a lot of times you have to take apart the engine to fix/add something new. That time when the engine is apart (the program does not RUN!) is very important, and should not be very long. If it is, you are not subdividing your tasks enough. I write all sorts of custom code to allow the engine to run again (even if in a half-assed way) while big changes are going on. These intermediate constructs are intended as throw-aways. But they save time. Having your program broken, writing more than a couple hours of new code that has not been tested, is a recipe for disaster. You could easily reach the point where you have no idea where the problem is. If you test in small bits as you go debugging is MUCH easier. Bugs are perhaps 80% likely in the most recently stuff. It’s the smoking gun you goto (haha) first.

You can do a lot with ASCII graphics!

A starter example of this whole process: My first game was a text based D&D type RPG game. I wanted to include a number of “cool” (to a 10 year-old) encounters. So I structured it as follows: There was the “character.” This was to be just a number of global variables (this is long before object oriented programming) like G (gold), HP (hitpoints) etc. I wrote a couple “methods” (functions – but they didn’t have names in BASIC, just line numbers) like “takes a hit.” This subtracts from HP, and if <= 0 branches to the “you are dead” part of the code (not really a function in those days). Then I wrote a number of “encounters.” These were the main flow of control in that program. It popped from encounter to encounter. They might be like: You have met an orc. draw orc on screen with text graphics (aka print statements). present options: “attack,” “run,” “use magic,” etc. wait for input and apply logic. If you are still alive send the player back to the main navigation loop (the place that doesn’t have a particular encounter).

That’s it. I expanded the program by doing things like: Adding more encounters. Adding resurrection as a pay option when you died. Adding an actual map to the main loop. Moving the “combat” logic from individual encounters into a function. Then adding to the character attributes like strength and dexterity which influenced combat. Beefing up character creation. Etc etc. These are all tasks that can individually be accomplished in a few hours. This is key. It keeps your program running most of the time. It provides good feedback on what you are doing.

The entire above “goal” -> “debug” loop can be repeated endlessly. Example: “add a save game.” You now have to save and restore the state of your player (various global variables). But to where? Disk presumably in those days. So you crack the BASIC manual and read about file I/O. First you go simple. There is one save game. It’s always named “adv.sav”. You write a function to open the file and write the vars into it. You examine the file to make sure it put them there the way you want to. You write another function to read the file. You add options to the game menu to call these functions. Then test.

Next baby step. Allow multiple save games. You add “filename” (or save slot or whatever) to the load/save functions. You hardwire it to something and test again. Then you add interface to the game’s main menu to specify which slot. You test that.

Iteration is king! Good luck.

_

Parts of this series are: [WhyThe SpecsGetting Started, School, Method]

Subscribe to the blog (on the right), or follow me at:

Andy:  or blog

Or more posts on video gaming here.

And what I’m up to now here.

Yojie – Deep Boiled Noodles!

Restaurant: Yojie

Location: 501 W Olympic Blvd. Ste 102. Los Angeles, CA 90015. (213) 988-8808

Date: September 7, 2011

Cuisine: sukiyaki and shabu

Rating: Sleek and tasty

_

I often go to Shabu Shabu (review of one of my favorites here), but it’s been a long time since I had Sukiyaki (it’s sweeter eggier cousin).

Yojie is smack int he middle of downtown and is one of those new slicker more modernized ethnic places. I.e. there is decor.

They offer both Sukiyaki and Shabu Shabu, but I’ll concentrate on the former. Both are hotpot dishes, cooked table-side by the diners.

Here is the Sukiyaki page of the menu. It’s mostly about the beef. And mostly about the size. I went “sumo” — because I’m well a big eater (you never guessed!).

Here is the beef itself. A little thicker than Shabu Shabu. The rice and the all important raw egg.

And the veggie and noodle plate. Pretty similar to Shabu Shabu.

The difference here is that the “broth” is a sweet Teriyaki-like sauce. Things are cooked a bit more heavily. And then instead of the post cooking dipping sauces you put the hot items straight into the raw egg, which then very slightly cooks as it coats the meat — and certainly makes it richer.

The broth gets all hot and sticky like a yummy thick meaty sweet teriyaki soup.

If you cook a bunch of stuff on it and ladle onto the rice you can make your own Teriyaki bowl type thing. The waiter actually wasn’t paying much attention to our temperature control and let our pots get too hot (we filled the room with smoke).

But he made up for it by giving us free dessert. In this case milk chocolate fondue, which conveniently also uses the hotpot.

These various yummies are then dipped in the chocolate. Not too shabby.

Overall an enjoyable Japanese treat. At the perfectly right thick bubbly consistency (which is hard to maintain) the thick sauce is pretty spectacular with the beef noodle and egg combo.

For more LA dining reviews click here.

The Vengeful Polyglot prays to the hotpot gods.

Crash Memories

In honor of Crash’s 15th Anniversary I wanted to make a post whose primary purpose is to serve as a repository for comments from you — the fans — about your first and favorite Crash Bandicoot impressions. Please make them in the comments. This is the place to tell that story of how you got your Playstation and Crash Bandicoot for Christmas when you were five, etc. etc. So to that effect, I’ll start it off with a brief tale that begins the night Crash Bandicoot launched.

In September 1996 all of Naughty Dog flew to New York for the combined Crash Bandicoot / Playstation 1 year anniversary party. It was on a big rooftop deck in the meat packing (hehe Beavis, you said meat packing) district. All of us got pretty drunk. There was a loud band. Very loud. Simultaneously, Ken Kutaragi (father of the Playstation!) decided to engage me in a highly technical discussion — against the 120 decibel background — using his rather broken English and my exactly zero command of Japanese. But in any case I didn’t sleep — we saw dawn in some New York greasy spoon.

About four hours later, Jason and I were on a plane to London. I didn’t sleep — why waste good reading time.

We arrived in London for ECTS and various Crash launch promotional meetings. We were immediately conducted to small hot smoky cubicles and interviewed by a variety of game journalists in numerous European languages for about eight hours — also against about 100 decibels of trade show. We then went to the bar (scotch). Then to dinner (wine). Then to a night club (more booze). Then a cigar bar (more scotch). Then to our hotel room (with about 15 or so European marketing and sales folk). There we consumed every single item in our minibar. We called down to the desk (4 in the morning) and had them bring us a NEW minibar. Yes, a complete refill of all items at 4 in the morning. We consumed that. Except for two miscellaneous tiny liquor bottles I can’t remember. The cost of just one minibar was 800 pounds sterling. We ate/drank two.

We didn’t sleep.

But we did spend another eight hours giving interviews. Then we went out again. That night I think we got 2-3 hours of sleep. But interviews again starting at 8am.

Somewhere in there I visited Westminster Abbey.

By day three we discovered that a number of our new friends (English) had never left the Island of Great Britain. So we all boarded the Chunnel and went to Paris (from Waterloo to Napoleon stations specifically, which is amusing). In Paris we started drinking at 10am. We kept drinking (many bars). We ate dinner (more wine). We went to someone’s apartment (more drinks). There was no sleep involved. After staying out all night (drinking) after the day of (drinking) we boarded the Chunnel back to London. I might have dozed. We went straight from there to the airport and got on a flight back to LAX.

Ah, first class. There were scones with clotted cream. And perhaps an hour or three of sleep. But we landed in LA at 7am. I was on the beach jogging by 8:30am. In the office at 10am. Back to work on the Japanese version of Crash. I went home early that day. Midnight.

Making video games builds stamina.

Don’t forget to put your own Crash memories in the comments section!

_

Subscribe to the blog (on the right), or follow me at:

Andy:  or blog

Or more posts on video gaming here.

And what I’m up to now here.

Middle Madness

I think I’m over the hump with the third major draft of my new novel, Untimed (for a quick blurb see here).

Story structure is hard. And while this book is much better structured than early drafts of my previous novel, it had two major problems: the ending and the first part of Act II. Late (very late) in the second draft I cracked the ending. So that just left the middle.

Therefore, I wasn’t surprised when the biggest comment from my awesome freelance editors’ (I use three: Renni Browne, Shannon Roberts, and R.J. Cavender) involved problems in this middle section. It’s not that the scenes wen’t good or exciting, but mostly that I fell prey to a personal need to sneak Napoleon into the story (time travel seems to call out for the most pivotal personality of the modern era) and this resulted in a bad case of “Double Mumbo Jumbo” (or a variant thereof).

So what is the dreaded Double Mumbo Jumbo? Most specifically it’s the phase coined in Blake Snyder‘s Save the Cat book (which I discuss here). DMJ is invoked by throwing two unrelated implausible things into the same story. However, my specific problem is really a cousin, what my editor Renni calls “1+1=1/2”. This is, the idea that doing the same improbable thing twice in the same book isn’t twice as good as doing it once, but actually half as good. Even if the thing is cool. So a kind of DMJ.

And I was doing it in my middle.

Still, this section of my story accomplished a lot of other things too. And I had to figure out how to rework it to keep as much of the good as I could, avoid a DMJ — and not make TOO much work for myself in terms of repercussions later in the book. Thinking about various ways to restructure, particularly given the constraints of my story, my elaborate time travel scheme, and history itself, was quite the brain buster. I thought on it all day for at least a week. So hard one Friday that I literally gave myself a migraine headache! I found myself pondering time travel so aggressively that I became confused as to what year it was — and then my vision began to shimmer (migraine).

I probably outlined 15 different scenarios and talked about countless more. This part of the writing process is very peculiar. I often end up with a half-baked scenario that satisfies some goals, but just doesn’t really work. One quickly reaches a point where no new ideas surface internally and you need to shake it up. I then find it extremely useful to talk with a limited pool of friends who have read the book in it’s latest incarnation. This allows me to efficiently go over the possible elements. Then we talk out the problems. By vetting numerous failed scenarios it’s often possible to collect enough different disconnected ideas that a single coherent new plot can be jig-sawed together. Or at least coherent enough to polish out in the writing.

This last week, I even twice resorted to writing out (as prose) incomplete outlines to see if they worked. The first revealed itself as a miserable failure. The second made it to the finish.

Now it’s off to friends and editors to see how it passes muster.

For more posts on writing, click here.

El Rincon Criollo – Cuban fun

Restaurant: El Rincon Criollo

Location: 4361 Sepulveda Blvd. Culver City, Ca 90230. 210-397-9295

Date: September 3, 2011

Cuisine: Cuban / Spanish

Rating: Garlic!

_

We took our son to the “train store” in Culver City (he loves trains) and this Cuban joint happened to be next door.


They curb sell with this cool 50s era car.


The menu. Mostly Cuban classics.


Bread of course.


Some croquettas (ham and cheese potato fry-balls) with banana chips. I’m not much of a banana fan, but these taste pretty much like potato chips.


And are extra good in this pure garlic sauce.


My son got plantains rice and beans. He loves bananas but for some reason knownst only to 2.75 year-olds would not try them.


But he did like this banana smoothy.


This is salmon in garlic sauce with onions. Rice, fries, and beans on the side.


And shrimp in garlic sauce. The garlic sauce is pretty uber actually, particularly poured over the rice. It did give me a carb coma though.


With the check are these weird little Cuban coconut caramels. Pretty good by my taste.

I’m not a serious Cuban aficionado — yeah I’ve been to various places a dozen or so times, but I’m no expert — but this was certainly tasty. And I do love garlic.

For more LA dining reviews click here.

Friday Night Heights – Shabbat Dinner

On Friday, September 2, we hosted a small Shabbat dinner party. This was a non-dairy (meat) kosher meal, which can be well done if you care (and most kosher restaurants don’t). As usual with our events everything was homemade. Almost all produce came from the Santa Monica Farmer’s Market.


For appetizers we served fruits and nuts. There was also some homemade humus and eggplant dip (that one of our guests generously brought), but I forgot to snap a photo.


Wine is one area where we go normal. Kosher wines are uniformly awful. Hideous. Wretched.

Parker gives this silky Rosso 90. “The 2009 Rosso di Montalcino is totally beautiful and elegant in its expressive bouquet, silky fruit and understated, harmonious personality. This is a wonderful, impeccable Rosso from Le Potazzine. Anticipated maturity: 2011-2017.” I’d rate it perhaps 91-92, with a little boost for understated style.


And the sweet option. Parker 91. “Donnhoff‘s 2009 Oberhauser Leistenberg Riesling Kabinett – ultra-delicate at only 9% alcohol and with considerably more overt sweetness than its Krotenpfuhl counterpart – is scented with buddleia, white peach, toasted almond, and a fusil note of crushed stone, and offers subtle creaminess, lusciously juicy refreshment, and minerally interactive persistence. This illustrates slate as a sort of sounding board as well as support structure for fruit such as one also encounters in the best residually sweet Mosel Rieslings. Donnhoff routinely expresses acute awareness of a duty to make something truly special out of the cooler ‘wrong-side-of-the-river’ Oberhauser vineyards that until the latter part of his father’s era constituted almost the entirety of his family’s acreage. That duty has here once again been deliciously discharged.”


What would Shabbat be without Challah. Raison Challah to be exact.

After going to Spain last year I’ve been on a bit of a Gazpacho kick, despite my general aversion to raw tomatoes (which I’ve been overcoming). And then about 5-6 weeks ago we went to Jose Andres’ Tres for brunch where they have a wonderful Gazpacho bar. So afterward I dug up his recipe on the internet and we tried it.

When I get into cooking certain dishes I like to perfect them. I’ve been working on this with my Ultimate Pizzas, my Spanish Eggs, and my Margaritas. This is our second stab at Gazpacho. It tasted great the first time but the texture was too chunky, so in this instance we whipped the living bleep out of it in the ever-reliable Blendtec. This batch is made with heirloom tomatoes and cucumbers from the SMFM and premium Spanish extra-virgin olive oil.


But first the garnish. This is a bowl prepped. The basic approach is to do this, and then to ladle in the soup itself table side, then dress it with a bit of premium Spanish olive oil. This garnish is croutons, cucumbers, heirloom tomatoes, spring onions, and chives.


The olive oil is on the left. On the right are homemade croutons. These are rustic bread fried (by hand) in olive oil and garlic, and seasoned with a bit of parsley.


Some of the gorgeous tomatoes used as garnish. Other cool looking ones are in the soup itself.


Chopped chives.


I’m kicking myself, but I forgot to photo a finished bowl with the soup. This one is three-quarters eaten 😦 It was darn good though.


For the main course we made a homemade Morrocan Basteeya. This is prior to baking. This is a savory pie of chicken and spices, slightly sweet.


Out of the oven.


You can see into it here.


One of our guests brought this lovely salad.


We also made this baked Israeli-style eggplant, with tomatoes, onions, garlic, and peppers (all from the SMFM too).


Here it is baked.


And my mother’s amazing fruit crumble. This one had SMFM peaches, blackberries, and apples. With a sweet crust and pecan topping. Due to the fact that my mother was on the other side of the country, and the written recipe a tad cryptic, the crust turned out a bit “different” than her more crumbly variant.


Still, it tasted great after baking!


And some farmer’s market fruit to finish.

For more home cooked meals look at the bottom of the food page.

Hostaria del Piccolo – Pizza + Pasta

Restaurant: Hostaria del Piccolo

Location: 606 Broadway, Santa Monica, CA 90401. P: 310-393-6633

Date: August 27, 2011

Cuisine: Italian

Rating: Good new casual Italian

ANY CHARACTER HERE

Hostaria del Piccolo is a casual new Italian with a Pasta/Pizza emphasis from the people that brought us Piccolo (my review here).


It’s located in a chic modern space at the corner of 6th and Broadway three blocks behind the Santa Monica Promenade.


The interior has a modern rustic quality.


And they have a lovely patio, which given that it was 5pm on an 85 degree perfect California August day totally ruled.


Given the weather, I decided to take a cue from my Italian friends and order a glass of Lambrusco Frizzante. Sparkling grape juice with a kick, what more can you ask for in the heat?


Very nice thick and buttery grissini.


The menu. Secondi are not numerous in quantity, but they have a lot of pizzas and a number of tasty sounding pastas.


“CANTALUPO  tuscan melon and Bresaola.” Artfully arranged!


“MESCOLATA organic greens, roasted tomatoes, sliced almonds.”


Rigatoni pomodoro for the boy.


“PAPPARDELLE tomato sauce, roasted eggplant, mozzarella di bufala.”


“SALSICCIA  tomato sauce, smoked mozzarella, sausage, bell peppers, Castelvetrano olives.” I actually ordered the FARCITA (which was a white prosciutto pizza) but he must have misheard me and anyway this was a tasty pizza. The sausage was very tender and flavorful. The crust was really yummy, and the whole thing not overly burnt like some wood oven pizzas are. If you want to see my Ultimate Homemade Pizza, click here.


“AGNELLO Marinated and grilled New Zealand lamb chops, roasted garlic sauce.” Very nice tender straight up grilled lamb chops. Bone gnawing good.


The dessert menu. We were full and didn’t order any.


But they brought my 2.75 year-old this ice cream cone as a freebee and he was mighty pleased.

Overall, Hostaria del Piccolo is a very nice new contemporary Italian, with a heavy pizza/pasta focus. This is sure to make it a crowd pleaser. They could use to beef up the variety of anti-pasta and secondi a bit, but what I had was very nice.

Click here to see more LA dining posts.

The open kitchen inside.

Or for a legion of great eating in Italy itself, here.


Joan’s on Third for Breakfast

Restaurant: Joan’s on Third

Location: 8350 West Third Street. 323.655.2285

Date: August 20, 2011

Cuisine: American

Rating: Fantastic gourmet shop & cafe

_

Another father/son morning rolled around and after a most enjoyable trip to the Peterson Automotive Museum (excellent boy fun) we headed over to Joan’s on Third.

The busy Third Street shop front is pretty much an institution. This is a combined cafe, gourmet shop, and bakery.

 You can pretty much bet on seeing celbrities, or at the very least lots of the beautiful people.

There is a good amount of outside seating.

Cappuccino of course.

My son went for the pancakes.


I had this grown up egg mcmuffin type sandwich. Buttered bread, egg, cheese, and of course, bacon!


Joan’s has some of the best cupcakes around and these are two of my favorites. Coconut and snickers!


It’s worth showing the interior spaces. We have all sorts of really good (but overpriced) gourmet products.


Fresh baked goods.


Cheeses!


Meats!


And even more baked goods. I only photoed a small sampling. Joan has really good taste. There may be a mark up, but there is some serious yummy going on here. That’s what impresses me the most, the general extremely high level of culinary quality of most stuff. The prices can be a shock though.

We’ve used them for catering too. They have all sorts of delicious salads, quiches, and whatnots.

For more LA dining reviews click here.

Osteria Latini 3

Restaurant: Osteria Latini [1, 2, 3]

Location: 11712 San Vicente Blvd.Brentwood, CA 90049 310.826.9222

Date: August 20, 2010

Cuisine: Italian

Rating: Excellent neighborhood Italian

_

We have a regular rotation of neighborhood Italians. There are so many of them, but only a few make the cut as genuinely good. Osteria Latini is one of them. You can see my previous reviews here and here.


Olive and chickpea/squash/bean pastes.


The 1997 Biondi-Santi Brunello. This is a solid Brunello I had bought years ago in Italy (probably in 2000). It probably scores somewhere in the low 90s, maybe 91 or 92 points.


A special, lobster bisque.


“BELLA SALAD. Arrugola, pears, dry cherries, goat cheese, shaved parmesan.”


A special, calimari steak stuffed with lump crabmeat and drizzled in ponzu sauce. This is unusual, and certainly has a bit of fusion about it — but it’s good.


Gnocchi genovese (in classic basil pesto).


“ACQUERELLO RISOTTO. Organic carnaroli, sea urchin, truffle scent, lemon zest (Please allow 20 Minutes).” A very nice subtle sea urchin risotto. This special hand shaved rice takes 20-30 minutes to cook.


OSSOBUCO ALLA MILANESE. With saffron risotto.” Latini’s version of the classic dish. Certainly good with a very nice meaty bone. The risotto could have been perhaps a tad creamier.

Two “rounds” of freebee desserts. This mixture of prosecco, lemon sorbetto, and meringue is very refreshing.


Chocolate chip cookies and biscotti.

Osteria Latini is always reliable. They have a big menu of modern Italian favorites and pretty much everything is very good.

For more LA dining reviews click here.

Or for a legion of great eating in Italy itself, here.