2015-01-06

A Quick Review of USB flash drives from Apacer, Sandisk and Strontium

In the course of building my USB thumbdrive based ceph cluster I tried USB keys from three different manufacturers with a total of five different varieties of USB drives. Here are my impressions of them.

Apacer
I have used 3 of the 8GB and 3 of the 32GB drives, both of the USB 3.0 Pen-Cap model (PBTech: 8GB | 32GB). One of the 8GB and 2 of the 32GB sticks failed (50%!). I have personal data on them so I don't want to return them for a refund in-case the failures are not total. I have had great feedback about these sticks from others and I did love the speed. However, they do run quite hot and perhaps the heavy IO loads of ceph melted them. They do have a blinky activity LED that is a gentle blue. The drives will stack on top of each other but are a too wide to stack side-by-side. However, stacking does increase the heat problem. The actual usage space is about 28-29GB this was low compared to competitors but the drives tended to be a bit cheaper.
The price probably makes them great for your briefcase/backpack but I wouldn't recommend them for high-usage.

Sandisk
I have 12 of the 8GB Cruzer Blade drives and one of the 32GB larger slide-cover Ultra3 thumb drives (PBTech: 8GB | 32GB). The Cruzer Blade style drives do not have an LED but thankfully I have had zero failures. The Cruzer Blade drives stack both horizontally and vertically in USB ports with a tiny bit of touching. The Ultra drive is too wide and tall to stack in USB ports but it does have a small blue activity LED. The Ultra3 would be my favourite USB drive for the briefcase/backpack because you get more usable storage than Apacer, the price is not much more and there's no cap to lose.

Strontium
I have four of the 32GB JET USB DRIVEs (PBTech: 32GB). These are much too large to stack multiples in standard USB ports, though you might squeeze them in stacking vertically. I love the price, performance and reliability. The Strontium thumb drives have a red activity LED and they have never failed me. These are my favourite drives for Ceph -> when I want reliability. They do come with a cap - which I don't like for a briefcase/backpack drive though.

It should be said that the economics of running CEPH on USB flash drives doesn't add up. USB hard-drives give better price per GB and probably better performance too (particularly on my old laptops).

Read more about my Ceph Cluster.

IFCOMP2014: With Those We Love Alive

With Those We Love Alive written by Porpentine and scored by Brenda Neotenomie placed 5th in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

Porpentine is one of the few authors I know much about. I have played CyberQueen, Cry$tal Warrior Ke$ha and Howling Dogs. Those works, and Porpentine’s interviews and posts keep me thinking the relationships between the tools, the medium, the story and how these produce a final work. Hagiography over.

I particularly WTWLA for the rich symbolism invoked with small amounts of text. I like how this game looks like it could go well onto a small screen. I’m not sure if the "select my preference" purple links had an effect on the underlying game but that didn’t matter because it helped ME construct a coherent picture of the world and how the relationships within it worked.

The game invites you to draw symbols onto your skin. I did not do this but I see how it could enhance the game. It would further immerse the player into the world and fit well with the way that time passes in the game.

The game is technically well crafted as prior actions etch onto other parts of the environment. The recognition of my prior craft reinforced how much my character had supported the machine from which I wanted to escape. Going along to go on. The music and colour changes support the story well.

Overall I was interested in where the story was going and how it got there. There are some lovely symbolic moments that will mean different things to many. I particularly like the princess uprising. Beautiful.

Highly recommended.

IFCOMP2014: Laterna Magica review

Laterna Magica by Jens Byriel placed 42nd (last) in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

This work occupies an interesting place for me. I’m not sure it intends to be FICTION. I read this as a dialogue between yourself and yourself as a way of exploring / confronting your own thinking about new age spirituality. YMMV on subject matter like this... I found myself having to just buy-in to certain beliefs in order to continue. Ugh fine, it’s fiction.

As an IF-work: I like the idea of using IF in a dialogue manner; a form of education, a conversation a reader can have to learn about things. This is different to Wikipedia where knowledge is presented in chunked totality. This mode of education is an unfolding journey. I’d love to see work where the conversation changes based on what has come before – that would unlock great educational potential.

I initially couldn’t find an ending and went around in loops trying to explore as many answers as I could. I get this was the whole point; to come and go as I choose but there is no end to this quest/questioning. I’m going to admit to cheating and eventually reading the source code to make sure I got everything – ha! It turns it there is a proper ending - this is sort of a maze game afterall.

I don't recommend this game.

IFCOMP2014: ICEPUNK review

ICEPUNK by pageboy placed 31st in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

A neat post-apocalyptic loner back story and an interesting narrative where you go around slurping up data out of the landscape. The interface riffs on old text console games and features some retro ASCII art. The map is randomised. The map was a bit clunky and slow to navigate – probably a feature of my impatience and my older computer.

The task of slurping up data got a bit tedious. It became more score-keeping than a chance to revisit the items of culture the game presented as data for the taking. It became less an unfolding story than a chore to complete. I did encounter one potential show stopper bug that gave a totally blank screen. I got around this with some console tricks.

Booting up the computer gave a simple victory screen. About what you’d expect.

A story-line with the inhabitants of another bunker basically opting-out of the game wasn’t particularly well followed. Neither was the initial screens of gender selection.

I score this game well in technical merit. The back story was cool, but too much was exposed via exposition in the opening scenes rather than discovered as the story unfolded. I suspect the author had high ambitions but unfortunately ran out of time. I don’t want to sound at all discouraging, because this could be a great game story if polished and honed.

IFCOMP2014: Begscape review

Begscape by Porpentine placed 28th in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

I went for this game because of its simple aesthetic. It feels like the PeopleSoft style text games from the 1970s (e.g. Chris Gaylo’s Highnoon). Those games helped me learn to program! I have done some fairly faithful conversions of these old games to Twine and Arduino. This means I already have an affinity for the style of game.

The choices are brutal and limited; even by the standards of the 1970s games. But those limits are the story. Poverty is not only about money though that becomes the basic means of maintaining health. Poverty is about resources; health, mental, charisma, and connectedness. That this game doesn’t let PC me do a bunch of things RL me could do (borrow, ask a relative or friend, apply state benefits, work for food, etc) speaks exactly to that.

Perfectly sized and I love it.

IFCOMP2014: Hill 160 review

Hill 160 by Mike Gerwat placed 36th in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

This is the first parser game I've played in quite some time, so it took me a bit of getting used to things. 3 hours in and ... well I opened up the walkthru and realised I'm not even quarter of the way there. But I really want to finish this game - find out what is going on.

It's probably my noob-ness with modern parser that make things a bit slow. Getting killed happened often, but it was great I got instant retries. Some of the continuity got a bit patchy - ie I was able to put things back into a locked cabinet without opening it.

Research was generally great except that: Sargeant is a non-commissioned officer rank. The story-line assumes Grant is a junior officer. It might work better to change Grant to a Lieutenant and Grant's entry to the army as an officer cadet. I was able to overlook this slip though to enjoy what bit of the story time allowed me to play.

I get the feeling that CYOA might've suited the game better than parser because the narrative pacing could be better controlled. While parser gave the illusion of freedom, the "narrative rails" the game was on were on quite apparent. It wasn't like I had the agency to do much except what the story next required of me. Still, this is my first parser play in quite some time so take what I said with a grain of salt.

Big game. Very engaging. A bit more testing and polishing and it would be great.

IFCOMP2014: The Secret Vaults of Kas the Betrayer review

The Secret Vaults of Kas the Betrayer by A. E. Jackson placed 33rd in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

As I started to play I got the strong feeling of a Fighting Fantasy novel - nothing to do with the author's surname. Cool - I have boxes and boxes of FF books in my garage so count me as a genre fan.

There's an interesting enough back story with enough depth for a FF story. The room-with-options-that-you-return-to is common enough in FF stories but SVKB gives too much freedom to move backwards and forwards. FF generally made the PC move the narrative forward as a general rule with only the occasional looping room. The looping room having to repeat text is a limitation of dead-tree format. In SVKB looping text felt nostalgic at first but quickly became annoying. I like computer based IF because it frees me from too much looping text. I wanted a short-cut back to the poem from puzzles. Eventually I just opened the poem in another browser window.

The writing could do with edits. Coding generally well crafted. Parchment styled CSS was nice enough though the default Responsiv storyformat grey header/footer should've also been brought into theme.

I think basing the game on tightly built rooms with options made the game feel small. There are 66 Twine passages though the density of <<if>>s make comparison with a FF400 not exactly useful. However, Fighting Fantasy made the 400 paragraph limit feel like large world because the decisions had a mixture of actions that had large and small effects. FF covered a lot of ground in passages like: you walk for a few hours and ...." or "you pass through a village of nondescript buildings that look much like each other."

At times I was a bit confused which links would examine things and which would perform actions on those things. Typically an examination action does not change state (except time, or triggering something as you walk to the NOUN). FF made this clear by usage; usually clear verb phrases. I like the style where links embedded in text examine / think (don't change state) and links at the bottom of passages DO things (change state). There isn't a correct answer though; do something that makes sense!

I keep coming back to the genre thing. I wonder if a tightly woven room puzzler with freedom to move back and forth might have better suited Inform. As it stands emulating the rooms in Twine worked well enough.

I did enjoy myself. That FF nostalgia was too strong for me to resist.

2014-12-23

IFCOMP2014: Arqon: A Criminal's Journey review

Arqon: A Criminal's Journey by H. J. Hoke placed 39th in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

You play the part of Arqon - a criminal basically forced to work as an assassin for the bureau of magic. It took me awhile to get used to which commands worked - probably my lack of familiarity with parser games. I encountered a few bugs:

In the room before meeting the hermit the description said I could go up, east and west but exits said I could only go west and up.

After killing the Hobgoblin and meeting the hermit:
*** Run-time problem P47 (at paragraph 663 in the source text): Phrase applied to an incompatible kind of value

I almost couldn't make the game work after that. #sadface And just as I was starting to have fun...

Ok, I managed to get past that bug and a misspelling of hermit as "hermet". Then the game was over. And just as I was starting to have fun.

A few things: a criminal recruited as an assassin ... yeah maybe. Your inventory being left intact after being imprisoned... nope. The mayor hanging out a few levels deeper than the dungeon... nope. If the placement issues were fixed then this could be enjoyable enough to play in a larger version.

The writing could do with some proof reading and edits. I didn't mind the combat, but I blanked over the combat text since it didn't seem to matter.

The verdict: skip this game unless there are major updates.

2014-12-22

IFCOMP2014: The Black Lily Review

The Black Lily by Hannes Schüller placed 17th in the 20th Interactive Fiction Competition IFCOMP2014. You can play online at ifdb. This series of blog posts are mini-reviews I wrote as a fellow author to document my impressions of other games.

Spoilers below

At first I thought this was some story about a man reaching a point in his life where he was deciding to leave aside the passions of the flesh and settle for more stable relationships. This was some bookish withdrawn guy who lived a quiet but comfortable enough life. Then I met Lily. What the heck! So I go back and open up the safe. Oh. I'm a murderer. Heck. So I play again. I'm also maybe a woman. Well that shows how much I'm projecting into the story.

Yeah, my suspicions were raised by the title: The Black Lily being similar to the Black Dahlia (a murder victim). As I played I saw the recurring Black Lily motif as some kind of marker - a symbol that linked the encounters into something to be left behind. But then it became a great plot device to represent the urges of the player character without giving too much away.

At first I wondered why the shower scene was needed. Why not just go straight to the albums... but in the end it made sense. This was the time to discover the identity of the character and I missed it.

The commands were easy enough and the world richly described. I didn't get all the endings or much of a score. But Yep. I liked it. Play time is under an hour and you might want to play a few times.

2014-12-06

Display text at end of passage macro for Twine

I was helping Harry Giles out with some modifications to his IFCOMP2014 entry Raik. It became useful to set text early in the passage that would be shown only at the end of the passage.

An easy way to achieve this in Twine with custom macros. They are <<atend>> ... <<atendd>>.

::PassageTitle
<<atend>>

This text appears at the end of the current passage.<<atendd>>And this text appears in the usual place.

How do you use this in your own projects? Add the following line to your StoryIncludes:

http://raw.githubusercontent.com/tweecode/TwineQuest/master/macros/9999%20Macro%20atend.twee

Why might you want this macro? Here are some examples. You be inside an <<if>> macro from which you want to set a choice to appear at the end of the passage. You might be using the excellent ReplaceMacros from Glorious Tranwrecks and want to have text that always appear at the end of the passage no matter what the state of the rest of the passage.
Please share / comment / like - your actions guide me on what to write about.

2014-11-19

IFCOMP14: The Entropy Cage Post-Mortem

The Entropy Cage (play | ifdb) was my entry to the 20th Interactive Fiction Competition (ifcomp2014). This post mortem is also posted in the Interactive Fiction Forums.

My thanks to all the players and reviewers. I’m overwhelmed; 14th was much higher than I expected. The reviewers (even the ones who disliked TEC) all gave me valuable feedback that help hone my craft.

Here are some random thoughts:

The feeling of the game was meant to capture how an out of their depth computer tech feels when there’s a major system meltdown. The boss is on their back being both helpful and accusatory (push-pull) while the tech bashes the keyboard hoping something will work. That feeling of awkwardness doesn’t make for a particularly fun experience so I shortened the game during testing to lessen the uncomfortable. The mechanic left no room for overtly showing progress or mastery so wasn’t a good choice of mechanic to base a game around and/or my execution was lacking.

I didn’t mention why the PC was on suspension. A few reviewers worked out that it was because the PC is actually out of their depth/incompetent. As the “first cyber-psychiatrist” there can’t have been a training course, industry accepted best practise or established performance indicators. There’s an underlying current of injustice because the PC feels they’ve been judged against invisible criteria. The PC has signed up for a job with a wizz-bang buzzword job description and the actual job has failed to deliver (psychiatry with that interface? are you kidding!) More than likely an overly-optimistic programmer (Jake) over-promised then underdelivered. The over-promises were then embellished by an HR person who glammed up the role to cover for a crappy salary with crappy T&Cs.

That does leave the question of why Jake gives the final big decision to you. Jake has no idea what to do! Rather than flipping a coin he gives the decision to you so that you can be scapegoated when it goes wrong. (Neither choice would 100% avoid negative consequences). The fore-shadowing to this are dialog choices where Jake mentions suing you and that Jake will insta-fire you if you threaten to bring in your lawyer.

Unfortunately the PC’s POV doesn’t give a particularly good lens into the religious war the subs are fighting. You only see the zombified subs (I’ve been bad, punish me) and the refugees. I will explore adding some “soldiers” into the mix to expose more of the battle story.

Starting with the alarm clock was noob. I’m cutting that whole scene. In terms of the game physics, it slightly alters how much your boss hates you and lets you choose a personality type that affects the game in only subtle ways. The scene is gone - and I get to remove a drug reference warning (the wake pills).

I want to write more in TEC universe.

True Random has interesting metaphysical implications relating to divine simplicity, tawhid and creation; a realisation I came to after reading Gregory Chaitin on Algorithmic Information Theory, the Omega Construct and Meta-biology. That’s pretty hard maths so I’ve tried to present some connotations of that via fiction.

Algorithmic governance and the related issue of big data are real world issues that have ethical dimensions we should probably discuss as a society rather than let things just happen. Driverless cars are the tip of the ice-berg.

And personhood; what rights do subsentients have? They are effectively our slaves. At what point do they become begin to the rights we accord our biological pets.

About that sub.punish() theme. Totally an accident. Sorry. It is going to be removed from the post-comp release. But, the ifcomp version will always live in the TEC cannon. The story would’ve been a very different one if I’d explored the sub/punish angle! I’m going to keep the term ‘sub’ (subsentient subroutine) but .punish() will become .reseed() to better fit with the theme. Those who enjoy innuendo still have an interesting angle with .reseed() but the terminology change provides a more solid clue to the overall theme of the work. Reseeding is a term used in pseudorandom number algorithms.

The science is pretty fleshed out in TEC: I’ll hope to reveal more of it in future works. But here’s a tidbit. Adding a bit to Base16 gives Base32, not Base17. TEC is consistent because the Forward Error Correcting codes cover a larger block of memory that contains more data than just the PID.
Why does changing error correction have anything to do with randomness? As a clue; Here’s some pseudocode that generates a truly random number:
> a = 000000000000000000000000000000000000
> b = 000000000000000000000000000000000000
> while a equals b, loop
> rand = number of the bit that is different between a and b?
The loop does exit because computers aren’t isolated from their environment.

And on construction:

I committed to the contest too late. I tried to enter last year but allowed IRL things to get in the way. This year I let IRL things slip in order to make IFCOMP. I’m glad I did because entering creatively re-energised me. I should’ve committed earlier so that I had more time to polish the game. The mainloop that controls the game pacing wasn’t written until the day before submission deadline. me.punish(): You may commence with the flagellation… hahaha actually no, really not my thing.

I considered not entering but decided that I NEEDED to. It’s been a rough several years and I’ve been creatively out of touch. My self-esteem needed to get an “achieve point” even if that was having participated into last place.

I suck at editing. No matter how many times I read and re-read, mistakes always slip through. I’ve put huge effort into improving but I’m not there yet. I’ll try to collab to get more testers and people with editing skill to help me; but I know collab will increase the lead-in time before I need to commit. I didn’t edit out all the universe specific jargon that added little to the game. Simu-sleeping, holosplays... ugh. Yeah, they paint the picture of the TEC universe but in the nugget sized TEC game they were distractions.

I intentionally aimed TEC towards the strengths of click-fics to give the pacing I wanted. TEC as a parser game would’ve been very different.

Thanks again to the reviewers for their feedback. I tried to personally thank you all, but it became too much to track.

The post-comp release of TEC will also be put into the Android Play Store. You’ll see me back next year and not necessarily with a story set in TEC universe. As much as I’d like to try enter more IntFic competitions, I still have IRL concerns. Whaddup PhD!

Play The Entropy Cage in your browser. Playtimes are about 15 minutes.

2014-11-17

My first Android App: FantaGen

I figured it was past time I made an Android app. So I made FantaGen - a fantasy name generator. These types of things are a dime a dozen. I added some expressiveness and aim for more variety to next-level it a bit.

You can get FantaGen from the Play Store

These types of generators are good for a bit of harmless fun but they do have a serious side to them. You can use the generator to help break some writer's block.

There are two cultures that have strange names: Simptee and Star Spirits. These were based on a simpler generative name system that was using for a now abandoned interactive fiction project. Basically, it made sense in that story to have characters with names that weren't always the same. I thought the names were kinda cool so into FantaGen they go. Code recycling is good.

There are tons of fun image generators doing the rounds at the moment. These usually take the form of having the reader build up a name by looking up alternatives based on letters in their own name or their birth month. While these are fun for a single lookup, they don't give much variety for doing 10 random names at a time. My own feeling of these is that 26x26 alternatives is simply not rich enough when the user can see ten items at a time and refresh every half second. Significant extension to the generator is needed to add enough variety to be interesting.

I'm particularly proud of Fairy Names and Star Spirits. Fairy names uses both vocabulary words and syntax variety to create fun diversity. When I can picture the character that goes with the name then I think the effect is good. The Star Spirits mix both words and syllable combinations to represent their angelic like culture. The syllabary is fairly restricted to match how I image their angelic language to be so the word-based titles help to create the variety.

The Roman name generator combines a syllabary with some real Roman names based on research. The syllable based names are most likely anachronistic nonsense. Though it would take much more work to do a historically accurate Roman name generator given how complex their naming patterns are. In particularly I don't handle the gender very well at all: Claudius / Claudia. I would like to do more name generators based on real cultures since that sort of ties into my semantic web interests.

Speaking of interests; this project also represents an interest I have in generative creativity. I want to be doing actual research into generative graphic design tools once my PhD is complete.

FantaGen is free and always will be. I have plans to continue extending FantaGen. As the list of generators grows I can see some ripe experimentation in how to navigate that space to keep things fun. I'm open to suggestions for new generators too.

2014-10-29

An Experience of Orcball

Orcball is a team sword sport similar to a touch version of Rugby League except with padded weapons. I can only find references to it at Waikato University. The day I joined was a training session. I intend to publish a more technical article for those with a background in sword sports.

The people are friendly and welcoming. The emphasis seems firmly on having fun and improving skills. Players can borrow weapons from the Orcball club. You can see play videos online here.

As a new comer I was asked to use a single long-sword. This is a sensible safety rule until they figure out that I’m not going to bash through the opposition while ignoring all hits. That did make my life a bit difficult because I was up against people with sword and shield and long/short sword dual wielders. Apparently the game itself has rules that reduce dual wielding and shields.

The boffer swords are heavy compared to foam swords and even to sport-fencing weapons. They are made from PVC pipes padded by dense foam and wrapped in duct tape. The construction also has “thrust-safe” tips. They were still light enough to thrust single handed.

The weapons are heavy enough that a hard swing still inflicts damage. The rules require a gentle touch and no strikes to the head. These are sensible safety rules given that nobody wears protection. Afterall, this is meant to be a casual game that almost anybody can join. Valid target areas are: above the knees excluding the hands and head.

Mutual strikes in Orcball are termed “Irish” and do not count as a hit but there seems to be a wide interpretation of this rule. Irish includes mutual hits when the swings are simultaneous (even when the strikes are not) and therefore excludes counter-attacks.

The no-head-hit rule did get a bit frustrating. Opponents often left their heads open and I couldn’t strike! But this is Orcball and them’s are the rules and for good (safe) reasons.

I’m about average height but I happened to be taller than the opposing team. I switched to a finger grip where the index finger goes over the cross-guard and around the front of the blade. This made lowering the blade angle easier and increased point control. I wouldn’t have done that if the fingers/hands were valid targets.

It also takes a reasonable amount of fitness to play well. I’m not fit and sat out more than once to rest. Also, Orcball’s play on grass and tons of lateral movement meant I ruined my ankles. Oh well.

Verdict: would play again.

2014-10-08

Ceph repair inconsistent pg placement groups

If you run Ceph for any length of time you may find some placement groups become inconsistent. The Ceph website has a handy list of placement groups statuses. The entry for "inconsistent" is what you'd expect; there's a difference between replicas of an object.

ceph pg dump | grep -i incons | cut -f 1 | while read i; do ceph pg repair ${i} ; done

(from here)

Get the cluster as healthy as you can before attempt this. Ideally the inconsistent placement groups should be at "active+clean+inconsistent". That means first resolving any missing OSDs and allowing them time to heal. If the OSDs don't seem to cooperate try restarting them and then retry the above command.

Explanation of the command:
ceph pg dump
gives a list of all pgs and their current status.
| grep -i incons
find only the lines containing "incons" - short for inconsistent
| cut -f 1
we only want the first field from the output
| while read i; do
loop through each line (one per pg), storing the pg number in a shell variable called i
ceph pg repair ${i}
instructs ceph to repair the pg
; done
signals the closing of the loop

The above command has always worked for me, but there are things you can try if this command doesn't work.

The ceph website says that inconsistent placement groups can happen as an error during scrubbing or if there are media errors. Check your other system logs to rule out media-errors because they may indicate a failing storage device.

Good luck!

2014-10-01

Ceph on USB: Back to LVM.

Consider this a diary post. Perhaps the war-story is useful.

A further update on my Ceph cluster. I was running BTRFS v0.19 and the performance was horrible. This is most likely a very early version of BTRFS and I am running on very under spec hardware. While the future of BTRFS is bright, it is not for the nodes I have running now. I’ve reverted all my OSDs on USB keys back to XFS. That gave an instant 2-3 times speed up on writes.

I found a good deal on a second hand server with a generous case, 8 gigs of RAM, dual gig Ethernet ports and a decent enough CPU. It already has 3 spinning disks on-board and room for plenty more. I need to rearrange my office space to fit it in so that’ll take a couple of weeks.

I also have the budget to upgrade my desktop machine. The parts that come free after that upgrade will be built into another ceph node.

The other neat thing was creating an init.d script to automatically find and mount the lvm volumes, startup the OSDs then mount the Ceph filestystem. I needed something that performs this task quite late (read: last) in the boot process so that all the USB devices have had a chance to wake up.

So, once some work and deadlines are cleared then there'll be exciting things happening with my ceph cluster.

2014-09-19

Eraserhead (1977): Obsession and Compromise

Directed by David Lynch, IMDB

This review is based upon my impressions having immediately watched the film. I have since been informed that noted film critics differ from my views. But, this is my review so YMMV. And spoiler alert.

Eraserhead has multiple overlapping themes. The protagonist (Jack) coming to terms with new adulthood and fatherhood is covered elsewhere. A former student of mine says the film was about being uncomfortable in everything about yourself. To me there are two further themes:

1. Ending an obsession to clear mental space for the new. In this theme the baby represents a grotesque and under-formed idea on which Jack has begun a collaboration. While others abandon him, he is driven on by obsessive responsibility and social pressure. Once Jack has killed the baby then, metaphorically abandoning the bad idea, that new and better ideas come to him.

2. A catharsis for David Lynch as he comes to terms with what he then saw as selling out or compromising. In doing so he knows he will have access to greater resources with which to achieve greater ideas but that comes at a cost. This interpretation stems from how the symbols in the movie are interpreted.

The women in the film stand in for various genres. He sees lesser men flirting with the woman next door. What have they got that he hasn't? The smiley dream woman is the mainstream crappy film genre. She stomps on his ideas without mercy or guilt, always superficial and shiny but with her own flaws. Jack’s wife represents his early film-making circles: fickle, weak and without the endurance to achieve much of note.

The pencil factory is Jack’s job interview/school exams where he is being evaluated to see if he can produce the sharp but ultimately ephemeral popular movie. Like the pencil, these films are not intended to leave an indelible mark so that they can be replaced on a consumer cylce.

Once the baby is dead, Jack is rewarded with a burst of creative energy symbolised by pollen clouds releasing from plants in his room. The man in the planet then burns - representing Jack mastering his anxieties.

I don't pretend to read DL's mind or have access to any insider info: to my lack I know little about David Lynch. I don't begrudge any creative who does bread and butter work to pay for living and financing their more pure works.

What did this film mean to you?

2014-09-10

Ceph on Thumbdrive Update: BTRFS and one more node.

A few things have happened to my Ceph cluster. The AspireOne netbook was really not up to the job. It is fine for just a few OSD processes but anything more was caused slow-downs resulting in cluster thrash. Amalgamating thumb drives using LVM was helpful… until I wanted to run CephFS. I was time to add another node to the mix.

Read about earlier stories about the Ceph on USB thumb drive cluster here:
Adding another node to Ceph is trivial. This was an old, but much more powerful laptop in every way. I’ve moved the mon and mds functions onto this laptop so now the AspireOne only runs OSD processes. When I add another node then I’ll also run a mon process on the AspireOne so that there is an odd number for quorum building.

The new node uses faster and larger USB keys. These were 32GB – which was both the fastest and cheapest price per GB available at my local PBTech. The new node currently runs two of these sticks in an OSD process each.

I also moved the cluster away from XFS to BTRFS. This was trivial and involved zero cluster downtime. Yes: zero. First ensure the cluster is reasonably healthy, then drop the weight of the OSD using:
ceph osd reweight OSDID 0.1
. Actually I got bored waiting – the cluster was healthy and the pools all had size 3 with min_size 2… so I just stopped the OSD process and removed it from the ceph. Don’t do that on a live cluster, especially where pools have few replicas. But, this was just for testing. Then...
sudo service ceph stop osd.X
ceph osd crush rm osd.X
ceph osd rm osd.X
ceph auth del osd.X


Then umount the backing storage and format it using BTRFS. Then I followed the instruction in my previous tutorial to add the storage back into Ceph. Wait for the cluster to heal before migrating another OSD from XFS to BTRFS.

The AspireOne node has three groups of 8GB keys, federated by USB hub. BTRFS is capable of spanning physical drives without LVM so I removed LVM once all groups had been migrated. Do read about the options for BTRFS stores because the choices matter. I went with RAID10 for the metadata and RAID0 for the data. RAID0 maybe gives better parallel IO performance because the extents are scattered among the drives but it does mean that all block devices in the FS effectively operate at the size of the smallest one. I can live with that.

Three BTRFS OSDs on the AspireOne is sometimes a bit much for that machine. Though, one cool thing about BTRFS was I extended a mounted BTRFS volume with a few more thumb drives, then restarted the osd process. Use
ceph osd crush reweight osd.X Y
to tell Ceph to reallocate space. That was instant storage expansion without downtime on the OSD long enough to trigger a recovery process. I did the whole process in less than ten minutes – and most of that was googling to find the correct BTRFS commands.

The cluster happily serves files to my desktop machine over CIFS. While it’s not a setup I’d recommend for production use it is kinda fun.

2014-08-27

While Loop Macro for Twine

One of the often requested features for Twine are proper loops. It has been possible to simulate loops with a recursion hack but that was ugly. Before we continue go and see the possibilities.

Yes. Those are nested while loops. Here's the code that makes it all happen:
<<set $j = 1>><<while $j lte 10>>
<<print $j>> countdown: <<set $i = 5>><<while $i gt 0>>
<<print $i>>... <<set $i = $i - 1>>
<<endwhile>> BOOM! 
<<set $j = $j + 1>>
<<endwhile>>

You've probably worked out the basic syntax (clever bunny) which is:
<<while $condition eq true>>
Do some stuff. 
NB: update the $condition or the loop will run to infinity.
<<endwhile>>

How do you use this in your own projects? Add the following line to your StoryIncludes:

http://github.com/tweecode/TwineQuest/raw/master/macros/9999%20Macro%20while.twee

You can also download the demo project and .twee file as a .zip archive.

Enjoy!

Please share / comment / like - your actions guide me on what to write about.

2014-08-25

Twine Game Story Authoring 1: Structuring Game stories with Pain and Progress

Twine is a versatile tool from writing game stories. It is freed from the imposition of somebody else's RighWayToDoThings framework and allows the author to focus on what is important to them. The downside is that the author must program everything they want themselves. A previous article discusses how Twine can be thought of from a programmers perspective but don't worry it that article makes little sense. This article is specifically about structuring game stories.

For our purposes, a game story has a mainloop because the story is driven by data. That data might be a map, character stats, an inventory or something else you can dream up. This style of story does not suit a hypertext branching narrative.

The over all structure of the story goes:
  1. Introduction Text
  2. Initialise Variables
  3. MainLoop Passage
  4. Actions Passages
  5. Check Conditions Passages
  6. End of Game Passages

I like examples, so here is a link to the Pleasure and Pain v1 (HTML | Twee) files. Try out the playable HTML version first then take a look at the Twee code in your favourite text editor. In twee new passages start on lines beginning with double colons ::passagename. Pain And Progress is a simple demonstration with two conditional variables. Let's examine the passages and their intent.

Start, RealStart, Instructions
These passages deal with beginning the story, giving background and the option for instructions if the reader so chooses. Here you might add extended about information and links to information about the story and the author.

InitGame
The game re-runs this passage whenever the game is (re)started. Initialise all the variables that your game uses in here. Twine itself does not require variables to be declared and initialised but that can cause awkward side effects if a game story is re-run. Imagine the reader picks up an axe in one play-through, then the $hasAxe variable is not reset and they suddenly have an axe on the next play-thru. Not good - but completely avoidable if ALL variables are initialised here.
Enclose the variable initialisations in a <<silently>> ... <<endsilently>> block so that you can add free-form comments to the variables that will not be seen by the user.
Once this passage has ended then control is passed to the MainEventLoop.

MainEventLoop
This is where the major action occurs. Typically the story might perform any engine initiated actions (e.g. random weather events, monster encounters), display status and provide a menu of actions.

MainStatus
Consider separating status displays so that they can be re-used.

MainActionPain, MainActionProgress
These passages are the entry points from user actions. They start by performing any action related things and then checking the game state. A flag variable $gameendflag lets the game story know if they should print user actions or not. The reason for this is that <<display>> will always return to the passage that invoked it and nothing further from these passages should be displayed if the game should end.

CheckPain, CheckProgress
Perform constraint checks in their own passages so that they can be re-used through the game story.

GameEndLose, GameEndWin, PlayAgain, PlayAgainNo
These passages deal with the game ending conditions. Game stories could expand this list for different ending conditions. The PlayAgain passage ensures that replays will begin again from the InitGame passage.

The Pain and Progress, the passage names are typically prefixed by their function, though prefixing by variable name is also valid. The idea is to make things as obvious as possible.

Hopefully this example will serve as a guide to structuring gamestories and encourage more Twine authors to try this type of story. If you found this guide useful then Share / Comment / Like - because it encourages me to write more on this topic.

Twine Thinking for Programmers

Programmers find Twine's hypertext way of doing things a little strange at first. Twine works well for branching hypertexts but needs some thinking for stories driven by variables. I've done a few game stories in twine - mostly conversions of early BASIC programs - so this is a lessons learned type of blog. You might find this article for useful for any Game Story; usually adventure games, RPGs.

Twine's basic unit is the passage. Passages work like procedure calls. Passages are similar to GOSUB in BASIC. By default passages print their content to the screen and you use tweecode macros to execute game logic.

Passages are "called" by the Twine engine in a few ways:
  • The Start passage is called to begin the story
  • Readers activating [[link]] or <<CHOICE>>
  • <<DISPLAY>> macro within passages.
The <<DISPLAY>> macro is the programmers GOSUB / procedure call. Twine has no GOTO equivalent: <<DISPLAY>> always RETURNs to the passage that called it. Anything after the <<DISPLAY>> macro will still be processed (and output if appropriate) by the Twine Engine. Use <<DISPLAY>> generously - it is the workhouse of programmer-like Twine and the basic unit of code re-use within a story.

Twine's tweecode has only global variables. This means that variables cannot be directly passed to passages - they are <<SET>> in global variable space before calling the <<DISPLAY>> function. Twine allows long variable names so use generous prefixes to distinguish variables.

Twine has no inbuilt loop constructs (for, do, while). Loop constructs can be built using <<IF>><<ELSE>><<ENDIF>> and passages. Here's a helpful article: How to Simulate for, while or do loops in Twine.
UPDATE: I've just released <<while>> macros.

Once your passage count gets higher Twine's diagram based UI can get unwieldy. Programmers used to text-based programming will find it more natural to write in TWEECODE and use the StoryIncludes feature to import files into a Twine Story. There is only a global namespace for passages so ensure that passage names are unique. Passages can be moved between the main Twine story file and included files as needed. Use StoryIncludes and tweecode files as the basic unit of code reuse between different stories.

Tweecode files are text files (UTF-8) that add a few extra things to the Twine macros already used. It's easiest to think of Tweecode files as a bucket of passages - for that most part Twine does not care about the order of passages. New passages begin with a single line passage header and end either when a new passage header begins or the file ends. A passage header begins a line with double colon (::) followed by the passage name. Optionally tags can be added space delimited with square brackets. Here's a brief example:
::Passage Title 1 [tag1 anothertag yet_another_tag]
This is part of passage one.

::Passage Title 2
more content

Twine allows complete access to JavaScript though consider keeping Javascript use to a minimum so that your story has fewer dependancies. If you do use javascript then consider placing custom scripts into their own tweecode files; both for your own reuse and to provide an easy way to find code if it must be later rewritten by future generations. Here are some useful articles: Once you get used to tracking state variables globally and how the <<DISPLAY>> macro always returns then it is only small extension to create event loop based games. I find it easier to work with example code so here's some classic game conversions with full source available: Please share / like comment: your actions influence what I decide to write about.