Stuck again

Hello again, your local madwoman here to complain. :sweat_smile:

So, ever since I made a post in another thread about usage of tile editors in games from the 90's (and to be fair, for as long as I've been "using" snap!) I've been trying to build a tile editor... and ... I'm extremely stuck. Not so much with the actual generating lists, but the putting it onto the stage in a manipulateable way kinda thing.

I'm missing stuff, I always am, but any solutions? Ideas? Complaints?

Here's what I've got so far, the blocks draw a square on the screen with the garishly silly colours I hand picked lol.

The script on the left reports a list of lists of size 28 x 20, and the script on the right creates a list of lists size 60 x 45, and the big mess of lists is an example of what I'm trying to do...

I am livestreaming this, as I type, but I'm not asking for people to hop over, but I am flailing in real time, because why not LOL.....

TL;DR == I R Dumb. Haaaaaaaalp

Quick addition. I'm using Jadga's Ray caster code, but once... (if) I ever get that tile editor working, I'm going to be re-writing it to use the tiles. If you're wondering what I'm using it for, and also, if I get the tile editor running, after that is going to be a very simple paint-ish program.

Also Also... Ignore the reporters, they're only there to show me the lists are correct.

Does the Tiles library help?

It does! I just spent a bit breaking it down and, yeah I absolutely get how it works... well, I did ten seconds ago, I've already forgotten lol.

So... yeah. For some really weird reason It wasn't working before. Probably user error.

They used the Run block. So that gives me ideas. Let's see if I get anywhere with it! (Chances are low)

Unrelated... I'm not sure when fade blocks got a little more distinction between blocks and highlighting, but it's GORGEOUS now. Holy swearword! If I were to change a couple things, it'd be contrast in input slots, make them a little brighter, and a seperator between scripts, but otherwise? I set fade to 97 and I don't think I'll ever go back!

Unrelated, but please make sure to use the gray reply button to the corner of each post to reply. The blue reply button is for replying to the topic itself.

The reason I don't do that, is it's a linear thread. So I scroll down to the bottom via the sidebar and up a notch to find the last response and then read to the bottom.

If this were reddit where it was visually indexed, then yes, I would.

The blue reply button is for replying to the topic itself

Instead, what I do, is highlight what other people said, if I want to reply directly that way.

What I also do, is read the forum mostly when logged off. I very seldom log into the forums, because I don't generally have much to say. Unless I do. So I'll generally see when I'm addressed and log in, but otherwise, I'll skim the thread and then close the forum for a couple hours. It helps that this isn't really an active forum most of the time.

Also, I am aware there is a block quote that mentions who I'm quoting instead of just the plain ">" markup. I do keep meaning to use that, but mostly instead I just mention that person by name... Unless of course they're the post directly above mine.

Now, onto the topic, after that brilliant big of success figuring out a block I probably should have figured out decades ago, now I'm going to use this thread as a dumb question shop.

Tomorrow, anyway. LOL

One reason I want you to: is that I don't get notifications if you don't quote or mention me, or at least make clear it's a reply to the forum software.

That’s not a reason

Well, I would disagree. Maybe that was true in 2019 or so though.

I mean, I just checked the box saying to not repeatedly log me out, I don’t think there’s a benefit to staying logged out.

One reason I want you to: is that I don't get notifications if you don't quote or mention me, or at least make clear it's a reply to the forum software.

Hmm, that may be down to how we read forum software. I may not log in, but I'm still fairly certain I haven't missed any major threads, even though I lurk all the time. Keep in mind that even though I use forums less now, I've used forum software for a long long long time.

That’s not a reason

Visible Confusion

Well, I would disagree. Maybe that was true in 2019 or so though.

This is not an active forum. I didn't count, and I've also cleared the noti's so there's no easy way for me to verify this, but from when I logged off last night and logged back in this afternoon, there were, say 40 posts spread over ten threads in a twelve hour period. When I say active I'm thinking a thousand posts an hour. This is not that. Maybe one day, hopefully, but right now, this is not an active forum. It's not a dead forum by any length of the imagination, but it's not active.

The caveat to that, is with discord and reddit and various other communication tools available, I don't know how many forums still hit those numbers, but it may be more likely than you think.

I mean, I just checked the box saying to not repeatedly log me out, I don’t think there’s a benefit to staying logged out.

I never check that box. I also turn my computer off at night. I actually prefer physically logging in. Iunno. We could go into the weeds about that on many levels, but I won't. This forum is primarily about snap coding not security.

So, off topics aside. I'm trying to think of a question regarding my tile editor but I haven't loaded my work from yesterday yet. I haven't figured out any further yet, I've currently got run giving all the tiles properties, but still not on screen.

I'm wondering how I'll save levels though. Initially I was going to turn each level into a costume, but that just saves the visual data and not the connecting data, so now I'm thinking maybe message passing variables. Having the render sprite recieve a level and then draw it.

While thinking about that, I did run into a thing where I built a block that ends with a message and had a receiver on the primary script area, but couldn't figure out how to take the data out, the block generated a list of vertices, which would ideally be passed to a list of lines, but the "send message with data" didn't seem to be doing anything, atleast, not to me. I'm figuring, atleast so far that I'm not supposed to put that in blocks.

Seriously, I had no idea you had quoted or replied to me - no notification, no mention whatsoever, just because there is some non linear thread it doesn’t mean you should purposefully not use the forum or something. That’s what I mean by it not being a reason.

Wow… that’s why I thought you made no sense earlier.

Huh. I thought everyone would.

I believe it is possible to get xml data if a sprite using the when anything is edited block, try that.

Seriously, I had no idea you had quoted or replied to me - no notification, no mention whatsoever, just because there is some non linear thread it doesn’t mean you should purposefully not use the forum or something. That’s what I mean by it not being a reason.

Ok, I kinda see that, but as I was saying to you earlier, that's not so much as me not using the forum correctly as we read forums differently.

Back in the day when I spent more times in much larger forums, I would read threads as they updated, regardless of if I was mentioned, because I was there for the discussion, and if I was involved that was a bonus, but mostly there for a discussion, this is also why I like reactions, because I can chime in and leave input without typing up a response which was probably going to be said better by someone else anyway.

I'll think about it.

Huh. I thought everyone would.

Without going into the specifics, There's a reason I do this. I'm not going to clarify, but it basically boils down to personal preference.

I believe it is possible to get xml data if a sprite using the when anything is edited block, try that.

I was thinking about that, but ideally, I want to keep this in snap without resorting to external techniques, and I want to stick to straight snap as much as possible, primarily to show off snap! (I stream, to no viewers mind you, but I do stream lol (I probably should give up, but never)) and primarily because I'm doing this because my knowledge base, while extremely extensive, is theoretical, not practical and it's about me figuring things out in a practical way.

Also, that'd be more doom style, which had line defs and sidedefs, where the ray hit a line and asked for it's id, which then linked to a sidedef which had fake-z, texture and properties, and also had a sector id which had lighting and item data. So that's very much for later.

This is still tile based theory. I'm working through John Carmack's engines because he had a massive influence on me when I was younger. After his work I want to dive deep into procedural, but that's LONG term.

Do you want to build a 3D engine using tiles ???

Do you know those old 3D projects?

Technically 2.5D, because they couldn't do true 3d back then, but basically? Yeah. Once I get the hang of that, then Quake. Quake I'm going to do backwards because in order for it to be 3D, I need to build GLQuake first to call webgl, and then I can go nuts with 3D, but not yet. (If Ever)

Yeah I've seen all those projects, and they are cool, but they are very, very basic. Oscar especially did great work, but his Wolf3d and Doom ports are using one map that's hand drawn.

That rubiks cube is also phenomenal work,I remember reading that code when they first released it. I was about to say it was really simple and did most of the work manually, but reviewing it, it actually looks really good. So, I'll definitely keep that in mind for Quake.

If I build a tile editor, I can make actual levels with actual assets, because there is also very little difference between a tile editor and a paint editor. One stores attributes for the renderer in each tile, the other stores RGB values per tile. (Yes, that's not even remotely true, but for this discussion? Yeah, good enough)

Wolf3D is really "easy" too because the two major components of Wolfenstein are native to snap, because they built it on machines meant for companies to crunch numbers really fast. It's basically just a rendered spreadsheet, and Snap has that natively, it's the core of the language, and it has a raycaster built into the "to" block.

Semi - Unrelated Question to @ego-lay_atman-bay can snapblocks do a list of lists? That'd be cool.

not as a result, but you could do list (list @addInput)@delInput@addInput and then use ego-lay_atman-bay's snapblocks converter block with the blockify @list :: lists reporter block in the metaprogramming library.

what counts as 2.5d vs 3d?

same

its literally a primitive block, and you can use more xml stuff with the extension primitives.

what counts as 2.5d vs 3d?

Basically, Neither wolfenstein or doom have z co-ordinates. Wolfenstein fakes it by scaling a column depending on how far away you are from it, so if you're 10 units away, it'll draw a column with most of the pixels in that texture, but if you're 100 units away, it'll draw 2 pixels of colours in the texture. Wolf3D also cheats by hard coding that data, so for each step you take it'll add a couple pixels to the column, but they're all pre picked until you need the entire column in which case it just draws it anyway.

Doom does it a little differently, instead of a list of tiles, it's several linked lists that reference each other.

When you load doom's map and type the cheat "iddt" twice, it'll show the entire map, even the stuff you can't see, and also all the sprites in the map, and that's all the engine actually sees at all times, just those lines and those things, but like wolfenstein, each line has information that decides what can or can not be seen, and how much texture to draw or not draw for that matter, then how dark it is, and if it also plays a sound or triggers a monster or changes the offsets.

Steps in the doom engine for example, look complicated, because you have to define each step seperately and it's offsets will be two sides, which tells the engine "I do not stop this ray" and the ray will hit each line, query it and keep going until it hits a full wall, then it stops and fires the next ray.

Quake which is true 3D, is similar, but what it does differently, instead of hitting a wall and calculating the height that way, each brush has x,y,x co-ordinates. So instead of saying "estimate this" it just draws the face it can see with the texture and lighting data in the brush. (This is grossly simplified to the point that it's completely wrong, but it's to contrast the difference between the three engines)

Is that clear as mud? Probably. If you're confused, tell me, if you understand everything I just said, well done. Because not even I do lol...

Also, technically, neither Doom or Quake are using rays like wolfenstein. Instead, it's searching a tree algorithm, jumping through each leaf and asking "am I visible?" if it's visible, it'll draw it, if it isn't, it'll not quite discard the data, it'll hold it in a buffer until it becomes visible, or if it thinks you're in a leaf that can't reach it, then it'll drop it completely. In order to do this though, each level is compiled into a model, which has that information baked in.

Carmack did a LOT of cheating, but he did it very well. Playing Quake for the first time when I was young blew my tiny little mind, because it should not have been possible with the toasters we were running then

Ah, so it’s not about the appearance, but how it’s made, right?

I'm not quite sure I follow, but maybe? Here, I'll try another explanation

All six engines are publicly available on github, but they're written in c or c++, languages I have trouble reading.

Snap I can read, but snap doesn't read c. So instead of me being able to use snap to blockify everything, I have to use snap to build guesstimates, but one of the issues with each engine, is the hard coding, specifically, a lot of the core of each engine is written in assembly, to mitigate limitations that old machines like 286's and 486's just can't do unless you find away around those limits. Hence the "cheating"

Snap! also doesn't differentiate between number depth. Wolfenstein for example, when it defines the tile properties, doesn't use a full byte, instead it has a hard limit of 0-3, or two bits, whereas the second plane of the map, used in gameplay, uses a whole byte, to define what is a treasure sprite or a lamp sprite or an enemy sprite.

Snap just does a key value, regardless of how many bytes the number it uses. I think a wolfenstein map would be just over 4kb in filesize (combining both planes), whereas snap, especially that big chunky list in the first post exports to a csv file 954 bytes, which is just over two bytes per cell. Indeed... after manually writing a 64x64 csv file... don't ask, I regret every moment... it's 8kb in size, so two bytes per cell... which I wonder if snap is saving the commas. Yup. No commas is exactly 4kb.

Now, that doesn't actually matter now, especially not now, what's an extra byte in a hard drive capacity of trillions of em...

but that's the crux of the issue, John Romero, who wrote the tile editor for wolfenstein, has to define things like EGA or CGA and he has to define all those limits manually, to check if the user is going to be rendering to lower resolutions, and... we don't.

Half the peril of reading old code is limitations that barely exist anymore, there still are limits mind, but they're so vast it might as well be irrelevant. (no, but...)

I can't help but think this isn't what you meant... anyway. smeg it. posts