29
Mar

Bursting bubbles at 60Hz

There’s not much to be said about this. I got into a funny conversation with someone the other day about two completely unrelated technologies working together in TPT.

Here’s the full story.

30
Dec

I’m building a computer

… In TPT, an awesome sandbox simulator thingie. Preview of the manual available here.

With a glorious 16-bit architecture, a RAM with 1024 cells and subroutines, it’s a milestone in TPT computing. That’s what I like to think.

[30-12-2015] It’s not yet officially published. Maybe in the following days.

[06-02-2016] It’s finally out!

01
Apr

Trees are awesome

I stumbled upon Taghua yesterday and have been thinking about it since then. Now I’m planning to do the same in 3D with more colours and if it turns out well, I might just write some sort of a forest generator.

I analyzed the trees I went by today and made a list of things to be taken into consideration when writing a tree generator:

  • The size and the shape of the tree (duh) and its leaves (if any)
  • The general direction and force of the wind blowing at the tree
  • Gravity and the density of the materials composing the tree

There may be several more, but these are the ones I’ll be working with for now.

Modelling Mother Nature using computers is something that’s always thrilled me, but this is the first time I’m actually working on a program that does that. Wish me luck and expect followups for this post.

02
Feb

Flapping those wings

The feeling of having finished something is just wonderful. Now that I’m pretty much done with this blog which I equipped with Markdown, SmartyPants, CodePrettify, a basic search engine, tags, and a monochromatic look, all that’s left is getting used to maintaining it. Too much to do and too little time to do it. I’ll just post my favourite Lua hack for now:

function _trace(ignore, level)
    level = type(level) == "number" and level
    local errorLevel = 3 + (type(ignore) == "number" and ignore or 0)
    local errorDiff = errorLevel
    local errorPos
    local result = {}
    repeat
        errorPos = select(2, pcall(error, "@",
        errorLevel)):match("^(.+): @$")
        if errorPos then
            result[#result + 1] = errorPos
            errorLevel = errorLevel + 1
            if errorLevel - errorDiff == level then return result end
        end
    until not errorPos
    return result
end