Auto-virtualenv, now with more magic

Following yesterday’s post about Auto-virtualenv trick, today I managed to fix the issue of “auto-virtualenv loses the virtualenv if you go into a subdirectory of the directory with the .venv“.

The only change is the _venv_cd function. All the other alias still remain the same.

function _upwards_search {
    venv=""
    curdir=`pwd`

    while [[ `pwd` != '/' ]]; do
        if [ -f ./.venv ]; then
            venv=`cat ./.venv`
            break
        fi
        cd ..
    done

    cd $curdir
    echo $venv;
}

function _venv_cd { 
    if [ ! -f $PWD/$1 -a "$VIRTUAL_ENV." != "."  ]; then 
        deactivate
    fi;
    \cd $1
    venv=$(_upwards_search)
    if [ -n "$venv" ]; then 
        venv $venv 
    fi
}
alias cd=_venv_cd

Next step: remove all this stuff from my .bashrc, move to a single file which can be easily sourced inside your on .bashrc and drop it in a repository somewhere.

NOTE: Apparently, there is something wrong with the test for empty venv. Hold down your horses for a sec.

NOTE 2: Ok, problem solved. Also, the repository is now live at https://bitbucket.org/juliobiason/auto-virtualenv.

My magical auto-virtualenv trick (without VirtualenvWrapper)

One thing that pissed me off a few days ago was working in a Python project with some modules and switching between virtualenvs every time[1]. So I quickly hacked a solution.

But before going further, let me say that the solution is highly based on VirtualenvWrapper — to the point that I’m using the same environment variables. I just didn’t want to install a whole package for a simple feature.

And, without further ado…

The whole thing started with two alias added in my .bashrc, one to create a virtualenv and another to “active” the virtualenv. Today, they look like this:

export WORKON_HOME=$HOME/Venv
function venv { source $WORKON_HOME/$1/bin/activate; }
function mkenv { virtualenv $WORKON_HOME/$1; venv $1; echo "$1" > ./.venv; }

Nothing fancy here: I’m using WORKON_HOME exactly as it is used with VirtualenvWrapper, to point the directory where all virtualenvs sit. Then, to avoid going full path to activate them, I can simply use venv <virtualenv-name> to activate any virtualenv and, finally, to create virtualenvs in the right directory, I have mkenv <virtualenv-name>. Simple as that.

One thing you may notice is that I’m saving the virtualenv name in a hidden file inside the current directory, called .venv. This is what makes the magic happen.

Then, I have this script + alias:

function _venv_cd { 
if [ ! -f $PWD/$1 -a "$VIRTUAL_ENV." != "."  ]; then 
    deactivate
fi;
\cd $1; 
if [ -f ./.venv ]; then 
    venv `cat ./.venv`; 
fi }
alias cd=_venv_cd

This basically replaces cd with my function, which checks if the target directory have a .venv and, if it does, activate the virtualenv (so I don’t need to use venv anymore in normal situations); if there is no .venv but a virtualenv is active, deactivate it.

The only problema I still have is that going up inside the project/module won’t check if there is a .venv in any of the parent directories and, thus, would disable the virtualenv.

[1] It was just a matter of “keeping each with their own”. The whole project goes around creating modules for a web framework and each module must be capable of working standalone, without the others.

My Take on Grim Dawn

Before the end of the (previous) year, Crate Entertainment decided to give early access to all backers of Grim Dawn. Well, it just happened that I was a backer — although not an “early access backer” — on their Kickstarter, so I had the chance to play it.

Just beware that everything I say here is based on their alpha, which have access only to the first Act and not the whole game. So I bunch of things couldn’t be accessed yet[1] and some things may change till the final release.

What’s Grim Dawn, anyway?

Grim Dawn is yet another ARPG, much like Diablo and Path of the Exile. The engine is a full 3D engine, which allows you to rotate the screen in any angle — although keeping the classic isometric view.

The story is somewhat intriguing, although not at all too different from other ARPGs: A race called “Aetherials” enters “our” realm and start turning humans into zombies, which puts the human race in the brink of extinction (I just read the Wikipedia page and it seems that the extinction was not brought by the Aetherials alone, but actually from a fight of the Aetherials and the Chthonians, the first trying to turn humans into an army and the later trying to kill all humans before that but I don’t remember reading anything about Chthonians in the whole first act, although I skipped most of the reading till the very end.)

Your character was saved in the last minute from a hanging due being possessed by one Aetherials. The whole story seems that it will float around the fact that you are now “infected” with aetherial material, which grants you some special abilities — opening rifts, for example, which can be related to “town portals” in other games, except require no special skill or item, require no mana and, be used as many times as you want and allow you to pick any other portal around (so not just to town, but to any other point you already know).

The whole environment is quite interesting too: instead of going full fantasy, Grim Dawn seems to be centered in a not distant past, as you can use fire weapons — pistols, rifles and shotguns — along weapons you’d find in any other ARPG — crossbows, swords, daggers, clubs, maces — not to mention the gear, with some heavy armor floating around leather jackets and such.

Getting your feet wet

When you start Grim Dawn, you’ll see your last played character, an option to jump to the next one or, if you have none, you’ll get straight to the character creation screen, which is as spartan as it can get.

2013-12-31_00002

It was my first surprise: No class/profession selection? No customization at all? Just “name” and “male or female” options?

Actually, yes, that’s it. It seems Crate took everything that was not really necessary for an ARPG and went down to the very bare bones of an ARPG. It’s so down to the bones that there are only three attributes to use: Physique, for health and armor usage; Cunning for attack speed; and Spirit, for your mana bar and mana regen.

2013-12-31_00004

Speaking of mana regen, some time after attacking or being attacked, you’ll receive a fast health regen. I’m kinda divided about it: First, it gives you some chance to recover health without resorting to massive health potion chugging — although the potion itself have a cooldown and, fortunately, gives health at once instead of simply giving you “regeneration” — or some other gimmick like health orbs dropping from time to time, but, at the same time, the simple fact that you can simply start running around your enemy, without giving it the chance of attack you and without attacking, will give you a massive regeneration feels so… gimmicky.

Becoming one

Even if you start with a clean slate, at level 2 you can pick a class, which will dictate your skills and abilities. There are 4 classes you can take then, which can be easily related to the “usual” ARPG classes:

The Soldier is, basically, the classic warrior:

2013-12-31_00005

The Demolitionist, although with a name like that, is basically the ranger/archer stereotype, without the pet and with a preference for fire weapons:

2013-12-31_00006

Occultists take the position the mage stereotype position in classic ARPGS:

2013-12-31_00007

And, finally, the Nightblade takes the assassin/rogue place:

2013-12-31_00008

I just need to stop here and point that there is nothing telling or even stopping you from using weird class/weapon combinations: You want to make a pistol solder? No problem, the game will not stop you from doing it so. The only barrier is that some skills — which I’ll show next — will require some specific weapons (for example, the soldier have a skill that requires a shield, the nightblade have skills that require dual wielding melee weapons and so on).

Going up

Once you pick your class, you’re presented your skill tree. And seriously, Grim Dawn rivals Path of the Exile in the “this will require some thinking” tree.

2013-12-31_00009

You have actually two intertwined trees: The basic one, at the bottom, indicates your class proficiency — the higher, the more skills are available to you, increasing your basic stats at the same time[2]. At every level, you gain only 3 points, which you must allocate in those two trees — which is the part that makes it something you may need to think ahead: You can make a very meek character with very strong skills or an incredible build character with weak skills.

2013-12-31_00010

Balancing the trees is, obviously, the way to go, but how do you balance it is the part you’ll have to look for a while before just clicking away.

Oh, and if you think that’s easy enough, at level 10 you get the chance of getting a secondary profession:

2013-12-31_00030

And the second tree is not at all tied to the first class: Adding points to the second tree will earn as many attributes as the early levels — so you’re gaining attributes for a level 2 character instead of a level 10 character, but you need to put those points to open skills!

Going above the baseline

There are upgrades, like any other ARPG. The difference here is that there are no slots in any piece of gear: Everything has the ability to carry an upgrade beyond those in the gear itself.

2013-12-31_00021

Once an item receives an upgrade, it can only be upgraded with the same piece — you can’t mix two different upgrading elements in the same piece of gear. On the other hand, “upgrading” an upgrade component will complete its set, which can grant better results — pretty much what would happen if you complete a set of gear in other ARPGs, but with upgrades.

Gear sets are also available, although in my play time I only found two pieces of one set.

2014-01-01_00001

Going around

As I mentioned before, because you have been infected by the aetherials, you can summon personal rifts at any time, although only one rift can be open at the same time. Beside those, you can also find stable rifts all around, filling the “waypoint”… erm… “stereotype”?

2013-12-31_00019

And, as I said, one you open a personal rift, you can go anywhere:

2013-12-31_00017

Oh, and, in case you didn’t notice, the world is massive. I’d say that one map (from waypoint to waypoint) is actually larger than Path of the Exile maps.

The final tidbits

Obviously, there are other things in Grim Dawn that every ARPG have. Weapon swaps, health and mana potions and Vendors, for example:

2013-12-31_00018

In the case of the vendors, you’ll notice that items can have 3 different colors: Yellow means it’s a magical item (there are three other “quality” colors: red for set items, blue for named items and green for magical with better stats); Red means you don’t have the necessary attributes to wield that item; and Gray points that you don’t have enough money to buy the item.

The idea is good, but sometimes it falls to its knees: If you don’t have the coin and the attributes to buy something, the colors mix in and you can’t say if you can’t buy it simply because you need a few more attribute points or you need attribute points and coin. Yes yes, in the end, it means that you can’t use the damn thing, but it still annoys me, somehow.

Grim Dawm have a full economy with “iron coins” being used on sell and purchase, which I personally think it’s uninspired when compared to the barter system in Path of the Exile. On the other hand, it makes things easier, I guess. Also, as a side note, the whole time I played the game, the vendors never had something better than what I already had. Either that or I’m really bad at stats.

There are also factions, although I didn’t notice any difference in game play with it.

2013-12-31_00023

There are also destructible objects, which can contain loot:

2013-12-31_00016

One of the downsides I found is that the minimap encompasses the whole visible zone, without any visible zoom indicator, which completely removes the “fog of unknownness”. The only way to see where you still have to explore is through the full map.

2013-12-31_00001

And finally, when you’re low on health, the whole screen will get darker and the borders will point out that you’re in a really bad shape.

2013-12-31_00025

Conclusion

At this point you’re probably asking yourself “So what?”. And I admit, there are very few interesting things in this piece of my opinion besides the skill tree. That’s because the most interesting thing in the game can’t be shown by images alone.

It’s its atmosphere.

Seriously, the visuals are darker with an amazing track which in very few times reminded me of the old Diablo games[3] which will keep you on tense the whole time: My right thumb is hurting by putting too much pressure on my mouse.

And the environment is really dark sometimes, which will reduce your vision to barely anything and will force you to navigate using only the minimap. And the maps are smartly designed to have some wet spots which will break your concentration by changing the noises and visuals.

And, to be honest, the story picks up really fast, to the point that after a while I decided to finally stop and read what was going on ’cause things were doing turns all the time.

Although I sunk more than 10 hours in the first act alone (8 with a single character, which was the only one I could finish the first act), I still think there are some points the game could improve:

First, voice acting. I admit that maybe this is asking too much, but I didn’t feel too interested the whole thing because there were too many walls of text. The story picks up and you start reading, but maybe I’d feel more into the story if I had someone to hear.

Second, the mini maps really needs some zoom and the “fog of unknown” zone needs to be smaller. If I need to explore around, I’d at least like to know if I’m not running around in circles.

Third, the maps could use some random generationness. I mean, 4 different characters and the maps were all the same. That makes me wonder if there is any replayability once you complete the whole campaign (well, besides multiplayer, that is).

All those are minor, in my opinion. The game is interesting enough, the skill tree is enough to keep (or, at least, to keep me) playing for a long time just to level up and open all those skills, the story seems incredible well written, even if you may skip most of it due the lack of voice.

At this point, with the latest build (released on the last day of 2013, nonetheless) I’m really not regretting backing Crate on this endevour, even if the final release seems to be a bit late — but honestly, with the quality shown so far, I guess no backer can be pissed if they still want to do some clean ups.

[1] Fun fact: After you complete the first act, the NPC which will probably grant you access to the second act zone only says something around the lines of “This is the end of the alpha version. In the future, you’ll be able to access the whole game”, which your character replies with “I can’t wait!”

[2] I didn’t notice any change in the attribute gain by class (like one could expect that the soldier would gain more physique per level than an occultist), but I could be wrong here.

[3] Compared to, say, Torchlight 1 and 2, which are pretty much the same musical tone, but that’s because Diablo 1 and 2 and both Torchlight games had the same composer.