ID:319596
 
Hey, I was wondering if anybody out there had a library/demo that covers the basics of a Roguelike game, I'm talkin' text graphics'n dat. I've seen one before, but it's quite tough to navigate around the BYOND resources when it doesn't even have it's own tab anymore.
It is here is a link to the hub for it.
Runt doesn't download. Lummox needs to update the resource (or something).
Runt is just about incomprehensible. I've tried uncompressing it but haven't been successful as of yet.
In response to D4RK3 54B3R
D4RK3 54B3R wrote:
Runt is just about incomprehensible.

Yeah I know! It is like he was beeing posessed or something...

#define u #define
u C Read(N)
u D(a) N[G[7][a]]>>
u E else
u F(a,b) for(a in b)
u H ..()
u I V[z]
u J new
u K loc
u P(a,b) "[a],[b]"
u Q pick
u R return
u S src
u T locate
u U usr
u V(a) vars[G[1][a]]
u W while
u X vars[a]
u Y(a) i(istext(a))a=r(a);
u Z del(S)
u i if
u l list
u SL a:e[sl]
u xo x+G[18][a]
u yo y+G[19][a]
u _ usr.t()
var{A;B;l{L;G;P=J;Y=J;F=J}V[1];obj{t{O;q}e/ef}mob/M;savefile/N}proc{n(a){N=J(a);N.cd="/"}B(z,a=1)R block(T(a,a,z),T(16-a,16-a,z));M(z,a){.=l();F(a,B(z))F(M,a).+=M}rs(a)R round(sqrt(a<0?0:a));r(a)R(istext(a)||a>0)?roll(a):0}world{New(){N=J("d.sav");N["G"]>>G;F(A,flist(G[9])){A=G[9]+A;n(A);D(5)Y[A]}J/r(0,0);H}view=7;mob=/mob/P}atom{var{d;D=0;h=0;j;k;f;t;g;w;o;v;r;rv;l{e;s;m}sl;hp;mh;st;dx;ac;xp=0;xn;us=1} New(b,a,n){i(a){f=a;t=n}N()}proc{N(a){i(f){n(f+G[4]);t=Q(t?(t):N.dir);N.cd=t;D(10)a;i(a&&type!=a){J a(K,f,t);Z}C}F(a,l()+s+rv)i(a)Y(X)rv=0}A(c,b,a){o&&c:m(b?2:1,,,1,o,xn);F(a,s)c:X+=b?-X:X;c:c()}c(a){F(a,s)i(X<0)X=0;hp=min(hp,mh)}e(b,a=K){A=SL;A&&A:f();SL=S;A(K);V(2)=sl;b?0:a:m(65,S)}f(b,a=K)i(a:e&&SL==S){a:e-=sl;A(K,1);V(2)="";b?0:a:m(66,S)}j(a=0,b)i(j){F(.,G[5]){b=get_step(S,.);i(!b||k==b:k)a|=G[6][.]}V(3)="[G[12][a+1]]"}m(n,a,s,c=10,b=G,m="."){i(s)M(z)<<G[24][s];S<<"[b[n]][a]"+m;a<<("[S]"+b[n+c]);M(z)-S-a<<"[S][b[n+c*2]][a]"+m}a(m,a,b){i(r(20)+h+rs(dx-m:dx)+v<8+m:ac){b(m);s(4);R m(60,m,1)}O=e&&e[G[13]]||S;m:hp-=max(r(O.d)+D+rs(st-m:st),0);b(m);s(r(3));m(61,m,1);m:d(S)}b(m,a){F(.,e){U=e[.];U&&_}m&&m:b()}s(a)M(z)<<sound(G[14][a],,1,1);t();v()}C{H;D(8).;icon=file(G[40]+.+G[8]);D(9).;V(3)=Q(.)}}obj{e{New(a){H;U=usr.v;F(a,g)X=r("[U*e[a]||U]d[g[a]]")+U*k[a];k=K;z=0;i(icon){K=k:K;spawn(10)z=0}A(k);i(j)F+=S}t()i(w--<0){k&&A(k,1);F-=S}}t{proc{g(a,b){K=a;b?sl?e(1):0:a:m(63,S)}d(){f(1);K=loc:K}}t()i(w&&--w<1){i(K){loc:m(67,name,4,,,k||G[59]);f(1)}Z}verb{Drop(){d();usr.m(64,S);_}Use()i(us){i(sl){e();R _}m&&usr.m(1,S,,1,m);i(r)F(B,j?M(usr.z)-U:l(U)){ef=J(B,f,t+"/ef");B:d(U)}E A(U);_;Z}Unuse(){f();_}}g{N()j(H);g(a){H;i(a:g){a:g:g+=g;a:g:j();Z}a:g=S}d(){loc.g=0;H}j()name="[g]"+G[3]}}}mob{P{Move(r,a,b,c)i(hp){i(r).=H;E{r=P[I];b=xo;c=yo;i(b&15){a&=3;b=x}E b=16-x;i(c&15){a&=12;c=y}E c=16-y;r=r:z(a);K=T(b,c,r:z);j(r,m[I]++);R 1}_}v(a){++w;m(68,a,2);xp+=a:xp;W(xp>=xn){s(5);xn+=++v*20;hp+=6;mh+=6;m(25,v,3,1)}}j(a,b){i(q){i(!a:v){e(m(55,g||"0"+G[3]));K=T("w");hp=0}R q.K==S&&a:A()}b?0:a:a()}e()S<<G[51]+"[m.len][G[52]]\s[G[53]][w][G[54]]\s."}Stat(a){i(z>1)stat(G[15],I);F(a,s)stat(s[a],a=="hp"?"[X]/[mh]":X);i(g)stat(G[16],g);F(a,e)stat(e[a]);statpanel(G[20],V(6));}N(a){H;hp=mh;F(O,S)O.N();F(a,k)i(r(k[a])>0){a:N();a:g(S,1)}}Login(){H;K=T(8,8,2);f=G[35];t=V(1);N();e=e||J;S<<G[50]}t(){F(ef,F)ef.t();i(++r>3&&r>21-v*2){r=0;hp+=v<9?1:r(v-8);c()}i(hp)F(M,M(z)-S)(S in view(1,M))?M.Move(K):step_to(M,S)}proc{d(a)i(hp<1){c();F(O,S)O.d();i(key)e(m(69));E{z=0}a&&a:v(S)}g(a){K=a:K;F(M,S)M.g(S)}}verb/Map(){.=G[30]+I+G[31];F(B,m+"0,0"){A=P[B];.+=P(B,A:d)+G[32]}U<<browse(.+G[33],G[34])}Bump(a)a:hp&&a(a)}r{var{x;y;z;v;d;l{e}s;f;m}New(a,b,j=0,c,k,n=0,o=0){x=a;y=b;v=rs((x*x+y*y+2)/3);z=++world.maxz;V+=P(x,y);P[I]=S;e=J;F(b,0to 3){a=d(1<<b);a=a?a:e[(b^1)+1]:(j&1<<b?0:++o&&-1);e+=a;a>0&&++n}j=n+(o>3?3:(o?1:0));L=J;F(a,Y){B=Y[a];i(B[41]>=j)F(U,0to 7){k=0;n=U*5;f=0;W(++f<5&&(e[f]==B[++n]||e[f]<0))B[n]&&++k;i(f>4&&k>=j)L[a]=1<<U|L[a]}}s=Q(L);f=L[s];L=J;F(a,G[6])i(f&a)L+=a;f=Q(L);L();i(o>1){a=Q(G[21]);d&a==a&&!d(a)&&o(xo,yo,a)}}proc{L(a,b,n){n(s);D(1)n;D(5)b;a=G[17][f];e=b:Copy(a,a+5);d=e[5];L=B(z);F(A,L){a=A:x;b=A:y;i(f&170)a=16-a;i(f&51)b=16-b;a=f&240?b+--a*16:a+--b*16;N.cd="/t/"+copytext(n,a,a+1);A:C}F(a,L)a:j();D(3)a;D(4)m;D(11)b;A();Y(a)W(a-->0)N();F(a,b){n=r(b[a]);W(n-->0)O(a)}}b(a=2,b){a=B(z,a);do{b=Q(a);a-=b}W(b:V(5)||length(b:V(6)));R b}N(){n(G[39]);D(3).;O=J(b(),Q(.))}O(a){n(a+G[4]);J/obj(b(),G[45]+Q(N.dir))}m(a){n(G[38]);a=l()+N.dir;W(a:len){U=Q(a);a-=U;N.cd="/"+U;D(6).;i(v>=.){D(7).;i(v<=.)break}}J/mob(b(3),G[37],U)}o(x,y,d,a){F(a,G[22])i(P[P(xo,yo)])R;J/r(x,y,d|Q(3,12))}A(a=m)i(v&&!length(M(z)-U)){Y(a)W(a-->0)m()}a()i(v>19&&r(6)>5)q=J(b(),G[36]);d(a)R P[P(xo,yo)];z(a)R d(a)||J/r(xo,yo)}}turf/Entered(a)i(a:e)F(O,S)O:g(a)


It's this and some more in a .dms
The hell?
I meant, like, text-graphics.
In response to Bumblemore
Off subject: I like your avatar.

On subject: i'm not sure if there's any demos with text graphics out there. This would be something nice to make, if you wanted to dig into it. :)
I've just downloaded the Runt source maybe less than an hour ago. I've expanded it to proper indentations, and it compiles properly. Getting runtime errors, though, so...

Oh, and I learned something new:
mob
Login()
(prob(50)) ? test() : test2()
(prob(50)) && (test() || 1) || test2()

proc
test() world << "A"
test2() world << "B"

I learned from the compressed Runt source that you can use the ternary ? operator in one line, and also the two-part &&/|| operators too.


edit: after ONE more modification, that runtime error has disappeared. Now all I need to do is convert the one-letter definitions to their full meanings, but that's enough of me hijacking this topic.
cheers.
The code is like that because it was compressed to save space for a 4K challenge.
By the way, Bumblemore, you won't be able to recreate DF in BYOND. :P Closest would be Dungeon Master, but it's pretty crappy.

El Wookiee was working on a tutorial for random generation, but he only made one chapter... Guess he gave up!