Tuesday, December 2, 2014

dcss : what have I learned

Evaluating risks

Dcss (dungeon crawl stone soup) is a pretty good game, it taught me very valuable lessons - why ? because this game is very rich in features, very very well balanced and very deadly.

I only realized the value of this game after hours and hours of frustration, but this game is good - first my strategy was to look for the 'perfect' combination - I tried gargoyle hunter (because gargoyle are not affected by poison and start with a decent armor class - and I was losing a lot of characters because of poisonous adder or scorpions) - but they lack in strength at the beginning, that's why I switched to troll hunter - but the constant search for food to feed these beasts was overwhelming, so I switched to spriggan (not requiring much food) and tried the spriggan venom mage - who is very powerful at the beginning, only to discover that he could be smashed in one hit by giants or ogres ...

Now I sort of found a real winning combination with the deep dwarf artificer follower of Elyvilon - he has a very nice beginning with 3 wands (including a healing wand he can recharge them using his MP) and then later he can cure himself - that was the way to fix his natural flaw of not being able to regenerate hit points. And now this little fellow has conquered the lair, decimated the spider nest, and entered the vaults ...

Oh, one thing you should never, never do as a healer is to protect yourself (using a,p) then attack monsters - this is considered as a transgression by Elyvilon and the healer is then under penance.

Strategy 

Quit early, if you have never seen that monster before, press x go over the monster and press v - this will give an overview of the monster's capacities, and more in depth description.

There is no shame in going away soon - as a rule of thumb if the character has lost one third of his hit points, it is time to run away, read a teleport scroll, blink or use a wand of teleportation on himself, if the loss goes more than 50% then the situation can really be fatal.

Don't engage monsters on an open ground, unless you are 5 or 7 blocks away and can outrun them (with a haste potion, or using cheibriados 'slow' on the opponents). Now if you don't have other options, then you better switch your weapon to an axe type - because you can then hit multiples opponents at once. But this is not a guaranteed strategy.

Trying to enchant and use a troll hide to regenerate a deep dwarf doesn't work.
If you want to use the immolation scroll, make sure you are far from the opponents flocks.

You can burn trees with a wand of Fire, this can be quite useful.

Stupid deaths series

Here's a few screenshots of stupid deaths

Mistake number 1 : getting surrounded
Mistake number 2 : not using an axe type (which I had in my inventory)
This was really a stupid death, I had a scroll of fear I could have used
none of these monsters alone would have been a problem at all.
Retreating the the small square on the right, I could have taken them one by one, I even had many unused healing and curing potions,  what was I thinking?!

Mistake number 1: attacking in the open (again)
Mistake number 2: not using the haste potion to run away
That is the typical situation that followed a 'winning streak' where I thought I could handle this kind of setup - I used a phial of floods to help - but it wasn't enough and then the character got confused and it was over in matter of 2 rounds.



Sunday, November 16, 2014

Join us on Tsū

I've joined tsu.co


You can now find me here on tsu.co

After joining facebook, tumblr, pinterest, deviantart, and many more ... spending a lot of time on social networks - I was attracted by the new paradigm of Tsū  - to be paid as a content creator to spend that same time sharing and interacting with  like minded people, not to be the product anymore. I hope the other social networks will get the message...

My first impressions

I like Tsū design, I like the color scheme - a gradient of yellow to green - Tsū is responsive, simple, but I wished they would have made a little clearer the limitation in the number of friend requests, the number of shares etc ...I understand the strategy, it is better to have a user coming back everyday than a couple of hard-core users spending a lot time at once, and spamming others, ruining their experiences.

This morning I was surprised to have my first 0.01$ in the bank settings. I think it took me a month to get to that with adSense...

Tsu.co users are very enthusiastic and nice, at the moment everybody is sharing, making friends, and bragging about receiving their first checks in the mail.
There is such a clash with facebook, where it is mostly grey in comparison, with the occasional rant in the groups.

Tsū doesn't (yet) have groups, or chat - but I've heard it is somehow planned.
I certainly hope there will be a tsu.co API too. At the moment I'd like to see a tsu.co bookmarklet (like the one I use for tumblr) because that is very handy.

Hope it works in the long run

I use to be a member of gnomz.com, yahoo meme, google buzz, google wave, googlepages, slinkset, pixish etc ... all of them looked shiny and promising and because of the ever-changing nature of the internet have been dissolved, disappeared or mutated ...

Anyway I hope tsu.co will work in the long run. I remember watching Jaron Lanier talking about how the internet users were working adding content without compensation (i.e: mostly on wikipedia) were content creator but were not recognized as such .. it was 2 years ago I think?! The platform dictate the rules, for people who are not yet ready to have their own website, that means to be dependent on the change of terms and conditions, or worse closure of the platform.

I'm glad Jaron is part of tsu.co team, he truly is a visionary but where is his profile!?

Friday, November 14, 2014

The Joy of updating

An actual example of why I hate newer version of anything

It happened on linux, but that is really not linux related - it is about the latest version of seamonkey (and should also affect mozilla browser, like firefox).
I just updated to the latest version which is 2.30  - and around the same time noticed a loss of hd space - for no apparent reason...

Looking into the cache folder

I had lost around 1GB of hd space (and since my linux partition is only 16GB - I have to be cautious about every GB) - so I made some queries to find where was the folder that got a sudden increase in size and found that the folder .cache was the culprit - went into that folder and found .cache/mozilla/seamonkey with my several profiles - and in them found 2 folders for cache - the old one, named 'cache' and a second one named 'cache2' ... that's all I needed to know.

Now everybody has a hd with at least 1TB of disk, 4GB of ram and will not notice something like that - or even care about .. which push the developers to let this kind of thing to happen. And even better, if the user is on an old pc, with little space - maybe that last update will be the last push he needs to buy a new pc or mac.

Wednesday, November 12, 2014

Opera to the rescue

Opera browser support

Even though Seamonkey 2.23 is working (it is after all a ppc platform version) it is very slow, so I've been looking for another alternative and found iCab, Omniweb, and haven't found satisfaction - then I found Opera - now, the trick is the main link for the download will bring you to the latest version of Opera that will not be supported on 10.5 - but through this link at http://arc.opera.com/pub/opera/ you will be able to install Opera 12.16 the last version available supporting 10.5

http://arc.opera.com/pub/opera/mac/1216/


The one to select is the highlighted one for Intel.

Customization

Contrary to Seamonkey - Opera is pretty nice out of the box, the only thing to change is in tools/advanced/plugins
Once again disable everything - but keep Flash.


Customizing Seamonkey

Seamonkey customization

Because to be honest, in my last post I explained that Seamonkey ppc was working fine on intel platform - running 10.5.8 - I forgot to say that it will be pretty slow, and that 'out of the box' looks pretty ugly - so here are some customizations that might help things get better :

 Reducing the cache to 64mb
 Disable all updates - there will be none available anyway

Disable all extensions
 And change the default theme
Same as for the extensions - disable all plugins but Flash (latest version available for intel-mac/10.5.8 was 10.3 something)

Monday, November 10, 2014

Good Guy Seamonkey

A solution 

After my recent rant about the programmed obsolescence designed to push sales of new computers artificially, and for users the sempiternal issue of  not being able to upgrade and having to install new version of their OS that will irremediably be slower and ask for more resources up to the point where they will not be able to use their old pc or mac - I pondered about finding solutions.

Here's one : Seamonkey!


This browser is still supporting old OS (otherwise officially obsolete) - and I think he is the only one to do this... wait ... no .. there's also TenFourFox

This issue of constantly requesting for update isn't a mac only problem - I have the same issue with a Linux distribution (after I installed mint Nadia - I didn't choose a long term support edition (my bad)) and now here's the quick-fix (another fix is to install Qiana (support until 2019) or Maya (support until 2017) but that means I'll have to reformat the disk and have about 3-4 hours of installation, restoring backups, and customization (assuming there will be no funny surprises)).

Which I will eventually do some day .. but not now!


Download seamonkey - it isn't coming through synaptic (the Nadia repository doesn't exist anymore since the support as ended (for Nadia the end was May 2014)).

Then extract the files and go into the folder containing 'seamonkey' folder - open the terminal and type :
$ sudo mv seamonkey/ /usr/local/bin/seamonkey/
After that all files will be transferred in /usr/local/bin

Now just create a xfce icon launcher on the desktop with these settings :

Step for a mac system are even easier

Just download the old release version (ppc version will work on intel platform).

The SeaMonkey for PPC project provides versions beyond SeaMonkey 2.9 for PowerPC/G4 on Mac OS 10.5.x.

Another workaround for mac is TenFourFox

The TenFourFox project provides builds of Firefox for PowerPC (PPC) that are based on Firefox ESR.

Now the last problem ... is Adobe Flash support .. and for this one, I still looking for a decent solution.

Wednesday, November 5, 2014

Programmed Obsolescence

What IT companies would never put on their advertisement

Customers are supposed to upgrade or buy a new computer every 3 years, doesn't matter if the old computer still works, if customers have complex setup - doesn't matter if they have spent a lot of time customizing their configuration, or have specifics applications ... Customers have to replace their old devices or computers every 3 years.

Don't believe me?
- Mac OS 9.2 was the last version after that Apple switched to OS X
- Motorola Powerpc is no more, Apple switched to Intel processor
- Adobe Flash is constantly asking for update
- Applecare Protection plan covers 3 years maximum
- Digital port equipped with DVI port, then ADC port, then now HDMI (VGA being still supported! Thank God)
-  Browsers are displaying messages complaining that there aren't supported anymore
- And I'm not even talking about Microsoft, where Windows XP couldn't be killed and new version (like Vista) couldn't even compete with their previous releases  ...

What if customers don't want to upgrade or change their computer?

IT companies will then pretend that suddenly things will not work on an old machine, the usual way is - "Sorry this application won't work unless you have 10.x installed."
the System Requirements BS trick. Or even better new environmental legislation (not RoHS compliant).
Another tricky way is to pretend that your computer is at risk if you don't have the latest version.
Another subtle way is to have the spare parts so expensive it isn't even worth to repair a computer.

Honestly, since my first PC with 5"1/4 floppy disks, I played the "upgrade game" and bought 3"1/2 disks drive, then cd-rom drive and omega zip 100Mb disk, then computer with dvd-rom and cd-burning capacity, then more ram, then more hard disk space, then got some usb disk because there was no cd-rom anymore on the new computer, then instead of having a desktop PC - I started to buy laptop, then a tablet, then a second monitor to have dual display,  then external backup hard disk, then I invested in network switches, then wi-fi, then routeur ... and now I think, we are somewhat at a plateau, the only things that is pushing customers are ... BS incentives like the one above - "Sorry, we don't support this version anymore!" - you are probably broke and we don't care, you need to buy a new machine to keep working with us!

This is BS because Youtube was playing video just fine in 2003, but now you have to update Flash player to watch the exact same thing, the trick is "Oh, we are so sorry, the new Flash Player isn't supported for your old machine!" ... hint, hint ... buy a new PC!

Why?

The whole economy depends on the customer buying like a crazy maniac everything that is newly produced - the problem is "new" doesn't necessarily means "better" than the old machine (newer model may or may not have webcam, or microphone, or as many USB ports, or a DVI port ....) 
And usually changing computer means you will have to buy new devices (like scanner, tablet, speakers, printers etc ...) - because of the change in the ports, or the lack of support for drivers with the new OS ...

Where do the old computers pile up?

 I bet somewhere in Africa, making a big heap of electronics, next to a mountain of old printers, and close to an enormous hill of broken monitors.

Thursday, October 30, 2014

Vacation in the Shaols

Today I had the chance to visit the Shoals - the entrance was in the Lair
and I was on a winning streak with my deep dwarf artificers follower of Elyvilon


As you can see this level has pretty colors and a whole new design - I don't know who has done the graphics for the Shaols, but it is really great looking, water especially - it somehow remind me of Wesnoth.

Some tips - as an artificer being a deep dwarf has many benefits - because the character starts with 2 wands (because of the class) and 1 wand of healing because of the race.

Deep dwarf don't heal naturally, so the healing wand is very important - at least at the beginning, but once my character started to follow Elyvilon - and has 2 stars I could use the 'ab' feature and heal myself.

Now the only thing that is still troublesome is not having an Amulet of the Gourmand (yep French in the text) - otherwise armor class is pretty good, and  I specialized in the axe and mace - prioritizing the invocations to at least 70% until it reach level 15 or more.

I also had an unfortunate visit to the maze - here also the graphics are pretty nice and colorful.


Monday, October 27, 2014

Crawl - dcss


This above was my first discovery of the game crawl (back in July 2014) - a text based rogue like game, since then ... I've discovered the graphical version (see below) and I'm sorry to say I've been addicted to this game, ever since...

So far that's how many characters I've played :
  33 Troll Healer
  32 Vine Stalker Monk
  25 Human Berserker
  24 Gargoyle Fighter
  13 Troll Hunter
   9 Troll Berserker
   6 Kobold Arcane Marksman
   5 Ogre Berserker
   5 Gargoyle Monk
   4 Troll Monk
   4 Spriggan Warper
   4 Mummy Wizard
   4 Gargoyle Wizard
   4 Gargoyle Hunter
   4 Deep Elf Wizard
   4 Deep Dwarf Hunter
   3 Vine Stalker Necromancer
   3 Troll Wizard
   3 Spriggan Conjurer
   3 Spriggan Air Elementalist
   3 Mummy Summoner
   3 Minotaur Hunter
   3 Formicid Fighter
   3 Deep Dwarf Healer
   2 Vine Stalker Air Elementalist
   2 Spriggan Venom Mage
   2 Minotaur Healer
   2 Minotaur Berserker
   2 Kobold Summoner
   2 Kobold Assassin
   2 Hill Orc Summoner
   2 Hill Orc Healer
   2 High Elf Wizard
   2 Formicid Earth Elementalist
   2 Draconian Wizard
   2 Deep Dwarf Artificer
   1 Yellow Draconian Venom Mage
   1 Vine Stalker Conjurer
   1 Troll Fighter
   1 Tengu Air Elementalist
   1 Spriggan Wizard
   1 Spriggan Ice Elementalist
   1 Spriggan Hunter
   1 Spriggan Healer
   1 Ogre Wizard
   1 Mummy Necromancer
   1 Minotaur Fighter
   1 Minotaur Death Knight
   1 Kobold Ice Elementalist
   1 Kobold Hunter
   1 Kobold Fire Elementalist
   1 Human Wizard
   1 Human Fire Elementalist
   1 Human Death Knight
   1 Hill Orc Fighter
   1 High Elf Warper
   1 Halfling Hunter
   1 Gargoyle Summoner
   1 Gargoyle Gladiator
   1 Gargoyle Fire Elementalist
   1 Formicid Hunter
   1 Formicid Healer
   1 Felid Healer
   1 Felid Conjurer
   1 Draconian Warper
   1 Draconian Wanderer
   1 Draconian Venom Mage
   1 Draconian Healer
   1 Draconian Berserker
   1 Draconian Abyssal Knight
   1 Demigod Fire Elementalist
   1 Deep Elf Conjurer
   1 Deep Elf Air Elementalist
   1 Deep Dwarf Warper
   1 Centaur Hunter

Which is ... 267 dead characters - and I'm still "mid game" (I have reached level 15 and seen the entrance to the vault or the depths) - like I said in a previous post my best luck was a gargoyle hunter follower of Elyvilon - because of the resistance to poison, and a good skill with a long range weapons, and the healing and capacity on top of it.

This game is very very (very) hard - I've seen a player finishing and escaping with the orb.  It is possible ...

But my experience so far, is not so glorious : 


Wednesday, October 22, 2014

Crawl stone soup

Monsters and Maze (M&M)

I used to play Advanced Dungeon & Dragons, I was reading and was quite familiar with the player handbook and the dungeon master guide, and many other manuals in English - since then I've (unfortunately) tossed away (or lost most of these materials) but I always find fascinating to play in a fantasy world.

Now like I wrote previously on this blog, I wanted to create a different kind of game where the player wouldn't be rewarded with experience when monsters where killed, but instead would gain bonus when applying other peaceful methods (such a game didn't exist, or so I thought).

Now obviously while I was writing the code of my python game - I looked for similar roguelike game and quickly found DCSS (Dungeon Crawl Stone Soup) - and in this game I found an interesting class the 'healer' - which basically does this pacifying technique on monster that will then turn neutrals. But this game is amazingly more complicated than any other game I have played so far - like Starcraft, or Warcraft II and III (mainly).

Making an artwork

Because I liked the game so much, I had the inspiration of creating a splash art of one of their monster - the infamous “Eye of draining” - which is now in the game (release 0.15 and above).


Here's how I submitted my artwork https://crawl.develz.org/mantis/view.php?id=8645


For the record the green background was chosen for contrast with the red color of the Eye of draining - the green color was not kept, but a purple variant was made for the game. Which is perfectly fine, the work is officially published here http://fav.me/d7kvgi0 under a "Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)" license
http://creativecommons.org/licenses/by-nc-sa/3.0/

I tried to make another splash art with a huge minotaur, but it is still not very satisfying - maybe I'll finish it someday.

Addictive gameplay

I don't really know why I like this game so much, because it is a lot of trials and errors that end up in permadeath(*) (so far I have played more than a hundred characters) finding some kind of winning combinations of starting as a gargoyle hunter and then choosing Elyvilon later (when above level 5). The Troll hunter is good too, or the spriggan venom mage ... but definitely not a summoner (I've tried many times, and couldn't go past level 3).

(*) DCSS doesn't allow the load and save - like in the usual sense. It is possible to save and continue from this saving - but if the characters dies, you can't load the previous game, he is dead for good - this is permadeath.

I like in this game the flexibility of being able to start as a fighter, and gain some spells or divine abilities later in the game. The mechanisms are pretty good, and the game is very well balanced (there is always a downside to every benefits the characters get).

Official link to the game (currently in version 0.15) http://crawl.develz.org/wordpress/
It is possible to play online or to download the game and install it locally.
The benefits of playing online is the capacity to play the latest version (trunk) and to watch how other players are doing. While they maybe some lags during the game.

Now the installed version is faster, and the interface is a little nicer and more compact.

Thursday, August 14, 2014

Warrior of Entropy

The story behind the "Warrior of Entropy"



Maybe you would remember that little character I drew last year - he was a representation of the art-block, the arch-enemy of any creative ... I kept thinking about what this represent to me, and how I felt about this cold undead knight wearing just a shield, that seems to have very small inscriptions on it (maybe part of ancient cryptic codex).

I renamed him the warrior of Entropy - or the knight of entropy because he's kind of a badass.

And he's now on sale at zazzle - Oh, the irony!

http://blog.peileppe.com/2013/04/la-feuille-blanche-et-le-blocage.html
http://www.zazzle.com/knight_of_entropy_t_shirt-235439564771717278?color=white&rf=238407010326545416
http://fav.me/d7v4dl5

Tuesday, July 8, 2014

"saneblockerG" a pygame experiment

Making progress, one step at a time


After my last attempt at programming Python with a graphical library (see http://blog.peileppe.com/2014/05/squadron4-game-now-in-graphic-mode.html)– I had used pygcurse, because I was familiar with the 'curses' library, and that was the next logical step.
But obviously there were limitations, meaning that I would only be able to have more or less the same experience using a sort of a grid, and fonts characters to play with (no actual "sprites").

Pygcurse served its purpose well, I started to understand better how to implement graphical elements and make them interact – but my real interest, has always been to put little sprites everywhere. And since Pygcurse is just another layer between python and pygame – I made the next logical step by programming the new game in Pygame only.

Commenting the source


As usual the program starts with a few constants (to avoid using 'magic numbers' something I learned in the excellent book by Al Sweigart called "Making Games with Python & Pygame ") and then the load_image function (I borrowed from the oldalien.py source file that is provided with pygame) – then I create my 3 classes "Block", "Ball" and "Player" in the same way I did for the last source - see previous post).

Then in the main program I setup the environment, load the sprites – and go in a loop that will exit when the player press "ESC" or "Q" – I struggle a bit to find a good FPS (frame per second) timing for the game, and avoid the "avatar" to move an extra step (which happened quite a lot, I noticed in many pygame examples) by waiting for the event KEYDOWN to update the avatar position.

The funny thing about this game, is that it's actually based on a "odd" behavior of the ball class that would sometime get stuck and not being able to find a valid position to move into – I solve this by having a loop (using the variable "sane") to search for all possible positions and if it fails, the ball then is considered frozen.

That's where the saneblockerG name comes from.

Want more?

 

The game could be certainly improved – by for example stopping after the last ball is stuck.
Or by having more flexibility in the ball's trajectory (avoiding the repetitive diagonals)

But the purpose was just to have a first pygame playable game. And the program is there on google code if anybody wants to improve it, so … the plan now is to program another one, going further in the difficulty and having multiple sprites to simulate movements, or dialogs, … 


Monday, May 19, 2014

Squadron4 game now in graphic mode

Squadron4G is born


Like I said earlier in this blog, my goal in programming with Python was to reach some kind of knowledge of the "graphical mode" - something to be honest, I was kind of excited and anxious about.

Excited because it means I will have  access to colors, loading images, changing palettes, using "sprites" and later adding sounds effects, maybe music etc ...

Anxious because during my past experiences in programming that was pretty much the end of the road (except maybe that Sprite Editor I was doing in Turbo Basic back in the days (on 320x200 screen resolution and 4 colors))

Pygcurse to the rescue



Now enter pygcurse, this was the missing link for my Python's adventure - something that could be a bridge between the curses library and pygame (which for the moment still seems a little too complex).

After reading the manual, and some sources from the pygcurse package (especially demo-maze.py), I made the "port" of the code into something more graphical "friendly" and Windows compatible.

My strategy for the "port" was to override all the curses standard function (addch(), addstr(), inch() and so on) at the start of the program - to minimize the changes in the rest of the source. And to my amazement it worked quite well, almost immediately ... because I couldn't figure how to replace the inch() function since they was no equivalent, that was until I figure that the PygcurseSurface object had a table variable : _screenchar[x][y] which  holds the character at cell x, y.

Problem was the geometry : 80x24 in text mode doesn't play well in graphics - it was ridiculously too wide. The code was working, but the design had to be redefined.

Now the game is running in 40x40 area - there are colors, and even a new feature for the player I just added this morning : "Teleportation"by pressing 't' the player will teleport himself back in the center of the area. A very handy feature, when he will get surrounded by the chasers. But Teleportation costs 100 out of the countdown score, so again a feature to use wisely.

 

Where is squadron4G?


It is hosted at code.google.com - and here are :

 NB :
To run the game pygcurse is required (just copy pygcurse.py in the same folder)

 

Installation 


One last thing concerning my first game (the one in text-mode) the curses library I was using - isn't compatible with Windows machine, they need to use another separate library - and changing a bit of the source code too (maybe?!).

To be fair, Python is pre-installed on OS X and Linux - so I never thought that windows user should have to select which version they needed to download on python.org.

In conclusion, the installation for Window user might appear as a little heavy :
The first time they need to download python from python.org, then pygame from pygame.org, then pygcurse from github, and then finally my source code hosted at code.google.com...

Friday, May 16, 2014

Squadron4 a simple Python game using curses

How Squadron4 got made

This week I was lucky, and got some spare time, so I wrote a little program - from scratch, over 2 days - (but less than 24h ; so basically it's like the 24h comics challenge but for game programming).

I was also lucky because my development machine is an old (from 2004-2005) iBook g4 powerpc based, running 10.4.11 and the default installed python running on it was a version 2.3 ... But, very supremely cool python.org website is keeping an archive of their latest release (python 2.7.6) for powerpc (ppc) platform (running 10.3.9 and higher)! This was really totally awesome of them to do so.

So now I'm running python 2.7.6 and I also installed pygame 1.9.1 (but haven't had time to test it yet).

What is "Squadron4"?


A very basic platform game written in Python 2.7 using the standard curses library - with only one level (but since the program use random location, technically this could be considered as an infinite number of levels).

Work best with a terminal window of 80x24 - during the test phase, I had the best game experience with this relatively small area, and it's also incidentally the default size of the terminal in OS X.

The goal of this game is for the player ( the little '@' symbol) to collect the four flags represented by symbol '1','2','3' and '4' that are disseminated over the 4 corners of the game area.

But the challenge for the player in the flag collection is to avoid (or trap) the chasers (symbols : 'c', 'd', 'e', 'f') that are after him ; to render the flag collection even more challenging in the middle area 4 balls are bouncing endlessly and can't be destroyed (but they can be trapped).

The task has to be done before the countdown (which start at 1000) reach 0.

When the player decides to use a "magnet block" (by pressing 'f' or space bar) the countdown is reduced by 20, so part of the tactic is to use them wisely.

When the four flags are collected - they are seen in the lower status bar between brackets - the game ends, and the high score is presented.

The idea of the game is to see the interaction between 4 different moving objects :

  •     one controlled by the player (symbol : '@')
  •     4 bouncing balls (symbol : 'o')
  •     4 chasers that will track the player (symbols : 'c', 'd', 'e', 'f')
  •     and magnet blocks fired by the player to trap the chasers (symbol : 'B')

Keys for the player '@' :

  •     Arrow keys to move
  •     'f' or space bar to launch a magnet Block
  •     'q' to Quit the program

How to win?


A tactic to win, is to use the obstacle blocks which are part of the decor, or to launch some magnet blocks to trap the chasers. If the chasers are getting too close, they will prevent the player's movements, or may actually completely prevents all movements ; then the only option is to quit the game (by pressing 'q'), or to wait for the countdown to reach 0.


Where is squadron4?


It is hosted at code.google.com - and here are :
  • the link of the whole project.
  • the link to the Python source : squadron4.py
  • and some screenshots of the game:

Sometime player wins :


Sometime player loses:


Tuesday, May 6, 2014

Making a game in Python

Coding a Game

How could I improve my coding in Python? that was my question a month ago - and after I made my menu library in curses for Python - I was thinking of writing a rogue like game, just for fun.
But to my surprise now I'm hooked on this fun project.

I've played rogue like game in text mode in the past - one of the greatest and most famous is called "crawl". But playing them - left me with a feeling of emptiness, killing monsters and being killed was pretty much the expected experience and after filling the morgue with all sort of failed attempts, I gave up...

And I thought, what is the main lesson in this game?! is it you have to kill or get killed?
what is it I'm unconsciously learning through this game? is it the old "Dungeon and Dragon" paradigm that when I kill monsters I get more experiences (xp) and can level up?

Because to be honest, the only incentive (and excitement) in this sort of game is to level up, so you can meet new monsters more powerful than before, but your hope is that you will level up soon enough, so you can defeat them, but the irony is that inevitably then you will meet even more powerful creatures...

This game mechanism is almost a metaphor for the Buddhist definition of "suffering" : The anxiety or stress of trying to hold onto things that are constantly changing...

So my idea was to write a different kind of game... where the avatar's desires and attachments are seen as a way to achieve enlightenment.

A different kind of game

A game where it's not about killing, but about playing with concepts and kōan , and learning philosophy and spirituality along the way ...

That's the idea in a nutshell, I'll give you an example of the kind of strategy to use in the game.
Let say my character is entering a cave and there is inside a dragon protecting his hoard, and through the use of meditation and persuasion the avatar is capable of teaching the dragon how to let go of attachment, after a while the dragon just leaves the cave and fly away ... there was no fight, no kill - the dragon is now a friend and the whole situation is positive.

There will be of course many challenges in this game, but no kill - no experience will be gained through slaughtering monsters. This idea of killing to gain experience and level up is completely wrong.

Monday, April 7, 2014

A curses menu library in Python

Curses Menu Library in Python


Just posted on Google Code a "curses menu library" ; 
https://code.google.com/p/menulib-python/

My little application (also on Google Code) to mimic the digital rain in the movie Matrix  using curses was a little warm-up for something a bit more interesting.

I'm working on the menu of the "call-centre Management" made even earlier - that will offer the menu option of creating a new Game, giving a list of the staff, hiring (and firing) agents, and Inspect them while they're working...

About this Menu library


It works as a standalone program - a demo of sort.
But it is more useful to import it in other program. Just make sure the menulib.py is in the same directory as your source file and then add this line in the import section:

from menulib import run_menu

and in your main program you can then declare a menu as a list :

main_menu = [ "New File", "Edit", "Search", "Exit"]

The last option has to be the one exiting the program

Then in the main function add
option=run_menu(main_menu)
and then add all the conditions to handle the option returned from the menu.

Friday, April 4, 2014

Python new code update and useful links

Some modifications

Since my last post - I've changed a few lines of code, because it wasn't using the "wrapper" function that I understand is a good practice when using the curses library.

Otherwise when debugging sometime the terminal is rendered unusable (typing characters aren't showed, the sequence would only appear after pressing the return key) - the remedy is to type (blindly) stty sane and pressing enter hoping there was no typo ...

 

Hosted on google code

The project is now both on pastebin.com and https://code.google.com/p/matrix-effect/

 

Finally

Here's my bookmarks for Python :

Very useful on how to use the curses library - helped me a lot to understand how to implement : https://www.youtube.com/user/pythoncursestutorial

Very useful tool to understand (by visualization) Python "funky" syntax like :
list1 = list0[:]
x, y = 10, 14
http://www.pythontutor.com/visualize.html#mode=display

Great list of online Python courses on Codecademy
http://www.codecademy.com/groups/python-fro-beginners/discussions/5168241ffd62d12b10004c46

Interactive online Python console lab from Codecademy
http://labs.codecademy.com/#:workspace

For later use (I'm not there yet) :
http://pyglet.org/doc-current/programming_guide/quickstart.html
http://inventwithpython.com/

Monday, March 24, 2014

Les lunettes


La métaphore de la paire de lunette

Voici une leçon assez important que j'ai mis du temps a comprendre – cette métaphore se base sur le fait indéniable que nous sommes fondamentalement différent - et appliquer ce que dit quelqu'un a son propre compte est potentiellement problématique.

Je m'explique - je suis myope et ma correction est de -2.32 dioptrie - j'ai des lunettes qui corrige ma vue, elles ont été conçue pour moi et moi seul, et je vois parfaitement avec.

Maintenant si j'entends quelqu'un qui se plaint de ne pas voir correctement parce qu'il est myope, presbyte, borgne, semi-aveugle ou louche et que je décide que, parce que mes lunettes me permettent de voir parfaitement - je vais créer une copie de mes lunettes, et les lui faire porter ; je suis de bonne foi mais la réalité c'est que cette personne bien sur va me dire qu'il n'y voit rien et je vais le regarder incrédule - "comment?! Il se moque de moi, je vois parfaitement avec" et si je tente de le convaincre qu'il doit se tromper car ces lunettes sont véritablement capable de corriger la vue... Je m'obstine comme un idiot et tout le monde comprends cela.

La ou ça dérape un peu ...

Pourtant c'est bien ce que nous faisons lorsque nous essayons de convaincre quelqu'un de nos opinions politique, religieuses, en terme de langage de programmation, d'art, sexualité, de système d'exploitation, d'alimentation et de pleins de sujets philosophiques (et de sport?!). Immanquablement un conflit se met en place, soit j'accepte de porter les lunettes que l'on m'offre (et je verrais parfois terriblement mal) soit je refuse de les porter et parfois j'essaie de convaincre l'autre personne de porter mes lunettes (ce qui devient super drôle).

En tant qu'interlocuteur ma position en cela est très simple, j’écoute .. j'assigne mentalement un pourcentage de plausibilité et très important je ferme ma gueule - maintenant si la personne me pousse je lui dit merci mais cela est ta façon de voir les choses et ensuite si il insiste encore je fais la même réponse que le Dude :"it's like your opinion,man!

Conclusion

Ma conclusion c'est qu'il est contre-productif d'essayer de convaincre quelqu'un que mes lunettes (mes opinions) sont les meilleures, effectivement elles le sont, mais que pour moi.

La vérité est subjective.

Wednesday, March 5, 2014

Python : Virtual Call-centre agent

Still progressing and learning Python

I started a call-centre management program in Python previously to perform hiring, and firing employees
Now my program will simply emulate one of them while he's chatting with a customer (or caller). This is basically an "conversation" based type of program similar to the well known "Eliza".
I choose for this experiment Bob Prezkovic (while he was only tier1 technical support front-line post-sale agent) 

Here's the program I tested it with Python 2.3, 2.5 and 2.7
It's based on a dictionary of keyword associated with 3 possible answers
and a loop.


You can test it here : http://labs.codecademy.com/CDbx#:workspace

This is the kind of "absurd/nonsense/surrealist" discussion you can have with Bob :

Hi, my name is Bob how may I help you?!
Caller:  I want to discuss a problem I have with my recently purchased product
Bob: This is a common issue
Caller:  oh really?
Bob: why would you say that?
Caller:  I'm surprise of your previous answer
Bob: usually, that is considered out of support
Caller:  what is your name again?
Bob: Sir, we are not supposed to give you our full name
Caller:  no, just your first name
Bob: My name is Bob
Caller:  great, so what can you do for my issue?
Bob: Really?
Caller:  yes, it's a technical issue and you are the technical support
Bob: I will need your serial number
Caller:  it's blablabla00111222
Bob: why would you say that?
Caller:  you asked for the serial number
Bob: usually, that is considered out of support
Caller:  you mean it isn't the serial number then?
Bob: Can you rephrase that, please?
Caller:  where do I look for the serial number on this product
Bob: I don't know where exactly I'm checking the FAQ
Caller:  no way
Bob: usually, that is considered out of support
Caller:  okay bye
Okay, talk to you later ...

Friday, February 21, 2014

Python - a list of call-centre Agents (2)

It works!

After many test and searches - the corrected code works


and it can be tested here
http://labs.codecademy.com/CBXj#:workspace

What does it do?

The program creates a call-centre, by populating it with new employees (2 ways of adding them - when the object Centre is initialized, or by using the method hire() later)

Then after the object (my_ccg (My Call-Centre Grinder)) is created - it's possible to fire or hire employee and to display the staff (using the method display()).

NB : I posted a question to Codecadamy forum at http://www.codecademy.com/groups/simple-python-projects/discussions/530723017c82ca60f300287c

Python - a list of call-centre Agents

Coding is fun

Since my previous post on Python - I've finished the Python module on Codecademy
and now I'm practicing with an exercise of my own - trying to create a call-centre model.

The idea was to create my first class - Agent to store the call-centre employee
then to create another class - call-centre which is basically a list of agents

Then as you may notice the code isn't working, when it comes to hire or fire an agent -- because it simply can't retrieve an agent in the list.

There's more explanation as to know why in the comment

http://pastebin.com/1XE5e3Bw


Coding is challenging

When I started this code, I had a very rough idea of implementing an agent class
- it will be in the staff or not (hired, or fired)
- it will interact with other (so far, no interaction - but maybe swap shift, or having likes/dislikes toward other agents)
- it will manage his stress level (burnout attribute)
- it will be promoted (level attribute)
- it will answer call
- it will go on break
- basically it will generate a log file of activities

At this stage, will have to implemented too - a call generator, and a shift class

But that's for later - the next class I created was the call-centre itself - thinking that it will be easy to simply organize all agents as a list within the call-centre.

I just have to figure out - if that's the best way to implement it - by finding a way to retrieve a specific agent within the list (which doesn't happen in the current code).

Or simply to change the strategy and how I currently handle the managing of the class Agents. My idea is to post a question on the codecademy forum.

In the meantime, sharpening a bit the basic Agent class is necessary - before I get into the call-centre class ..

I will keep posting my progress, I'm excited.

Thursday, January 30, 2014

Why learning Python is a good thing

Lately I've been addicted to learning "Python" from CodeCademy -  https://www.codecademy.com/catalog/language/python - to form a habit you have to do something daily for around 3 weeks, but as I'm already on my 10 days streak ; I know that I'm doing myself a favor.


It feels good to have a daily little challenge and while I'm not too fond of "sudoku" - I like to flex my old knowledge of developing language - after all I used to know Turbo Pascal, Turbo Basic, and Turbo C++, and had some java experiences too ; I always felt that in  order to know about computers I had to learn how to program.

why Python?

The fun thing about programming language, is that it almost always involve endless arguments like "language X is the best because this or that" and my first experience with programming started with Gw-basic (and everyone would agree that it was the worst programming language).
But those discussions are really trivial - the important thing is To code.

Python is attractive because it's pre-installed on OS X and Linux (although the version might differ greatly) - it can run interactively through the terminal or can run files and frankly can handle pretty complex project (myPaint if I'm not mistaken is written in Python).

what benefits?

Spending 5 to 10mn each day solving puzzles on codeCademy is fun,  giving me a nice feeling of achievement to start the day and in the long run - it feels good to realize that I've made progress and can now write simple  Python scripts.

CodeCademy is a great website to track efforts, and to motivate people to continue.

Incidentally 2 stories lately picked my interests - one was about a generous developer who offered a homeless guy a challenge and the second was the interview of CodeCademy creator Zach Sims by Stephen Colbert - these 2 success stories revolve around the passion for coding.


Another thing inspires me and that's making a game - (maybe involving a call-centre simulation?)
Why you shouldn’t make a game (or, why you should make a visual novel) | Kinetic Literature: Answer: probably not good game developers willing to work for free. ”Developer” tends to be a profession with relatively high demand, and a correspondingly high market value. $50 per hour is on the low end of what you can expect to pay a freelance developer. Similarly, good artists expect to be paid for their work. When it comes to art, there’s a wider spectrum “acceptable” qualities (and prices to go with them), to get a good idea of what’s available, browse around the Deviant Art jobs forum.

But that would be in the long long run...