sabato 31 gennaio 2015

Scantanador, un roguelike "in fieri"

Cliccate qui per provare Scantanador 0.0.1 Alpha.
Scantanador è il nome di un roguelike programmato da me, in JavaScript, e basato sulla libreria ROT.JS, libreria JavaScript (che sorpresa!) che contiene diverse funzioni per semplificare la vita a chi, per una qualunque forma di pazzia, decida di programmare un nuovo roguelike. Come potete immaginare, io sono tra questi pazzi.
I comandi sono semplici e sono più o meno i classici di un roguelike. Voi siete la @ al centro dello schermo, vi muovete coi tasti freccia, il tastierino numerico o clicando/toccando il quadrante dello schermo corrispondente alla direzione. Premendo [Invio], o cliccando/toccando l'icona @, potete aprire un menu, con le azioni principali. Il tasto [?] vi mostrerà una lista di tasti, coi comandi corrispondenti.
Al momento, Scantanador è poco più di uno scheletro, ancora in ampia fase di lavorazione e con ponteggi e impalcature sparsi più o meno ovunque. Se il mio obiettivo fosse stato quello di creare un 7DRL, ossia un roguelike programmato in sette giorni, il lavoro sarebbe ormai molto vicino alla conclusione: basterebbe annodare un paio di fili, infilarci un mostro finale, magari due o tre oggetti in più e stop, il gioco è fatto. In tutti i sensi. Siccome però, nella mia pazzia o incoscienza, progetto di realizzare qualcosa di molto più ampio, la conclusione è rinviata a un futuro più o meno lontano, ma che prima o poi arriverà. Almeno, è quanto spero.
Il modello a cui più mi sono ispirato, nella progettazione, è stato ToME, storico roguelike degli anni ‘90 e oltre, nonché uno dei pilastri del genere. Per essere precisi, il mio modello è stato la vecchia versione di ToME, ossia quella che ancora si chiamava Troubles of Middle Earth e che ha chiuso i battenti con la versione 2.3.5, per rinascere poi sotto altro nome, ma identica sigla. Perché una versione così vecchia? Perché è la versione che ho giocato e amato di più, e che mi ha fatto perdere piacevolmente una montagna di ore, ai tempi dell’università: il gioco più recente è senza dubbio migliorato e più ampio, ma alla nostalgia non si comanda. E poi tutti i gusti sono guasti, no?
Nella versione definitiva, quando arriverà, Scantanador presenterà più dungeon, collegati tra loro da un mondo di superficie, oppure un solo, lunghissimo dungeon: ancora non ho deciso, ma il tempo per scegliere non mi manca, con tutto il lavoro ancora in corso. Per il momento, questa versione di prova, versione alpha che più alpha non si può, presenta un solo dungeon, di dieci livelli, e senza mostro finale. Insoddisfacente? Certo, ma è anche una versione di base, che serve a me più che altro come palestra in cui provare le funzionalità che vado via via aggiungendo: potete considerarlo una demo, in altri termini, almeno per il momento.
Trattandosi di un roguelike in JavaScript, è quindi destinato a essere utilizzato soprattutto in un browser e da dispositivi di ogni tipo e dimensione, finora mi sono concentrato principalmente sul supporto vari tipi di input: in pratica, può essere giocato utilizzando la tastiera, nella migliore tradizione dei roguelike, ma può anche essere giocato utilizzando il mouse, oppure le ditate sullo schermo. In teoria. In pratica l’ho potuto collaudare soltanto su un ristretto numero di dispositivi, per adesso, per cui ogni segnalazione di malfunzionamento sarà gradita.
Altro aspetto su cui ho lavorato molto, aspirando a un gioco di lunga durata, è il salvataggio delle partite. Il salvataggio utilizza il localStorage, per cui la partita è salvata all’interno del browser che state utilizzando: se riaprite il gioco con lo stesso browser, dovreste pote ripartire dal punto in cui avevate salvato. A meno che non siate morti dopo il salvataggio, ovviamente: come ogni roguelike che si rispetti, Scantanador abbraccia la filosofia del permadeath, ossia “si muore una volta soltanto”. Quando il vostro personaggio muore, i salvataggi sono cancellati. Punto. Ovviamente, utilizzando il localStorage voi potete imbrogliare quanto volete, se avete una minima conoscenza del JavaScript, perché i dati del salvataggio sono nelle vostre mani, facilmente accessibili.
Riassumendo, vediamo di elencare in breve ciò che è già presente in questa prima versione del gioco, (chiamiamola Scantanador 0.0.1) e ciò che sarà introdotto più avanti.
Già sviluppato:
-supporto per tastiera, mouse, touch;
-salvataggio e caricamento delle partite;
-combattimento corpo a corpo, più alcune armi;
-alcune armature, utilizzabili da player e mostri;
-combattimento a distanza (semplificato), più alcune armi;
-pozioni con effetti immediati o prolungati (alcune);
-oggetti con poteri speciali (alcuni);
-player e mostri possono raccogliere, gettare e utilizzare (alcuni) oggetti;
-mostri con poteri speciali (alcuni);
-meccanismo di combattimento riadattato dal d20 system.
Da sviluppare:
-migliorare il combattimento a distanza;
-nuovi mostri, nuovi oggetti, nuovi poteri;
-mostri più intelligenti (o meno stupidi);
-esperienza e passaggio di livello;
-classi per il player;
-abilità speciali per player e mostri;
-nuovi dungeon/ampliamento dungeon;
-mostro finale;
-magia;
-trappole;
-oggetti da identificare;
-correggere singolari/plurali;
-PNG?
E molto altro, al primo posto la correzione di tutti gli errori che troverò strada facendo. In pratica, come dicevo all’inizio, per adesso ho posto le basi: il resto consiste nell’edificare sopra queste basi. Sperando che reggano.
Ah, la grafica è ovviamente in ASCII: sono tradizionalista, ma soprattutto possiedo le capacità artistiche di un merluzzo. Inserire immagini e trasformarlo in un gioco contemporaneo non sarebbe difficile; realizzare immagini decenti lo è, almeno per me. Che poi in realtà non è proprio definibile come ASCII; dato che utilizzo caratteri Unicode, ma non importa.

Scantanador - A roguelike "in fieri"

Click here to try Scantanador 0.0.1 Alpha.
Scantanador is the name of a roguelike in JavaScript, which I’m programming. It utilizes the library ROT.JS, which is a very nice tool to help a poor, distressed programmer, who is working on a roguelike: its author seems to have a difficult relationship with semicolon and suchlike, but that’s another matter. It’s a good library, if you are crazy enough to program a roguelike. I am.
Command keys are quite easy and are, more or less, those you find in any roguelike. You are the @ in the centre of the screen and you can walk around by using arrow keys, numpad, or clicking/tapping the portion of the screen corresponding to a given direction. Pressing [Enter], or clicking/tapping on the @ icon, you can access to the menu, which lists all the main commands. The ? key will show you a list of all the keys used in the game.
Right now, Scantanador is little more than a skeleton, a bare-bone structure on which I am still working and a lot of work is still needed. A lot. If I were aiming for a 7DRL, which is to say a roguelike wrote and concluded within 7 days, I would be almost there: add a little more stuff, a final boss, maybe another pair of objects and the game would be ready. But not. Since I am crazy enough to think about a bigger game (way bigger), I still have a long way to go, before having a game which, somehow, can be seen as completed. Some day I’ll get there, for sure. Or, at least, I hope.
My model is ToME, mainly, which is a historical roguelike from ‘90s, but still alive and kicking. More or less. In truth, the version I’m using as an inspiration is not exactly alive and kicking, being the old 2.3.5 version, which was still called “Troubles of Middle Earth”, before kicking the bucket and being reborn with a different name and quite a different world. Why am I looking and the old version, if there is a new one, which is richer and probably better in every aspect? Because ToME 2.3.5 (and all the previous versions) is the one I played and loved the most, the game on which I wasted away many and many hours, when I was in college. It’s nostalgia, pure and simple, and I know it, but... it’s a matter of tastes, right? And all tastes are a waste, in the end. More or less. Let’s say so, okay?
Ina distant day, Scantanador will posses many dungeons, all connected by a wilderness or maybe just one dungeon, but extremely deep: I’ m not sure, yet, but I still have plenty of time, to make up my mind about it. There is still an awful lot of work, for me. Anyway, this demo version (which is really an Alpha release, but very alpha) has only one dungeon, with 10 levels, and without a final boss. Not satisfying? I know, I know, but it’s a first release, which manly serves to me as a playground, where I can test new stuff and see if everything works correctly, any time I add some new object, monster or power. It’s just a demo, as I said.
Being a JavaScript game, it should work on a very wide range of browsers and devices, and work fine everywhere. Or at least fine enough. This is the reason why I concentrated on supporting many kind of input: you can play it with your keyboard, with a mouse, tapping on a touchscreen and so on. Or, at least, you should be able to: I could only test it on a limited number of devices and browsers, so I’m not sure that it will really work everywhere. If you find something wrong, just tell me and I’ll fix it.
Given that I’m trying to program a game, which could last many hours, I also spent quite some time on the save and load process. The game is saved inside the browser you’re using to play it, in its localStorage object: if you open Scantanador with the same browser, you should be able to restart a previously saved game. Unless you died after the last save, of course: as a true roguelike, at least in spirit, Scantanador follows the philosophy of permadeath, which is to say “you can only die once”. Once you die, your character and all the saved game are deleted. That’s all. Of course, since it utilizes the localStorage, you can cheat the living shit out of a saved game, if you really want and if you have a minimal working knowledge of JavaScript: all the data are in you browser and very easy to access.
In short, let’s see what has already been implemented in Scantanador (version 0.0.1) and what is still waiting in line.
Already here:
-keyboard, mouse, touch support;
-saving and loading of a game;
-melee fight, plus some weapons;
-some armours, which can be equipped by player and monsters;
-ranged fights (simplified), plus some ranged weapons;
-potions with immediate and prolonged effects (some);
-items with special powers (some);
-player and monsters can pick up, drop and use (some) items;
-monsters with special powers (some);
-slightly changed d20 system rules;
Still waiting:
-improving the ranged fight;
-new monsters, items, powers;
-smarter monsters (or at least less stupid);
-experience points and level-ups;
-classes for the player;
-special abilities for player and monsters;
-new dungeons/bigger dungeon;
-last boss;
-magic system;
-traps;
-unidentified items;
-fix singular/plural;
-NPC?
And much more, starting from all the bugs I will surely have to squash. Put another way, as I said at the very beginning, I only put the basis for a game: now I must build over it, hoping that everything will be solid enough to hold.
Ah, graphics are obviously in ASCII: I’m quite the traditionalist, but I am also as artistic as a cod. It would be easy to add graphical tiles to the game and turn it into something more modern, but it’s not easy to make decent graphical tiles, at least for me. And, by the way, it’s not really ASCII, since I’m using Unicode characters, but never mind.