So, first order of business: creating a tile map from a set of pixels. I understand that I can have Decker read each pixel (or set of pixels) and draw a tile based on that pixel's position but offset. But what I don't understand is how to put that idea into practice. Any ideas on how I could turn a pixel map into a tile map?
I’m not sure I understand what you’re asking.
You mean something like the NES, where you have a “tilemap” that’s a grid of tile IDs, and “tile data” associates a texture with each tile ID, and then they get combined so each tile is drawn with its associated texture?
That’s not normally part of a raycasting engine, as I understand it, though it might be useful for a level-editor for a raycasting engine. Is that the problem you’re trying to solve?
Here’s a card that demonstrates rendering a tilemap. There’s a field named tilemap whose size and position defines the region of the card background to be used as the tilemap. Likewise, there’s fields tile0 and tile1 that define the regions to be used as the textures for those indexes in the tilemap.
%%CRD0{"c":{"name":"home","script":"on view do\n ts:each i in 0,1\n n:\"tile%i\" format i\n f:card.widgets[n]\n card.image.copy[f.pos f.size]\n end\n \n tmf:card.widgets.tilemap\n tm:card.image.copy[tmf.pos tmf.size]\n \n output.clear[]\n \n each pos in (range tm.size[0]) cross (range tm.size[1])\n t:ts[tm[pos]]\n output.paste[t pos*t.size]\n end\nend\n","image":"%%IMG3AgABVgKEj6nL7Q+jnLTai7PevPsPhuJIluaJpurKtu4Lx/JM1/aN5/rO9/4PDAqHxKLxiEwql8ym8wmNSqfUqvWKzWq33K73Cw6Lx+Sy+YxOq9fstvsNj8vn9Lr9js/r9/y+/w8YKDhIWGh4iJiouMjY6PgIGSk5SVlpeYmZqbnJ2en5CRoqOkpaanqKmqq6ytrq+gobKztLW2t7i5urexTQ6/sLHLA7XCgcYXwRvNFL3NwkDA2AnDBNwXxwnezrzI0UHb1QLZGNLX7822DevT4Dzayu/gCfsR0ez47f8i3NcN8P7y9dMGX5CsbYN6/CvYD/BqIzCFHfOAsLMTh8GDFjCob8FDrgqOBiPY0kS7hDiAwkto/0LpZ8ScKYTH7gVBoghwCnwoEwe4aYKe1dymT9Ogz1idTozaX7Ou4MabPo0qRU6U1FOJXiNJ0WV1b96vFYS4zLZEYFS1UkQbRs27p9Czeu3Ll069q9izev3r18+/r9Cziw4MGECxs+jDix4sWMGzt+DDmy5MmUK1u+jDmz5s2cO3v+DDq06NGkS5s+jTq16tWsW7t+DTu27Nm0a9u+jTu37t28e/v+DTy48OHEixs/jjy58uXMmzt/Dj269OnUq1u/jj279u3cu3v/Dj68+PHky5s/jz69+vXs27t/Dz++/Pn069u/jz+//v38+/v/D2CAAg5IYIEGHohgggouyGCDDj4IYYQSTkhhhRZeiGGGGm7IYYcefghiiCKOSGKJJp6IYooqrshiiy6+CGOMMs5IY4023ohjjjruyGOPPv4IZJBCDklkkUYeiWSSSi7JZJNOPglllFJOSWWVVl6JZZZabslll15+CWaYYo5JZplmnolmmmquyWabbr4JZ5xyzklnnXbeiWeeeu7JZ59+/glooIIOSmihhh6KaKKKLspoo44+Cmmkkk5KaaWWXopppppuymmnnn4Kaqiijkpqqaaeimqqqq7KaquuvgprrLLOSmuttt6Ka6667sprr77+Cmywwg5LbLHGHotsssouy2yzzj4LbbTSTktttdZei2222m7LbbfefgtuuOLGWQA=","widgets":{"tilemap":{"type":"field","size":[16,16],"pos":[336,32],"show":"transparent","border":0},"tile0":{"type":"field","size":[16,16],"pos":[368,32],"show":"transparent","border":0},"tile1":{"type":"field","size":[16,16],"pos":[400,32],"show":"transparent","border":0},"output":{"type":"canvas","size":[256,256],"pos":[16,30],"locked":1,"volatile":1,"border":0,"scale":1}}},"d":{}}
The actual code that renders the tilemap is in the card’s view handler, and looks like this:
# "ts" is going to be a list of images, the textures for each tile
ts:each i in 0,1
# Look up the field named after this tile index
f:card.widgets["tile%i" format i]
# Copy the region of the card background covered by the field
card.image.copy[f.pos f.size]
end
# "tmf" is the field that covers the background region we'll use as the tilemap
tmf:card.widgets.tilemap
# "tm" is the image we'll use as the tilemap
tm:card.image.copy[tmf.pos tmf.size]
# Clear the output canvas
output.clear[]
# For each pixel in the tilemap...
each pos in (range tm.size[0]) cross (range tm.size[1])
# ...grab the tile corresponding to the tilemap index at that pixel...
t:ts[tm[pos]]
# ...and paste it into the output canvas,
# at a position scaled up by the tile size
output.paste[t pos*t.size]
end
And here’s what it looks like in Interact mode:

Does that help?
Sorry, I was contemplating if creating a fake 3D first person engine was worth persuing if I could just make a bunch of images at less of a headache. In other words, yes, this does help.
Edit: Actually, no, no it does not help. I'm not looking to create a top-down explorer or a 2D platformer... yet. What I want to tackle first is creating a tile system that reads a text and makes that text into a pseudo-3D projection a la Wolfenstein 3D or Duke Nukem 3D. Each text in the array tells the ray caster to render that tile as a specific 3D shape. Does that make sense?