Giter VIP home page Giter VIP logo

crafti's Introduction

crafti

3D Minecraft for TI Nspire CX calcs running Ndless
Thread on omnimaga: http://www.omnimaga.org/ti-nspire-projects/ngl-a-fast-(enough)-3d-engine-for-the-nspire/

Screenshots

menu anim

newinv redstone

help settings

ticalc.org Program Of The Year 2014

Controls

Move around using the numpad: 8-4-6-2
Jump using 5
Switch the current inventory slot with 1-3
Open a list of blocks with "."
Set the current inventory slot with 5 while the block list is open
Put a block down with 7 and destroy a block with 9
Open the menu with menu, move the cursor with 8-2 and select it with 5
ESC is a shortcut for "Save & Exit"

Limitations

crafti doesn't use floats, so there will be some graphical inaccuracies.

crafti's People

Contributors

vogtinator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

crafti's Issues

Compile to take advantage of the new 396 megahertz processor.

I have been playing Crafti seriously on and off for about a month, and I have noticed that it has not been compiled for the new Processor in the TI Nspire CX II. It would run much faster if it were compiled to so do. If that is possible, it would also be possible to add working tools, pistons, observers, dispensers, a bow and arrow, and a peaceful survival mode, right?

Bug found

When I flip a lever, I very weird glitch happens. It looks like a curved rail when flipped and Redstone does not work.

Incorrect backface culling on custom models

Hello, I'm trying to add pistons to Crafti, and when creating a simple block renderer with the following code, half the faces are incorrectly culled and are not visible without the TEXTURE_DRAW_BACKFACE flag, is there any reason as to why this is happening?

void PistonRenderer::renderSpecialBlock(const BLOCK_WDATA block, GLFix x, GLFix y, GLFix z, Chunk &c)
{
    TextureAtlasEntry piston_side = terrain_atlas[12][6].current;
    TextureAtlasEntry piston_back = terrain_atlas[13][6].current;
    TextureAtlasEntry piston_front = terrain_atlas[11][6].current;


    /////
    // Get the piston data
    /////
    const uint8_t piston_type = static_cast<uint8_t>((getBLOCKDATA(block) & piston_data_bits) >> piston_bit_shift);


    //////
    // GL CODE
    //////
    glPushMatrix();
    glLoadIdentity();

    glTranslatef(x + BLOCK_SIZE/2, y + BLOCK_SIZE/2, z + BLOCK_SIZE/2);

    std::vector<VERTEX> piston_vertices;
    piston_vertices.reserve(24);

    // Piston Front
    piston_vertices.push_back({0, 0, 0, piston_front.left, piston_front.bottom, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({0, BLOCK_SIZE, 0, piston_front.left, piston_front.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, BLOCK_SIZE, 0, piston_front.right, piston_front.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, 0, 0, piston_front.right, piston_front.bottom, TEXTURE_DRAW_BACKFACE});

    // Piston Bottom
    piston_vertices.push_back({0, 0, BLOCK_SIZE, piston_side.left, piston_side.bottom, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({0, 0, 0, piston_side.left, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, 0, 0, piston_side.right, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, 0, BLOCK_SIZE, piston_side.right, piston_side.bottom, TEXTURE_DRAW_BACKFACE});

    // Piston Top
    piston_vertices.push_back({0, BLOCK_SIZE, BLOCK_SIZE, piston_side.left, piston_side.bottom, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({0, BLOCK_SIZE, 0, piston_side.left, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, BLOCK_SIZE, 0, piston_side.right, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, piston_side.right, piston_side.bottom, TEXTURE_DRAW_BACKFACE});

    // Piston Left
    piston_vertices.push_back({0, BLOCK_SIZE, BLOCK_SIZE, piston_side.left, piston_side.bottom, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({0, BLOCK_SIZE, 0, piston_side.left, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({0, 0, 0, piston_side.right, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({0, 0, BLOCK_SIZE, piston_side.right, piston_side.bottom, TEXTURE_DRAW_BACKFACE});

    // Piston Right
    piston_vertices.push_back({BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, piston_side.left, piston_side.bottom, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, BLOCK_SIZE, 0, piston_side.left, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, 0, 0, piston_side.right, piston_side.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, 0, BLOCK_SIZE, piston_side.right, piston_side.bottom, TEXTURE_DRAW_BACKFACE});

    // Piston Back
    piston_vertices.push_back({0, 0, BLOCK_SIZE, piston_back.left, piston_back.bottom, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({0, BLOCK_SIZE, BLOCK_SIZE, piston_back.left, piston_back.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, BLOCK_SIZE, BLOCK_SIZE, piston_back.right, piston_back.top, TEXTURE_DRAW_BACKFACE});
    piston_vertices.push_back({BLOCK_SIZE, 0, BLOCK_SIZE, piston_back.right, piston_back.bottom, TEXTURE_DRAW_BACKFACE});


    // Rotate Piston According To Face
    BLOCK_SIDE side = static_cast<BLOCK_SIDE>(getBLOCKDATA(block) & BLOCK_SIDE_BITS);

    // Rotate GL stuff
    switch(side)
    {
        default:
            break;
        case BLOCK_BACK:
            nglRotateY(180);
            break;
        case BLOCK_FRONT:
            nglRotateY(0);
            break;
        case BLOCK_LEFT:
            nglRotateY(90);
            break;
        case BLOCK_RIGHT:
            nglRotateY(270);
            break;
    }

    glTranslatef(-BLOCK_SIZE / 2, -BLOCK_SIZE / 2, -BLOCK_SIZE / 2);

    for(auto&& v : piston_vertices)
    {
        VERTEX v1;
        nglMultMatVectRes(transformation, &v, &v1);
        c.addUnalignedVertex(v1.x, v1.y, v1.z, v.u, v.v, v.c);
    }

    glPopMatrix();
}

Examples of the inpropper display are:

  • Top doesn't render
  • Right side only renders if left side renders
  • Back only visible when viewing through front

But using TEXTURE_DRAW_BACKFACE fixes this, do you know why this happens?

Thanks in advance

Can't turn my head. Is that normal?

I'm trying to turn my head, but I can't. I can move, but not my head. How am I supposed to move it? I tried the arrow pad, but it does not work. I have the ndless 5.2.0, and my calculator is a TI Nspire cx ii cas t.

Redstone lamp bug

My calculator:
TI Nspire 136mhz HW-B overclocked to 236mhz.

While I was building a restone lamp letters, I built a letter T (3 bocks high, 1 block on each side on top, and on the back is Redstone. There is a delay on the letter, The top will go on, then the bottom if you are in 8 blocks of distance, If you are out of the distance, Everything will look normal, Sometimes. I am running on craft 1.2 (Latest).

Is this normal?

Questions regarding source and float alternative

I'm trying to add some new blocks to crafti and a few other QOL improvements, I was wondering how the special block textures are managed, especially with special_block_texture_idx?

Additionally, I was wondering if it would be possible to use fixed point numbers as they would give benefits of floating point numbers, but without the requirement of a FPU and would also give similar performance to current fixed-width integers (in theory?

Also, what exactly does enabling #define BETTER_PERSPECTIVE do?

Binary File

Could you provide a binary file for crafti?

Scrollable inventory

Hi,

Thank you once again for the help last time! I am forever grateful.

Anyway, I realize that it seems all the inventory slots have been taken up, prevent any new blocks.
Whether this is a good thing or not, I've forked the repo and added a new branch scrolling-inventory. It adds a new feature, if the player keeps pressing down, the inventory scrolls down, and vice versa.

Do you think this is a good idea? Should there be more slots or are the ones currently available good enough? Is there anything else I should add or is it due for a redesign.

It's not complete yet. For one, there is no indication of more slots yet so users have no idea there is more.
But before I continue further, I must ask for your opinion.

If you think this is a good idea, I will be happy to open a pull request.

Thanks, M.

New Tech, upgrade graphics??

It would be interesting if we could maybe try to up the graphics in a setting because of the new technology. The new calcs could probably handle using floats instead of integers (in a reduced render distance)

I don't know if you ever tried using floats, but it could be interesting.

Special Block Data?

I'm wondering how special block data is handled?

I can see that they use some sort of bit-shift system to store block side and whatnot, but how exactly does this work?
And other than block-side is any other data sent to blocks?

I basically just want to know how blocks are represented in terms of binary and how that works? Like what bits are used for what data.
Thanks.

Lever/Switch, texture questions

I'm working on adding additional blocks and in order to do this I had to modify the terrain.png, in the long term it will no longer be 16x16 and follow something more like TU69's terrain.png, but with a modified layout to be more consistent with the existing terrain.png

But anyway, while working on that, I realised that the switchrenderer.cpp references the texture at terrain_atlas[10][15]
I was basically just wondering what this texture is and why it is used, thanks.

Also, just wondering, other than modifying the terrain.cpp file, would anything else need to be changed to support terrain.pngs with a larger size (in terms of rows and columns)?

and also, does Crafti natively support terrain.pngs with textures which aren't 32x32 resolution?

Thank you in advance

Doors, switches and other

I really enjoy this game but was wondering how to open a door, flick a switch, etc.

EDIT: If you need it, I am using the file from the last page of the omnimaga thread

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.