Is a Craft texture pack possible?

One of the initial announcements of Craft mentioned being able to create and share texture packs:

https://codea.io/talk/discussion/7076/what-is-codea-craft

…did this happen? This is literally the only link that came up when I searched “craft skin textures”, so it seems like not.

I may be wrong but it’s my impression that craft has not resulted in a flurry of voxel-based projects, and if there’s no room for texture packs, I would strongly suspect that has a lot to do with it.

Texture packs and environment shaders for Minecraft are one of the loci of intense fan activity in the Minecraft community and if that can’t be done, it’s lost a huge chunk of fun.

I mean, the reason I searched for it myself is that I thought it would be fun to try to pinch some cool fan-made textures and try to give the Craft voxel blocks a makeover, because personally—no offense to anyone—the included ones read to me as, as the kids say, basic.

Anyway I hope there’s a way to make texture packs for these things because it would be super fun and I’m certainly not the only one who’d think so.

And yes @dave1707 I know I could try doing it on my own, but it’s not clear that would even work, and more importantly the block documentation suggests that modifying the default blocks will probably affect performance, possibly by a lot.

@UberGoober - if you look at the recent image carousel thread @dave1707 and I have been building textures for cubes. You can do the same quite easily and build your own Minecraft style blocks.

Also the characters, within Codea, have textures which you can import into a paint package and over paint with you own graphics. When I get chance I’ll give it a try and post something.

@Bri_G please no, I don’t need a demonstration of how textures work.

I think you might not understand what @John was talking about when he said Craft would support texture packs.

https://minecraft.fandom.com/wiki/Texture_Pack

@Ubergoober - I know what texture packs are in Minecraft. Should be easy to set up Minecraft style blocks from a texture image containing multiple block textures. Why do you need someone else to build that facility. Part of playing with Codea to get what you need.

@Bri_G, first off, having texture packs was specifically mentioned by @John as upcoming feature. There’s nothing lazy about looking forward to a feature and being disappointed when it doesn’t materialize, and having fun making & browsing texture packs is completely different from spending a huge amount of time reproducing the ability to do it.

Second, it seems to me, the Craft voxel system has kind of run aground. Is anyone making original games with voxel blocks? Forget original, has anyone built a game using Codea’s built-in voxel environment? Forget games, has anyone used Codea’s built-in voxel environment to make anything you can walk around in? Forget walking around even, has anyone even stacked voxel blocks into anything cool, like a house or a bridge or a face or, for goodness’s sake, a wall? Voxel blocks are the whole thing Craft was advertised with. It was literally made for them. Why aren’t the forums full of voxel-block projects?

For me, art matters. I don’t like how it looks. If I don’t like how it looks, why on Earth would I build something with it? And if I have to hand-write a whole texture pack system before I get to the fun part, thank you no. I’ll still enjoy Codea, I still think it’s great, that’s just not what I want to spend time on. And honestly I kind of suspect no one does.

@UberGoober And you thought I was the one going to say something.

And yes @dave1707 I know I could try doing it on my own

@UberGoober - I think I get the general gist of that - misunderstood your initial question.

@Bri_G , @dave1707 I think I got off on a bad ranty state there and I apologize,

I hope I didn’t make anyone feel bad.

I am legitimately curious about the questions I was asking though.

Has anyone made a game with voxel cubes? Has anyone made something you can walk around in? Has anyone made anything cool out of the cubes themselves?

Maybe I’m using the wrong search terms, but when I search the forums about these things nothing obvious comes up.

@UberGoober I don’t know if this is cool enough, but it does use Voxel blocks.

viewer.mode=FULLSCREEN

function setup()
     ss=81          -- cube size, powers of 3 only (3, 9, 27, 81, 243)
     --ss=243      -- doesn't draw correctly    

    fill(255)
    assert(OrbitViewer, "Please include Cameras as a dependency")
    scene = craft.scene() 
    v=scene.camera:add(OrbitViewer,vec3(ss,ss,ss), ss*3, 0, 6000)    
    v.rx=-10
    v.ry=-30
    
    scene.voxels.blocks:addAssetPack("Blocks")
    tab = scene.voxels.blocks:new("Table")
    tab.setTexture(ALL, "Blocks:Table") 
    scene.voxels:fill("Table")
                                         
    scene.voxels.visibleRadius=90
    scene.voxels:resize(vec3(60,1,60))          
    scene.voxels.coordinates = vec3(ss,ss,ss) 
    count=0
    cube(0,0,0,ss)
end

function update(dt)
    scene:update(dt)
end

function draw()
    update(DeltaTime)
    scene:draw()
    text("Cube size "..ss.."x"..ss.."x"..ss.." = "..(ss^3).." cubes",WIDTH/2,HEIGHT-25)
    text("Number of cubes drawn "..count,WIDTH/2,HEIGHT-50)
end

function cube(x,y,z,size)
    local s=size/3
    for x1=-s,s,s do
        for y1=-s,s,s do
            for z1=-s,s,s do
                if (y1~=0 or z1~=0) and (x1~=0 or z1~=0) and (x1~=0 or y1~=0) then
                    if size~=3 then
                        cube(x1+x,y1+y,z1+z,s)
                    else
                        count=count+1
                        scene.voxels:block((x1+x+ss),(y1+y+ss),(z1+z+ss))
                    end
                end
            end
        end
    end
end

@dave1707 it crashes my iPhone 8. I’ll have to try it on my iPad later.

Later:
I mean, it’s not not cool. I like it. Got anything else?

@UberGoober Try reducing the number of cubes per side. Reduce the value of ss to 3. Then try 9, then 27.

@dave1707 I like it. I tried to make it cycle but I couldn’t get the positioning to work. Also I added an icon because me. :slight_smile:

@dave1707 the code in the above:


viewer.mode=FULLSCREEN

function setup()
    ss=81     -- cube size, powers of 3 only (3, 9, 27, 81, 243)
    --ss=243
    
    fill(255)
    assert(OrbitViewer, "Please include Cameras as a dependency")
    scene = craft.scene() 
    v=scene.camera:add(OrbitViewer,vec3(ss,ss,ss), ss*3, 0, 6000)    
    v.rx=-10
    v.ry=-30
    
    scene.voxels.blocks:addAssetPack("Blocks")
    tab = scene.voxels.blocks:new("Table")
    tab.setTexture(ALL, "Blocks:Table") 
    scene.voxels:fill("Table")
    
    cube(0,0,0,ss)
    
    parameter.action("cycleSideSize", function()
        ss = ss * 3
        if ss > 81 then ss = 3 end
        cube(0,0,0,ss)
    end)
end

function update(dt)
    scene:update(dt)
end

function draw()
    update(DeltaTime)
    scene:draw()
    text("Cube size "..ss.."x"..ss.."x"..ss.." = "..(ss^3).." cubes",WIDTH/2,HEIGHT-25)
    text("Number of cubes drawn "..count, WIDTH/2,HEIGHT-50)
end

function cube(x,y,z,size)
    print(size)
    scene.voxels.visibleRadius=90
    scene.voxels:resize(vec3(60,1,60))          
    scene.voxels.coordinates = vec3(size, size, size) 
    count=0
    local s=size/3
    local offset = vec3(1, 1, 1) * s
    for x1=-s,s,s do
        for y1=-s,s,s do
            for z1=-s,s,s do
                if (y1~=0 or z1~=0) and (x1~=0 or z1~=0) and (x1~=0 or y1~=0) then
                    if size~=3 then
                        cube(x1+x,y1+y,z1+z,s)
                    else
                        count=count+1
                        local base = vec3((x1+x),(y1+y),(z1+z))
                        scene.voxels:block(base + offset)
                    end
                end
            end
        end
    end
end

@UberGoober Not sure what you’re trying to do, but the cube isn’t working right.

@dave1707 thats what I said.

I’m trying to make it so you can press the button and it switches between different sizes.

I can’t get the positioning right.

@dave1707 maybe my subtle hinting was too bashful.

You suggested trying out running the project with different side sizes, and I thought that was cool, so I wanted to make it possible to do that right while the code was running.

I really spent a good deal of time trying to get it to work, and I did kind of, but I couldn’t figure out two things that seemed basic:

  • I couldn’t figure out how to clear blocks so that the new blocks would draw in a blank space
  • I couldn’t figure out how to get the generated shapes of different sizes to all display in the middle of the screen

I got frustrated because these seemed like simple things but I couldn’t figure them out. Can you help?

@dave1707 - your initial demo in this thread wouldn’t run after demanding camera dependencies. It crashed on ss=81. I reduced size to 3 and it ran, 24 and above (in multiples of 3) it fired up multiple errors. 21 it crashed. Note these were run consecutively.

@Bri_G ss has to be a power of 3. That is 3, 9, 27, 81, 243. The value of 243 doesn’t work right. I think it has to do with Voxel limits, but I don’t know that much about voxels to figure it out.

@dave1707 but how do I get it centered based on size? The thing that was stymying me was that you use the side size to center the cubes when you’re only running one at a time, but when I try to use the side size when I’m “live-swapping” the cubes it always puts them off-center.

@UberGoober You not only have to move the camera, but the Voxel coordinates too.