CC:Tweaked 1.120.2 backport to Forge 1.12.2 [Very WIP]

Yesterday evening I was talking with someone about speakers and discovered that the 1.12.2 version is stuck on a pre-pcm version and also still used craftos 1.8. I decided to backport the latest version using parts of the 1.4.7 port which is on craftos 1.9 as well as a lot of shims and build system trickery to make it work properly. Its nowhere near fully tested or finished yet but slowly getting there. I try to keep compatibility with old extension mods and from my short tests, it seems to still work.

u/MinkiTheAvali — 6 days ago
▲ 17 r/halftop+1 crossposts

Macbook Air M1 halftop - Need help with Asahi

I have an M1 Air halftop and I just installed asahi, the installation process ran successfully and i get a boot chime after the step2 ran through in recovery but i now do not get any video output from my usb-c after turning on the computer, it seems to be going into UEFI but doesnt output video to my external monitor so i cant see what its doing, any help with this would be appreciated

reddit.com
u/MinkiTheAvali — 28 days ago
▲ 20 r/ComputerCraft+1 crossposts

644 character SUBLEQ emulator capable of booting Linux

I made a minimal SUBLEQ architecture emulator for Lua which also works on Computercraft, It is fully capable of booting a recent Linux kernel. I tried to make it as small as possible and over a couple hours of discussing and testing managed to get it down to 644 characters. Big shoutout to the Minecraft Computer Mods Discord server, without the community there, this would still be over 700 characters.

s="";M=math.floor;function b(a)a=a%2^32;return a>=2^31 and a-2^32 or a end;function d(a)return a<0 and-M(-a/4)or M(a/4)end;f=io.open(arg[1]):read("a")g={}for c=0,M(#f/4)-1 do g[c]=s.unpack("<i4",f,c*4+1)end;function j(e)return g[e]or 0 end;l=0;m=0;function o()p=j(l)l=l+1;if p%2==0 then return d(p)else return d(j(d(p)))end end;while''do u=o()v=o()w=o()if w==0 then break elseif u==-1 then g[v]=0 elseif v==-1 then x=j(u)%256;io.write(s.char(x))io.stdout:flush()else if u==64 then y=os.time()g[64]=b(y%2^32)g[65]=M(y/2^32)g[66]=0 end;z=b(j(v)-j(u))g[v]=z;m=m+1;if z<=0 then l=w end end;if m>8e5 and j(0)~=0 then g[1]=b(l*4)l=d(j(0))m=0 end end

This emulates the processor, RAM, clock and a simple UART output.

Tested working with this kernel image.

reddit.com
u/MinkiTheAvali — 1 month ago
▲ 116 r/ComputerCraft+2 crossposts

ClassiCube for ComputerCraft PUBLIC BETA RELEASE

It has been a hot minute but I finally have this project in a state where I feel comfortable sharing my first public version. It works well with both Vanilla and enhanced ClassiCube servers. Custom servers that make heavy use of extra models and textures however do not work correctly as of now, custom blocks are broken to a point of unplayable with MCGalaxy server software which is why they are default disabled for now. The client uses textures I made in GIMP and public domain music.

You can download the beta version here for now. A Codeberg repository is coming soon.

Please report bugs encountered during vanilla gameplay back to me!

u/MinkiTheAvali — 6 days ago
▲ 144 r/PhoenixSC

Minecraftception (A ClassiCube client I wrote running inside ComputerCraft)

ComputerCraft is a Minecraft mod that adds small virtual computers to the game which is originally mostly meant for automatisation in redstone systems like farms and for map building. The computers use the Lua programming language and while they don't expose any 3D rendering capabilities themselves, that is nothing that a software renderer cannot solve!
Details on my ClassiCube client for ComputerCraft (aka C24C2) can be found over on r/ComputerCraft where I post updates on my progress.

u/MinkiTheAvali — 2 months ago

C24C2 Progress Update

Its been a bit since my last post about the ClassiCube client for CompuerCraft I'm working on. I have not published it yet as I decided i want to iron out some of the issues first.

Here are some of the major changes so far:
- Dithering support for semi-transparency and for block sides to add depth
- Player models
- Entity Shadows
- Better movement system with distance based fall acceleration and terminal velocity

u/MinkiTheAvali — 2 months ago
▲ 166 r/ComputerCraft+2 crossposts

ClassiCube for ComputerCraft (C24C2) - ClassiCube client running on top of PinePix / Pine3D stack, using ClassiCubes official WebSocket proxy

This is still very WIP but here are some technical details:

The connection works through the use of the WebSocket protocol, normal minecraft servers and clients use TCP which works very similar but is not directly compatible. However, ClassiCube has a web client on their website which uses a WebSocket proxy to convert TCP to WSS connections. This client makes use of that feature to connect to the Minecraft server.

The graphics are rendered using Pine3D for the geometry and culling with a slightly modified version of the PinePix extension for handling the affine texture mapping as well as transparency. This does require the CC:Graphics mod to be installed as it makes use of a 256 colour palette (16 reserved for terminal/text colours, 216 for the texture atlas and 4 for the skybox). This can most likely be made to work with 16 colours through the use of dithering although I have yet to test or implement such a feature.

For performance, the map is split up into quadratic chunks of 16x16x16 blocks which are loaded depending on camera view and render distance. Each chunk is split into 8x8x8 sub-chunks which are used by the meshing engine which determines which faces to hand to the rendering pipeline.

Since Minecraft uses gzip for map data compression, the client makes use of the LibDeflate.lua written by Haoqian He (Github: SafeteeWoW) which was bundled in JacMacWindow's CC-Archive repository.

All details regarding the protocol have been based on my own C99 implementation of a Minecraft 0.30 server which is available on my Codeberg, details on my research into the protocol can be found in said repository.

Please keep in mind, this client is not a parity client. It is a reimplementation from scratch which in many places guesstimates and approximates the behavior of Minecraft. In its current WIP state, especially the player movement physics are a very rough estimate.

Legal disclaimer: USE THIS CLIENT AT YOUR OWN RISK! if you are planning on joining a server that is not yours, I am not responsible for any moderative actions that may be taken against you due to inaccuracies that may result in an unfair advantage over other players. All resources used within this client (textures, fonts, etc) are material of the public domain unless explicitly listed otherwise and none are affiliated in any way with Microsoft or Mojang studios.

With that out of the way, I currently do not have an installer for the client yet. I will update this post once a usable public version is available and once i have heard back from the classicube administrators if i am permitted to use their proxy service for this.

u/MinkiTheAvali — 2 months ago

Quake map viewer in PinePix

As an example for how to use PinePix in more complex programs, I started writing a quake map renderer. It uses the new PinePix texture mapping features. I will attempt to add support for light maps as well in the future so baked lighting can be used.

u/MinkiTheAvali — 3 months ago
▲ 463 r/avali

AWii

4 AM me should not have access to Photoshop lol

Someone wanted to say "a wii" but said "awii" and i first read "avali" so uh, I made this xD

u/MinkiTheAvali — 3 months ago

PinePix - A Pine3D wrapper library for high resolution and up to 256 colour rendering under CC:Graphics and CraftOS

Get it here on Pinestore: https://pinestore.cc/projects/239/pinepix

FEATURES
--------

Pixel mode (256-colour framebuffer)
  Switches the terminal to CraftOS-PC graphics mode 2.
  The Pine3D color buffer is blitted to the screen as raw pixels.
  The 16 CC palette entries are replicated at 80%, 65%, and 50% brightness
  to give 64 usable palette slots for shading.

Directional lighting
  Each polygon is dot-product shaded against a world-space light direction.
  Four shade levels: full, 80%, 65%, 50%.
  The light vector is transformed into each object's model space so shading
  stays correct as objects rotate.

Winding fix
  Pine3D culls faces designed for interior (dungeon) rendering.
  Both pixel mode and teletext mode include a v1<->v2 winding swap so that
  outward-facing geometry renders correctly from an exterior camera.

Pixel font
  gfx.drawString draws 3x5 pixel text directly to the framebuffer.
  Supports A-Z, 0-9, and a handful of symbols. Input is uppercased
  automatically.

OC colour space
  gfx.enableOC() programs all 256 palette slots with the OpenComputers
  fixed colour grid (5x8x6 RGB entries 0-239 plus a 16-step greyscale ramp
  240-255). Textures are quantized to the nearest OC colour at registration
  time using squared RGB distance. Solid geometry colours are pre-mapped via
  a lookup table built at enableOC() time. CC palette slots 0-15 are saved
  before overwriting and restored automatically on gfx.disable().

Texture mapping
  gfx.drawTexturedObjects allows for rendering objects with mapped textures
  through a UV space onto the screen. It is pixel accurate but costly if
  many textures are to be drawn.

  gfx.drawFastTexturedObjects is a faster variant of drawTexturedObjects
  that interpolates UV coordinates linearly across each scanline instead of
  correcting for perspective. There is no per-pixel division, so rendering
  is noticeably faster on complex geometry. Textures may warp slightly on
  oblique or steeply angled faces.

P3D binary model format
  gfx.loadModel reads a compact P3D v1 binary file into a polygon table
  ready for drawTexturedObjects. A face costs 31 bytes on disk versus
  roughly 200 bytes as embedded Lua. convert_obj.py converts OBJ files to
  P3D + BMP texture in one step.FEATURES
--------

Pixel mode (256-colour framebuffer)
  Switches the terminal to CraftOS-PC graphics mode 2.
  The Pine3D color buffer is blitted to the screen as raw pixels.
  The 16 CC palette entries are replicated at 80%, 65%, and 50% brightness
  to give 64 usable palette slots for shading.

Directional lighting
  Each polygon is dot-product shaded against a world-space light direction.
  Four shade levels: full, 80%, 65%, 50%.
  The light vector is transformed into each object's model space so shading
  stays correct as objects rotate.

Winding fix
  Pine3D culls faces designed for interior (dungeon) rendering.
  Both pixel mode and teletext mode include a v1<->v2 winding swap so that
  outward-facing geometry renders correctly from an exterior camera.

Pixel font
  gfx.drawString draws 3x5 pixel text directly to the framebuffer.
  Supports A-Z, 0-9, and a handful of symbols. Input is uppercased
  automatically.

OC colour space
  gfx.enableOC() programs all 256 palette slots with the OpenComputers
  fixed colour grid (5x8x6 RGB entries 0-239 plus a 16-step greyscale ramp
  240-255). Textures are quantized to the nearest OC colour at registration
  time using squared RGB distance. Solid geometry colours are pre-mapped via
  a lookup table built at enableOC() time. CC palette slots 0-15 are saved
  before overwriting and restored automatically on gfx.disable().

Texture mapping
  gfx.drawTexturedObjects allows for rendering objects with mapped textures
  through a UV space onto the screen. It is pixel accurate but costly if
  many textures are to be drawn.

  gfx.drawFastTexturedObjects is a faster variant of drawTexturedObjects
  that interpolates UV coordinates linearly across each scanline instead of
  correcting for perspective. There is no per-pixel division, so rendering
  is noticeably faster on complex geometry. Textures may warp slightly on
  oblique or steeply angled faces.

P3D binary model format
  gfx.loadModel reads a compact P3D v1 binary file into a polygon table
  ready for drawTexturedObjects. A face costs 31 bytes on disk versus
  roughly 200 bytes as embedded Lua. convert_obj.py converts OBJ files to
  P3D + BMP texture in one step.
u/MinkiTheAvali — 3 months ago