I've finally completed my 1krl! This is also my first rogue-like game,
and my first completed game.
It's written in 1024 bytes of FreeBASIC, and needs version 0.15b or
earlier (rather old) to compile. I don't know why, FB is very fond of
making up error messages, and of changing rules between versions.
Since it took me forever to finish it I'm calling it About Time (and
as justification, there is a time pausing item).
Use the numpad to move, with numlock on. The objective is to make it
down 5 levels of the tower to escape. But the downstairs on most
levels are hidden! That is, you must interact with the objects on the
map. You're also given a score when you die or escape. I'm afraid I
couldn't make proper puzzles out of reaching the exit, I had to cut
stuff to make the mark. Still, I hope I achieved some small level of
replayability, and an impressive number of features.
Screenshots:
http://tmc.castleparadox.com/abouttime/shot0.png
http://tmc.castleparadox.com/abouttime/shot1.png
Map features:
s An animated skeleton. Moves randomly slowly towards you. Harmless on
their own, but numerous
% A key
+ (brown) A door. Skeletons can't follow you through them
+ (purple) A locked door. Expend a key to unlock
( A locked chest. Expend a key to reveal something
/ A lever. Modifies the level in some way, sometimes bad (9 different
effects)
? A scroll of Mapping. Can have one of 3 different effects
! Potion of Healing. Cures 6 HP
$ A gold coin. Increases your final score
> (white) Downstairs. No return
> (red) Teleport. Sends you to a random spot (different every time)
O A time portal. Stepping into it pauses everything (that is, the
enemies) for a little while
Status line:
H: HP
K: Keys
$: Gold
L: Level
Linux binary:
http://tmc.castleparadox.com/abouttime/abouttime.tar
Windows binary:
http://tmc.castleparadox.com/abouttime/abouttime.zip
Source:
#define W #define
W B(q):for i=0 to a:j=i\61:k=i U 61:q:next:
W T(q,r,s):v=q:if v then r else s end if:
W N and
W R*rnd
W U mod
W L m(p)
W C m(i)
W RM(m,o)(o\6>=(m-1)\6N(o-1)\6<=m\6)
W H T(v-1,:,:
W G:z=p:L=0
W S:while L:p=a r:wend
randomize:cls:a=1159:y=65:d=3
1:dim m(a),o(a)B(T((k U 6)*(j U 6),T(1r^7,C=8,C=1r^4:C*=((5+9r\1)^(7r
\1)+6)U 15)C+=C*bit(1634,C),T(k U 60N j U 18>0N(p+i)U 5=0,p
+=1r:C=5+0.6r,C=9)))S:x=p:L=f*2 U 6+11S G:while f<5B(T(C=8N q<1,p=i
+sgn((z U 61)-k)r+(sgn(z\61-j)r\1)*61T(p=z,y-
=6R,T(L, ,L=8:C=0)), ))locate 1,1,0B(p=RM((z U 61),k)N-RM(z
\61,j)T(k, ,?)T(z=i,v=10,v=C)o(i)or=p:color v*o(i)N(q>0)+8*p+7:?
mid(" ?O>++%s#@(!/$>",v+1,1);)color
7:?"H";y,"K";d,"$";e,"L";f:T(y>0,v=getkey-49:p=z+bit(73,v)-
bit(292,v)-61*bit(455,v)*sgn(5-v),?"DEAD";f*25+e*4:end:)v=L+1H G)H)H
T(-2r,B(o(i)=2+v),o(x)=1)G)H q=14G)q-=1H S G)H T(d>0,d-=1G+6, ))H G
+6)H d+=1G)H L*=7r\5)H)H)H T(d>0,d-=1T(x=p,L=15,L=(5R+10)U 13+2), ))H y
+=6G)H L=0T(x=p,p=0S:x=p:L=15,p=7R:B(C+=C=p+1N 1R)))H e+=1G)H f
+=1:goto 1)wend:?"WON!";99+y+e*6
or get at http://tmc.castleparadox.com/abouttime/abouttime.bas
For spoilers and a little documentation of the source, see
http://tmc.castleparadox.com/abouttime/vars.txt
Ralph Versteegen wrote:
> It's written in 1024 bytes of FreeBASIC, and needs version 0.15b or
> earlier (rather old) to compile. I don't know why, FB is very fond of
> making up error messages, and of changing rules between versions.
I have only 0.2 version of freebasic. Isn't it possible to adapt the
code to the newest version ?
> Linux binary:
> http://tmc.castleparadox.com/abouttime/abouttime.tar
./abouttime: error while loading shared libraries: libtinfo.so.5: cannot
open shared object file: No such file or directory
I don't know where this libtinfo could come from. I have ncurses 5.6-8
on my system.
<snip>
Just completed this and I must say I was impressed. It's fiendishly
difficult, reasonably varied, and most impressively of all it looks
really nice with a lot of cool colour effects. Hard to believe you
managed this in 1k - well done!
--
Darren Grey
Ah ha. I finally figured out how to get it to compile with FB0.20, and
it's still 1024 bytes in size. The only change is to the T macro,
though strangely it still doesn't compile with FB0.17. I updated the
files.
No idea about libtinfo, it seems to be a subset of ncurses, but is
required by FB0.20 console executables as well?
It is part of older version of ncurses. 5.6-19 seems to be last version
featuring libtinfo. Could you please check your version of ncurses? I have
got 5.6-8 on my system too and same problem.
--
Michal Bielinski
libtinfo is part of one of the supported configurations of ncurses.
Whether you have it on your system depends on how ncurses was
configured.
--
Thomas E. Dickey <dic...@invisible-island.net>
http://invisible-island.net
ftp://invisible-island.net
I went around this by downloading Free BASIC and compiling the game myself but
thank you for explanation. Now I do not have to get libtinfo and can play; sheep
is whole and wolf is fed at the same time.
--
Michal Bielinski
fbc abouttime.bas
abouttime.bas(13) error 41: Variable not declared, a in
'randomize:cls:a=1159:y=65:d=3'
abouttime.bas(13) error 41: Variable not declared, y in
'randomize:cls:a=1159:y=65:d=3'
abouttime.bas(13) error 41: Variable not declared, d in
'randomize:cls:a=1159:y=65:d=3'
/.../
abouttime.bas(14) error 123: Too many errors, exiting
etc.
my version is:
FreeBASIC Compiler - Version 0.20.0 (08-10-2008) for linux (target:linux)
Great work! will it be possible to get a bigger, un-obfuscated
version?
-Ido.
Use
fbc -lang deprecated abouttime.bas
Here's a bigger, much more obfuscated version: the preprocessor
ouput ;) (with newlines added):
http://tmc.castleparadox.com/abouttime/at_preproc.bas
Alternatively, here's an annotated version:
http://tmc.castleparadox.com/abouttime/at_annotated.bas
What fun would reading unobfuscated code be?
Pretty cool and complete, congratulations!
Will soon review it for roguetemple.
--
Slashie
> Use
> fbc -lang deprecated abouttime.bas
it's compiling and running perfectly now. Really impressive, and
original at the same time. Congratulations!
It seems it's possible to get stuck (I entered this place from upstairs):
http://anamnese.online.fr/temp/abouttime_stuck.png
Thanks!
Yeah, this can rarely happen. I was generating an extra line of doors
along the middle row, but took it out for lack of room (5 bytes). I
was hoping that there would usually be teleports on each side, but I
guess I also reduced the number of teleports since then. There must be
some cleverer way to place the doors.