How Naughty Dog Fit Crash Bandicoot into 2MB of RAM on the PS1

“Here’s a related anecdote from the late 1990s. I was one of the two programers (along with Andy Gavin) who wrote Crash Bandicoot for the PlayStation 1.

RAM was still a major issue even then. The PS1 had 2MB of RAM, and we had to do crazy things to get the game to fit. We had levels with over 10MB of data in them, and this had to be paged in and out dynamically, without any “hitches”—loading lags where the frame rate would drop below 30 Hz.

It mainly worked because Andy wrote an incredible paging system that would swap in and out 64K data pages as Crash traversed the level. This was a “full stack” tour de force, in that it ran the gamut from high-level memory management to opcode-level DMA coding. Andy even controlled the physical layout of bytes on the CD-ROM disk so that—even at 300KB/sec—the PS1 could load the data for each piece of a given level by the time Crash ended up there.

I wrote the packer tool that took the resources—sounds, art, lisp control code for critters, etc.—and packed them into 64K pages for Andy’s system. (Incidentally, this problem—producing the ideal packing into fixed-sized pages of a set of arbitrarily-sized objects—is NP-complete, and therefore likely impossible to solve optimally in polynomial—i.e., reasonable—time.)

Some levels barely fit, and my packer used a variety of algorithms (first-fit, best-fit, etc.) to try to find the best packing, including a stochastic search akin to the gradient descent process used in Simulated annealing. Basically, I had a whole bunch of different packing strategies, and would try them all and use the best result.

The problem with using a random guided search like that, though, is that you never know if you’re going to get the same result again. Some Crash levels fit into the maximum allowed number of pages (I think it was 21) only by virtue of the stochastic packer “getting lucky”. This meant that once you had the level packed, you might change the code for a turtle and never be able to find a 21-page packing again. There were times when one of the artists would want to change something, and it would blow out the page count, and we’d have to change other stuff semi-randomly until the packer again found a packing that worked. Try explaining this to a crabby artist at 3 in the morning. 🙂

By far the best part in retrospect—and the worst part at the time—was getting the core C/assembly code to fit. We were literally days away from the drop-dead date for the “gold master”—our last chance to make the holiday season before we lost the entire year—and we were randomly permuting C code into semantically identical but syntactically different manifestations to get the compiler to produce code that was 200, 125, 50, then 8 bytes smaller. Permuting as in, ”

for (i=0; i < x; i++)

“—what happens if we rewrite that as a while loop using a variable we already used above for something else? This was after we’d already exhausted the usual tricks of, e.g., stuffing data into the lower two bits of pointers (which only works because all addresses on the R3000 were 4-byte aligned).

Ultimately Crash fit into the PS1’s memory with 4 bytes to spare. Yes, 4 bytes out of 2097152. Good times.”

Dark Editorial: Jurassic World | Review

With all the mayhem and death that was going on in this film, they failed to show any on-screen kids getting eaten or hurt by dinosaurs. They showed plenty of adults getting eaten alive, though. The best they could show on-screen was the aftermath of kids with scratches getting treated. I suppose this can’t be helped. Our world has extremely weird taboos and standards. Being that violence and murder is fine but when it comes to anything sexual with nudity, then it’s too much for television/movies.

Another thing that I found amusing was Hoskins, head of InGen security, trying to persuade people to use the dinosaurs for military use. None of his arguments brought up our current use of canines overseas and how this would just be the evolution of military uses of animals. I guess that would be too real for audience and would make them feel guilty. People would like to forget that that there are actual animals dying in wars who are trained to sniff out IEDs. They had to paint this guy as a bad guy, so you can’t really blame them.

In the end, this movie was a good popcorn movie. If you are looking for a fun movie to watch, you won’t be disappointed.

Fish Tank(2009): Review

In an ocean of independent films about troubled teenagers, Fish Tank truly sets itself apart from the pack. This a movie that I fell in love with progressively as it went on. Fish tank is a film I’m going to shower with praise because I really just can’t any faults in it.The best word to describe certain aspects of the film Fish Tank is authentic.

I sat there watching certain parts of the film, simply admiring how grounded the world seemed. It felt like I was looking outside of a window in  East London and spectating the lives of these characters.Camera work is phenomenal in this film.  The imagery isn’t the usual pretentious indie affair. There’s actual meaning for what the audience is allowed to see. The way the cinematographer selected what he should focus on was genius and allows for some great symbolism.

The director did a great job with the pacing in Fish Tank. A lot of independent movies end abstractly and almost feel completely detached from the rest of film. Fish Tank starts, progresses, and ends in a satisfying manner. It’s helped even further with fantastic writing.  The characters in Fish Tank are extremely well done. The performance by Katie Jarvis as the character Mia was really gripping.The dialogue was very well thought out for all of the characters. The dialogue almost seemed to give off the vibe that it was improvised for some sections of Mia’s scenes. That statement isn’t a criticism though; it’s just a testament to how absorbed I was in the world that Andrea Arnold had directed and penned.

Fish Tank is a forceful  drama that mesmerizes you by doing everything right. It’s a moving  piece of British cinema that works because its characters are convincing. It boasts a fantastic supporting cast and a real winner with a break out performance and debut from Katie Jarvis. I’ll definitely be keeping my eye out for more work from Andrea Arnold. I recommend this film if you like your heart strings being played on.

Assassin’s Creed: Brotherhood|Review

brotherhood1

Assassin’s Creed is one of those games that you go into not expecting to spend much time. Unfortunately, you get dragged into the the side missions and scavenging that you start to forget how much time you’re spending.  The game starts off slow but the later levels starts to really pick up. When you do get to those later levels it’s some really satisfying game-play which force you to use several stealth mechanics. The game’s shining improvement is it’s implementation of a Assassin’s Guild which is a surprisingly deep system. In this system, you can recruit and train assassins to fight for you anywhere and send them on contracts around the globe to gain experience. The more territory in Rome you acquire the more assassins you are allowed to recruit.

Though the main missions of the game had many fillers it was still interesting enough to keep me going. I found that scavenging for lost glyphs and listening to the audio recording on them equally engrossing. Finding out information about the Illuminati-like organization known as Abstergo offers some thought provoking commentary on capitalist governments, consumerism, and privacy. Sadly, a lot of the material seems chillingly familiar to U.S policies. One gripe I had with the game is that there isn’t any option to change difficulty. This is a big gripe for me because I usually play my games on hard difficulty and this game seemed too easy at some points especially when you have assassin’s that can do most of the fighting for you. After beating the game, Brotherhood will still have plenty replay value. You will most likely have plenty of guild missions to keep you occupied for several hours and there is also an extra romance mission to wrap things up for Ezio.

If you haven’t played it yet, I would recommend you to pick this thing out of a bargain bin. It’s well worth it. It should be dirt cheap at this point. I bought mine for 8 bucks at Gamestop.

Transformers: Age of Extinction| Review

49523d098eb4f241f236a044a03a7e07547824ccd7a6dd435d8ac86127de0e76_facebook

With the exit of Shia LaBeouf from the franchise, many people, including me, have mixed opinions about this recent addition to transformers. I suppose it helps that they cast Mark Wahlberg to try and fill in that gap of stardom. His role in the movie wasn’t as big as I thought it would be. There wasn’t much character development for most of the main characters of the film. This is what made the first transformers movie so good. I found it hard to feel any sympathy for the humans. Why should I? It felt like these characters were just pushed on the audience. The robots got more face-time than most of the actors. I wonder how much of this film was shot in a green room. It must have been exhausting for the actors.

When the actors did get face time it seemed like they were forcefully saying some cheesy pun or line that made me cringe. I remember one line in particular where the autobots were talking about Optimus Prime and one of the autobots says something along the line of “That’s a leader you follow in the dark” and another autobot replies dramatically “NO… That’s Optimus Prime”. Without thinking I say out loud “NO… that’s Gay”. My buddy and I had a good laugh. It was immature and insensitive but I didn’t care at that moment. It reminded me of that scene in Godzilla where Ken Watanabe dramatically says “ We call Heem GODZEELA”. It was that bad. The movie delivers on a lot of action and great fight scenes but ultimately falls in pacing and seems drawn out. It seemed like a big part of the movie was just watching cars speed down back roads and highways. This movie is definitely rental material for a quick thrill with little substance but if you want a little more than that, you’re better off passing this one up when it hits Blu-ray and dvd.

 

American Horror Story: The Replacements | Review

It’s becoming very clear why American Horror story has been getting its record ratings, since the show premiered this fall. This week’s episode has it all; incest, brutal scenes of violence, bestiality, and betrayal. Ryan Murphy is showing he isn’t afraid to tackle some controversial topics. Things are beginning to heat up in the coven as the girls are becoming more in tuned with their powers.

One of the interesting prospects of the previous episode of AHS was Cordelia’s fertility issues. Cordelia had already tried everything from natural remedies to black magic rituals. This led to Cordelia resorting to asking for help from her rival tribe. The show gave us a glimpse at the ritual she would have to perform with Tibitia- the leader the rival clan. Cinematography of the Tibitia ritual was a treat to watch.  The camera work throughout this show is unique because it is constantly changing. Overhead cameras, gold fish eyed views, close ups, slanted angles, and other dynamic camera techniques give the viewer a wide and varied perspective of whats going on.

Much like the  last season on AHS, ,  Sarah Paulson plays another troubled and struggling character. Cordelia is dealt a very bad hand and must play it out to the end. She finds herself stuck in between a feud between Tibitia and Fiona . Her goal of bearing a child is being challenged. Her performance is solid as usual. We’re looking forward to seeing more from her in the upcoming episodes.

Meanwhile, Madame Lalaurie must deal with adapting with modern day society and facing her past demons. This all offers some much needed comedic relief. Since the premiere of the show there has been a drastic role reversal for her character. We’ve seen her ability to portray a sadist and now we are seeing how she can easily meld into a more tortured character.

Kyle has more air time this week. Evan Peters manages to show some emotion playing Kyle, even though he’s a mute Frankenstein. Zoe Benson must deal with the resurrection of Kyle and his emergence back into society. This proves to be quite difficult. I hope Kyle regains his humanity because the way he is now is pretty difficult to imagine where the story will leave him. Misty Day also has an appearance which is welcoming. I always smile when I see her character. I don’t know why I like her so much. I think it because she really conveys a carefree soul, even through all the things she’s been through.

Jessica Lange, is superb as usual. Too be blunt she is this show. She really takes demand of the screen. Lange takes on her character Fiona’s flaws and strengths and transforms them into an acting spectacle. Fiona battles with her mortality and becomes a surprise mentor for the ladies of the house. The episode ends on a note which will probably upset some.

Overall, this episode was supreme…(See what I did there?)

9.5/10

What did you think?

Dishonored | Review

dishonored-review-boat-1920

Dishonored  takes many elements from the shooting genre that works well and meshes it into one solid shooter. If I had to explain Dishonored in three words, I would just say, Bioshock with Stealth. The stealth mechanics of this game are tight with several abilities that make it very interesting: From teleportation to possessing animals. You use  variety of skills to get  your objective done.

The downfall of playing the stealthy approach is that many explorative players will find themselves bored. This is  because after a while there is no reason to pick up runes to upgrade.  All the stealthy upgrades are quickly brought up. The developers of this game made it so you can save the game at anytime . So it’s basically irresistible to play the morally sound route but in all honestly is probably not the funnest way to play.

The graphics in this game are pretty solid but not really that impressive. You can’t really expect much considering the art style of the game which is cartoonish. The story of the of game is pretty straight forward and is told in the in-game engine which helps in not ruining the immersion. My biggest gripe for this game is that the ending is pretty anti-climatic considering you played the whole game stealthily in order to receive the “good ending”.

Where the game really shines is that there is so many ways to complete a mission that it gives the game a really open world and sandbox feel that is really fun.  The gameplay is definitely the saving grace of this game and solidifies my review score of …

8/10