tyson2 has quit [Remote host closed the connection]
drainpipe has joined #commonlisp
drainpipe has quit [Ping timeout: 268 seconds]
VincentV` has joined #commonlisp
<doulos05>
I'm trying to represent the map of a roguelike in my program.
VincentVega has quit [Ping timeout: 264 seconds]
<doulos05>
I can't figure out if I should be using a nested list or an array or something else.
<beach>
Wouldn't that be more like a graph with nodes representing locations?
<doulos05>
Well, it's basically a 2d grid of x,y coordinates.
<beach>
Hmm, OK.
<doulos05>
I starte out with an array, but then couldn't logic my way into how to use format to print that out.
<doulos05>
So I thought maybe nested lists would be better, but then I'm struggling with a convenient way to access specific cells (to change how it is displayed).
<beach>
What importance do the 2D coordinates have in a "roguelike"?
<doulos05>
Though now that I'm writing this here, I'm thinking I should probably just build a class.
<doulos05>
Only in how it gets printed to the screen, though if I wanted to do mouse inputs then I'll need a way to know which cell was clicked on.
<beach>
My first thought would be to have a standard class for the nodes and another standard class for the transitions.
<doulos05>
The advantage of storing the whole map as some sort of 2d array-like structure is that players and monsters can have their x and y coordinates and find themselves on the map.
<beach>
Yes, I see. But the grid would be sparse, yes?
<doulos05>
That way their location is only recorded in 1 place (the creature) and not two.
<doulos05>
It would be sparse
<beach>
So then, if you use a 2D structure, you would waste a lot of space.
<doulos05>
Hrm... Good point. A hash table would solve that problem.
<doulos05>
And then I can just use maphash to print it out at the right place based on coordinates it is mapped to.
<VincentV`>
Are roguelike maps really sparse, though? I thought every cell is likely to have something in it. Even ground may be of various kinds.
<VincentV`>
Also, if you have an infinite map, you could just allocate chunks too.
<VincentV`>
As the player is progressing I mean.
<doulos05>
Well, they semi-sparse? I mean, there's ground in every space... Except for the part that isn't dug out of the dungeon.
<doulos05>
Probably 40-60% full maximum
<doulos05>
I guess you could have a particularly full floor. But I'm not trying to make an above ground one like Cataclysm or something like that, just a basic nethack clone.
<VincentV`>
So, just 50%? I don't know, I would just use 2d arrays.
<boigahs>
If you're having trouble printing the arrays, I would imagine anything more complicated would be a lot harder...
<boigahs>
I want to make a roguelike now, dangit
<doulos05>
Yeah, I was just having a dumb moment, I think. A hash-table is what I wanted (though I'm going to hide it inside a class).
<doulos05>
It's what I get for designing while getting distracted
VincentV` is now known as VincentVega
rgherdt has joined #commonlisp
drainpipe has joined #commonlisp
drainpipe has quit [Ping timeout: 246 seconds]
Brucio-61 has quit [Ping timeout: 252 seconds]
scymtym has quit [Ping timeout: 268 seconds]
attila_lendvai has joined #commonlisp
azimut has joined #commonlisp
igemnace has joined #commonlisp
Cymew has joined #commonlisp
Brucio-61 has joined #commonlisp
pve has joined #commonlisp
Cymew has quit [Ping timeout: 268 seconds]
xlarsx has joined #commonlisp
shka has joined #commonlisp
xlarsx has quit [Ping timeout: 252 seconds]
frgo has quit [Ping timeout: 268 seconds]
Brucio-61 has quit [Ping timeout: 268 seconds]
lsj has quit [Quit: Leaving]
Algernon69 has joined #commonlisp
Algernon69 has quit [Read error: Connection reset by peer]
Algernon69 has joined #commonlisp
<doulos05>
Ok, I'm still having a moment here and I think all of this would be solved if I understood how to loop this correctly in format.
<doulos05>
The problem is that I need to loop within a loop and I don't now how to recreate the dotimes effect in format.
<aeth>
that's probably not correct, anyway
<aeth>
when stream isn't NIL
<doulos05>
It isn't, this where I've ended up before I finally gave up and asked for help, lol
<aeth>
well, even when it's FORMAT NIL, you're concatenating the return of DOTIMES, which is NIL
<doulos05>
Right
<aeth>
you don't want to think about strings at all
<doulos05>
I didn't know why that's what I was getting, just that that was what I was getting
<aeth>
if you wanted strings you'd want something like with-output-to-string, but this is a function on streams so you can do that at the caller
<aeth>
just do the dotimes, no LET, no CONCATENATE, and it should work?
<doulos05>
But then I don't know how to get the next step, which is overlaying the characters onto the map.
<aeth>
if you want display-map to be a string as an intermediate thing to parse, then you don't want CONCATENATE 'STRING
<aeth>
you want with-output-to-string
<aeth>
and you draw the intermediate map on *that* stream, not the ultimate, final stream
<doulos05>
Some of this is that I'm probably trying to marry too many new concepts at once: mcclim and beast (the ECS library).
<aeth>
(with-output-to-string (s) (dotimes (j 10) (dotimes (i 10) (format s "Hello, world! ")) (terpri s)))
<aeth>
(terpri s) being the same thing as (format s "~%")
<aeth>
(* if s is actually a stream; FORMAT supports a few more things)
<doulos05>
At any rate, it's time to pack it in for a bit. Hopefully wandering around outside will give me a fresh perspective on it.
<phoe>
how do you do rendering to the screen?
<phoe>
one thing is generating the map, another is actually drawing it to be displayed
<phoe>
at some point you gonna need to to set the actual pixels somewhere, or characters if you are going for ascii art
<doulos05>
I'm printing a string out to a McClim pane
<phoe>
by "string" you mean the textual representation of your board?
<phoe>
is this the only thing present in the pane?
<doulos05>
The call to `(visibility/character tile)` does that.
MajorBiscuit has joined #commonlisp
<doulos05>
Yes and yes
<phoe>
then, if you have that string, you should be able to set the pane contents to only contain the string unless I don't understand mcclim well enough
<doulos05>
`visibility/character` will return the character that represents that things.
<doulos05>
Yeah, it was making that string that was confusing me. I'm about 90% sure that the fog will lift in a bit. I'll let you know.
<phoe>
the main source of confusion is that you try to hold values as a string, but you are formatting to STREAM
<phoe>
as mentioned before, (with-output-to-string (temp-stream ...) ... (format temp-stream ...) ...) will return a string object that you can then use
<phoe>
I don't know the details of why you have a STREAM in there though - I assume it's a mcclim stream that is ready to accept the stuff to display on the pane?
<phoe>
at this point maybe you can just format there and never build up the intermediate string, right
Dynom_ has joined #commonlisp
waleee has joined #commonlisp
Dynom_ is now known as Guest933
Cymew has joined #commonlisp
Cymew has quit [Remote host closed the connection]
Oddity has quit [Ping timeout: 252 seconds]
makomo has quit [Ping timeout: 268 seconds]
cosimone has joined #commonlisp
rgherdt_ has joined #commonlisp
ttree has quit [Ping timeout: 246 seconds]
rgherdt has quit [Ping timeout: 260 seconds]
gxt has quit [Remote host closed the connection]
gxt has joined #commonlisp
makomo has joined #commonlisp
cosimone has quit [Ping timeout: 252 seconds]
drainpipe has joined #commonlisp
drainpipe has quit [Ping timeout: 268 seconds]
chipxxx has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Hibernating too long]
pranavats has joined #commonlisp
Guest933 has quit [Quit: WeeChat 3.6]
skeemer__ has quit [Remote host closed the connection]
MajorBiscuit has quit [Ping timeout: 268 seconds]
skeemer has joined #commonlisp
pillton has quit [Remote host closed the connection]
VincentV` has joined #commonlisp
attila_lendvai has quit [Ping timeout: 268 seconds]
VincentVega has quit [Ping timeout: 268 seconds]
random-nick has joined #commonlisp
VincentV` has quit [Ping timeout: 268 seconds]
makomo has quit [Ping timeout: 252 seconds]
Algernon69 has quit [Quit: Leaving]
MajorBiscuit has joined #commonlisp
scymtym has joined #commonlisp
Brucio-61 has joined #commonlisp
qiduo has joined #commonlisp
qiduo has quit [Client Quit]
qiduo has joined #commonlisp
thuna` has joined #commonlisp
Gnuxie has quit [Quit: Bridge terminating on SIGTERM]
Mrtn[m] has quit [Quit: Bridge terminating on SIGTERM]
kakuhen has quit [Quit: Bridge terminating on SIGTERM]
Helmholtz has quit [Quit: Bridge terminating on SIGTERM]
dieggsy has quit [Quit: Bridge terminating on SIGTERM]
loke[m] has quit [Quit: Bridge terminating on SIGTERM]
ecocode[m] has quit [Quit: Bridge terminating on SIGTERM]
acma has quit [Quit: Bridge terminating on SIGTERM]
char[m] has quit [Quit: Bridge terminating on SIGTERM]
sp has quit [Quit: Bridge terminating on SIGTERM]
nicmollel[m] has quit [Quit: Bridge terminating on SIGTERM]
AadVersteden[m] has quit [Quit: Bridge terminating on SIGTERM]
iceman[m] has quit [Quit: Bridge terminating on SIGTERM]
infra_red[m] has quit [Quit: Bridge terminating on SIGTERM]
mxben has quit [Quit: Bridge terminating on SIGTERM]
jryans has quit [Quit: Bridge terminating on SIGTERM]
yitzi has quit [Quit: Bridge terminating on SIGTERM]
Duuqnd has quit [Quit: Bridge terminating on SIGTERM]
qiduo has quit [Client Quit]
Seb[m] has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
rgherdt has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
rgherdt_ has quit [Ping timeout: 268 seconds]
VincentVega has joined #commonlisp
lisp123 has quit [Ping timeout: 268 seconds]
tyson2 has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
rgherdt has quit [Remote host closed the connection]
cosimone has joined #commonlisp
rgherdt has joined #commonlisp
Mrtn[m] has joined #commonlisp
Gnuxie has joined #commonlisp
kakuhen has joined #commonlisp
char[m] has joined #commonlisp
yitzi has joined #commonlisp
bitspook[m] has joined #commonlisp
Duuqnd has joined #commonlisp
ecocode[m] has joined #commonlisp
nicmollel[m] has joined #commonlisp
mxben has joined #commonlisp
hayley has joined #commonlisp
jryans has joined #commonlisp
loke[m] has joined #commonlisp
iceman[m] has joined #commonlisp
AadVersteden[m] has joined #commonlisp
acma has joined #commonlisp
infra_red[m] has joined #commonlisp
sp has joined #commonlisp
Helmholtz has joined #commonlisp
dieggsy has joined #commonlisp
hayley has quit [Changing host]
hayley has joined #commonlisp
scymtym has quit [Ping timeout: 264 seconds]
scymtym has joined #commonlisp
Cymew has joined #commonlisp
scymtym has quit [Ping timeout: 246 seconds]
Brucio-61 has quit [Ping timeout: 264 seconds]
chipxxx has quit [Ping timeout: 252 seconds]
rgherdt has quit [Read error: Connection reset by peer]
rgherdt has joined #commonlisp
chipxxx has joined #commonlisp
drainpipe has joined #commonlisp
drainpipe has quit [Client Quit]
scymtym has joined #commonlisp
Brucio-61 has joined #commonlisp
scymtym has quit [*.net *.split]
Cymew has quit [*.net *.split]
tyson2 has quit [*.net *.split]
dieggsy has quit [*.net *.split]
jryans has quit [*.net *.split]
acma has quit [*.net *.split]
waleee has quit [*.net *.split]
Madsy has quit [*.net *.split]
pjb has quit [*.net *.split]
robin has quit [*.net *.split]
megeve has quit [*.net *.split]
sm2n has quit [*.net *.split]
remexre has quit [*.net *.split]
smlckz has quit [*.net *.split]
tyson2 has joined #commonlisp
smlckz has joined #commonlisp
remexre has joined #commonlisp
sm2n has joined #commonlisp
Madsy has joined #commonlisp
megeve has joined #commonlisp
pjb has joined #commonlisp
scymtym has joined #commonlisp
waleee has joined #commonlisp
smlckz has joined #commonlisp
smlckz has quit [Changing host]
pjb has quit [Changing host]
pjb has joined #commonlisp
pjb is now known as Guest9055
Cymew has joined #commonlisp
robin__ has joined #commonlisp
pjb has joined #commonlisp
dieggsy has joined #commonlisp
jryans has joined #commonlisp
acma has joined #commonlisp
Guest9055 has quit [Ping timeout: 268 seconds]
makomo has joined #commonlisp
cage has joined #commonlisp
pjb has quit [Ping timeout: 246 seconds]
causal has quit [Quit: WeeChat 3.6]
waleee has quit [Ping timeout: 246 seconds]
pjb has joined #commonlisp
pranavats has left #commonlisp [Disconnected: Hibernating too long]
cosimone has quit [Read error: Connection reset by peer]
pranavats has joined #commonlisp
ec has quit [Ping timeout: 258 seconds]
ec has joined #commonlisp
Oddity has joined #commonlisp
green__ has quit [Remote host closed the connection]
lagash has quit [Remote host closed the connection]
chipxxx has quit [Read error: Connection reset by peer]
makomo has quit [Ping timeout: 264 seconds]
drainpipe has joined #commonlisp
mxben has quit [Quit: You have been kicked for being idle]
lagash has joined #commonlisp
thuna` has quit [Remote host closed the connection]
xlarsx has quit [Remote host closed the connection]
xlarsx has joined #commonlisp
xlarsx has quit [Remote host closed the connection]
xlarsx has joined #commonlisp
eddof13 has quit [Ping timeout: 268 seconds]
lisp123 has joined #commonlisp
cage has quit [Quit: rcirc on GNU Emacs 27.1]
robin__ is now known as robin
lisp123 has quit [Ping timeout: 268 seconds]
attila_lendvai has joined #commonlisp
pranavats has joined #commonlisp
chipxxx has quit [Read error: Connection reset by peer]
_cymew_ has joined #commonlisp
Guest7344 has quit [Quit: WeeChat 3.6]
thuna` has quit [Ping timeout: 252 seconds]
_cymew_ has quit [Ping timeout: 264 seconds]
attila_lendvai has quit [Ping timeout: 268 seconds]
robin has quit [Read error: Connection reset by peer]
robin_ has joined #commonlisp
xlarsx has quit [Ping timeout: 260 seconds]
tyson2 has quit [Remote host closed the connection]
xlarsx has joined #commonlisp
xlarsx has quit [Ping timeout: 246 seconds]
euandreh has quit [Ping timeout: 252 seconds]
causal has joined #commonlisp
enzuru has quit [Ping timeout: 252 seconds]
euandreh has joined #commonlisp
morganw has quit [Remote host closed the connection]
azimut has quit [Ping timeout: 258 seconds]
robin_ is now known as robin
drainpipe has quit [Ping timeout: 268 seconds]
pillton has joined #commonlisp
killerstorm has joined #commonlisp
xlarsx has joined #commonlisp
<killerstorm>
Hi. Back in the day, SLIME was the best CL IDE. Is it still the case? I've tried to install it on a new system and it seems like it's incompatible with Emacs 28 - "cl" got deprecated, etc.
epony has quit [Remote host closed the connection]
<killerstorm>
Is another IDE recommended now?
epony has joined #commonlisp
<pjb>
stay with emacs 27!
<pjb>
good old software from back in the days.
<_death>
if you're using up-to-date slime and emacs there's no problem
<pjb>
killerstorm: but you're right is reall too old software. I'd avise you to implement your own up to date, cutting edge, MAINTAINED, IDE.
<killerstorm>
I've got 28 from the package manager. I guess I'd need to build Emacs from source to get 27...
xlarsx has quit [Ping timeout: 268 seconds]
<killerstorm>
I've installed SLIME via MELPA. Is git version better in that respect? It seems MELPA version is quite fresh...
<_death>
for development tools (like sbcl, slime, and even emacs) I find that it's best to clone the repos and compile yourself.. that said, the melpa version does seem recent, so maybe you could elaborate on what the issue is
<killerstorm>
Compiling file /home/alex/.emacs.d/elpa/slime-2.26.1/slime.el at Thu Oct 13 23:14:24 2022
<killerstorm>
slime.el:72:1: Error: Wrong number of arguments: (3 . 4), 2
<_death>
that's not melpa, that's elpa.. elpa contains v2.26.1 which is from the end of 2020
thawes has joined #commonlisp
<killerstorm>
Oh, damn. I thought it's the same thing LOL. Sorry...