Books/mythology/stuff discussions moved to: loopingworld.com

This means that the site here won’t (usually) be updated and I’ll eventually copy all of book-related posts over there. The rest of the stuff will stay here for as long the site stays up (not planning of pulling it down for the foreseeable future).

UPDATE: I’ll sporadically still post here, but it will be for writing about roguelike development, tracking my own (lack of) progress, or other quirky gaming things.

Posted in: Uncategorized | Tagged:

Game design: Pillars of Eternity and character creation

Me to my brother: “hey, there’s another game beside Bloodborne that got 93 on metacritic.”

His answer: “Pillars of Eternity? Who cares. That game is born old.”

People on the internet: “I really hope this sells a lot and publishers take notice of this and see the very presence of a large audience that doesn’t want/need focus tested, dumbed down games.”

And me? Pillars of Eternity is an example of modern design that dumbs down the games we loved.


I was reading how Pillars of Eternity revolutionizes RPG rules:

Since I’m dealing with similar design issues let’s be polemic. The specific argument here is character creation. They try to fix the problem where you can potentially create a character that sucks. They say it’s bad.

Spoony summarizes well why it’s not, watch from minute 19:35 to 24:30, where he actually talks about point allocation, “you are a bunch of pussies and coddled babies”, “THEY THINK THEY ARE BEING RETRO”:

Of course I thought about that, and of course it’s not a new problem, and classic RPGs all tackled it in some way. Most of the recent D&D versions give you a number of methods to create a character, and you can definitely see a general trend going from early RPGs to the late ones. In ancient times it was all about the dice. There are systems where you roll everything. You roll for your age, race, class, statistics, profession and so on. This means it’s all random and the “fun” is just to roleplay whatever comes up. Even if what comes up is a beggar covered in rags and without a leg.

In a actual RPG with people this might be a little easier, but it’s not very fun if you play a computer one with a set content that requires some minimal competence (in doing the tasks). And so you see the trend in modern games. You don’t roll anymore the dice, but you use a “point system”. Where you can purchase improvements, maybe with an adaptable system where higher values also cost more points.

Is there a good solution? Nope, that’s the point. There’s never one better solution. A point system has the negative consequence of making every character the same. If I make a warrior then I’ll put the points in similar things, if I make a wizard I’ll go for high Intelligence. Since the point system is more “balanced” the result is in characters that have very little diversity.

It’s the reason for my system I went for a classical solution. I want to see a system that offers a lot of variance, and that also means that it should cover all types, from those that are awful to the walking demi-gods. I like a system that is potentially open to everything, more than a “game” system where all characters are just “game classes”.

That’s a basic difference between an actual RPG system, that builds a world. And a game system, that builds a game.

Pillars of Eternity went for the game system. Instead of having statistics that define a character for what it is (personality, aspect, physical and mental qualities), they decided to only use statistics that are exclusively combat related, and class-generic (which is their idea of innovation).

Instead of Strength, they have “Might”. Which is no actual Strength, like what you can lift and carry. Nope, Might is just a damage bonus, and it applies to all possible damage. So you are a wizard, your magic dart will deal more damage if you have more Might. Or “Intelligence”, that increases your area of effect or duration. Even if you use some melee skill.

Guess what? None of this is new. Blizzard, who would sacrifice all RPG substance for game-y purposes, has removed the stats point allocation in Diablo 3. The moment you remove the idea of numbers that define your character, you have essentially a talent system. Or a modular system where instead of putting together incremental bonuses you instead assemble modules of “effects”. Which is usually better received by players since you juggle “fun” skills, instead of meaningless +0.1 increments (and this is the whole axis that divides Diablo 3 from, say Path of Exile).

That happened to World of Warcraft too. Out goes the talent system where you juggled a myriad of incremental effects, in goes the system where you juggle an handful of skills/modules. Streamlining ALWAYS DEMANDS MORE STREAMLINING.

Pillars of Eternity solution isn’t smart or even innovative. It’s an half-assed compromise who had the only purpose of doing what Blizzard did, but without giving the impression they went that way (and so pissing off those who expect an actual RPG). It’s THE MEDIOCRE MIDDLE-GROUND. Where you are too scared of going “all in”.

The fundamental difference between designing a consistent system that builds a world, so all scales, all characters, from the crappiest one to the god-like immortal status. To a system that builds a “game”. Where the system only knows and builds “balanced” tools. Where every character is merely a combat-oriented device, and the only definition it has, and the choice you have, is what kind of attacks you want to perform. That is no different than deciding what kind of weapon to use or power-up in God of War. The “character” is no more. Streamlining cuts the corners. To cut your cardboard character they give you scissors with a rounded point so you don’t cut yourself and make a “bad” one.

The problem is that Pillars of Eternity doesn’t know what it is. It is legitimate to go for the second style of system design, but once you go there you should know what you’re making. If you decide that statistics have to be always balanced and only applying to combat, then BETTER games have figured out that at that point it’s good to abandon +1 increments to make players juggle more hefty modules that are directly more interesting. A character is no more.

Pillars of Eternity offers what is essentially a spell-making tool. Take this damage component, add this area of effect. But since you don’t have control on the actual spell (beside picking a class), you end up with a system where those fixed choices are applied to ALL “spells”. And in the end it means this point allocation really creates no concrete difference. No actual impact. It doesn’t give you control or choice on something that is actually interesting, since it’s just +1 bonuses applied across the board, and since everyone has the same numbers because the system needs to be “balanced”.

So the conclusion is that Pillars of Eternity first emptied the classic statistics system. Then kept it there, as a relic of old times, modified in a way so that it becomes a modular system, but not completely. It’s a partial fix that doesn’t fix anything. That doesn’t innovate anything. Because it only comes out from a type of design triggered by an identity crisis: of being a computer game that also wants to be a classic RPG. If they think character customization needs to be tightly controlled to avoid “bad” characters then you should have the courage to hand out the character and removing the point allocation, since it concretely does nothing at all and is only kept there as an illusion of control, while thinking players are gullible enough to not see it through for what it is.

Game designers who want to make classic RPGs even if they don’t know what they are. And so make copies that are empty, soulless shells, that have nothing of what make the originals good.

A copy, of a copy, of a copy. With the original image progressively fading. There’s AD&D, then there’s Baldur’s Gate, and then there’s Pillars of Eternity, who thinks “knows” batter than AD&D and so goes to “improve” it. Poor fools. There’s no AD&D left there, only an empty shell that, for the kind of game they make, is only baggage.

If I say all this it is because elegant modern game design is frequently starting to take shape around “afterimages” (it’s happening for Dark Souls-likes too). Only the last stage is remembered, vaguely. The one before is forgotten. So is lost the origin of those mechanics and their purposes, their history. The fact is: without memory you can’t expect to fix or improve anything.

A classic, Pillars of Eternity, is not. Being a classic requires memory.

Roguelike: Ranged combat rules

Pasting here my considerations on range combat rules. Maybe someone else can find this interesting. I'm also open to suggestions.

Of course with the awful coding skills I have even implementing a rough shell of all this will take me forever. But at least IT SEEMS there's nothing technical that looks impossible.

In the end my game will never become real, but MAYBE someone will be inspired and will go down the same path :)

Now that I have a rough line function that deals properly with FOV and walls I think I have the technical basis to start integrating some form of ranged combat into the actual game combat. But I figured out that before I can do that it's better if I have a good idea of the ruleset I'm going to use and all the features it needs to have.

Of course I'm not inventing anything here, so I went looking how ranged combat works in various rulesets, taking out the individual features I like, and then integrate them into my own system. The goal even here is that the number of "moving parts" determines the actual depth and complexity of the game. So more moving parts, more potential complexity. On the other side the system needs to be "realistic" so that these moving parts behave consistently. This means that if they do behave consistently then the game mechanics may be complex, but also intuitive.

So here's the various points I'd ideally cover:

  • While a sword usually has the Strength stat adding to the damage, a bow only have its own fixed Strength. This means the character stat only determines if a bow is usable or not, but if in excess the Strength is not added to that of the bow, which is fixed (realistically).

  • Knock and draw delay. Since there's going to be a rough facing mechanic, I can determine if a character is being actively "threatened" in melee. If so you just can't knock and draw the arrow or bolt. If instead the arrow was already prepared, then of course it can also be shot at point blank. Knock and draw delays are fixed (maybe with a small "Agility" bonus) and happen automatically as long a ranged weapon is equipped. Swapping from melee to range of course takes some time.

  • I'm integrating an aiming mechanic by default. Preparing an arrow is not enough to shoot properly. The idea is that I'll use the character's Dexterity attribute. The Dexterity determines the speed at which the skill "fills out". If for example a character has 80% in the bow skill, he still can't simply draw and shoot. It takes time to take aim, and this time slowly fills up the skill. So for example in a round a character might fill 50% of his skill. Meaning that our guy with the skill at 80% gets an actual 40%, if he waits one more round he might get to 65% and only after waiting a third round he might shoot at his full 80%. This because since I have a classless system I also want to avoid a scenario where characters eventually max all their skills and so end up identical. If stats matter then it means a mage might focus on the bow skill and become very good with it, but the Dexterity still determines the time it takes to "fill out" the skill value, and so affecting directly the rate of fire. Meaning that in the end there's a potential for a great archer, but not one that was built precisely with that goal.

  • Range is divided in tiers (and tiers depend on the weapon stats). Every tier adds a fixed penalty to the roll. This obviously means that firing at long range makes the target much harder to hit. The penalty is fixed, meaning that a character with a lower skill might be completely crippled. If the penalty matches the character's skill then the shot is simply impossible (unless he rolls a lucky critical).

  • Another penalty depends on the movement of the target. Whereas range penalty is fixed, the movement penalty is proportional to the character skill. So the target might move in a way that gives a 25% penalty. This penalty is applied to the skill. If the character has an 80% skill then he shoots at 60%, if he has 40% he shoots at 30%. So it applies proportionally and in a different way to the range penalty.

  • Dealing with actual aim, the possibility to target a precise location. I'll probably handle this so it's based on a "rigged range". In general the location is determined by rolling dice. Taking a precise aim means adding a penalty to the hit roll, and then a bonus to the location roll. The more distance the more the location roll can be actually guided. But this should provide the effect that if you aim for the eyes from far away then you're still more likely to hit the head or upper body rather than the legs.

  • During the flight of the arrow, for each actual target encountered there's a fixed, arrow-based % to hit the target (friend or foe). So if you actually aim to hit something behind something else, the arrow still has to fail a roll to hit the first target in the way. For the actual aimed target the to-hit roll depends on the weapon skill, for accidental targets instead the roll is fixed. And for every target the arrow passes a penalty is added to every consequent roll. Meaning it's more likely the arrow will miss if it passes through multiple targets without hitting, simulating the fact it's likely to hit some piece of armor and get deflected (also simulating the fact it's more convenient to aim at someone in the front, rather than aim someone in the back with the hope the arrow hits someone along its flight. If you aim someone in the back you just make more likely the arrow hits no one at all).

  • Damage is obviously done with the fixed weapon strength as described above, plus the arrowhead type. So there might be arrows that make worse wounds, cause bleeding, or pierce armor, or stun. Stuff like that, but only affecting the damage roll.

All this to explain an idea of design I have: detail and complexity open the way to meaningful combat with interesting mechanics. And it can all work in a simple and intuitive way as long the rules are transparent and behave consistently.

Of course coding all this is an entirely different matter.

Roguelike rarity: classic ToME 2.3.5 + Theme 1.2.0 (Windows binaries)

Currently “ToME” is a roguelike game available on Steam. This post is instead about of an earlier version that is unique and completely different. It (this post) also previously appeared on the Reddit roguelike.

I consider this fairly important because this game is a rarity. This site is partly about recovering precious things that are otherwise left behind, overlooked and forgotten. And recovering that specific flavor that is now lost. This game is probably so huge and “epic” in scope that you’ll hardly ever find again something like it. Its existence depended on a number of things, and that made it unique.

Usually the vanilla Angband should take an experienced player about 20-30 hours to win on a single run. For someone who isn’t as experienced probably at least twice as much (but then you wouldn’t survive very long in that case). Of course playing a roguelike means failing, learning and repeating, so those who play them easily end up putting hundreds of hours into them. In this case this version of ToME can be considered a much bigger version of Angband, so I have no idea what kind of numbers we have here. You could think playing games being an hobby. In this case ToME isn’t part of the hobby, it would make an hobby by itself.

Of course, I like this. I like specifically the ideal of something so big that is outside of human possibilities to play. I like the idea of something so ambitious that its existence is improbable. This game approaches that delicious madness, and so I’m writing about it here.

I was reading on CRPG Addict his report about Moria and so I went looking for the roguelike family tree to see how the game developed. I like longer, epic roguelikes more than those that are fast and repeatable, so the idea of a very long progression and deep character development appealed me (and if you have more suggestions, please add them).

From Moria comes Angband and from everything I read there’s really no reason to prefer Moria. Angband is just a richer and improved version without any downside (it seems). But then I remembered that about a year ago I was looking into the older ToME, an Angband successor with more flavor and content, since someone told me that the newer ToME was much streamlined, and with a comparably smaller world, with shorter dungeons and so on. That piqued my interest and I looked more into that, learning that Tome 3 was a dead end, and that the only “pure” version of ToME that remained was 2.3.5, and that it was only maintained by some guy, with a few bugfixes, only available as source code. So I spent some time trying to compile it on Windows and after a few struggles I finally succeeded.

As far as I figured out, whereas Angband is about a descent down 100 individual levels of dungeons, with one town on top, instead ToME 2.3.5 takes the 100 levels and splits them across a number of different dungeons (Barrow-Downs / Mirkwood / Mordor / Angband) that are then scattered around an explorable world map. This means that they expanded and opened out the structure, creating a wilderness “overworld” zone to explore, with different towns and dungeons. On top of all that they also added another cumulative 260 levels of “optional” dungeons to add to the first number (Orc Cave / Old Forest / Helcaraxe / Sandworm Lair / The Heart of the Earth / Maze / Cirith Ungol / Land of Rhun / Mines of Moria / Small Water Cave / Submerged Ruins / The Sacred Land of Mountains / The Tower of Dol Guldur / Erebor / Mount Doom). But not only, this version of ToME also has built-in an optional module that once again greatly expands the basic game, adding a lot more stuff and more Tolkien flavor all over the place, including more quests, items, monster types and so on. It seemed also very well received, at the time, and since we have the very last version I also hope it’s relatively stable and bug free.

So I’d love to read about experiences about this. The best thing would be if someone decides to revisit it. I have the Windows binaries I compiled, packed with tweaked settings that solved a few issues I was having, so it should be good just unpacking the .zip and run the binary. This version was compiled at the very end of 2013, so one could think it’s outdated, but looking at the source commits absolutely nothing was changed in the meantime. The version appears as 2.4 in the game, but of course only minor bugfixing happened after the official 2.3.5, and as far as I know this could be considered the most up to date and working version of the lost classic ToME (plus the Theme module that expands it).

And, given the amount of content that seems packed there, probably something unique that no other Rogue/Angband/Nethack successor can match.

Anyone want to pick the challenge and try it? I’d like to see reports about how it stands the passage of time and how it matches compared to the other, many, Angband successors. Oh, and it would be great if someone eventually wrote an in-depth guide about the most important ones, because it’s impossible to actually know what sets each apart…

Here the links, one is a screenshot of how it looks out of the box, the other is the zip with the binary:

I’ve played a little bit on my own as a total noob.

The game is still filled with lots of counter intuitive things. For example, if you enter a particular building in the first village you get hit by thieves and put in a jail. You can wake up and escape but as a level 1 you can’t kill the thieves on the level. So restart.

The first level of the dungeon has no stairs going down. Eventually I could find a special room that is locked. After numerous attempts the door opens and inside there are a few bandits and a princess calling for help. I tried, of course, but I was only level 2 and later figured out I didn’t save the allocation of skill points for some reason, and I was even wounded, so died again in two hits.

The third time I wait until level 3, fully healed and with skills allocated. This time I was more careful but the bandits still damaged me a lot, so I retreated toward the exit of the dungeon and when I knew I was safe I tried to land a few more hits before leaving. I was lucky and I was able to kill the bandit, and got enough experience points from that single kill to level up a few times. Whoa! I think I went from level 3 to level 6 straight away. Then when I returned to the princess I found her between two impassable glass walls and had to look up on the internet to figure out what I was supposed to do. It turns out the quest log tells you to kill six bandits, but beside the one I already killed there was no one else around. Eventually I figured out they spawn around the level and appear and disappear from time to time stealing for you. In the meantime something weird also happened and I started to be followed around by a massive amount of “friendly” creatures, including a guy who kept telling me my shoes were unlaced. It was kind of weird. When I finally killed the last bandit the princess said she was free and asked me to pick a reward, and when I returned to her spot there was now the reward on the ground, along with the actual ladder going down…

It takes some time to figure out what the game wants you to do. Other small mechanics, like the need for a light source and food, do not seem annoying as the stuff is very cheap and lasts for a very long time. So, it’s a fun game, but kind of quirky and opaque in the way it works.

This is what the first level looked like:


Another version, still level 1:


And this is level 2:


Anime Decadence

A week or so ago I decided to revisit a Japanese anime that I loved when I was a kid: Saint Seiya.

The rewatch has been a surprising experience because the anime not only is still very fun, but the art style can still be amazing today. I went digging for some volumes of the manga, and this is one of those RARE cases where the adaptation (the manga comes first) is way, way better than the original. The anime does the exact contrary of what typical adaptations usually do (that is, downscaled, simplified versions). For example you’d expect the armor complexity to be simplified for the anime, compared to the manga. It’s the opposite, the anime armors have been redesigned and are way more beautiful and complex than they are in the manga. The same for the story, where in the manga some scene can be thrown away in a handful of pages, in the anime it’s much better developed, with inspired direction, great use of music, much sharpened tension and lofty drama. It’s no wonder that this series was popular all over the world. It’s plain obvious that the team behind it had many talented people.

In fact, this anime is so great that I began seriously wondering WHAT THE FUCK happened to Japanese animation in recent times.

Look at this. Here’s a screenshot from something done in 1987. Almost 30 years passed, and this is a common television series, not a movie or an OAV:

And now look at how it becomes in a movie from 2005:

ARGH! WHAT HAPPENED?! Twenty years and everything’s gone to shit.

I’m pointing at this because I see more of an overall, pervasive trend, instead of a single case. There’s something beautiful in how the old anime were drawn, the medium itself and the physicality of it, those ink lines that are never uniform but more coarse, with a varying thickness. More organic to the image. Colors and light more natural compared to brightened, flashy ones and the sharp cut lines of modern animation. That first shot from 1987 looks as beautiful today as it did at the time. It doesn’t become obsolete.

Of course I’m aware there’s plenty of good stuff today, amazingly drawn, colored and animated, but I also see the pervasive trend that is widespread around the most common, commercial series, and that’s the bad part. Saint Seiya WAS a common, commercial and popular series. There’s something in how anime were made in those past years that makes every shot so beautiful and that instead looks plain ugly and flat in modern animation. As if all life and soul have been sucked away.

See this other example from a more recent Saint Seiya series (or this other one):

And compare to this:

Or even compare this and this. They seem from a completely different source, but only two moments just a few episodes apart. Yet, the second one, even if displaying a much lower quality, retains the charm of those bold lines. A charm that is completely gone from modern anime. What I mean is that it’s not just a matter of quality and detail, but of the actual texture, the physicality of the work itself, the tools used. You can take any anime from the eighties and they all have that special something, a beauty that is timeless and unsurpassed.

Of course there’s more to this discussion. It’s about technology and art, and it is common across the media. It applies to anime as it applies to cinema. The film grain of some old black and white Super-8 Kodak film gone out of production just can’t be achieved now. The secret is that movies can be better than life. Reach for an ideal dimension that is more. The medium itself, the process, has a unique beauty to it. Its own soul and unique aesthetic. Modern technology achieves higher fidelity and realism, but it also loses something in the process. Realism can be a value, but it does not have to be. Modern processes replace obsolete ones.

Something invaluable is lost. Things get better but there’s always a loss. A beauty irreplaceable, but forgotten.

(Since I’m taking screenshots as I watch, you can “manually” browse them. Currently they start from http://cesspit.net/misc/anime/seiya03.jpg and they go up to 39.)

Updating All The Things – 2

Since the provider moved to a new Linux distribution, last year, I had to work to unfuck the site. It was using an old version of Drupal that was also modified by me, updating to newer versions has never been possible because it meant losing a lot of the custom features I needed. So all the work was about making that old piece of software run anyway despite a rising number of incompatibilities and problems everywhere (can’t expect things to run smoothly when you are using server software that is almost nine years old).

I actually succeeded, in the last few months the site was up as it always was, but it was kind of annoying keeping it that way since every time there was some database reboot I had to manually update certain things to make it run again. So every few hours I had to check to make sure the site was alive.

Now I finally completed the process. Both my sites (this and loopingworld.com) are now on WordPress and no more running on ancient software (still, my nine years old engine runs several times faster than this up-to-date WordPress despite LOTS more database queries and overall more complexity, don’t ask me why). The links should be preserved, so old links should work and point to the proper corresponding wordpress entry. The database was ported over, but of course not perfectly. I think categories were turned into tags and there might be more weirdness.

Locally I also keep a working copy of the old site, but it will stay hidden for the public. At least I don’t need to kick it alive once a day as I had to do lately.

Maybe I’ll try to de-uglify the theme at some point (I eventually did, and what you see is how the site will look for now).

Rape culture, #GamerGate, misogyny and Slow News Day

These are a few forum posts (relatively standalone) where I tried to analyze and explain what the hell is going on. When I’m doing this sort of thing I step away from my own personal opinion and just try to figure out the motives behind all that I see. I try to understand and describe what I see from a neutral point of view.

Notice that I don’t mention Zoe Quinn, because that’s one aspect that I just find baffling and do not understand at all.

So this is my interpretation of what is going on:

All these women (and some guys) are saying is ‘Can we have less violent video games please, with less violence towards (insert choice of concern)?’ and the reaction from the socially conditioned video game masses (that are mostly teenage boys and maladjusted guys) is ‘KILL THEM! BURN THE WITCHES! GAYS!’

You won’t reach your goal by ranting about someone else’s enjoyment because you don’t have yours.

Your actual problem isn’t about the next GTA, your problem is about the need for games that do not exist yet. A market space that you feel is empty. So the goal is: fill that space.

But if your strategy to fill that space is about going against someone else’s space, you simply won’t obtain much (if not reactive hostility).

I’m talking from a purely practical point of view: you will obtain very little by pushing the issue in that way.

(context: game critics or players going against perceived rampant misogyny in games)

The problem is that those critics seek contrast. As I said above, instead of trying to find and develop a new space, they rile against current games.

It’s only natural that someone who enjoys CURRENT games feels like it’s an attack on the things they like. And so all the accuses about limiting expression, freedom and whatnot. It’s like: you’re stepping into my garden with your haughty judgmental stance. You judge things I like, and by extension you judge me as a human being because I like those things (rape culture, every white male guy gamer endorses rape by liking and playing these games). So now I’m going to kick you out. Very vehemently. You’re not anymore a welcome guest.

The core of all problems is this judgmental look from the outside. Someone looks at what you do and what you like, and judges you.

The problem is again that this strategy sucks. If you want new types of games, once again, you don’t get them by confronting what already exists and pretend change (like petitioning to add female avatars in Assassin’s Creed). You simply open that space. You focus on new games that do not exist yet, instead of ranting against games that exist and that you scorn.

But if instead your style is confrontational, then the contrast just escalates in the ways we’ve all seen. Legitimately or not.

Finally, someone came along and said “Hey, whoa, these are some pretty offensive worlds you guys have created, I mean just look at these examples”

This is a judgmental stance.

It reads like “whoa, you are a lesser human being for liking and appreciating this stuff. Feel ashamed of your gaming habits, poor kid.”

It’s the implicit scorn that sets people off: “Haha, look at this kid.”

Are you surprised that then these guys respond with all the vitriol?

Making sweeping generalization only stacks one faction against the other and builds up the hate. I’m simply saying that this “strategy” to address the very issue won’t solve a thing, and is instead likely exacerbating it.

Vile, hateful speech is to condemn regardless of its topic. If there’s more of it than usual, it’s because this war of factions was energized by the amount of attention it received.

The attention itself is good, but too often to defend a position people point to the worst cases in both parties.

I’m persuaded that a majority of the vocal minority is made of trolls who don’t even think what they are writing, they just bask in the mess and are having a laugh. Just because there are lots of people like that, who enjoy the vitriol. It’s like attending one giant rave party that lasts for weeks. They do it merely for fun, and not for the political heft of the issue.

And it’s *these trolls* in particular that create the revolving party. I’m writing about this because my twitter has become 80% clogged by this. And between a number of developers commenting the issue, 90% of their tweets is about POINTING AND LAUGHING at the worst examples.

These developers and players are TAKING THE BAIT, making everything worse.

These are the same people who created the #ResolutionGate because Xbox output 720p compared to 1080p PS4. It’s just another giant meme.

You know? Slow News Day.

Nothing exciting happens in gaming, waiting for the autumn releases, people are bored. This one topic is just the occasion for a number of people to enjoy the Internet in their own Special way. Everyone else just took the bait and eagerly jumped in the mud pit. Because it’s fun and makes you feel like you belong to a community. And as when kids go around in bigger groups of kids, the naughty becomes the style of choice, because you are anonymous in the group and being part of the group means you don’t feel any personal responsibility.

It’s exactly like city-wide looting, when people get completely batshit crazy just because they are in a group that legitimates all they do.

Posted in: Uncategorized | Tagged:

Setting up all the shit (MinGW-w64 and libtcod)

The original idea was to document all the steps, from deciding which programming language to use, the books I used to learn, the compiler I decided to use, how to set it up, the editor I would use, its own configuration and so on. There’s quite a lot of stuff and it requires quite a bit of time to examine and figure out.

Since I just went through the process of refreshing a few things, I’ll document at least this transition.

The problem I got was that I was looking for a way to convert hex format color codes, like HTML #FFFFFF, converting it to RGB that I need to use to make colors within libtcod (the roguelike library I use to print stuff on screen).

In the end I came up with something like:

This is supposed to work, but in the standard and most up to date version of MinGW it doesn’t:
error: ‘stoi’ is not a member of ‘std’

And if you look it up on the internet you’ll see it’s a bug in the distribution that has been there from YEARS. On top of that, this standard version of MinGW is lagging behind with updates.

So I started looking again for alternatives and found two:

I went with the second that seemed more widely adopted but, honestly, the documentation sucks.

“Mingw-builds Project” and “Win-builds Project” on the sidebar lead to the same page. And on that page you find again both options:
Mingw-builds project
Win-builds project

Both seem to target Windows, so I don’t know the difference. I decided to go with the second option that more explicitly targeted Windows and that looked like based on a more stable version. So I end up on another different site:

The documentation here is worse than sparse. We get a:
“Installation on Windows can be done for MSYS, Cygwin or without them.”

Initially I tried a barebone install, but eventually I found out there was no “make” in this package, and to compile my own game I normally use a basic form of makefile. MSYS instead is a tool that creates a Linux-like shell under Windows. Normally it is not required, unless you want to compile other stuff that makes also use of Linux commands and the like. This is OFTEN the case when you want to compile other games and libraries.

So I knew that MSYS at least included “make”. But the MinGW package here does not include MSYS. If you follow those instructions on that page you get:
for MSYS: run it from the command-line as: yypkg-1.4.0.exe –deploy –host msys

But if you do this, the program asks WHERE you have installed MSYS. So it’s obvious that first you have to install MSYS, then you install this MinGW on top of it. But, go figure, if you install MSYS it will ask you where you have installed MinGW. So read on and lets figure this out.

Since I needed MSYS, I went looking for a standalone MSYS package, and reached this other page:

Have I already mentioned the documentation sucks? Because that page there gives you three package options, the last of which is said to be more inclusive. So you go grab that one, but when you look in the archive you notice there’s no “sh /postinstall/pi.sh”, which is exactly the command it tells you do execute to configure the program.

So, instead of downloading that third package, I downloaded the middle one. In this case it had the configuration script. BUT the important point here is that you don’t need to execute that configure command at all. So all those three packages will be fine, and you should just choose them depending on what kind of features you want added (if you are a noob like me you’ll probably use none of them, so you could as well go with the first package. Though, as far this guide is concerned, I personally used the 2nd).

Before starting to install stuff I’ll mention that whereas installing MSYS included with standard MinGW puts MSYS within MinGW itself, instead if you go with the option of installing MSYS, then it’s MinGW that goes into MSYS. So you’ll only interact with MinGW through MSYS itself.

Let’s start installing stuff. Since I work in D:/, I’ll install MSYS in D:/msys.

That second package I downloaded comes in just a “MSYS-20111123.zip”, so I’ll simply unpack it in the directory, making sure that MSYS bin directory becomes d:/msys/bin

At this point you’d normally execute D:/msys/msys.bat opening a Linux/DOS prompt (right click on the window top to set properties as you like, like buffer size, font type and useful QuickEdit mode), so that you could give it the configuration command. But with MinGW-w64 this step should be skipped.

Then I proceed to install MinGW-w64 itself, downloading the package manager from win-builds.org and launching it through the command line/DOS prompt:
yypkg-1.4.0.exe –deploy –host msys

It will ask you to install i686 or x86_64. As far as I know it’s basically 32bit or 64bit. Since I’m on 64 bit I decided to try with 64 by default, and it’s also possible to install both and then switch to the version you want to use through a command given to MSYS. But consider that when I tried to install both, after it finished installing one and started to fetch packages for the other, IT CRASHED. This is not a big deal since you can just relaunch the installer, but it’s a better idea to install 32/64 separately, so running the launcher twice.

After you tell it which version to install, it will ask for MSYS directory, so I give D:/msys which is the root where /bin should be, and press ENTER. Then it will automatically download the packages from the internet and install them.

The whole thing (32+64 bit packages, and MSYS) takes about 1.2Gb on the hard disk.

Now is the time to configure MSYS. Since the package manager seems to install MinGW within MSYS, so that the 32bit and 64bit versions can be freely swapped, there seem to be no need to mess with Windows PATH or MSYS configure scripts.

Instead I used this command (explained here):
echo ‘. /opt/windows_64/bin/win-builds-switch 64′ >> ~/.profile

This essentially switches by default to the 64bit version. Whenever I open msys through the .bat, it will be already set up to work in 64bit toolchain, with all the paths set correctly. If you then type gcc -v it will look up at the right version of gcc it has internally (4.8.2 at this time).

Apparently no other tweak seems needed. I was able to compile my game alright, so the paths should be already set correctly.

In short:
– Install MSYS separately by simply unpacking the archive in a directory you want to use.
– Launch the MinGW package manager through the command: yypkg-1.4.0.exe –deploy –host msys
– Pick either 32bit or 64bit version, or both, and tell it to install into MSYS root directory (where ‘bin’ and other directories are)
– Launch MSYS with the .bat file in its root, and give the command to default to either 32 or 64 version, like: echo ‘. /opt/windows_64/bin/win-builds-switch 64′ >> ~/.profile

Now the problem is that if you want to use 64bit, libtcod library is instead compiled as 32bit version, so if I now try to recompile my game at 64bit it will fail because it says the library is not compatible.

So I went and had to recompile the library itself on 64bit. Yet, this also requires a further step, because the SDL it uses also needs to be in 64bit. Since SDL1 is not available in 64bit, I had to compile it myself. So I downloaded the sources for SDL 1.2.15 (because for some reason SDL2 is INCREDIBLY slow with libtcod), launched through MSYS: configure, and then make.

It compiled alright. Then I only had to move the compiled SDL-1.2.15\build\.libs\libSDL.dll.a to libtcod-svn\dependencies\SDL-1.2.15\lib\mingw

And finally I had to tweak libtcod makefiles, because they use mingw32-gcc and mingw32-g++ that do not exist in this MinGW-w64, so renamed them to just gcc and g++

To compile libtcod I use, from its root: make -f makefiles/makefile-mingw release

Also consider that through my various attempts I was often getting compiler/linker errors. I eventually found out that some data was lingering in C:\Users\username\AppData\Local\Temp\libtcod so make sure the Temp directory is clean if something goes wrong

This should be enough to compile the library fine. The tool to compress the .dll at the end will fail, but the libraries still work well for me.
EDIT: You can obtain here a more recent version of UPX that compresses 64bit files. Just download and move upx.exe to dependencies\upx\win\ in libtcod directory. The makefile will use it automatically, and you can also use it manually to compress SDL dll as well your own game exe, if you want.

So finally, after having both libtcod and SDL compiled in 64bit I could also compile my own game fine. Caveat: it now requires another dll to run: libwinpthread-1.dll, which does not seem to compile statically. So you have to go fish for it in MSYS/MinGW directory and move it to your game dir.

But otherwise it actually runs, and with a nice 8-10% speedup in my case, compared to the usual 32bit version. And std::stoi compiles fine.

Last tweak: D:\msys\etc\profile can be edited so that every time you open msys.bat you are already in the directory you want. At the very bottom there’s a line cd “$HOME”, so I commented that out and edited to what I needed:
cd “D:/foe/foetest”

To update this distribution of MinGW-w64, when new packages are released, go into /msys/opt here there should be one or two directories, for 32 or 64 bits, pick the one you want to update, navigate into, for example, /opt/windows_64/bin and (hopefully) just double click on yypkg.exe it should check the repository for updated stuff and install everything automatically.

Posted in: Uncategorized | Tagged: