|
Post by Pete Byrdie on Sept 14, 2020 23:35:31 GMT
An online friend of mine recently released some interactive fiction on Kindle Direct Publishing. While proof reading it, it occurred that it's odd some of the amateur writers here don't do so. Hyperlinks make the ebook format ideal for game books. It only costs whatever resources you want to put into creating a cover, and you don't have to do it with a view to making money. Obviously, you can't really use the Fighting Fantasy system, but I've come to realise that the details of the system aren't really the important factor in a good gamebook. Has anyone considered writing gamebook for Kindle?
|
|
kieran
Baron
Posts: 2,460
Favourite Gamebook Series: Fighting Fantasy
|
Post by kieran on Sept 15, 2020 12:40:33 GMT
An online friend of mine recently released some interactive fiction on Kindle Direct Publishing. While proof reading it, it occurred that it's odd some of the amateur writers here don't do so. Hyperlinks make the ebook format ideal for game books. It only costs whatever resources you want to put into creating a cover, and you don't have to do it with a view to making money. Obviously, you can't really use the Fighting Fantasy system, but I've come to realise that the details of the system aren't really the important factor in a good gamebook. Has anyone considered writing gamebook for Kindle? Yeah, Kindle is a great choice of format for simpler gamebooks. I think it might be more problematic for gamebooks that require note-taking and dice rolls and the like as that kinda goes against the whole point of Kindles (ie that they're lightweight and portable), but it's still certainly feasible. If ever I write a fresh IP gamebook, particularly if it doesn't require dice or notes, I'd certainly consider it.
|
|
|
Post by Pete Byrdie on Sept 15, 2020 20:24:58 GMT
An online friend of mine recently released some interactive fiction on Kindle Direct Publishing. While proof reading it, it occurred that it's odd some of the amateur writers here don't do so. Hyperlinks make the ebook format ideal for game books. It only costs whatever resources you want to put into creating a cover, and you don't have to do it with a view to making money. Obviously, you can't really use the Fighting Fantasy system, but I've come to realise that the details of the system aren't really the important factor in a good gamebook. Has anyone considered writing gamebook for Kindle? Yeah, Kindle is a great choice of format for simpler gamebooks. I think it might be more problematic for gamebooks that require note-taking and dice rolls and the like as that kinda goes against the whole point of Kindles (ie that they're lightweight and portable), but it's still certainly feasible. If ever I write a fresh IP gamebook, particularly if it doesn't require dice or notes, I'd certainly consider it. I get your point about kindles being designed to be portable. But increasingly, people are choosing them, or even the kindle app, rather than books. The ideal solution would be a gamebook app. But, until then, it's another option to release your gamebook into the world. Gamebook players would happily use it if they like the idea of the book itself.
|
|
aggsol
Wanderer
Bored...
Posts: 93
Favourite Gamebook Series: Lone Wolf
|
Post by aggsol on Sept 16, 2020 8:58:45 GMT
I never play gamebooks on the Kindle. The paper, pencil and dice are part of the experience. Also jumping to sections is a PITA with a Kindle.
|
|
kieran
Baron
Posts: 2,460
Favourite Gamebook Series: Fighting Fantasy
|
Post by kieran on Sept 16, 2020 13:05:03 GMT
I never play gamebooks on the Kindle. The paper, pencil and dice are part of the experience. Also jumping to sections is a PITA with a Kindle. You can hyperlink the sections on a Kindle so you're instantly taken where you need to go. But yes if the author hasn't bothered to do that then it would be a nightmare.
|
|
|
Post by thealmightymudworm on Sept 16, 2020 14:36:38 GMT
An online friend of mine recently released some interactive fiction on Kindle Direct Publishing. While proof reading it, it occurred that it's odd some of the amateur writers here don't do so. Hyperlinks make the ebook format ideal for game books. It only costs whatever resources you want to put into creating a cover, and you don't have to do it with a view to making money. Obviously, you can't really use the Fighting Fantasy system, but I've come to realise that the details of the system aren't really the important factor in a good gamebook. Has anyone considered writing gamebook for Kindle? Yeah, Kindle is a great choice of format for simpler gamebooks. I think it might be more problematic for gamebooks that require note-taking and dice rolls and the like as that kinda goes against the whole point of Kindles (ie that they're lightweight and portable), but it's still certainly feasible. If ever I write a fresh IP gamebook, particularly if it doesn't require dice or notes, I'd certainly consider it. Those are certainly real problems, but anyone travelling with a Kindle is very likely to have smartphone with them as well. The instructions could nudge them to install a simple dice roller app which would solve one problem.
|
|
kieran
Baron
Posts: 2,460
Favourite Gamebook Series: Fighting Fantasy
|
Post by kieran on Sept 16, 2020 14:48:59 GMT
The instructions could nudge them to install a simple dice roller app which would solve one problem. True and there's also notepad apps of course.
|
|
|
Post by Pete Byrdie on Sept 16, 2020 18:15:49 GMT
I never play gamebooks on the Kindle. The paper, pencil and dice are part of the experience. Also jumping to sections is a PITA with a Kindle. You can hyperlink the sections on a Kindle so you're instantly taken where you need to go. But yes if the author hasn't bothered to do that then it would be a nightmare. In fact, it's precisely the hyperlinks that make it a perfect platform for interactive fiction, including gamebooks. It's a lot easier to use than flicking through a book, and it's a hell of a lot easier to write than separating references out, numbering them and writing the correct links to all the right references.
|
|
|
Post by linflas on Sept 16, 2020 18:43:26 GMT
I've coded a PERL script that adds automatically refs and hyperlinks in a HTML format gamebook. That's not perfect and written for french syntax (i.e. adds non-breaking space before some punctuation for example), but it definitely saves time. If anyone wants to have a try, here's the code.
#!/usr/bin/perl
# ------------------------
#
# hyperAVH
# by Linflas
#
# ------------------------
use List::Util qw(shuffle);
use Getopt::Long;
# ------------------------
# Initialisation
# ------------------------
$SIG{INT} = sub { die "[BREAK]\n"; };
GetOptions( "tag=s" => \$tag, "shuffle" => \$shuffle, "title=s" => \$title, "debug=s" => \$debug, "auto" => \$auto ) or die "Usage: hyperAVH [--tag=<TAG>] [--title=<NUMBER>] [--shuffle] [--debug=<SECTION>] myAVH.htm\n";;
$tag = lc $tag; # On privilegie les minuscules pour les tags HTML
$defTag = "h2"; # Le tag utilisé par défaut pour les numéros de paragraphes est <h2> (Titre 2)
if ( $shuffle ) { $tag or die "\n[ERROR] Le shuffle n'est possible que si un tag est defini.\n"; }
die "[ERROR] La valeur pour l'option 'title' doit etre un nombre.\n" if ( $title and $title !~ /^\d+$/ );
print "\n++++++++++++++++ hyperAVH R15.11.06 ++++++++++++++++\n";
# ------------------------
# Expressions régulières possibles qui précèdent un renvoi
# ------------------------
# Par défaut, "AU" du "rendez-vous au", "LE" de "gagner/joindre le" et "paragraphe"
@defRegExp = qw ( au Au AU le Le LE paragraphe Paragraphe PARAGRAPHE section SECTION Section page PAGE Page to TO To );
# Pour d'autres expressions comme le "DU", une validation est demandée
@addRegExp = qw ( du DU );
# ------------------------
# Chargement des données en mémoire
# ------------------------
$file = shift or die "Usage: hyperAVH [--tag=<TAG>] [--title=<NUMBER>] [--shuffle] [--debug=<SECTION>] myAVH.htm\n";
open FILE, $file or die "\n[ERROR] $!\n";
@data = <FILE>;
close FILE or die "[ERROR] $!\n";
# ------------------------
# Agrégation du contenu des tags <p> pour simplifier les substitutions
# ------------------------
$index = 0;
while ( $index <= $#data ) {
$data[$index] =~ s/\n/ /;
if ( ( $data[$index] =~ /^<[pPhH]/ and $data[$index] !~ m@</[pPhH]\d*>@ ) or $inParagraph ) {
$inParagraph = 1;
undef $inParagraph if $data[$index+1] =~ m@</[pPhH]\d*>@;
$data[$index+1] = $data[$index].$data[$index+1];
splice @data, $index, 1;
} else {
$index++;
}
}
if ( $debug) {
open FILE, ">tmp_$file";
for ( @data ) {
print FILE;
print FILE "\n";
}
close FILE or die "[ERROR] $!\n";
}
# ------------------------
# Alerte en cas de recherche automatique
# ------------------------
$tag or print "\n[INFO] Recherche automatique des numeros de paragraphes.\n";
# ------------------------
# Recherche des titres/numéros et regroupement du texte de chaque section
# ------------------------
$section = 0;
for ( @data ) {
undef $read;
# Suppression des tags <a> s'ils existent
s/<a href=[^>]+>//g;
s/<a name=[^>]+>//g;
s@</a>@@g;
s/<A HREF=[^>]+>//g;
s/<A NAME=[^>]+>//g;
s@</A>@@g;
# Supprime les options non souhaitées du tag (s'il est défini en paramètre ou réutilisé)
$tag and s/<$tag[^>]+>/<$tag>/g;
# Début de section si le tag est défini en paramètre
$tag and /^<$tag>(\d+)/ and do { $section = $1; next };
# Le numéro d'une section fixe est suivi par un +
$tag and /^<$tag>(\d+)\+/ and $shuffle and do { $section = $1; push @lockedSections, $section; next };
# Recherche automatique des numéros de paragraphes lorsque le tag n'est pas défini
if ( not $tag and /^(<[pPhH].*>\D*)(\d+)(\D*<.*)$/ ) {
$prefix = $1; $num=$2; $suffix = $3;
# On nettoie tous les tags HTML du prefix et du suffixe
$noTags = "$prefix$suffix"; $noTags =~ s/<[^>]+>//g; $noTags =~ s/\s//g;
if ( not $noTags ) {
# Il faut vérifier que le numero trouvé n'était pas dans les tags HTML
$noTags = $_; $noTags =~ s/<[^>]+>//g;
if ( $noTags =~ /$num/ ) {
# On est sûr d'avoir trouvé le numéro du titre
print "\n[INFO] $num ::: $prefix\[$num\]$suffix\n" if $debug;
undef $read;
if ( $debug eq $num ) {
print "\n[DEBUG] S'agit-il du titre du paragraphe $num ([o]/n) ? ";
$read = lc <>; chomp $read;
}
if ( not $read or $read eq "o" ) {
# Si le motif trouvé est un <hX>, on le conserve comme tag
#lc $prefix =~ /<(h\d+)>\s*/ and $tag = $1;
$section = $num;
next if $title; # le titre sera ecrasé par le tag défini par l'option title
}
}
}
}
# Détection des titres avec un caractère spécifique. Dans le texte courant, on cherche le numéro suivant
$nextSection = $section + 1;
if ( /^(<[pPhH].*>\D*)$nextSection(\D*<.*)$/ ) {
undef $read;
$before = $1; $after=$2;
$noTags = $_; $noTags =~ s/<[^>]+>//g;
if ( $noTags =~ /$nextSection/ ) {
print "\n[WARN] J'ai decouvert un [$nextSection] dans le paragraphe $section.\n------------------------\n$noTags";
print "\n------------------------\n[WARN] S'agit-il du TITRE du paragraphe $nextSection ([o]/n) ? ";
if ( not $auto or not $section ) {
$read = lc <>; chomp $read;
}
$read or $read = "o";
}
# On incrémente le compteur de section
if ( $read eq "o" ) {
$section++;
push @warnings, "[WARN] Le titre du $nextSection est particulier.\n" if $title;
}
}
# On concatène le texte de la section
$sectionText[$section] .= $_;
undef $dot if $dot eq 10;
print "." unless $dot; $dot++;
}
# Si on n'a pas reussi a trouver de numéros
$section or die "\n[ERROR] Je ne peux pas traiter votre AVH (titre du paragraphe 1 non detecte).\n";
print "\n[INFO] J'ai decouvert en tout $section paragraphes : est-ce exact ([o]/n) ? ";
$read = lc <>; chomp $read; $read or $read = "o";
if ( $read ne "o" ) {
die "\n[ERROR] Je ne peux pas traiter votre AVH (titre du paragraphe $nextSection non detecte).\n";
}
# ------------------------
# Mélange des paragraphes (expérimental)
# ------------------------
if ( $shuffle ) {
# Shuffle ON
print "\n[INFO] Shuffling.. ";
@shuffledSections = shuffle ( 2 .. $section );
unshift @shuffledSections, 1; # on ajout le 1
unshift @shuffledSections, 0; # et le 0
# Suppression des sections vides
print "[INFO] Suppression des sections vides..\n";
for ( @shuffledSections ) { $sectionText[$_] and push @newSections, $_ or print "\n[WARN] Le paragraphe $_ est vide !"; };
# Arrangement des sections fixes
if ( @lockedSections ) {
print "\n[INFO] Arrangement des sections fixes.. ";
do {
$loop = 0;
for $i ( 0 .. $#newSections ) {
$j=$newSections[$i];
if ( grep /^$j$/, @lockedSections ) {
next if $j eq $i; # section deja réordonnée
$k = $newSections[$j];
# Swap des sections
$newSections[$j] = $j;
$newSections[$i] = $k;
print "\n\t[$i] <=> [$j]";
# Nouvelle boucle si swap avec une autre section fixe
if ( grep /^$k$/, @lockedSections ) {
print " !!! $k !!!\n";
$loop++;
}
}
}
} while $loop;
print "\n";
} else {
print "\n[WARN] Aucun paragraphe fixe !";
}
print "\n[INFO] Nouvel ordre des paragraphes ::: ".join(" ",@newSections);
} else {
# Pas de mélange
@newSections = ( 0 .. $section );
@newSections = $debug if $debug;
}
# ------------------------
# Création des renvois et écriture du nouveau fichier
# ------------------------
$tag = "h$title" if $title;
print "\n[INFO] Creation de l'index et des hyperliens..";
print " [$tag]" if $title;
print "\n";
open FILE, "> new_$file" or die "[ERROR] $!\n";
# En mode debug, on ne traite que la section spécifiée par l'option
$debug and $newSection = $debug or $newSection = 0;
# On boucle systématiquement sur la liste (mélangée ou non) des nouvelles sections
for $section ( @newSections ) {
$text = $sectionText[$section];
# Le paragraphe a mal a été détecté, on prévient
$text or do { push @warnings, "[WARN] Je n'ai pas pu detecter le titre du paragraphe $section.\n"; };
# Suppression des CR résiduels pour un affichage plus propre
$text =~ s/\n/ /g;
$text =~ s/<[pP]/\n\n<p/g;
$text =~ s/<[hH]/\n\n<h/g;
# Suppression des doubles,triples,quadruples... espaces
for ( 1 .. 5 ) { $text =~ s/ / /g; }
# Remplacement des espaces sécables par des insécables
# pour certains signes de ponctuations courants
$text =~ s/ \?/\ \;\?/g; # interrogation
$text =~ s/ \!/\ \;\!/g; # exclamation
$text =~ s/ \: /\ \;\: /g; # deux-points
$text =~ s/\«\; /\«\;\ \;/g; # guillemet francais ouvrant
$text =~ s/ \»\;/\ \;\»\;/g; # guillemet francais fermant
# On découpe le paragraphe ligne par ligne
@lines = split /\n/, $text;
# On (ré)initialise le paragraphe avec seulement le signet/titre si l'option title est stipulée
if ( $newSection ) {
if ( $title ) {
$text="\n\n<$tag><a name='_$newSection'>$newSection</a></$tag>\n<!------------------------------------------------ $newSection ------------------------------------------------>";
} else {
$text="\n\n<a name='_$newSection'></a><!------------------------------------------------ $newSection ------------------------------------------------>";
}
} else {
undef $text;
}
# Traitement des renvois pour chaque ligne
for $line ( @lines ) {
undef @links;
# Suppression des tags HTML pour mieux répérer les renvois
$noTags = $line;
$noTags =~ s/<[^>]+>//g;
print "\n[DEBUG] $newSection ::: $noTags" if $debug;
for $exp ( @defRegExp ) {
#push @links, ( $noTags =~ /[\s\'\’\(]${exp} \d+[\s\'\)\.\,\:\;\?\!\&]/g );
@possibleLinks = ( $noTags =~ /${exp} \d+/g );
# Si l'expression n'est pas précédée par des caractères alphanumériques, c'est un renvoi
for $turnTo ( @possibleLinks ) {
push @links, $turnTo unless ( grep /\w+$turnTo/, $noTags );
}
}
for $exp ( @addRegExp ) {
#@possibleLinks = ( $noTags =~ /[\s\'\’\(]${exp} \d+[\s\'\)\.\,\:\;\?\!\&]/g );
@possibleLinks = ( $noTags =~ /${exp} \d+/g );
for $turnTo ( @possibleLinks ) {
unless ( grep /\w+$turnTo/, $noTags ) {
print "\n[WARN] Au $section, l'expression << ...$turnTo >> est-elle un renvoi ([o]/n) ? ";
$read = lc <>; chomp $read; $read or $read = "o";
if ( $read eq "o" ) {
push @links, $turnTo;
}
}
}
}
# Affichage des renvois trouvés sur la ligne (mode debug)
if ( @links and $debug ) {
print "\n[DEBUG] $newSection ::: Renvois = ", join ( '/', @links);
$read = <>;
}
# Ajout des tags <a href> en ordre de numéro décroissant pour éviter les mauvaises substitutions
for $turnTo ( sort { $a =~ /(\d+)/; $la=$1; $b =~ /(\d+)/; $lb = $1; $lb <=> $la } @links ) {
#$turnTo =~ /[\s\'\’\(](\w+) (\d+)/; $exp=$1; $link=$2;
$turnTo =~ /(\w+) (\d+)/; $exp=$1; $link=$2;
for $i ( 0 .. $#newSections ) { $newLink = $i if $newSections[$i] eq $link; }
print "\n--------------------------------------\n[DEBUG] turnTo = $turnTo" if $debug;
$line =~ /$exp([\s\w<>\/='\"\:\;\-\,\.\%]*)$link/ or die "\n[ERROR] Renvoi '$turnTo' introuvable dans le paragraphe $newSection !\n[ERROR] Merci de modifier manuellement ce renvoi.\n";
$between = $1;
print "\n[DEBUG] between = $between" if $debug;
# Si on a plusieurs occurences de l'expression dans la ligne courante, il faut conserver la plus proche du renvoi
while ( $between =~ /$exp(.*)/ ) {
$between = $1;
print "\n[DEBUG] between = $between" if $debug;
}
$line =~ s@$exp$between$link@$exp$between<a href='#_$newLink'>$newLink</a>@ or die "[ERROR] Substitution impossible au paragraphe $section, renvoi '$turnTo'\n";
}
# On concatène la ligne modifiée pour regénérer le paragraphe
$text .= $line;
}
die "\n--------------------------------------\n[DEBUG] Sortie du programme?\n" if $debug;
print FILE $text;
$newSection++;
undef $dot if $dot eq 5;
print "." unless $dot; $dot++;
}
print "\n[INFO] Sauvegarde de new_$file.. ";
close FILE or die "\n[ERROR] $!\n";
print "\n\n",@warnings,"[WARN] Des ajustements manuels sont peut-etre necessaires..\n" if @warnings;
|
|
|
Post by a moderator on Sept 16, 2020 23:24:20 GMT
How does hyperlinking handle concealed section numbers - things like the 'deduct/add X to the section number' for having the right item or clue, thfej nstr vctjp nsob vrjfdej nifn cpdfd epbs sbgfs in Creature of Havoc, the hidden direction in The Crimson Tide?
|
|
kieran
Baron
Posts: 2,460
Favourite Gamebook Series: Fighting Fantasy
|
Post by kieran on Sept 17, 2020 5:24:48 GMT
How does hyperlinking handle concealed section numbers - things like the 'deduct/add X to the section number' for having the right item or clue, thfej nstr vctjp nsob vrjfdej nifn cpdfd epbs sbgfs in Creature of Havoc, the hidden direction in The Crimson Tide? There is a "Go To" option on a Kindle where you can skip to any location in the book so you could use that if need be.
|
|
|
Post by Pete Byrdie on Sept 17, 2020 7:10:01 GMT
How does hyperlinking handle concealed section numbers - things like the 'deduct/add X to the section number' for having the right item or clue, thfej nstr vctjp nsob vrjfdej nifn cpdfd epbs sbgfs in Creature of Havoc, the hidden direction in The Crimson Tide? That's a good point. Those things are a product of how traditional gamebooks work, and with an ebook, different approaches might have to be found.
|
|
aggsol
Wanderer
Bored...
Posts: 93
Favourite Gamebook Series: Lone Wolf
|
Post by aggsol on Sept 17, 2020 7:45:37 GMT
I never play gamebooks on the Kindle. The paper, pencil and dice are part of the experience. Also jumping to sections is a PITA with a Kindle. You can hyperlink the sections on a Kindle so you're instantly taken where you need to go. But yes if the author hasn't bothered to do that then it would be a nightmare. Well, I also sometimes use 5 finger bookmarks and on the final run I often peak into diverging paths out of curiosity. That is impossible to do with a Kindle. I have properly hyperlinked gamebooks on the Kindle and it is just no fun for me at all.
|
|
aggsol
Wanderer
Bored...
Posts: 93
Favourite Gamebook Series: Lone Wolf
|
Post by aggsol on Sept 17, 2020 7:48:59 GMT
Also another problem with the Kindle are illustrations. In good gamebooks the layout is in a way the a sections and its accompanied illustration can be seen together. I find illustrations very important for a gamebook that is also a reason I prefer paper gamebooks.
|
|
kieran
Baron
Posts: 2,460
Favourite Gamebook Series: Fighting Fantasy
|
Post by kieran on Sept 17, 2020 8:09:30 GMT
I prefer paper gamebooks. Me too, but while there are disadvantages to the ebook format, I think it's worth acknowledging there are benefits too - particularly to amateur authors.
|
|
|
Post by linflas on Sept 17, 2020 8:32:44 GMT
eBooks with illustrations should be read in landscape mode. But Kindle is quite small...
|
|
|
Post by a moderator on Sept 17, 2020 13:49:35 GMT
You can hyperlink the sections on a Kindle so you're instantly taken where you need to go. But yes if the author hasn't bothered to do that then it would be a nightmare. Well, I also sometimes use 5 finger bookmarks and on the final run I often peak into diverging paths out of curiosity. That is impossible to do with a Kindle. I have properly hyperlinked gamebooks on the Kindle and it is just no fun for me at all. That reminds me of a fan-written FF book I played online years ago. It was hyperlinked, and had software to handle inventory, dice rolls and combat, so it wouldn't show the option to use an item unless you had that item, only provided the link for the outcome achieved when you Tested your Luck and so on, and didn't allow progress beyond a fight if you didn't win it. There was one avoidable combat against a Giant Spider with one-hit-and-you're-dead venom, and I was curious abut whether if it had any decent treasure, but whenever I fought it, it managed to win a round and killed me, and there was no way of accessing the 'if you defeat it' section without actually winning the fight, so I never did find out.
|
|
|
Post by Pete Byrdie on Sept 17, 2020 19:47:14 GMT
Also another problem with the Kindle are illustrations. In good gamebooks the layout is in a way the a sections and its accompanied illustration can be seen together. I find illustrations very important for a gamebook that is also a reason I prefer paper gamebooks. I should stress, I haven't made this suggestion as an alternative to getting a publisher to publish your book. If you think you can get published, go for it. This is a way to get published without going down that torturous route. It's unlikely you'd be able to afford illustrations anyway. Incidentally, I've mentioned some of this forum's reactions to my friend, and he says there's an option for getting paperback versions of an ebook printed on demand on Kindle Direct Publishing. He's used hyperlinks in his IF, and would have to number all the references to create a paperback version. That might be a consideration, though, if you're making a gamebook rather than a straight IF.
|
|