This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
SquidDev's profile picture

[MC1.12+][Fork] CC: Tweaked

Started by SquidDev, 15 November 2017 - 05:20 PM
SquidDev #1
Posted 15 November 2017 - 06:20 PM


What?
CC: Tweaked is a fork of ComputerCraft which aims to provide earlier access to experimental and in-development features of the mod.

I'm not aiming to create a competing fork of ComputerCraft, nor am I planning to take it in in a vastly different direction to the original mod. In fact, CC: Tweaked aims to be a nurturing ground for various features, with a pull request against the original mod being the end goal.

CC: Tweaked also includes many pull requests from the community which have not yet been merged, offering a large number of additional bug fixes and features over the original mod.

Features
CC: Tweaked contains the all features of the latest alpha, as well as numerous bug fixes, performance improvements and several additional features. Whilst a full changelog can be found on the GitHub release page, here's a couple of exciting features:
  • Replace LuaJ with Cobalt.
  • Allow running multiple computers at the same time.
  • Websocket support in the HTTP library.
  • Wired modems and cables act more like multiparts.
  • Adds the /computercraft command, offering various diagnostic tools for server owners. This allows operators to track which computers are hogging resources, turn on and shutdown multiple computers at once and interact with computers remotely.
  • Add full-block wired modems, allowing one to wrap non-solid peripherals (such as chests).
  • [1.80pr1] Add binary mode to HTTP.
  • [1.80pr1] Dyable pocket computers and turtles.
  • [1.80pr1] Allow computer and monitors to configure their palette. Also allow normal computer/monitors to use any colour, converting it to greyscale.
  • [1.80pr1] Add require to the shell environment.
Download
CC: Tweaked can be downloaded from CurseForge. The source can be found on GitHub.

Contributing
Any contribution is welcome, be that using the mod, reporting bugs or contributing code.

If you find a bug, report it on the CC: Tweaked issue tracker and not the ComputerCraft one. Whilst there's a chance the bug may apply to both versions, I would like to confirm that before copying it across.

If you wish to contribute code, do consider submitting it to the ComputerCraft repository instead: after all, that is the primary place for ComputerCraft development.
Edited on 24 January 2020 - 07:43 AM
KingofGamesYami #2
Posted 15 November 2017 - 10:43 PM
*Notices my PR was included* Woo!
Overall, this looks pretty nice. It's not actually a fork of the main repository on github, probably because github doesn't allow you to merge PRs that way? I'm not sure, but I really hope these changes make it into the main mod soon.
Edited on 15 November 2017 - 09:43 PM
SquidDev #3
Posted 15 November 2017 - 10:57 PM
*Notices my PR was included* Woo!
Of course! I'm looking forward to (ab)using it.

It's not actually a fork of the main repository on github, probably because github doesn't allow you to merge PRs that way?
I wanted to, but GitHub doesn't allow you to have multiple forks of the same project. Given that I needed to keep my "normal fork" of ComputerCraft around in order to PR changes, this was the only option. On the bright side, it does make the repo a little easier to search - GitHub reduces the functionality of forked repos somewhat.
Edited on 15 November 2017 - 09:58 PM
Bomb Bloke #4
Posted 19 November 2017 - 06:28 AM
Played around for a bit this afternoon and couldn't find any broken functionality other than in mon.getTextScale(), which always returns 1… which I assume is a problem within the implementation here?
SquidDev #5
Posted 19 November 2017 - 01:59 PM
Played around for a bit this afternoon and couldn't find any broken functionality other than in mon.getTextScale(), which always returns 1… which I assume is a problem within the implementation here?
Good catch! I didn't test that PR as I thought it would be simple enough, but sadly CC is never as simple as that. I've submitted a fix for that, so it should show up in the next release. Thanks!

I've noticed some issues with computers not appearing to be on when they definitely are, so it'd be much appreciated if you could keep an eye out to confirm/deny that. I'm not entirely sure if this is a 1.12 issue or something which broke in one of my PRs.
Edited on 19 November 2017 - 01:00 PM
Bomb Bloke #6
Posted 19 November 2017 - 02:23 PM
I've noticed some issues with computers not appearing to be on when they definitely are, so it'd be much appreciated if you could keep an eye out to confirm/deny that. I'm not entirely sure if this is a 1.12 issue or something which broke in one of my PRs.

Come to think of it, I did notice that behaviour, and hadn't before (despite having used vanilla CC a fair bit under 1.12) - assumed it was something to do with my code causing a shutdown, but taking a closer look, the affected system is running correctly.

It appears the frontal texture isn't updated until term.setCursorBlink() is called (so a startup script with "while true do os.pullEvent() end" should be enough to reproduce it, assuming you're cold-booting your systems).
Edited on 19 November 2017 - 01:25 PM
SquidDev #7
Posted 19 November 2017 - 03:17 PM
It appears the frontal texture isn't updated until term.setCursorBlink() is called (so a startup script with "while true do os.pullEvent() end" should be enough to reproduce it, assuming you're cold-booting your systems).
Weirdly enough, terminal blinking marked a computer as changed but it turning on/shutting down didn't. Normally this didn't matter as the terminal would clear and so the state would be transmitted. However, I've changed that behaviour so this caused issues. Anyway, it's all fixed now and should be in the next release.

Thanks for this testing and sorry for the bugs. Though I guess it's better if it surfaces now than in appearing in "actual" ComputerCraft :)/>.
Edited on 19 November 2017 - 02:18 PM
SquidDev #8
Posted 01 December 2017 - 08:02 PM
I've finally got round to pushing a new update to CC: Tweaked. This is mostly composed of bug fixes, though there are several new features:
  • Fix term.getTextScale() not working across multiple monitors.
  • Fix computer state not being synced to client when turning on/off.
  • Provide an API for registering custom APIs.
  • Render turtles called "Dinnerbone" or "Grumm" upside-down.
  • Fix getCollisionBoundingBox not using all AABBs.
  • Experimental: Add map-like rendering for pocket computers.
I'd really appreciate people's thoughts on the map-like rendering. Whilst it's an improvement over CCTweaks's implementation, it's far from ideal. Have a look at the PR for more information
Edited on 01 December 2017 - 07:40 PM
DannySMc #9
Posted 06 December 2017 - 01:15 AM
Hey Squid,

Any documentation on how the websocket addition to HTTP works?

Thanks,
SquidDev #10
Posted 07 December 2017 - 04:12 PM
Any documentation on how the websocket addition to HTTP works?
I've slowly begun putting together documentation on the GitHub wiki. Not everything is there, but most of the major changes are.

In other news, I've pushed a new release to CurseForge. It hasn't shown up yet (it's been in review for ~7 hours now), but do grab it once available.

Changelog
  • Add /computercraft command, providing various diagnostic tools.
  • Make http.websocket synchronous and add http.websocketAsync.
  • Restore binary compatibility for ILuaAPI. This fixes crashes under 1.80pr1.2 with Plethora.
SquidDev #11
Posted 21 February 2018 - 03:57 PM
I've just pushed another update to CC: Tweaked. This adds several useful new features, as well as making the mod even more stable. I've been working closely with SwitchCraft and Project</Beta> to iron out numerous CC issues. Using these fixes, SwitchCraft went from crashing every few hours to being relatively stable.

Changes from the last ComputerCraft alpha
  • Verify the action can be completed in copy, rename and mkdir commands.
  • Add /rom/modules so the package path.
  • Add read to normal file handles - allowing reading a given number of characters.
  • Various minor bug fixes.
Changes from the last CC:Tweaked release
  • Ensure ComputerCraft peripherals are thread-safe. This fixes multiple Lua errors and crashes with modems monitors.
  • Add /computercraft track command, for monitoring how long computers execute for.
  • Add ore dictionary support for recipes.
  • Track which player owns a turtle. This allows turtles to play nicely with various claim/grief prevention systems.
  • Add config option to disable various turtle actions.
  • Add an API for extending wired networks.
  • Add full-block wired modems.
  • Several minor bug fixes.
Like always, the release can be found on CurseForge.
Edited on 21 February 2018 - 04:52 PM
SquidDev #12
Posted 15 March 2018 - 05:38 PM
I've just pushed another release of CC:Tweaked to CurseForge. There's no major changes here: it's mostly composed of fixes for various monitor bugs (some introduced in 1.80pr1.4, some which have been around for a long time). Many thanks to Lignum for their fixes for some of the graphical issues.

Changes from the last CC:Tweaked release
  • Several additional fixes to monitors, solving several crashes and graphical glitches.
  • Add recipes to upgrade computers, turtles and pocket computers.
Edited on 15 March 2018 - 04:39 PM
SoruCoder #13
Posted 18 March 2018 - 09:29 PM
Noob question, but is this supposed to be a replacement for the ComputerCraft mod, or a dependent thereof? And if so, are all mods that are made for the nightly builds of ComputerCraft 1.80pr also compatible with this?
Bomb Bloke #14
Posted 19 March 2018 - 01:23 AM
It's a fork - an alternate version based on the original code, not an addon that runs alongside the original version.

Other mods which are compatible with the mainline version of ComputerCraft may or may not be compatible with this version (but you should expect most, if not all, of them to work). Same deal with scripts, although any of those that work in CC but not CC:T would warrant a bug report to SquidDev.

At this point in time, I believe most users would be better off running CC:T.
Edited on 19 March 2018 - 12:25 AM
SquidDev #15
Posted 19 March 2018 - 08:16 AM
And if so, are all mods that are made for the nightly builds of ComputerCraft 1.80pr also compatible with this?
To add to what BombBloke said, I'm not aware of any mods which aren't: SwitchCraft has been running CC:T with running Plethora, Computronics and OpenComputers and not seen any integration issues so far. I'm very careful to maintain backwards compatibility, so unless a mod is doing something seriously wacky it should work.
SquidDev #16
Posted 15 May 2018 - 06:18 PM
I've just pushed another release to CC:Tweaked. There's nothing exactly groundbreaking, but there's definitely a couple of useful bugfixes and features:

Changes from the last CC:Tweaked release
  • Allow network cables to work with compact machines. They do not currently visually connect, but are still usable.
  • A large number of improvements to the /computercraft command, including:
    • Ensure the tables are correctly aligned
    • Remove the output of the previous invocation of that command when posting to chat.
    • /computercraft track is now per-user, instead of global.
    • We now track additional fields, such as the number of peripheral calls, http requests, etc… You can specify these as an optional argument to /computercraft track dump to see them.
  • wget automatically determines the filename (Luca0208)
  • Allow using alternative HTTP request methods (DELETE, PUT, etc…)
  • Enable Gzip compression for websockets.
  • Fix monitors not rendering when optifine shaders are enabled. There are still issues (they are tinted orange during the night), but it is an improvement.
Minor changes/fixes
  • Fix .isDiskPresent() always returning true.
  • Fix peripherals showing up on wired networks when they shouldn't be.
  • Fix turtle.place() crashing the server in some esoteric conditions.
  • Remove upper bound on the number of characters than can be read with .read(n: number).
  • Fix various typos in keys.lua (hugeblank)
Just to say a massive thank you to Luca0208 and hugeblank for their contributions! Luca has added a feature I've been wanting for a while, but never got round to implement. huge fixed typos in a file I must have read many times, but never noticed.

On a semi-related note, if you're interested, I've put together a little write up of the various profiling tools CC:T offers. It's intended more as a casual blog post than documentation, but it may prove interesting/useful. Any comments are welcome - I'm not much of a writer so feel free to critique my prose.
Edited on 15 May 2018 - 04:18 PM
Bomb Bloke #17
Posted 16 May 2018 - 02:15 AM
Why not just rate limit things?

Oh er not sure I like the sound of that.

Are we talking number of resumes per tick, or number of calls per yield, or…?
SquidDev #18
Posted 16 May 2018 - 07:20 AM
Why not just rate limit things?
Oh er not sure I like the sound of that. Are we talking number of resumes per tick, or number of calls per yield, or…?
I don't plan on doing any rate for execution time, as I feel "too long without yielding" is "good enough" for most cases. I think there are some improvements which could be made to allow execution time to be more fairly spread across computers, but that's not a priority.

I'm currently investigating only investigating rate limiting HTTP requests, as there's been some issues with broken programs running requests in an infinite loop, saturating the bandwidth. There's an issue describing things in a little more detail, but it mostly boils down to "stop people downloading stupidly large files or a stupid number of files".

If people have any thoughts on all of this, do say! The general aim is to make the default configs relatively server, while not impacting any single player world which is slightly more abusive of resources. However, I'm not exactly renowned for balancing things well, so any feedback is welcome!
Dreossk #19
Posted 09 June 2018 - 02:43 AM
I reported a bug for ComputerCraft here: https://github.com/d...raft/issues/549, then I saw CC Tweaked might actually be the most recent ComputerCraft mod? My problem is about computers not booting when I login on a server. Is that problem fixed in CC Tweaked? If I switch to this mod should I destroy my computers in the game before?
Edited on 09 June 2018 - 12:43 AM
Bomb Bloke #20
Posted 09 June 2018 - 05:10 AM
Over time there have been various attempts and failures to fix the startup bug. I'm pretty certain it's squashed for good in CC:Tweaked, though.

You don't need to destroy your old computers if switching, although it never hurts to make a backup copy of your world before messing with your mod collection.
Dreossk #21
Posted 13 June 2018 - 01:19 AM
It works indeed now. Thanks!
SquidDev #22
Posted 09 July 2018 - 09:05 PM
Just pushed another version of CC:Tweaked (1.80pr1.7 for those people who, like me, have lost track). There's no major changes, just a couple of QOL improvements:


Fancy rendering of printouts
I've rewritten a large portion of printed pages in an attempt to make them look a little bit more sane. When you've got a large number of pages, they'll have a bit more of a "curl", which in my opinion looks much better. As you may have noticed from the screenshot, you can also hold them in-hand and place them in item frames, though this does not allow you to read beyond the first page.

I'm still not entirely happy with how they look, so if people have any opinions do let me know on the PR.

Changed turtle block breaking
This was more out of necessity rather than desire, but I've rewritten how turtles break blocks to more closely match how players do it. This should mean there's less bugs, however there are a couple of side effects. Most notably, breaking a chest will deposit the items inside the turtle (if there's room) instead of leaving them on the ground.

.getNameLocal
Wired modems now provide a method which allows you to get the name of this computer on the wired network, effectively a pair of .getNamesRemote. This is mostly of interest to people (ab)using Plethora's transfer system, though I'm sure there are other uses of it too. I'm not entirely settled on the name, so suggestions are welcome!

Minor fixes
  • Improve formatting of /computercraft when run by a non-player.
  • Fix pocket computer terminals not updating when being held.
  • Fix a couple of minor blemishes in the GUI textures.
  • Fix sign text not always being set when placed.
  • Cache turtle fakeplayer, hopefully proving some minor performance improvements.
Ta©ti_Tac0Z #23
Posted 16 July 2018 - 08:20 PM
how does this work: "Websocket support in the HTTP library"?
SquidDev #24
Posted 16 July 2018 - 08:37 PM
how does this work: "Websocket support in the HTTP library"?
https://github.com/SquidDev-CC/CC-Tweaked/wiki/http-library
Ta©ti_Tac0Z #25
Posted 23 July 2018 - 11:31 PM
how does this work: "Websocket support in the HTTP library"?
https://github.com/S...ki/http-library

define "remote server"
CLNinja #26
Posted 24 July 2018 - 01:57 AM

…A server… that isn't local…
Ta©ti_Tac0Z #27
Posted 25 July 2018 - 10:02 PM

…A server… that isn't local…

… yes i know that thank you but any "spesific" type of remote server (what protocal is perhaps a better term)
SquidDev #28
Posted 25 July 2018 - 10:09 PM
… yes i know that thank you but any "specific" type of remote server (what protocol is perhaps a better term)
It just works with any server which supports HTTP upgrade/the websocket protocol. I'm afraid I'm rather confused what you're asking for,
Edited on 25 July 2018 - 08:09 PM
Ta©ti_Tac0Z #29
Posted 27 July 2018 - 04:52 PM
yes me two so both the http and the http.socket table then does the same???
SquidDev #30
Posted 28 July 2018 - 09:37 PM
As you may be aware, Minecraft 1.13 was released not long ago. While a version of Forge is probably several months away (due to the large amount of refactoring they are doing), I thought it'd be worth getting on with some refactoring of my own in order to prepare for the update.

You can see my progress on the PR - I've been trying to write some update posts as I'm going along, to try to explain the changes and rationale behind them. If people have any thoughts on the whole thing, or would be willing to help me test things, do get in touch!
Bomb Bloke #31
Posted 29 July 2018 - 06:02 AM
Yeah, I noticed GamePedia was suddenly flooded with footnotes saying "1.13 is different". Heck, even the bulk of my Command Computer scripts are certain to go splat, and not just due to simple matters of syntax. I'm guessing 1.12.2 will be well established as another 1.7.10 by the time Forge updates, and once again many modders will stay behind.

The logic behind "the Minecraft side of things" really isn't my field, but certainly I can test.
SquidDev #32
Posted 16 August 2018 - 09:31 PM
So it's been a couple of weeks since the above post and I thought I'd post a status update (and beg for help, but we'll get onto that).

As a little bit of background, Minecraft 1.13 introduced an awful lot of changes in how Minecraft functions internally. As this means some features of CC will need to be restructured, it seemed as good a time as any to go through the mod and refactor some elements. ComputerCraft is a relatively old mod, and has been through a lot of Minecraft versions. Consequently, there's a lot of code which once was "the only way to do it", but now is strongly discouraged.

One of the biggest changes MC 1.13 introduced was "the flattening". This effectively removes block metadata and item damage, encouraging people to split things into separate blocks. For instance, almost all peripherals used to be stored under one block, some storing rotation information in block damage, others in NBT. The flattening allows (well, requires) us to split this into separate blocks - meaning we can simplify an awful lot of code.

The result of this is a mod which is about 3k LOC smaller (about 7% of the mod), with substantially simpler code and much less indirection. Oh, and an awful lot of bugs. That's where you come in:

While I have done some pretty thorough testing I can guarantee I have missed things. If you'd be willing to devote some time either to explicitly testing the changes, or just running the modified version of a mod in a testing world it would be much appreciated. I've put some instructions on how to go about this on the associated PR.
SquidDev #33
Posted 23 August 2018 - 06:01 PM
I've just noticed (as if I haven't been monitoring for the last few days) that we've hit 10k downloads on CurseForge. While downloads isn't really an indication that people are using the mod (80% of downloads have come from a single pack) it's as good a benchmark as any and so is cause for celebration.

Party! Party!

I'd like to thank everyone who has contributed to both CC and CC:Tweaked over the last 15 months. It's been a fantastic journey to see the mods progress from something which barely functioned in 1.9, to today's 1.12.2 mod, with a whole host of features I never thought I'd see. Special shoutout to apemanzilla, who only today found and fixed a bug in turtle placing!
Edited on 23 August 2018 - 04:03 PM
SquidDev #34
Posted 25 August 2018 - 11:10 AM
I've just pushed a new version of CC:Tweaked (with the glorious version number of 1.80pr1.8). It should show up on CurseForge in the next few hours, but until then, here's a snapshot of the changes:

Changes from the last CC:Tweaked release
  • Bump Cobalt version
    • Default to using little endian in string.dump
    • Remove propagation of debug hooks to child coroutines
    • Allow passing functions to debug.getlocal, al-la Lua 5.2
  • Add Charset support for bundled cables
  • /computercraft commands are more generous in allowing computer selectors to fail.
  • Remove bytecode loading disabling from bios.lua.
Minor fixes
  • Fix stack overflow when using turtle.place with a full inventory (thank you to apemanzilla for finding and fixing this)
  • Fix in-hand printout rendering causing visual glitches.
As always, a massive thank you to everyone who has helped test the mod and reported bugs since the last release.
rowas #35
Posted 05 September 2018 - 03:33 PM
I've just pushed a new version of CC:Tweaked (with the glorious version number of 1.80pr1.8). It should show up on CurseForge in the next few hours, but until then, here's a snapshot of the changes:

Changes from the last CC:Tweaked release
Bump Cobalt version
Default to using little endian in string.dump
Remove propagation of debug hooks to child coroutines
Allow passing functions to debug.getlocal, al-la Lua 5.2
Add Charset support for bundled cables
/computercraft commands are more generous in allowing computer selectors to fail.
Remove bytecode loading disabling from bios.lua.
Minor fixes
Fix stack overflow when using turtle.place with a full inventory (thank you to apemanzilla for finding and fixing this)
Fix in-hand printout rendering causing visual glitches.
As always, a massive thank you to everyone who has helped test the mod and reported bugs since the last release.

Squid, So glad to see someone pushing the mod forward.
I've wanted to get back into Minecraft for a while, and I was worried that I wouldn't be able to program turtles again.
The latest update you pushed out, is it compatible with 1.13? Or is that still to come?
Edited on 05 September 2018 - 01:34 PM
SquidDev #36
Posted 05 September 2018 - 05:01 PM
The latest update you pushed out, is it compatible with 1.13? Or is that still to come?
It's being worked on, but is still a way off. Forge, the modding framework that most mods use (CC included) is in the process of being ported and so we may still be a month away.
SquidDev #37
Posted 24 October 2018 - 01:19 PM
It''s been a while since the last update (wow, almost two months!), but I'm happy to announce a new release with an abundance of features and bug fixes. As always, you can download it from CurseForge (well, you will be able to when they've finished reviewing it).

The biggest change in this release is that I've rewritten how file handles are implemented, meaning they're now backed by ByteChannels instead of streams. This may seem largely cosmetic, but means we can now add seeking to binary files! In line with this, I've also rewritten the io library to more accurately emulate PUC Lua's version of it. While this should be largely compatible with the previous implementation, there is a risk of breaking existing programs - let me know if you find any problems.

I'd also like to give a shoutout to Vexatos for providing a German translation, and to gollark (aka osmarks) for finding and fixing a bug in the receive program. Contributions to both CC and CC:T are always welcome!

In other news, there's been very little progress on the 1.13 update. Forge's update process has taken longer than I was expecting, and most of the major contributors are rather burned out, so I'm afraid I can make no promises when it'll be ready.

In closing, CC:T has recently hit 40k downloads, which is a rather exciting milestone. Truth be told, almost all of those downloads come from one pack, but if it means greater exposure to CC/CC:T, I'm really not going to grumble! And no, I'm not mad at all that Plethora is much older and has still has fewer downloads.

Changes from the last CC:Tweaked release
  • Add German translation (Vexatos)
  • Add .getCursorBlink to monitors and terminals.
  • Allow sending binary messages with websockets.
  • Extend fs and io APIs
    • io should now be largely compatible with PUC Lua's implementation (:read("n") is not currently supported).
    • Binary readable file handles now support .readLine
    • Binary file handles now support .seek([whence: string[, position:number]]), taking the same arguments as PUC Lua's method. You can find out more on the CC:T wiki.
Minor fixes
  • Fix repeat program crashing when malformed rednet packets are received (gollark/osmarks)
  • Reduce risk of deadlock when calling peripheral methods.
  • Fix speakers being unable to play modded sounds.
SquidDev #38
Posted 24 October 2018 - 08:03 PM
Just updated the CC:T version of CCEmuX to 1.80pr9 (just launch it and restart to update), which allows me to do a nice side-by-side comparison of the old and new io library:


Also a fantastic way to show off some of mbs' fancy pretty-printing features :)/>.
Bomb Bloke #39
Posted 25 October 2018 - 01:07 AM
The biggest change in this release is that I've rewritten how file handles are implemented, meaning they're now backed by ByteChannels instead of streams. This may seem largely cosmetic, but means we can now add seeking to binary files!

Huh, I'll have to look into these "ByteChannel" things. I've just been using skip/mark/reset to "seek" through streams, and it'd be great to be able to do it "properly".

One of the good things about Java is that there's a class for everything. One of the bad things about Java is that there's a class for everything.

Just updated the CC:T version of CCEmuX to 1.80pr9 (just launch it and restart to update), which allows me to do a nice side-by-side comparison of the old and new io library:

What do the "file" thingies refer to?
SquidDev #40
Posted 25 October 2018 - 12:20 PM
One of the good things about Java is that there's a class for everything. One of the bad things about Java is that there's a class for everything.
Yeah, I think these came in around the same time as the whole "non-blocking IO" code, which would have been Java 6. There's some very nice features (especially the file system abstraction), but it's not the most intuitive to use.

What do the "file" thingies refer to?
It's just a table with a __tostring metamethod - I'm mostly doing it as that is what "actual" Lua does. stdout and stderr are just writable streams (though stderr writes in red al-la printError). stdin is just a wrapper for read, though apparently is somewhat broken.
SquidDev #41
Posted 05 November 2018 - 07:43 AM
stdin is just a wrapper for read, though apparently is somewhat broken.
Just to note that CC:T 1.80pr1.10 (I need a better naming scheme) has been released, which fixes several bugs introduced by the filesystem rework. Amongst the changes, there's a fix for io.stdin (and thus io.read) not working as expected.
IndustrialLemon #42
Posted 10 November 2018 - 01:40 AM
Hey sir, quick question. Are there any plans to add some or all of the features prevalent in the computeacube fork? I really enjoy the regex api and the fact that pocket computers act like maps, but also like the changes that come along with CC:tweaked.
SquidDev #43
Posted 10 November 2018 - 01:49 AM
Are there any plans to add some or all of the features prevalent in the computeacube fork? I really enjoy the regex api and the fact that pocket computers act like maps.
Pocket computers acting like maps is also present in CC:Tweaked (as well as printed pages having similar functionality). Interestingly enough, Computeacube's implementation of this comes from CC:Tweaked's predecessor.

As far as Computeacube's additional APIs go, I've no plans for adding them to CC:Tweaked. While PCREs are more powerful than Lua's patterns, introducing an API for them is a little grotty. It's another non-standard way of manipulating strings, and doesn't integrate as cleanly with the rest of the language.
Edited on 10 November 2018 - 12:49 AM
IndustrialLemon #44
Posted 10 November 2018 - 02:16 AM
Oh so lua has a way of accomplishing the same thing? I've no problem with that so long as I can pick at words from documents and possibly webpages.

EDIT: Also I'm sure there's a better place to report bugs but while I've got you. I just experienced a bug that was so hard to describe. I have a GPS system that runs off of a disk/startup dir and every time I would edit the disk/startup.lua file and save it would save the file with clips of the programming strewn about at the bottom. Every save it was worse. So, in the beginning, it was just a piece of, 'shell.run("gps host "..x, y, z)'. But a couple saves later and it was more like this.

  shell.run("gps host "..x, y, z)
end
t"..x, y, z)
end
end

t"..x, y, z)
en
end
x, y, z

end


Keep in mind everything after the first 'end' was deleted everytime each save before the next.
Edited on 10 November 2018 - 01:21 AM
SquidDev #45
Posted 10 November 2018 - 10:36 PM
EDIT: Also I'm sure there's a better place to report bugs but while I've got you. I just experienced a bug that was so hard to describe. I have a GPS system that runs off of a disk/startup dir and every time I would edit the disk/startup.lua file and save it would save the file with clips of the programming strewn about at the bottom.
Thanks for the report. I'm working on a fix, for the time being it might be worth downgrading to 1.80pr1.8 - the last couple of versions introduced an experimental rewrite of filesystems, and we're still working out a few kinks.
SquidDev #46
Posted 24 November 2018 - 02:32 PM
I've just pushed another CC:Tweaked release, which fixes the remaining issues with the file system rewrite (well, the ones I know about), as well as a couple of other bug fixes, and performance/stability improvements.

As far as interesting changes go (you can see the full changelog on GitHub)
  • Rename all tile entities to have the correct computercraft: prefix. Existing tile entities should be mapped via a data fixer, but please tell me if you encounter issues.
  • Fix files not being truncated when opened for a write.
  • .read* methods no longer fail on malformed unicode. Malformed input is replaced with a fake character (this is what CC did before).
  • Fix numerous issues caused when wireless modems were attached to wireless networks.
There's really not much I can say about this (aside from how embarrassing a couple of the bugs were), so I'm instead going to chunter about some of the backstory to one of the changes:

In preparation for this release, we updated SwitchCraft to use a development build of CC:T, just to see how stable it was. Unfortunately, the answer came all too soon, as SwitchCraft crawled to a halt.

Due to some other changes, some wireless modem code was now being called far more frequently than before. The function in question acquired a lock, added of removed something from a collection, and released the lock. However, this function would be called both on the main thread, and by several computers off-thread. The main thread would spent an awful lot of time waiting for other threads to finish, and so lagging the sever.

While we were able to fix this quite quickly (it turned out the lock wasn't really needed), we started having other issues - somehow, Java had created far too many threads, and so was unable to execute critical tasks. We didn't previously keep track of how many threads the JVM was using, but after adding that, we were able to see there was a bit of a problem.

While the number of "live" threads was pretty steady, the total number of threads ever created was growing. Rapidly. In fact, the JVM was creating, and then promptly destroying, 50 threads per second. The obvious solution here was to pool the threads: instead of creating and destroying them, we can take a thread from the pool, use it to run some Lua, and then return it once finished. This means you only need to create new threads when the pool is empty.

A couple of modifications to Cobalt later, and we had a graph which looked like this. The total number of threads looks far more healthy, but the number of live threads never goes down! The thread pool was set to evict threads which hadn't been used for a while, so something else was going on. It turns out, computers were not correctly cleaning up their coroutines when they shut down. We had a couple of computers which were stuck in boot loops, which only exacerbated the problem. Thankfully this was trivial to fix, leaving us with a graph which looks much more sane.

Ideally in the future, we would be able to move Cobalt to use one thread for all coroutines, which would substantially reduce the number of threads used (of the server's ~1.2k threads, ~1.1k are created by ComputerCraft), however that is still a way away. This'll have to do for now…

I'm sure there was a point for me writing this massive wall of text, but it eludes me. I hope somebody maybe finds this a little bit interesting :)/>.
Bomb Bloke #47
Posted 25 November 2018 - 02:16 AM
That's a lot more threads than I was expecting to see. About how many computers is SwitchCraft running on average?
SquidDev #48
Posted 25 November 2018 - 09:35 AM
That's a lot more threads than I was expecting to see. About how many computers is SwitchCraft running on average?
There's about 220 computers on right now. At a bare minimum, they'll be running 3-4 coroutines (the main coroutine, rednet.run, the shell, and maybe also multishell). There's a couple of computers with over 20 coroutines on the go, so not quite sure what they're doing.
Bomb Bloke #49
Posted 25 November 2018 - 10:51 PM
A couple hundred! I wonder if an automatic shut down timer should be implemented somewhere - there'd need to be a setting to disable it for individual computers (which the gps/repeat scripts should probably toggle automatically), but I suspect that in most cases, if a computer/turtle hasn't received an event in ~five minutes (half an hour? an hour?), it really doesn't need to be running at all. rednet.run seems a good place to slip one in, if it were to be done Lua-side, as that's already being resumed for all event types anyway.
SquidDev #50
Posted 26 November 2018 - 10:57 AM
But I suspect that in most cases, if a computer/turtle hasn't received an event in ~five minutes (half an hour? an hour?), it really doesn't need to be running at all.
Interestingly, we already track when computers receive events, and so have a plot of what computers have done something in the last minute*. From the looks of it, about half of them are doing something, though how important that something is a whole different matter. There's a couple of things to note though:
  • There are a reasonable number of computers which don't do anything, but need to respond to events when they get them. For instance, SC has a lot of shops, which need to respond to monitor touches.
  • CC:T has a command to shutdown all (or some) servers on a computer. We've used this in the past when the server is utterly choking, but you find the number of "on" computers is pretty much at the normal level within a few hours.
  • I'd argue that punishing computers not doing anything is a little counter-productive. Obviously every computer is a bit of a memory (and thread) drain, but computers doing more work than required is definitely more of an issue than computers just sitting doing nothing at all.
It'd kinda be interesting to do a "tab wrangler" type program, randomly shutting down computers if there's more than a specific number running. I'm not sure it'd be effective, but definitely interesting.

*I've just realised that SwitchCraft has just become one giant data-gathering operation for CC now. Oh well.
SquidDev #51
Posted 20 December 2018 - 06:02 PM
I've just pushed a new release of CC:T. It's mostly bug fixes, but there's some very minor improvements too:

Changes from the last CC:Tweaked releaseMinor fixes
  • Fix InventoryUtil ignoring the stack limit when extracting items
  • Fix computers not receiving redstone inputs sent through another block.
  • Fix JEI responding to key-presses when within a computer or turtle's inventory.
On a very unrelated note, I've been playing around with running CC:T on the 1.14 snapshots using a new modding toolchain called Fabric. Rest assured, I'm not going to leave 1.13 or Forge behind, but if you fancy messing around with CC:T (albeit a rather buggy and incomplete version), on Minecraft's bleeding edge, do check it out!
Bomb Bloke #52
Posted 21 December 2018 - 08:50 AM
There's a 1.14 already? Oy vey.
SquidDev #53
Posted 11 January 2019 - 09:57 PM
It's a new year, and thus must be time for a new CC:Tweaked release! I can't say it's an exciting release, but there's been a lot of internal changes, so I'd like to get them out before the changeset gets too crazy.

The big change this release is that I've (finally) rewritten the http API to entirely use Netty. While Netty has been used for websockets since they were first introduced, we've always depended on the Java standard library to make http requests. While this is convenient, it does end up being rather limiting in what we can do with it. The switch to netty offers several small, but critical advantages:
  • Support http to https redirects: While the http API has always handled redirects on the same protocol, it wouldn't allow redirecting between protocols. This means websites which automatically upgrade you to https will function as expected.
  • Allow using the PATCH request method: We've allowed using most other methods for a while now (GET, POST, PUT, DELETE, etc…), but not PATCH. This meant you had to use custom headers to interact with some REST APIs.
  • Less thread usage: Previously, every HTTP request would be run on a separate thread, which was a little inefficient. The asynchronous nature of netty means that ComputerCraft should rarely go above 8 threads, how ever many concurrent HTTP requests you are making.
I honestly didn't mean to write that much, but on the bright side, it now makes it look like there were actual changes this release! Even if they didn't impact anyone.

Just a couple of other things which changed this release:
  • The config file has had a bit of a spring cleaning: Related properties should be grouped into child categories (http, turtle, peripheral), which makes the whole file a little easier to navigate. This should be automatically upgraded when you load the mod, but let me know if you experience issues.
  • I've also begun work on implementing the long-discussed HTTP limits, as described in this issue. I've tested them a fair bit, but again if you experience issues (or regressions with the netty changes), do report them so they can be fixed ASAP!
  • There's also been an awful lot of cleanup going on throughout the main CC codebase. This issue documents it a little more, but we're pretty much just replacing our home-grown implementations with ones built into vanilla or Forge. It means we can delete an awful lot of code (always a plus), and hopefully make things more consistent too.
There's a couple more things I've not mentioned here in the release notes, if that's your sort of thing.
SquidDev #54
Posted 21 January 2019 - 05:30 PM
It's a bit soon to the last one, but there's just been another CC:Tweaked release. Not a lot has changed, but there's a couple of useful bug fixes and one (not very) exciting optimisation, so I thought it'd be better to get it into the wild sooner rather than later.

Changelog
  • Allow seeking within ROM files. I've wanted this since the initial implementation, but there were some unexpected problems. I've finally got round to implementing this (though it possibly is of dubious use).
  • Make several tile entities (modems, cables, and monitors) non-ticking, substantially reducing their overhead, On SwitchCraft this reduced tick time by about 10ms, though this is probably more than most people will see due to the Sponge overhead and the rather large number of monitors and cables.
  • That said, it's still a pretty large change, so let me know if you experience issues related to any of the peripheral blocks.
Minor fixes
  • Fix cables not rendering the breaking steps
  • Try to prevent /computercraft_copy showing up in auto-complete.
  • Fix several memory leaks and other issues with ROM mounts.
  • Fix not being able to craft upgraded turtles or pocket computers when Astral Sorcery was installed.
SquidDev #55
Posted 24 January 2019 - 09:44 PM


Spoilers! Yeah, I can't draw numbers very well.
Edited on 24 January 2019 - 08:45 PM
Bomb Bloke #56
Posted 24 January 2019 - 10:39 PM
Oh hey, you added turtles! :D/>

;)/>
SquidDev #57
Posted 21 February 2019 - 10:22 PM


Yeah, I'm bad at screenshots.

Anyway, I've just pushed an alpha of CC:Tweaked for Forge 1.13.2. A couple of things to note:
  • Forge is still pretty unstable (for instance, the current build, .45 is broken - you'll have to use .44). As a result, there's currently some features we can't implement and bugs we can't fix (there's some container desync, turtle upgrades don't always render. This should be resolved over the coming weeks.
  • This is not compatible with previous worlds: the save format has changed a lot, and there's nothing I can do to load worlds created in 1.12 or before.
  • We're still an alpha, and Minecraft internals have changed a lot - there will be bugs, and there are still changes to be made.
If you do have issues, questions, or just would like to see the work done, check out the pull request!

It's probably worth mentioning at this point that 1.12 will remain in development for a wee while yet - I'm expecting it to take a while before 1.13 has become "mainstream" (and 1.14 will probably be out before then).
SquidDev #58
Posted 23 February 2019 - 11:02 AM
There's just been another CC:Tweaked release! Probably the most obvious change here is that we're no longer using the "1.80pr1.x" versioning scheme - it's now just 1.81.0. There's a little bit more of an explanation on the issue, but it basically boils down to it being unreasonable to tie ourselves to CC versions, especially given there's not been any changes to the repo for almost a year.

Now, onto more exciting things! Like with most CC:T releases, there's been a fair few changes, but you're unlikely to notice any of them. The "big" change is that Cobalt got a lot of long-needed attention, meaning it's even more compliant to standard Lua, and a wee bit less resource intensive in places. Many thanks to SwitchCraft yet again for helping test things.

Also, many thanks to Lignum and WIlma456 for their PRs - one of the sad things about CC:T is that it has had much less community involvement than the original repo, so it's always nice to have other contributors! Anyway, the changelog:

Changes from the last CC:Tweaked release
  • Handle connection errors on websockets (Devilholk)
  • Make require a little more consistent with PUC Lua, passing the required name to modules and improving error messages.
  • Track how long each turtle action takes within the profiling tools
  • Bump Cobalt version
    • Coroutines are no longer backed by threads, reducing overhead of coroutines.
    • Maximum stack depth is much larger (2^16 rather than 2^8)
    • Stack is no longer unwound when an unhandled error occurs, meaning debug.traceback can be used on dead coroutines.
  • Reduce jar size by reducing how many extra files we bundle.
  • Add term.nativePaletteColo(u)r (Lignum)
  • Split colours.rgb8 into colours.packRGB and colours.unpackRGB (Lignum)
  • Printers now only accept paper and ink, rather than any item
  • Allow scrolling through the multishell tab bar, when lots of programs are running. (Wilma456)
Minor fixes
  • Fix modems not being advanced when they should be
  • Fix direction of some peripheral blocks not being set
  • Strip \r from .readLine on binary handles.
  • Websockets handle pings correctly
  • Fix turtle peripherals becoming desynced on chunk unload.
  • /computercraft tables are now truncated correctly
Bomb Bloke #59
Posted 25 February 2019 - 09:46 AM
The "big" change is that Cobalt got a lot of long-needed attention, meaning it's even more compliant to standard Lua

Well THAT sounds ominous…
SquidDev #60
Posted 25 February 2019 - 10:45 AM
Well THAT sounds ominous…
At this point it's just really minor things about when/how debug hooks are called, how the stack is unwound, etc… There shouldn't be any noticeable behaviour changes. The other changes are far more likely to cause issues.
Edited on 25 February 2019 - 12:04 PM
SquidDev #61
Posted 08 March 2019 - 10:13 PM
It's been another six months since I touched my website, which means it must be time for another blog post! I thought it would be fun (for me, probably not for you) to write about some of the changes made to CC's internals in the previous and next CC:T versions. I'm afraid it's rather long, and rather dense - there's not very many things you can take images when discussing internals.

One thing I would like to highlight though is this issue about documentation. I'd really like to rethink how CC's APIs are documented, in an effort to keep up-to-date. I've put together a little (massive) proposal, but I may be over-complicating things. If you have any ideas, suggestions, or just feel like it, do comment!

On a side note, we just smashed past 450k downloads, largely due to our inclusion within the FTB Ultimate Reloaded pack. Obviously the vast majority of people aren't actually using CC:T at all, but it's definitely nice to see some mainstream packs adopting it.
Edited on 09 March 2019 - 01:55 PM
Bomb Bloke #62
Posted 09 March 2019 - 01:27 PM
FTP lol. You've got downloads on the brain. ;)/>

Long since past time that CC:T made it into a mainstream pack, though.
SquidDev #63
Posted 02 April 2019 - 09:36 PM
I've just pushed another release of CC:Tweaked to CurseForge, with the ever-exciting version number of 1.82.0. What's more exciting is the changelog though. It's a bit unwieldy, so I'm only going to go through the hightlights rather than milking it like I normally do. You can always read the whole thing if you like.

Firstly, may thanks to the people who have contributed to this release: absolument, Ale32Bit, daelvn, nothjarnan, hydraz, Luca0208 and WIlma456. If people have suggestions, ideas or code, please do contribute. I'd also recommend keeping an eye on the issue tracker, as there's always things I'd like feedback on.
  • Computers may be preemptively interrupted if they run for a long time. This shouldn't result in any noticeable change in behaviour, but means badly/malicious computers have less of an impact on other computers.
  • Computers are limited to how much server time they can use each tick, hopefully reducing the impact a computer can have on a server's TPS. This may cause issues if you were queuing a lot of tasks (say, lots of calls to commands.execAsync). If you encounter issues, please let me know.
  • Massively improve JEI integration. You can now get the recipe and usage of any upgraded turtle or pocket computer. On a related note, JEI will now label upgraded turtles/pocket computers as belonging to whatever mod which registered its upgrade.
  • MCMultipart support for wireless and ender modems. This is dubiously useful, but now means you can decorate modems with Chisel and Bits.
  • Several improvements to pastebin, including detection for when you trigger the spam protection mechanism and handling of running pastebin get with a URL instead.
As you may be able to tell, there's been a lot of under-the-hood changes again this release. While everything has been pretty well tested, I'm sure some things have slipped through the hoop. Please file a bug if you if you find anything suspect!
Edited on 02 April 2019 - 07:38 PM
SquidDev #64
Posted 31 May 2019 - 01:48 PM
It's Friday, it's Five to Five, and it's Crackerjack CC:Tweaked release time! I'm afraid CC:Tweaked 1.83.0 hasn't got any especially exciting changes, just a few QoL improvements to CraftOS and CC:Tweaked.

Many thanks to XuyuEre, hydraz and JakobDev (aka Wilma456) for their contributions this release! I won't go over every change, but here's a couple of highlights:
  • Add os.date, and handle passing datetime tables to os.time, making them largely compatible with PUC Lua.
  • rm and mkdir accept multiple arguments. (hydraz, JakobDev)
  • Rework rendering of in-hand pocket computers, making them closer to computer GUIs than the pocket computer item.
  • Prevent rendering of a bounding box on a monitor's screen.
  • Clean up the Lua type-checking code, shifting it into a helper method. As a result, error messages now include the function name where known (for instance, sleep(false) will error with "bad argument #1 to 'sleep' (expected number, got boolean)"). Hopefully this makes it even easier to work out what's going wrong!
On a side note, if you're on Windows 10, you might be interested in CC:Tweaked (Bedrock Edition). It's a silly little port I did of computers to the new addon system Mojang and Microsoft are working on. It's very slow and largely unusable, but kinda cool none-the-less.
Edited on 24 June 2019 - 06:35 AM
SquidDev #65
Posted 15 June 2019 - 09:45 AM
Just a small note to say that I've updated CC:Tweaked to run on Minecraft Forge for 1.14.2. Both Forge and CC:T are in early days of updating, so I'm sure there's plenty of bugs, but it seems pretty stable so far.
SquidDev #66
Posted 26 June 2019 - 08:09 AM
Just done another update to Minecraft 1.14.3. No major changes, just lots of bug fixes - thank you to everyone's who has helped test and reported things!
blunty666 #67
Posted 05 July 2019 - 01:39 PM
Hey SquidDev, you're doing great work keeping CC alive, it's really appreciated!

I've not been able to get on to the new computercraft.cc wiki / forum for a few days? Is it down at the moment?
Lupus590 #68
Posted 05 July 2019 - 01:56 PM
It is down at the moment, it's the same outage that hit switch craft a while ago(which switch craft is still recovering from, not 100% yet). You can keep yourself updated on the switch craft discord https://discordapp.com/channels/198130613759246337/200122879646367745/590850498060484611
Edited on 05 July 2019 - 12:00 PM
blunty666 #69
Posted 05 July 2019 - 03:29 PM
It is down at the moment, it's the same outage that hit switch craft a while ago(which switch craft is still recovering from, not 100% yet). You can keep yourself updated on the switch craft discord https://discordapp.c...850498060484611
Ah ok thanks, will keep an eye out there for updates!
SquidDev #70
Posted 04 August 2019 - 04:31 PM
Just pushed CC:Tweaked 1.84.0, which fixes a fair few bugs, and adds a couple of minor new features:

Changelog (full changelog on GitHub)
  • Improve validation in rename, copy and delete programs
  • Add window.getLine - the inverse of blit
  • turtle.refuel no longer consumes more fuel than needed
  • Add "cc.expect" module, for improved argument type checks
  • Mount the ROM from all mod jars, not just CC's
Many thanks to JakobDev, Lignum, LiquidObsidian and powerboat9 for their contributions this month. As always, please do check out the list of active pull requests (and issues) to have a say in the upcoming changes to the mod!
SquidDev #71
Posted 04 October 2019 - 07:35 PM
I've made another CC: Tweaked release: 1.85.0. This contains a couple of minor improvements and a fair few bug fixes.

Changelog (see full 1.12.2/1.14.4 changelog)
  • Window.reposition now allows changing the redirect buffer
  • Add cc.completion and cc.shell.completion modules
  • Fix several turtles' GUIs desyncing after moving.
Just as a bit of a status update for people, I'm entering the last year if university right now, and so have substantially less time and energy to spend on CC-related projects than I might like. This doesn't mean development will stop, but sadly both new features and bug fixes will be slower to materialise. As always, if people want to help out - either with the mod itself, or any related projects/tooling, that would be very much appreciated!
SquidDev #72
Posted 24 December 2019 - 07:04 PM
Merry Christmas everyone, it's time for (hopefully) the last CC:T update of the decade:



Like many recent updates, there's not a lot of big changes, but a couple of nice small ones:
  • The read function now allows changing the cursor position using the mouse.
  • Add support for PATCH and TRACE HTTP methods (jaredallard)
  • CraftTweaker support: This is currently relatively rudimentary, but allows you remove turtle upgrades, and add new tools to turtles. For instance, the following script replaces the default mining upgrade with one crafted with wood:
  • 
    dan200.computercraft.turtle.removeUpgrade(<minecraft:diamond_pickaxe>);
    dan200.computercraft.turtle.addTool("minecraft:diamond_pickaxe", <minecraft:wooden_pickaxe>, <minecraft:diamond_pickaxe>);
    
    It's not a lot, but hopefully should be useful for pack makers (and can be extended in the future should it prove useful)!

Anyway, all the best to everyone in the new year, and here's to another year of CC(:T).

PS: Just as an update on Minecraft 1.15.x, I've started work, but currently waiting on MCP mappings to be a little more up-to-date before getting too much in to things. It doesn't look too difficult an update though, so hopefully should appear relatively quickly after that though!
Edited on 24 December 2019 - 06:06 PM
SquidDev #73
Posted 24 January 2020 - 08:50 AM
I've just made an initial release of CC: Tweaked for Minecraft 1.15.2, which can be downloaded from CurseForge.

I will stress that this release is alpha quality, and so is missing several features and is most likely rife with bugs. There's also a couple of other (minor) changes I'd like to make internals before making a stable release, so some things may break between releases too. That said, it should still be usable for casual gameplay so please do use it (and report the inevitable bugs).

Changelog
  • Update to Minecraft 1.15
  • Rewrite monitor rendering to use VBOs instead of call lists.
Please note the current features have been temporarily removed until Forge's support for them is fully updated:
  • Map rendering for pocket computers and printouts
  • Item frame rendering for printouts
  • Custom block outlines for monitors and cables/wired modems
  • Custom breaking progress for cables/wired modems
SquidDev #74
Posted 07 February 2020 - 01:03 PM
Happy February everyone, just thought now would be an opportune time to post a couple of things about CC: Tweaked.
  • Firstly, I wrote a while back about documenting CC: Tweaked, and I'm happy to say that some work has been done, a year after the discussion started.
  • I'm currently hosting a very WIP documentation site at tweaked.cc - if people have time to have a read through it, check things make sense, or even contribute documentation I'd really appreciate it. There's a PR on the GitHub repository, if you have any comments or just fancy finding out more.
  • Plethora recently hit 1 million downloads, and CC: Tweaked isn't far of 3 million. There is absolutely no meaning to these numbers, but it makes me feel fuzzy inside :)/>. Thank you to everyone who has used the mod, reported issues, or even contributed code! ♥
  • I'm planning on making several changes to the Lua VM in the next few weeks, to hopefully bring it more inline with PUC Lua (i.e. standard Lua), as well integrate a couple of Lua 5.2/5.3 features. That said, there are a couple of changes which may break things - if people are willing to help test, please ding me on GitHub/Discord/IRC.
Finally, I leave you with an FPS comparison of monitors on 1.12 and 1.15:
SquidDev #75
Posted 23 April 2020 - 10:37 AM
I'm currently doing releases for CC:Tweaked 1.87.0 - hopefully they'll be done by the time you read this! There's lots of (dubiously) exciting changes, but here are the big ones:

Documentation!
A little over a year ago, I wrote a little bit about the current state of CC:T documentation, and my plans for it. While both the cc.info and cc.cc wikis are fantastic, as a developer they're hard to maintain and keep in sync with the current state of the project.

As of this release, a good portion of CraftOS's has is documented using inline doc comments, which exported to https://tweaked.cc/. While there's a lot of functionality missing from the site right now (and the documentation is a long way from complete), hopefully it's still a useful reference.

Monitor rewrite
For the 1.15 update, I moved monitors over to use VBOs, which resulted in a dramatic FPS boost. These changes have now been backported to 1.12 and 1.14, with several other optimisations. This allows the us to render the 960x360 image from the previous post at about 95fps, compared with 7fps on the previous renderer. I will stress that this is very much an edge case - updating the monitor is still slow. There's some work being done by others to optimise both network and GPU traffic of monitor rendering, so hopefully we'll get even more improvements in the future!

Lua VM changes
There's been a couple of changes to the Lua VM, to bring it closer in line with PUC Lua, and backport several 5.2/5.3 features:
  • The __len metamethod may now be used by tables.
  • Add \z, hexadecimal (\x00) and unicode (\u0000) string escape codes.
  • Add utf8 lib.
  • Mirror Lua's behaviour of tail calls more closely. Native functions are no longer tail called, and tail calls are displayed in the stack trace.
  • table.unpack now uses __len and __index metamethods.
  • Parser errors now include the token where the error occurred.
Other highlights
  • Added fs.getAttributes: A bit like stat, this allows you fetch file size, type and creation/modification times.
  • Added textutils.unserializeJSON. This works with both standard JSON, and stringified-NBT, like you may receive from the output of commands.
  • The settings API now allows "defining" settings, along with a description and default value. This means that the .settings file now only stores the changed values.
  • The menu bar on paint and edit can now be clicked on using the mouse! This allows you to paint and save on monitors (@JakobDev)
  • The Lua REPL's pretty printer has been rewritten. It now supports functions and recursive tables.
As always the full changelog can be found on GitHub. This release touches a lot of CraftOS in subtle ways so there's likely to be breakages. Please file a bug if so!
Edited on 23 April 2020 - 08:40 AM