Thursday, March 7, 2013

Computer Graphics: Coding Experience - Done!

I've been trying to complete this post for a while. Well, now that you are reading these lines it is clear that I finally found the time to do it.


In my previous post I presented the Computer Graphics: Coding Experience event. I am happy to say that it was a huge success. Big thanks to organizers, participants and everyone who lent a hand along the way.

About the event


Follow this link to get the presentation slides and the Visual Studio 2010 solution project. The code is in C++ and uses Irrlicht Engine.

The goal of the event was to present 3D Rendering concepts in as layman terms as possible. The elements discussed where:
  1. The Scene
  2. The Camera
  3. Geometry, Triangles and Vertices
  4. Texture Mapping (UV coordingates)
  5. VertexBuffer & IndexBuffer
  6. Draw Primitives (Lines, Triangles)
  7. Transformations with Matrices
  8. Framebuffer (color buffer, depth buffer, stencil buffer)
  9. Concept of Fixed and Programmable pipelines



Some things that I missed or could have improved were:
  1. Might have presented some of the items too fast and with not enough depth
  2. Did not mention anything about the application's main loop (also known as the game loop)
  3. Better implementation for the terrain below the city. 
  4. Got helped from two awesome 3d artists that provided assets that I could not manage to put into the demo/presentation. Big mistake on my part. Huge thanks to Manuel Machado and Javier Fernández for their (unused) collaboration!
Anyways, live and learn.

After the presentation was done, participants were invited to continue with the programming section of the event: The Hackathon.

The idea was to start with a base code that rendered the following scene.


 ... and modify it to make it look like this:


Some of the elements to program were:
  1. Buildings to populate the city.
  2. Streets and blocks for the buildings
  3. A Skybox.
  4. The terrain bellow the city.

The idea behind the fourth item was to give the impression that the city was floating in the sky. Like a chunk of earth had been ripped of the planet and had flown up to the sky.

I think that my original idea for the implementation was good, but I was not able to make Irrlicht Engine render it correctly. After the event happened, I decided to change the inverted terrain implementation and coded some blocks positioned in an inverted pyramid-like shape. Like this:


The change was made to make the overall solution more coherent with the presented topics. Because the proposed idea was that each building would use its own Vertex and Index buffers, the brown squares would be objects that would all reuse the same Vertex and Index buffer data.

About the inverted pyramid, special effort was put to make it empty on the inside. I took this decision for performance reasons. The framerate would drop hard when I instantiated all the inner cubes. Reason being that even though the cubes were not visible, they would still be sent to the rendering pipeline, consuming precious processing resources. Not good.



Issues like this remind me of games like Minecraft. There, the amount of cubes present on stage is much much bigger. It makes me wonder how Markus Persson managed to render them all while maintaining a solid 60 fps. What kind of optimizations did he make? 

Btw, Markus is Minecraft's creator. He also goes by the name of 'Notch' as in his twitter account.

Fun fact: the texture used by the blocks on the inverted pyramid was taken from a Minecraft tileset I googled. Thanks, Internet people.


The Theme

While the Minecraft textured cubes were coded in after the event happened, there were other thoughts in my mind that helped me shape the event. Though I was not entirely clear on it until the last week of preparation. Typical.

After the topics were selected, I still had the urge of choosing a theme for the programming part of the event. In hindsight, I'm not sure I did a well enough job of transmitting the event's theme to all participants.
Now I have the chance to redeem myself.


The event's theme was Procedural City Generation.

I got inspiration from this Pixel City video. The video shows the results of the programming effort carried out by Shamus Young. His aim was to explore the generation of a city by using nothing else but code. No other assets should be loaded in. All geometry and textures should be generated at start up. It should also run in older PCs (he did it back in 2009). No shaders were used in his demo.

Shamus wrote in detail about the development process in his blog and has even made the code available at Google Code. You can even download a Windows executable file and run the demo. Just make sure you don't move your mouse nor press any keys or the simulation will exit.


I would like to give a special thanks to Federico Rocha for pointing me towards the Pixel City video. Though the idea of generating a city with code was bouncing in my head, Federico brought the necessary cherry to put on the presentation cake.

Worst. Metaphor. Ever.

More about generated cities

I don't know exactly why but I find the subject of city generation very interesting. In addition, just looking at city-like scenarios is quite pleasant.

One example of this is the art project created by Peter Root named 'Staple City'. Peter managed to represent a city just by using staples. It's strange how our brains (at least mine) process those piled staples and somehow concludes that it's looking at city buildings.

This is 'Staple City' by Peter Root. Kinda related.

In my youth I remember playing through games like SimCity 2000. I sure invested quite some time in this game, though I must admit that I preferred games with more action, like the Age of Empires series. Interestingly enough, it looks like Microsoft Studio is releasing an HD version of that game.

In related news, I just got my hands on the newest SimCity game. The video footage available looks terrific. I specially like all the data visualization stuff they put in there. Data visualization is a topic that I would love to explore in more depth. I have a hunch that there is huge potential there. Specially with 3D visualizations. Maybe in browsers. Using WebGL. That kinda stuff.


If SimCity's DRM is holding you back from getting the game, I would like to give a shout-out to another game in a similar vein: Tropico 4, a city building simulation game created by Haemimont Games. It was released to the market in 2011. You can get a Special Edition on Steam.

More about procedural generation


During my research for the event's content I came across several procedural generated projects. One that really caught my attention was this procedural generated racing game track, made in Unity. I'm still amazed every time I watch that video. Really.

I also bumped into this other video entitled Procedural Generation of Parcels in Urban Modeling. It shows how an irregular block gets populated with buildings while the area gets changed in real time. Loved it. It has this I-don't-know-what that makes is so appealing. Maybe its because it feels like a game? I mean, it does resemble games like SimCity.

Well, that sums up pretty much all I wanted to say about the event. Again, thanks to everyone involved!

Global Game Jam 2013 legacy



Before I close this post I would like to go back to a news related to the Global Game Jam.

Remember Surgeon Simulator 2013? Well, they just happened to get Greenlight on Steam. What that means is that the game is candidate to be purchasable through Steam Store.

That is an awesome achievement. Just think about it, with two days of work the developers created a game that really got the attention of the gaming community. With that, they now have the potential to cash in some big bucks. That is no small feat.

When available, I'll be sure to get a copy.

Sunday, February 17, 2013

Incoming Event: Computer Graphics Coding Experience

Just a quick post with an incoming event that I'll be hosting next Thursday February 21st. The event has been named Computer Graphics: Coding Experience. Fancy name, I like it. You can find more information right here.


The event is sponsored by Globant, the company where I work. The event will be in Spanish. The coding will be done in C++. We will be using Irrlicht Engine.

I recommend using a Windows computer with Visual Studio 2010. Can be the Express (free) version or the professional one. If you have the professional, I strongly suggest that you get the Visual Assist plugin. That thing makes C++ development possible. No joke. It improves navigation through files.

Irrlicht supports both DirectX 9 and OpenGL1.2 through 3.x devices. That's what it says in the features section of their website. Participants are welcome to use either one.

About the topic we'll be working on, I can't really say now. I want it to be a surprise. Hopefully, it will be a pleasant one.

Okay, enough of that. See ya'll next time!

Sunday, February 10, 2013

Montevideo's Global Game Jam 2013


There's some information on last year's event in my previous post.

Two weeks back, from January 25th to the 27th, the Global Game Jam 2013 edition was celebrated. I was fortunate enough to participate and I'm very happy for taking that decision.

Quick reminder: Global Game Jam is an event where participants have 48 hours to create a game. It can be a computer game or a board game. Everything from the idea to all the coding, graphics, sound and materials are produced during the event.

Every Global Game Jam revolves around a theme that participants should follow when creating their games. This year was no different. The presented theme was the sound of a beating heart, something like this.

If you are eager to see all games created for this game jam just follow this link and explore away. Or if installing and playing through the games is not your thing, just go through this list of Youtube gameplay videos. Great stuff.

Games were created using technologies such as Unity3D, Flash/AS3, HTML5, GameMaker, UDK and XNA to name a few.

Jamming in Uruguay



I'll start by stating that this year's Global Game Jam was a huge success. About 10 games were created here in Uruguay with the most amazing group of people. My respect to all participants from these latitudes.

The event really took off since last year. The amount of jams doubled. Participants where able to go either to the jam organized by Universidad ORT/Antel or the new one at A+ Escuela de Artes Visuales. Hey, two is twice as much as one. Math does not lie.

In my case I decided to participate from A+ Escuela de Artes Visuales. I'll continue this writing talking about my experience there.

Before moving on, you can access the list of games created in both sites at the following links:

- Games created at Universidad ORT/Antel
- Games created at A+ Escuela de Artes Visuales


I'd like to make a special mention to the game Latin Lovers. Both the game and the team behind it rock.


Jamming from A+ Escuela de Artes Visuales

The event there was organized by Fernando Sansberro, director of Batovi Games Studio. Fernando selected a very interesting approach for the jam: Focus on Game Design.

But, what did it mean exactly?

In a general sense the event was not only to "get together and begin full production right away". Instead, the schedule proposed by Fernando was as follows:

Friday

Sorry, I just had to put this image here somewhere.


Participants started arriving and received their badges. Most of them knew very few other people. In my case I knew almost no one. Which was great actually as my plan was to get to know motivated and talented people.

After participants shy away from one another, the organizers moved us all to another room where a discussion panel was set up, featuring individuals responsible for pushing forward the Uruguayan gaming industry. Guys like Alexis Sabatovich (independent 3d artist), Alvaro Gonzalez (Lead/Producer Game Designer at Kef Sensei), a couple guys from Trojan Chicken (Ceibal game development, sorry I don't know their names!) and Alvaro Azofra (Game Designer at Ironhide Game Studio, creators of Kingdom Rush).

They talked about who they were, what they did, and some life experiences that were gladly welcomed by everyone in the audience. They were also asked some questions by Fernando. The last question was quite interesting: ¿Are we [Uruguay] ready to create triple A games?


Some day, I'll be better at Photoshop

Now in my view, the reason why this question was interesting is because in order to answer this, you really have to analyze different aspects of game development. Let's try to see what they are:

1. What are triple A games?
2. What do we need to make triple A games?
3. Do we really want to make triple A games?

After the question was thrown at the guys in the panel, some discussion started popping between them and also from people at the audience. Most discussion was about question 1. To get over this question, let me paraphrase a text I got from About.com:
A AAA game, or pronounced "triple-A game", is generally a title developed by a large studio, funded by a massive budget.
Mmm, massive budgets. That's not very likely to happen over here any time soon. Nor it is common to find large studios over here. Despite these missing attributes, I don't feel we are in disadvantage. I feel that we are in a great position to seek other opportunities within the gaming industry.

This reasoning leads us to the second question about the needs for making triple A games. Yes, budget is an issue, and a big one (that's what see said). But another one that is also very important to note is that even with the budget available, there is still the issue of getting enough people capable of developing a game of such caliber within a reasonable time frame. We are talking about developers, artists, producers, game designers, marketing and more. The full package. In my eyes, we are very far away from achieving this. And I don't see it as something terrible. Enter question three: Do we really want to make triple A games?

Personally, I don't.
I won't refuse to participate in the development of one.
In fact, I've been involved with one such big-budget gaming company before.
I learnt a lot with them. I have no regrets.
But it is not one of my life goals.
I may end up in one of those again, but for other reasons.
Not for the soul purpose of making a triple A game.
I think that is just none sense.
This paragraph looks like a poem of something.
Whatever.

Okay, enough about that.



After the discussion panel, Fernando assembled three teams based on available skills (programming, art, design, audio, other/none). After the teams were made, each one went to a different room and the brainstorming session began. The brainstorming session's objective is to get a game idea from the presented theme. Heart beat may lead us to a heart, that may lead to words such as life, love, vampires, zombies, and many others. The point here is to settle with one and then choose a game mechanic to go along with it.

After it was finished, at around 23:00 or maybe 24:00, we were encourage to go and sleep at our homes and come back Saturday morning to begin full production. Some of us did, some others did not. To each one his own.

Saturday


With the game idea defined and a basic mechanics established, groups began writing code, creating graphic assets and audio assets. This is what "full production" means.

Not much to say here, just that I've uploaded some pictures from these days into Facebook.
I suggest not to send me a friend request if I don't know you. I tend not to accept them.

Sunday


Almost everybody stayed awake from Saturday to Sunday. Me included.

It's very interesting to see the effects that being very close to a deadline generates. I remember being asked about the possibility of implementing missing features and just answer with a blunt "that is just not happening". So cool.

Development was supposed to stop at 15:00 hrs. We finished almost 16:00 hrs. Classic game development story.

After games started being uploaded, Fernando organized a closure meeting with all participants. Each group presented their games and talk a little bit about their experience developing it. This was a great moment, one could see how these groups evolved. You could see that they achieved some kind of mastermind alliance. Sort of, that's what I like to think. Anyway, you could see the satisfaction despite the tiredness. I also felt that way, and it's a great feeling to have.

Participants at A+ Escuela de Artes Visuales.

I'll close this section with this GGJ 2013 teaser video. Seeing this video after being part of a GGJ gives it a whole new meaning. It really makes you appreciate the time invested there. Again, no regrets.

Special mentions

I would like to end this writing with two games created in this jam, not in Uruguay, though.

One of them is LEGITIMATE BUSINESS SIMULATOR 2013. I just love the name. It's very clever, and the humor around it is just fantastic. It looks pretty complete: There is a titlecard, a play screen and a shop. Pretty polished if you ask me.


The other game that got an enormous amount of attention from communities like Reddit and gaming sites like Kotaku. I'm talking about Surgeon Simulator 2013. Just check their gameplay video. You will not be disappointed.

Props to Reddit's NightSage for this meme.

The game was developed in Unity3D, it features very nice 3D graphics and a QWOP-like gameplay. Let's not forget its dark sense of humor. What's not to love!


Next year's Global Game Jam will be amazing. I can feel it. Until then!

Thursday, January 24, 2013

Incoming event: Global Game Jam 2013

Global Game Jam?

Global Game Jam (GGJ) is an event that happens in multiples locations all around the globe. The first edition was back in 2009 and it has been repeated yearly every since.


The objective: Make a game in less than 48 hours.

Here is an awesome trailer from last year's GGJ. You can get a pretty accurate picture on how the event goes. Plus, its super fun video to watch.



You can access the Wikipedia page for more information and details.

My experience with GGJ

I first found about the event last year. I was unsure about my participation. Finally, I decided not to go. Not the brightest of my decisions. The event was a huge success, congratulations to everyone who participated. Everyone did an outstanding work! Here is a picture of the uruguayan heroes:

An awesome group!

This year I will make up for that; I'll be participating at the site A+ Escuela de Artes Visuales here in Montevideo, Uruguay. Actually, there is another site for the event: Universidad ORT/Antel.

Going back to last year's GGJ, I got great feedback from my good friend Sebastián who participated along with other friends. The game his group did is called ParaParaParanoid, a platform game about a girl that is chased by ghosts of her past. The objective of the game is to collect memories that will help her overcome her paranoia.

ParaParaParanoid in action!

There is an awesome gameplay video created by IdealSoft. Check it out here! I think that the person playing there did not get the mechanics right away. Each of the shadow-chasing-characters travel through the very same path that you, the player, take. In that sense, their movements are 100% predictable and the gameplay evolves around this concept. Level design and item map distribution play a very important role. Really great stuff.

Another great game, and the only 3D game at our site was created by another friend: Federico Rocha and his group. The game is called Wuji GO! and its about a little snake-like-fella that travels through what it seems to be the perimeter of a doughnut (hehe) and has to collect opposite entities to keep its energy from depleting in a never ending journey. Each time a full round-trip around the doughnut is done, the snake-thing increases its speed. Check the gameplay video! It is a really fun experience.

They did an awesome job with the camera.

There were other great games created, this post only showcases the ones from the people I know more. Maybe this year I'll get to know all the other great minds behind the games :)

One thing that is missing here is that all games created in the jam have a common theme to follow. Last year's theme was the image of Ouroboros, a snake eating its own tail. Now go back and think about the games created. You'll get much more sense out of them.

Ouroboros!

It will be interesting to see what they have us prepared for this year.

Community and Social Networks

During the days of the event, Global Game Jam has a very big presence in Twitter. Participants are encourage to create twits with hashtags such as #GGJ, #GGJ2013. Here in Montevideo, Uruguay, we will be using #GGJUY.

If you have Twitter, don't forget to follow @globalgamejam!

I've also seen Global Game Jam on Facebook. I really like what they did with their timeline image.



Closure 

Here in Uruguay in these very same dates there is also another popular event being celebrated: Carnival. To be honest, I'm not very fond of it, though I do appreciate and understand it. Sort of.


Images like this might hint you into why the event appreciated all around the world.

Decisions, decisions: stay inside with a bunch of guys to create a videogame... or go outside and listen to some tambores while watching some girls shake it? Decisions, decisions...

Until next time!

Saturday, January 19, 2013

Conway's Game of Life - AS3 Project

Becoming God's pupil

A few months back I had this idea: What would it take to program life? This question has been raised many times by lots of people all over the world. In my case, I got the idea on my way back home while listening to the audiobook A Short History of Nearly Everything by Bill Bryson. As soon as I arrived, went online and raised this question to my good ol' friend Sebastián.


Interestingly enough, Sebastián had something to say about it: "What you are talking about already exists... have you heard of the Game of Life?"

Clearly, I did not know about it. So I did a little research about it.

The first Google results nailed it. Sebastián was talking about Conway's Game of Life. This wasn't exactly what I was aiming for, but I though it could be a good exercise to begin with.


I first read the Wikipedia article, then opened FlashDevelop and began coding. I got a first workable version very fast. I improved it a bit and added a bunch of maps. You can check this first version here. Click or drag to make the simulation advance one tick.

Some of these maps will come to an end even although they are supposed to be never-ending growing patterns. This happens because the map size is fixed and the patterns need more room than the one available.


Some technical details


Maps were defined by drawing points into white png images, like the ones above. Then from the code I would load them as BitmapData elements and process them pixel-by-pixel. White pixels represent dead cells while black ones represent cells with life.


Improving the solution

Now this time I did take my time to improve the implementation. Mostly because I felt that the logic of the solution was super easy to achieve.

I decided to improve the user experience.


  1. The background has now changed to a color that clearly differentiates from the maps. 
  2. Map borders are now all from the same width.
  3. Each map can be advanced separately.
  4. Rollover behavior has been added to each map, displaying the current tick count and a name for the map.
  5. Red map border changes into green when rollovered to indicate that it can be interacted with.
  6. Added a title and author text. Just because.

I can honestly say that these changes took as long (or even more) than programming the first implementation. The reason is that I did not have a clear idea on how to improve the solution UI-wise. So I tackled this problem by iterating through ideas, one by one.

Though it was not hard work, it did take quite some time.

I can even state that most of the creative stuff takes time, simply because one does not know exactly what one wants to achieve. Personally, I always have a hunch that guides me, but its feels like walking in a foggy terrain. I will know I've reached my destination once I arrive there. Not before, though I get a sense that I'm going in the right direction. Kinda hard to explain, actually.

Anyway, I have uploaded the source code into Github. If you are curious about it, check it out here.


Conclusion

I feel quite satisfied with the improved AS3 solution. After doing additional Googling about the Game of Life, I found that it would be really cool to explore additional visualizations for this. Maybe trying to play a bit more with the colors that are used, or make it 3D, maybe by using cubes of some other shape.

I'm still curious about the subject of programming life. Though this was a nice exercise, I feel that it was not enough to satisfy my hunger. I might continue exploring other possibilities in the future.

Finally, here's a happy panda:

Believe me, he is happy! 

Maybe if we could arrange pandas in a Conway's pattern that perpetuates their life... we could stop worrying about them going extinct!

Yeah, right...

Stay awesome!



Monday, January 7, 2013

CatTyping Challenge - AS3 Side Project

The game

CatTyping Challenge is a typing game I created back in July 2012. The game presents a list of words for the player to type. The objective of the game is to type as much of these words as you can minimizing spelling mistakes. You even have to take punctuation into account. There are even some words in Spanish. With accents.


As I always say, Try it Now! before you continue reading. Thanks.

You can also check out the source code at Github. Additional information can be found in the Technical details section bellow.

The motivation

I have very little memory where this idea came from. It do remember it was one of those surprise-gift projects of mine. I think it was born out of a conversation with Mar and Xime, about typing courses. I remember assisting to one of those when I was about 13. I really loved it!


There was also a super cool typing web application that I used a lot. I totally forgot the URL, though. But there was something missing. The missing elements were cats. And lots of them!

Of course, I could try to karma-whore the game on Reddit. Never did it, though.

The game

In this game the player has 30 seconds to type as much words presented as possible. Words are presented line by line. When all the words of a line are completed, a new line appears for the player to type.

The catch of the game is that whenever the player types a word correctly, the photo of a cute kitty is added on stage. But when a player makes a mistake then three kittens are removed at once. Life is tough.



Here's a screenshot of the playing screen. Nothing fancy:


The main elements in this game are:
  1. The list of words to type.
  2. Time remaining.
  3. Counter with words typed correctly.
  4. Counter with words typed wrong.
  5. The input area
While letters are being typed, the game will display if the current word is being typed correctly or not.
A word is considered written when the spacebar is pressed.

When time runs out you will see something like this:

Choosing green for the text above was not the greatest of the ideas.

Green words are the ones typed correctly. Red words are the ones typed incorrectly. Black words are the ones that have not been typed yet.

WPM means Words per Minute. 70% is the typing accuracy, calculated as OK words divided by OK + Not OK words, multiplied by 100.

In the lower part of the image there is a counter for the amount of kitty images onscreen and the amount of kitties that have run away (fallen). It was supposed to be something cute.

Technical details

It might look strange that the very first thing you see when launching the application is that it asks the player to "click somewhere!".

There is no real need to click it.

The reason for this is to give focus to the application. By default, the embedded Flash movie will not have focus. Every key pressed by the user will be captured by the containing page. Not by the Flash movie.

I used TweenLite for the kitten animation. Again, it's just a very simple and easy-to-use interpolation library.
For example, to make the kittens appear, the following code is used:


What is going on in the previous code is pretty self-explained. 
But because I feel like writing, here's some additional explanation:
  • A random bitmap is selected and added as a child. This class, Kitty, extends from Sprite.
  • Horizontal and Vertical positions (x & y) are set randomly, anywhere on the stage. A small margin of 100 pixels is taken off the stage to account for the bitmap's dimensions.
  • A starting transparency value is set (0.25).
  • A starting size value is set (1.4).
  • A starting rotation is randomly set. This value is in degrees!
  • An end rotation is randomly set. This value will be passed to TweenLite as a parameter.
  • TweenLite's .to() method is called. This method takes an object as its first argument (this in this case), then a Number value for the time it takes to perform the interpolation (1 second) and finally an optional "properties object".
  • In this case the properties object contains all the final values for scaleX, scaleY (value of 1), and ending rotation value, alpha value (0.5) and a function pointer for when the interpolation ends (myOnCompleteFunction).
  • Actually, after looking at the code I realized that the onComplete function was totally useless. I think it is still there because of some old code that got deprecated. Well, shit happens.

For the ending fireworks Flint particle engine was used. I'll do some dissecting some other time. Maybe. 

About the input of words, I attached an Event.CHANGE to the input TextField. In this way I do not have to be checking the keys pressed by the player. I only need to check the newly added character to the textfield. This character will be "formated". That is, it may be upper or lower cased, with or without an accent or any other strange symbol, etc.

If you are getting the game's source code from github, you will have to download both TweenLite and Flint particle engine library. Here is a screenshot of how my project folders look like with those folders included:


If you open the project's properties, class paths tab you fill find the following code sources:


Disclaimer

All of the images in the game, this post, and all my other posts have been taken from images.google.com. I do not claim to own the rights of any of these pictures. Expect for the ones I do actually own. You know, stealing other peoples kittens is no joke.

Great site, I just wish I had more experience with it

Afterthoughts

Can the game be improved? Hell yeah.
Will I improve it any time soon? Nope.
Why? Well, first of all it achieved its objective. In software development, you can always improve whatever is that you are creating. From the very beginning it is very important to set a clear objective of what you want to achieve. If not, you will be involved in a never-ending development life cycle. And that is no good for you nor your kittens.




Saturday, December 29, 2012

AS3 Three hour "rant" project

Hello again. You might have realized that I am pretty fond of AS3 for my programming projects. Without getting into the never-ending debate of what programming language is the best, the reasons I like to code in AS3 are:

  • I know the language.
  • I can code stuff very quick.
  • I can share the results online easily (Dropbox public folder)

On the negative side, I do have trouble getting my creations into all iDevices. I'll be looking into that eventually.



My "Rant" project.

Okay, so the story goes something like this. I was at work, doing my usual thing, drinking my usual Ginkgo Biloba infusion. On a side note, it took me about a month to learn those two words: "ginkgo biloba". There was a time when I call it ginkgo balboa. Oh, those fun happy days.
Anyway back to the point. It seems that I drank to much ginkgo biloba, so naturally I had to hit the restroom. I did my thing, was all happy about it and went to wash my hands. 

So far things went smooth and I was happy.
But then it suddenly happened.

I opened the water faucet and a high pressure water splash spit all over my shirt.


I don't know exactly why, but I ended up pretty upset for this. So naturally, I had to talk it over with someone. That someone happened to be Xime.


The AS3 project


After talking the situation with Xime, I decided to code something funny. The result can be seen right here. The project consists of an AS3 application that recreates a chat sequence I had with Xime in Google Talk. It's in Spanish. Curiously enough, I'm listening to some German music right now. Talking about polyglotism...

The whole application was done in about 3 hours. I'm not trying to making a huge deal out of it. It's just to point out that there was little design and coding was done fast an furious

The coding

Before continuing, I suggest that you take a look at the application. There will be some spoilers bellow, so please, play through the application. It's quite short, it wont take much of your time. I promise.

Okay, let's move on.

The simulation advances whenever the user clicks somewhere on the canvas. Here is the code that controls the pace of the application:


There is a ChatConversation class stored in mChat variable. Whenever a click is detected, the next() method is called. The method returns false when the conversation is over. When that happens, the chat is finalized by calling the end() method and a new class is created and added to the stage: QuemarTodo. "Quemar Todo" is the Spanish of "Burn Everything".

External Libraries used


The chat conversation interpolates the position of the appearing images. This is done by using Greensock's TweenLite library. I recommend it to anyone that wants to quickly add a feature rich and performant interpolation solution. You can thank me later.

At the end there is a fire-like particle animation. The effect was created using Flint particle system. Again, you can get particles on screen pretty fast. The samples at their page are good. I found that some of the samples have missing data. You may found those missing bits of information by searching through their forums.


Epilogue

I'll end up with a tribute to this guy:

The name's Proof. He was a Rapper. He's dead now.

Because I just saw the "Insert Video" option here in blogger, I'll end up with a video of Proof featuring 50 cent. Represent.