The Parallel Toy

  • LBPHacker
    30th March Developer 2 Permalink
    So for more the lolz than anything else, we've been discussing over on the Discord server a not exactly new and not exactly elegant approach to multithreading TPT, and I've implemented it and am releasing it as a mod as an experiment of sorts. This is very much in development, expect updates.

    The mod is based on a fairly recent development version of vanilla, so it's 99.3 with all the fixes and new stuff since then, e.g. BASE, SEED.

    New features:

    • multithreaded simulation, with caveats: not all of the simulation is multithreaded, and not always, but it still can provide very noticeable performance boosts
    • new command line arg: threads:N
    • new Lua function: sim.threads(N)
    • a few new HUD readouts about timing in the top left area if you enable tpt.debug(0x100).

    You WILL have to use sim.threads(N) to get any multithreading action because the initial value is 1, e.g. try sim.threads(4). to experience actual speedup, you'll also have to uncap FPS with tpt.fpsCap(2). You can try using more and more threads until you hit a point where FPS doesn't go any higher. Do not expect linear speedup, e.g. 8x FPS for 8 threads, but definitely expect significant speedup.

    Download links below. Builds naturally are hosted by @jacob1 and updated from starcatcher.


    Known issues (will be updated as more issues are discovered or fixed):

    • Subframe is broken; this is by design and will not be fixed
    • Powder and liquid movement is sometimes funny
    • Water equalization hinders multithreading
    • Partial frame steps hinder multithreading and are no longer a useful debug tool
    • Lua scripts are currently expected to crash the game, please don't report such issues; will be fixed later

    Please report any other issue here or on Discord.
    Edited 5 times by LBPHacker. Last: 30th March
  • Tadpole1
    12:42:06 Member 0 Permalink

    So what exactly is a thread?

  • LBPHacker
    13:35:17 Developer 0 Permalink
    The more of them the game can use effectively, the faster it is.
    Edited once by LBPHacker. Last: 13:35:47