domingo, junho 30, 2013

"The Inverted World" by Christopher Priest

The Inverted World - Christopher Priest
The Inverted World is a cold book. 

Most of Priest's books are told in a stiff and remote mode, which frequently suits the alienated subject matter. It's not the case here.

Faults:

1 - The sterile environment depicted is reflected in the unemotional natures of the characters and of their relationships with one another: Helwood vs his wife Victoria and Helwood vs his father; 

2 - The dialog is very stilted and stiff; it barely pretends to achieve more than information exchange. And as a result, it is difficult to become involved in the characters' lives or to care about their feelings;

3 - The leitmotiv of the book is abandoned three-quarters of the way through;

4 - It lacks an explanation on how the characters moved from this world to the Inverted World;

5 - The books wrap-up at the end, ie, "The Explanation", leaves a lot to be desired. There're lots of questions unanswered. Intentional?

Redeeming factor:

1 - It has a mind-boggling idea that is at the very heart of the novel. 

Compared to his later books I think it lacks the subtlety and ambiguity expected from him.

It's well worth the read simply for its basic concept (3 stars for that).

sábado, junho 29, 2013

"Permutation City" by Greg Egan

Permutation City - Greg Egan
(Read originally in 1994).

"I was six years old when my parents told me that there was a small, dark jewel inside my skull, learning to be me"...

Learning to be me

With this starts off one of the most astonishing short stories I've ever read. If you haven't read it, I urge you to do so. Egan questions what it really means to be human in a way that it's quite unsurpassed in my mind.

I've just finished "Permutation City", and the feeling I got from reading it now is the same I got in 1994 when read it for the first time.

Is it possible to write a book exploring the dichotomy between a computer simulation of a person and a "real" person? More specifically, is it possible to focus on exploring one possible model of consciousness and reality? (YES, It's possible!!!)

The Dust Theory upon which the book works is based on Tegmark's mathematical universe hypothesis (MUH). The assertion states that our external physical reality is a mathematical structure. Without going into much detail, the following article is great to start grasping the concepts that underpin the book: 

MUH

Without the proper conceptual framework, I admit it's difficult to get into the book. But as one understands the questions lurking behind it, it's one hell of a ride.

Other Computer Science concepts needed to deeply appreciate the book:

1 - The assumption that human consciousness is Turing computable, ie, all aspects of genuine consciousness can be produced by a computer program. Egan tries successfully to deconstruct not only some standard notions of self, memory, and mortality, but also of physical reality;

2 - Cellular automata. In this book VR assumes the form of The Autoverse, which is basically a deterministic chemistry set, internally consistent and vaguely resembling real chemistry;

3 - VR making extensive use of heuristics to simulate completely immersion and convincing physical environments, but at a maximum of seventeen times slower than "real" time.

The three ideas above are at the core of the book. Not even William Gibson nor Neal Stephenson explore these concepts the way Egan does. His ideas are way, way bigger than Gibson's or Stephenson's. He's thinking way bigger. He's asking questions that start in the real world and run right past the border to metaphysics and philosophy using Computer Science constructs. I look back and wonder if there was ever a line at all.

Despite the fact that it makes some demands on the reader, namely Computer Science Literacy, the book feels absolutely real. 

Greg Egan is really one of a kind. He deserves a wider readership, not being pinned down to SF.

Computer Science apart, his work is so pure that it resonates. I'm going to reread all of his work. I'm in for a ride.

segunda-feira, junho 24, 2013

"Der Fall Collini" by Ferdinand von Schirach

Der Fall Collini - Ferdinand von Schirach
Irgendwann wird es einem das Guten zuviel, zumal wenn man sich gerade in einem Kriminalroman aufhält wo das Gute stets das Schlechte ist, das Elend, die Trogödie, die schiere Depression…

Apropos ausblenden. Würde man all das, was gute deutsche Kriminalromane des Jahres 2013 ausmachte, ganz einfach ignorieren , stünde er tatsächliche da: der Krimi. Ein Mord, ein(e) Ermittler(in), Verdächtige, falsche Alibis, viel Kombination, ein wenig Aktion, Rätsel, Rätsel, Rätsel, … und am Ende alles klar und alles gut. Keine “Literatur”. Keine Abgründe. Keine Wirklichkeit. Keine enttäutschten Erwartungen? Dafür ein paar Stunden harmlosester Unterhaltung? Wiederspruch? Warum denn?? Ordnung! Aber eigentlich…bin ich noch froh, dass ich auch 2013 wieder einmal nicht wissen, was Krimi ist, was nicht, was er darf und was keinesfalls. lol. 

Vom Anfang bis zum Ende des Buches dieses Romans stand ich unter Schock. Grausamkeit auf jeder Seite. Oftmals an die Grenzen des Erträglichen konnte ich dennoch das Buch kaum aus der Hand legen. Selten habe ich so viel Mitleid mit einem Angeklagten empfunden. Doch wie lange kann ein Mensch rechtliche Ungerechtigkeit ertragen und das auch noch immer im Namen des Volkes. Ist es nicht vom menschlichen Standpunkt her nachvollziehbar, dass sich Opfer – und als solches muss Collini gesehen werden – irgendwann zum Täter wandeln, wenn ihnen der Justizapparat Gerechtigkeit und Sühne verwehrt? 

Erzählweise machen das Buch "Der Fall Collini" zu einem des besten Bücher 2013. 

Auch das Weiterdenken nach dem Buch ist garantiert und in unserer Gesellschaft durchaus vonnöten.

sábado, junho 22, 2013

"Hyperion" by Dan Simmons

Hyperion - Dan Simmons
(read originally in 1993).

The details of the technology or the scientific credibility in a SF Book are not the main flaw for SF writing.

I am a computer scientist and I read the Hyperion Saga long ago, but the more persistent elements that these books left in my memory are not related to the quality of the scientific background:

1 - The sole idea of the cruciform organism and its curse of endless life was already very attractive, but it failed miserably.

2 - The shrike has a very weird turn-around, becoming a protector although it was originally a baroque-awesome-evil killing machine. Deus-ex-machina... 

3 - Similarly the fate of the characters in this book was a bit wasted by the irruption of Aenea as a kind of saviour. Another Deus-ex-machina...

4 - Another thing that spoiled the series for me: The incredible flaws in logic. The 4-book-series is drowned in incredibly idiotic characters that just keep going, failing to prepare even when they have years to do so, they never learn, most of the time, they are just dragged along by events. Whenever it suits the author, the characters are smart and cunning. And when it’s too bothersome, they are as dumb as a lamp-post. We also have computers abusing the mental power of all of mankind but too moronic to get rid of a little paranoia? 

The book has a few good ideas, but it stops there. The technology is based more on magic than science. In a few odd places, the author starts to develop an advanced civilization but it only scratches the surface. 

Getting the basic science right is nowhere near the point, but it helps when the writer gets it right...

quinta-feira, junho 20, 2013

"Joyland" by Stephen King

Joyland - Stephen King
At heart this is a sentimental Bildungsroman for a college young man who’s tending what he thinks is a broken heart, but written from the perspective of a 60 year old. 

It's a straightforward murder mystery, and one which King saturates with his own usual quivers-and-shudders here and there to keep you alert. 

I had a few problem with it. It's not the story itself that's the problem. The scene of the amusement park with a dark history is a surprisingly underused setting in thriller fiction, and the overall details and description give the book a "ring-true" portrayal of the epoch.

The protagonist tells the story of his summer at the park when he was 21 when he was desolated from an ill-fated college love. His friends and fellow carnival employees are lively and unique characters (on the surface).

What was missing for me, and why this book is only three stars, is the "life" (or lack thereof) of the characters beyond the surface. The characters from "The Stand" are some of the most rounded in all of literature. Not with the ones here.

Another main ingredient lacking is the dialogue and how the characters interact. The interactions move the plot along, but they rarely feel like real people talking. The fact that the book is aimed at the pulp-paperback market is no excuse.

domingo, junho 16, 2013

Personal Take on the Book "Jerusalém" by Gonçalo M Tavares

Jerusalém (O Reino, #3)Jerusalém by Gonçalo M. Tavares
My rating: 4 of 5 stars


Uhm...Ich fühle mich zweischneidig lol

Disgrace it's just too terribly depressing. Phrases that come to mind after having finished the book: "tremendously suffocating", "feeling of emptiness deep down inside", and on and on.

It's gives such an horrific view of human existence that I've finished it feeling as if someone had just punched me in the gut. Intentional (or not...)? Gonçalo, what were you thinking...?

I'm a man of two minds about his book... It didn't fully work for me but the parts that did. Oh my!

Let's put the jarring effects aside:

1 - The effectiveness of the philosophical pondering misses the mark due to the fact that the book is too focused on the thoughts and actions of the "abnormal man" and not on the "normal man" and therefore the applicability of the novel’s themes lacks some necessary universality of themes;

2 - The characters are extreme caricatures and not one of them mirrors the common modern man (aka normal or abnormal);

3 - It gives a very distant and cold perspective that makes it difficult to relate to.

Above-average effects:

1 - The writing is superb;

2 - Gonçalo is funny, intelligent and mind-numbing original. Enough said.

It was my first Gonçalo's book and it won't be the last. I'm curious to read this book in a language other than Portuguese. His prose poses some conundrums that I would like to see how they're dealt with in another language.

I think Gonçalo is the equivalent to reading crack cocaine and I'm damn well addicted. Fortunately I'm Portuguese and I can read all of them in the original... lol

NB: Along with this book, a friend of mine also recommended another one: "O homem ou é tonto ou é mulher", which means something like this: "Man is either a fool or a Woman". How much better can one get, ah?


View all my reviews

sábado, junho 15, 2013

"Red Mars" by Kim Stanley Robinson

Red Mars - Kim Stanley Robinson
Read it for the first time in 1993. 

Going into this book 20 years later, the feeling I had was one of trepidation. Would the book have stood the test of time?

And the answer is: Unfortunately no.

One of the things that I've noticed almost from the onset was a huge dissonance (I don't remember spotting it 20 years earlier, but now I did): Why plan the mission without firmly establishing at least some sort of general idea about what sort of terraforming might be done? 

I cannot imagine spending hundreds of billions of dollars to send Men to Mars without a proper plan in place. It was quite inconceivable more than 20 years ago, and it still is.

Also at times I had the impression that there were things Robinson just didn't want to bother to develop. The name of "Underhill" pops up out of nowhere in the middle of a paragraph inside a chapter with no explanation at all. You'd think the naming of the first settlement would be somewhat more momentous.

It just doesn't seem like there was much of a story present at all. 

Great swaths of the book consist of characters wandering around being lonely and accomplishing nothing, though it hardly feels like there's much character development to speak of.

hen they wait until after they arrive on Mars to have some big, nasty row about terraforming? Surely this would be an issue that would have been hammered out well in advance of anyone leaving orbit?

What about the fact that the 1st 100 settlers waited until arriving on Mars to start bickering? How could the 1st 100 have been chosen so badly?

The answer given is not convincing, ie, apparently everyone lied horribly during the recruitment phase because they wanted to get there... WTF??? What kind of behaviour assessments were given to this guys??

What about Maya? What was the purpose of including her thread in the book? It serves no purpose, except as the love triangle Boone/Chalmers/Maya.

The only redeeming fact about the book is the Science. For that 3 stars.

sexta-feira, junho 14, 2013

Advanced Python Class: Asteroids' Game (Final Project)






In 2013 I did a 3 months Python Course, where the final project was an Asteroid's Game. It took  me around 2 weeks to create it, but it was worth it...I'd to pull a lot of all-nighters...

To see the full code and play the game open the link at the end of the post and click the play button in the upper left corner. Because of sound (mp3) it's best to open it in Chrome (controls: left and right arrows rotate the ship. Up arrow activates the engines. Space bar fires missiles).

Follows the game specification handed over in class to be implemented by each student.

Game Specification:


"At the end of this project, your game will have multiple rocks and multiple missiles.  
You will lose a life if your ship collides with a rock and you will  score points if your missile collides with a rock. You will keep track  of the score and lives remaining and end the game at the proper time.  You may optionally add animated explosions when there is a collision.

Phase one -  Multiple rocks

For this phase, you will keep a set of rocks and spawn new rocks into this set.  This requires the following steps:

Remove a_rock and replace it with rock_group. Initialize the rock group to an empty set.

Modify your rock spawner to create a new rock (an instance of a Sprite object) and add it to rock_group.

Modify your rock spawner to limit the total number of rocks in the game at any one time. We suggest you limit it to 12. With too many rocks the game becomes less fun and the animation slows down significantly.

Create a helper function process_sprite_group. This function should take a set and a canvas and call the update and draw methods for each sprite in the group. Call the process_sprite_group function on rock_group in the draw handler.

Phase two - Collisions

For this phase, you will detect collisions between the ship and a rock. Upon a collision, the rock should be destroyed and the player should lose a life. To implement ship-rock collisions, you need to do the following:

Add a collide method to the Sprite class. This should take an other_object as an argument and return True if there is a collision or False otherwise. For now, this other object will always be your ship, but we want to be able to use this collide method to detect collisions with missiles later, as well.

Collisions can be detected using the radius of the two objects. This requires you to implement methods get_position and get_radius on both the Sprite and Ship classes.Implement a group_collide helper function. This function should take a set group and an a sprite other_object and check for collisions between other_object and elements of the group. If there is a collision, the colliding object should be removed from the group. To avoid removing an object from a set that you are iterating over (which can cause you a serious debugging headache), iterate over a copy of the set created via set(group). This function should return the number of collisions. Be sure to use the collide method from part 1 on the sprites in the group to accomplish this task.

In the draw handler, use the group_collide helper to determine if the ship hit any of the rocks. If so, decrease the number of lives by one. Note that you could have negative lives at this point. Don't worry about that yet.

At this point, you should have a game of "dodge 'em". You can fly around trying to avoid the rocks!

Phase three - Missiles

For this phase, you will keep a set of missiles and spawn new missiles into this set when firing using the space bar. This requires the following steps:

Remove a_missile and replace it with missile_group.  Initialize the missile group to an empty set. Modify your shoot method of my_ship to create a new missile (an instance of the Sprite class) and add it to the missile_group. If you use our code,the firing sound should play automatically each time a missile is spawned. 

In the draw handler, use your helper function process_sprite_group to process missile_group. While you can now shoot multiple missiles, you will notice that they stick around forever. To fix this, we need to modify the Sprite class and the process_sprite_group function.

In the update method of the Sprite class, increment the age of the sprite every time update is called. If the age is greater than or equal to the lifespan of the sprite, then we want to remove it. So, return False (meaning we want to keep it) if the age is less than the lifespan and True (meaning we want to remove it) otherwise.

Modify process_sprite_group to check the return value of update for sprites. If it returns True, remove the sprite from the group. Again, you will want to iterate over a copy of the sprite group in process_sprite_group to avoid deleting from the same set over which you are iterating.

Phase four - Collisions revisited

Now, we want to destroy rocks when they are hit by a missile. We can't quite use group_collide, because we want to check for collisions between two groups. All we need to do is add one more helper function:

Implement a final helper function group_group_collide that takes two groups of objects as input. group_group_collide should iterate through the elements of a copy of the first group using a for-loop and then call group_collide with each of these elements on the second group. group_group_collide should return the number of elements in the first group that collide with the second group as well as delete these elements in the first group.

Call group_group_collide in the draw handler to detect missile/rock collisions. 
Increment the score by the number of missile collisions.

Phase five - Finish it off

You now have a mostly working version of RiceRocks!!! Let's add a few final touches.

Add code to the draw handler such that, if the number of lives becomes 0, the game is reset and the splash screen appears. In particular, set the flag started to False, destroy all rocks and prevent any more rocks for spawning until the game is restarted.

When the game restarts, make sure the lives and the score are properly reset. Starting 
spawning rocks again. Restart the soundtrack.

When you spawn rocks, you want to make sure they are some distance away from the ship. 

Otherwise, you can die when a rock spawns on top of you, which isn't much fun. One simple way to acheive this effect to ignore a rock spawn event if the spawned rock is too close
to the ship.

Experiment with varying the velocity of rocks based on the score to make game play more 
difficult as the game progresses.

Tweak any constants that you have to make the game play the way you want.
Congratulations! You have completed the assignment. Enjoy playing your game!!!

Bonus

The following will not be graded. Feel free to try this, but do not break any of the other game functionality. We strongly recommend that you save your work before doing this and keeptrack of it, so you can submit a working version of the first five phases if you end up breaking your game trying to add more features.

One thing that is missing in your game is explosions when things collide. We have provided a tiled explosion image that you can use to create animated explosions. To get things working, you will need to do a few things:

In the draw method of the Sprite class, check if self.animated is True. If so, then choosethe correct tile in the image based on the age. The image is tiled horizontally. 

If self.animated is False, it should continue to draw the sprite as before.

Create an explosion_group global variable and initialize it to an empty set.

In group_collide, if there is a collision, create a new explosion (an instance of the Sprite class)and add it to the explosion_group. Make sure that each explosion plays the explosion sound.

In the draw handler, use process_sprite_group to process explosion_group.

You should now have explosions working!

Grading rubric - 13 pts (scaled to 100 pts)

Note that the animated explosions are not graded. However, please add comments concerning the quality of the explosions and general gameplay in the free comments at the bottom of the page. 

Please assess your peer's mini-projects in Chrome. If,for some reason, you must use Firefox or another browser (or had issues playing sounds in Chrome), please give your peers full credit on the sound-related rubric items.

1 pt - The program spawns multiple rocks.
1 pt - The program correctly determines whether the ship collides with a rock.
1 pt - The program removes a rock when the ship collides with a rock.
1 pt - The number of lives decreases by one when the ship collides with a rock.
1 pt - The program spawns multiple missiles.
1 pt - The program plays the firing sound when each missile is spawned.
1 pt - The program removes a missile that does not collide with a rock after 
some fixed time period.
1 pt - The program correctly determines whether a missile and a rock collide.
1 pt - The program removes missiles and rocks that collide.
1 pt - The score is updated appropriately after missile/rock collisions.
1 pt - When the lives go to zero, the splash screen reappears and all rocks 
are removed.
1 pt - When the splash screen is clicked, the lives are reset to 3, score is 
reset to zero and the soundtrack restarts.
1 pt - The game spawns rocks only when the splash screen is not visible and a 
game is in progressed."

Physics' primitives:


The game's challenge was to develop the basic primitives: vector acceleration, velocity, collision (detecting collisions between one object and a group, detecting collisions between two groups of objects), acceleration, friction, and orientation. Some of the notes from the class:







The collisons was the part that was the most tricky, because I'd to to keep redrawing the sprites and canvas at the same time:

# detecting collisions between one object and a group
def group_colide(group, other_object):
    global explosions
    collisions = 0
    for sprite in list(group):
        if sprite.colide(other_object):
            if tron:
                a_expl = Sprite(sprite.pos, [0,0], 0, 0, explosion_image, explosion_info, explosion_sound)
            else:
                a_expl = Sprite(sprite.pos, [0,0], 0, 0, explosion2_image, explosion2_info, explosion2_sound)
                
            explosions.add(a_expl)
            group.remove(sprite)
            collisions += 1
    return collisions
            
# detecting collisions between two groups of objects
def group_group_colide(group1, group2):
    collisions = 0
    for sprite in group1:
        collision = group_colide(group2, sprite)
        if collision > 0:
            group1.remove(sprite)
            collisions += collision
    return collisions

# displaying group of sprites
def process_sprite_group(sprite_set, canvas):
    if len(sprite_set)>0:
        for sprite in list(sprite_set):
            sprite.draw(canvas)
            sprite.update()
            if sprite.age == sprite.lifespan*10:
                sprite_set.remove(sprite)

For the full source code, see link. To play the game on the Google Chrome Browser the link is the same.

"Galileo's Dream" by Kim Stanley Robinson

Galileo's Dream - Kim Stanley Robinson
As a book of historical fiction this book works admirably. Unfortunately the Jovian Story Line almost ruins it. This part is mixed with the historical passages with brief visits to the distant moons of Jupiter - Galileo travelling through both time and space to discover the colonized moons. 

To begin with, these passages felt as though they were implanted into the novel in a inept fashion and we readers, suffering the same confusion as the Galileo of this novel must have suffered. The passages set in the future were roughly sketched, the world-building not living up to the meticulously researched historical sections. 

Robinson is a writer who is fascinated by science. Not just the knowledge it yields, but also with the entire process of observing, hypothesizing and testing. The many hours of hard work that is involved as well as the scarce moments of new insight. Many of his characters are scientists and their work as well as their impact on society is a frequent theme in his work.

The historical part of this novel was an absolute delight to read. Especially the machinations that lead to Galileo's conviction and the banning of his book by the Vatican are very interesting.

The Jovian story line was the one which I had most troubles with. It's interesting in it its own way but it cannot balance to absolutely brilliant historical part of the novel.

This novel shows the continual fascination with science that gave us science fiction in the first place. That's one of the reasons why I read SF.

5 stars to Galileo's characterization and 1 star to the Jovian story line. 

Galileo lives on through this novel.

"Jerusalém (O Reino, #3)" by Gonçalo M. Tavares

Jerusalém - Gonçalo M. Tavares
Uhm...Ich fühle mich zweischneidig lol

Disgrace it's just too terribly depressing. Phrases that come to mind after having finished the book: "tremendously suffocating", "feeling of emptiness deep down inside", and on and on.

It's gives such an horrific view of human existence that I've finished it feeling as if someone had just punched me in the gut. Intentional (or not...)? Gonçalo, what were you thinking...?

I'm a man of two minds about his book... It didn't fully work for me but the parts that did. Oh my!

Let's put the jarring effects aside:

1 - The effectiveness of the philosophical pondering misses the mark due to the fact that the book is too focused on the thoughts and actions of the "abnormal man" and not on the "normal man" and therefore the applicability of the novel’s themes lacks some necessary universality of themes;

2 - The characters are extreme caricatures and not one of them mirrors the common modern man (aka normal or abnormal);

3 - It gives a very distant and cold perspective that makes it difficult to relate to.

Above-average effects:

1 - The writing is superb;

2 - Gonçalo is funny, intelligent and mind-numbing original. Enough said.

It was my first Gonçalo's book and it won't be the last. I'm curious to read this book in a language other than Portuguese. His prose poses some conundrums that I would like to see how they're dealt with in another language.

I think Gonçalo is the equivalent to reading crack cocaine and I'm damn well addicted. Fortunately I'm Portuguese and I can read all of them in the original... lol

NB: Along with this book, a friend of mine also recommended another one: "O homem ou é tonto ou é mulher", which means something like this: "Man is either a fool or a Woman". How much better can one get, ah? 

terça-feira, junho 04, 2013

"Way Station" by Clifford D. Simak

Way Station (A Collier Nucleus Science Fiction Classics) - Clifford D. Simak
description

I've been reading this book on and off for several years (first time I read it in Portuguese...). Once in a while I get the urge to pick it up again. It happened again... lol

Storytelling, movie making, painting are all art forms. There is no right or wrong way to make art. There's no inherently proper or improper, no right or wrong, no appropriate or inappropriate way to craft artistic expression. Simak had his way. Heinlein had his way. Bach had his way. Eça de Queiroz had his way. Nick Ray had his way (Johnny Guitar...). 

One of the things that still makes me uncomfortable is its naked appeal to raw emotion. As a culture we've become very postmodern and ironically self-aware.

This novels proves beyond a shadow of a doubt that great writing isn't just about writing tastefully and avoiding bloopers in current literary fashion. It's about striking a responsive chord in the reader and in that respect this book works perfectly.

Clifford D. Simak was a great writer, and had the awareness of nature and environment that lent a depth and reality to his settings and characters.