Jump to content

simplex

Registered Users
  • Posts

    5283
  • Joined

  • Last visited

Reputation

2631 Excellent

Converted

  • Location
    In a simplicial complex.
  • Modder
    http://forums.kleientertainment.com/user/237781-simplex/?tab=idm

Badges

  • Visited by the Title Fairy
    Couldn't be Simpler
  • Don't Starve Together
    Contributor

Recent Profile Visitors

16408 profile views
  1. I plan on uploading it to Steam once the DS and DST codebases are fully unified. The version posted here does also work under singleplayer Don't Starve, though it still has some glitches I have to iron out in that case.
  2. Checking whether a value evaluates to true (as in "if x then") is indeed marginally faster than an equality check, but whether or not throwing a negation (as in "not x") in the mix offsets that or not may very well depend on the phase of the moon and whether the gods have decided the day is in your favor. When we get to *that* kind of minutiae and of such small differences, will it ever be at all relevant? You're more likely to get a different output due to hardware differences than due to any fundamental characteristic of the Lua virtual machine.
  3. And oh, @SageOfLegend, could you post in this thread instead? I don't want to feel responsible for derailing this thread. @JoeW , @ImDaMisterL or some moderator seeing this, could you move the posts (starting from this one) from this thread to that one? Again, just to avoid cluttering this guide.
  4. Could you try the command at the end of my previous post? (I had posted it as a new post, but the forums glue recent posts together)
  5. If you type the command 'dir' from the same folder, are anim.bin and build.bin listed in the output? Sorry for asking you to perform such simple checks, I'm just puzzled about the issue since the path/filesystem related code hasn't changed in ages, so I'd just like to discard anything obvious first. @SageOfLegend Try the command 'krane . whandler_beard'. This is an alternate syntax (and the one I personally use) where the folder where the anim.bin and build.bin are located is given instead of their paths directly.
  6. @SageOfLegend Could you try the same command with './anim.bin' and './build.bin' instead of just 'anim.bin' and 'build.bin' and tell me if it works?
  7. I'll double check. It was working fine until the last game update, but it's possible that upgrade broke it.
  8. Huh. Indeed it's rather strange that pairs could be faster than ipairs, even if marginally, over large arrays. If anything, since pairs performs checks to see if there are hash elements and since all of the luaX_next functions are in different compilation units (preventing inlining, thus hindering locality of reference), I'd expect pairs to be universally slower. But anyway, indeed this is only relevant as trivia. Though I'm not sure I agree with the claim that "in most practical cases no loop (in Lua) is that tight that I need to consider the cost of the iterator itself", at least if this is to be taken as a general claim. If we're talking about pairs vs. ipairs then sure, it's irrelevant, but a numerical for can be significantly faster than ipairs iteration for simple "foldl" operations, such as summing an array, computing its minimum, etc. But ok, unless one's implementing a numerical linear algebra or scientific library in pure Lua (and why would they?), this kind of code shouldn't be a bottleneck. And you did say "in most practical cases" and "I need to", so I guess I'm needlessly nitpicking. And oh, since we're talking about Lua performance: why doesn't Don't Starve/Don't Starve Together use LuaJIT?
  9. Aw, you didn't test table indexing! One of my favorite pieces of trivia about Lua is that table indexing with string keys is actually faster than indexing with numerical keys, even if that number falls in the array key range (though in this scenario the performance difference is very small). They're virtually identical when a table has no hash part. In my system which one had the best average runtime changed between benchmarks, due to the performance being so close (the difference in runtime is of about 1%, one way or the other). If you check their C implementations under Lua 5.1.5, you'll see that the operations performed by luaB_next (pair's generator) and ipairsaux (ipairs's generator) are basically the same. They are both defined in lbaselib.c, though reading luaB_next will take you to lua_next (lapi.c), which eventually will lead you to luaH_next (ltable.c). And oh, @Maris, the cost of computing the length of a table (as in '#t') is roughly proportional to the logarithm of its size. Also note that the header of a for loop (such as 'for i = 1, #t do') is only evaluated once, so the cost of computing a table's length there is much smaller than the cost of actually running the loop, even if it's empty (for sufficiently large tables).
  10. @Ipsquiggle This is only fringe-related to this topic, but is there a way to obtain a shard name from a shard id at the Lua level? The engine level log prints show the engine has that info, but I haven't found any way to access it from Lua.
  11. @Ipsquiggle If I may ask, what's your current schedule? I mean, how is your time currently divided between the worldgen data and modding API changes discussed here, bug fixing DST and working on Through the Ages? I ask mostly to have a feel for what kind of request is reasonable or not.
  12. Try AddTaskSetPreInitAny(function(task_set_data) local task_names = task_set_data.tasks --// Do stuff with task_names, but note this must be done within this function. end)
  13. We use custom world and world network entities, so adding a preinit wouldn't even be necessary. There are certainly workarounds, but the major concern is user transparency: having a worldgen option which does nothing (because there's code overriding the override) feels off and glitchy. I'd say this is a low priority request, but a relatively simple one (due to not requiring affecting other game subsystems) to be worth it.
  14. @Ipsquiggle I just remembered a request: could you allow for some override options in levels being hidden from its customizationtab in server creation? For example, U&A requires rain to be set to "always"; it doesn't actually rain in U&A, this is just an element of how we represent the static mechanic and make it relate to vanilla prefabs. Changing rain to anything other than "always" will in fact break the mod, so having that be a spinner in customizationtab is really bad. The issue is, now that level overrides are in a key-value dictionary instead of an array of tuples, the simplest solution (adding support for an optional 'hideinfrontend = true' entry in the tuples themselves) is no longer available, so a custom scheme is necessary. Maybe an optional 'hiddenoverrides' array of override key names added to level data, which is checked by customizationtab to exclude certain override options from the frontend, but ignored by everything else in the game?
  15. It works online, but it's a security risk to use it that way. When online, you can already give admin access to users. It's only when offline that dedicated servers refuse any remote commands. So while you can use it online, I wouldn't recommend it.
×
  • Create New...