SamSuka
Kyzrati
Kyzrati

patreon


Experimental Time System Build

It's finally happened--I've put together a different underlying time system for Cogmind. The original system was something I borrowed from Rogue Basin when I'd never done one before and need a quick something for Cogmind 7DRL, and I liked it because it was a flexible approach with some pretty interesting characteristic. Of course, fast forward to Cogmind being years old now and I find we don't really need that flexibility, and those characteristics might even have negative side effects in some cases. More specifically, in Cogmind it's technically been possible to guarantee free peeks around corners, and a few people have been using such tactics, which is kind of tedious and also imbalanced and unintended. Earlier attempts to address this couldn't really overcome the inherent behavior of the underlying time system, so the idea was to make some bigger changes...

So I've put together a new release that completely replaces the old system with a straight priority queue which is reordered every time an action is made. Strategically speaking this approach to time is not quite as lenient as it was--while before you could often perform consecutive quick actions without interruption, now it's possible for other actors to take their turns immediately after you do something. But this vagueness has advantages, too, like it should theoretically be more difficult to guarantee free peeks around corners, for those who were using such tactics ;)

If you try out this patron-only build, test out peeking and any other "time cheats," and also just pay attention to regular gameplay, since immediately queue changes might have other effects now that turns are more granular! Be on the lookout for any time-related oddities as well. Or maybe you don't notice any difference at all? :P

You can access this build in one of two ways:

Saves in this release are incompatible with those from all previous releases. Note that anyone with wizard mode access can use it as normal in this build as well.

Leave any comments here, or discuss in the patron channel on Discord.

I'll be writing up a blog post about this later (especially once we have info on the results), but for now I'll leave my related notes below.

As an example of what I do when adding a feature, here's a list I made of all the things I needed to explicitly test or look into after getting the basic implementation down:

Sure enough the game crashed when I tried to do an AI autotest, but fortunately it was readily repeatable and clearly related to the new changes somehow. Still, it took half an hour to track down the cause because the actual crashes were happening in a completely unrelated part of the code xD

Viewing relative time values for actors:

A new debugging view showing the top of the action queue, shading by how long until their turn. (I also have a yellow color for when actors late in the list have a positive time value, which was happening due to bugs and I needed to spot them, but ideally that should never happen now :P)

The queue in action in the Scrapyard.

The original time system didn't use any special algorithms to speed up the process, nor did my first implementation of the new one, but I did a bit of quick profiling and found that 11.59% of the turn processing was taken up by putting actors where they belong in the queue.

That seemed like a lot, so I did a bit of premature optimization. Sadly this took literally four hours because I'm an idiot when it comes to technical matters, but oh well I guess it was worth it. Got it down to 2.25% :)

Hope this new system works out okay!

Comments

Correct, that hasn't changed. The differences will only be noticeable in certain situations, for example when moving fast, or doing actions that require *less* than one turn. If you don't notice though this is fine as well :). The intent was to stop some of the tedious cheesy tactics some players were using, though the change can also have some other situational side effects. I'll be explaining it in more detail in a full blog post, comparing it to the old system (prior to this update, you could have up to one full turn of actions without being interrupted).

Kyzrati

Not sure what changed. Performing action with delay of X still pushes you back X time units in the queue.

muxecoid

Heh, as I did the screenshots I was precisely thinking "Suslik will probably like this..." I think with regard to save/load, players will already be able to game the RNG any way they like, so this bit is pretty inconsequential. It's likely for the lowest difficulty anyway, though, so all that really matters there is fun :)

Kyzrati

i'm honestly just happy to see a bunch of method names in the profiler output :D i think this system might prove useful if you do end up implementing a valid save/load functionality to make it less abusable.

Suslik


More Creators