Grid Sage Forums

Grid Sage Forums

  • November 21, 2024, 09:45:06 PM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: Oddities of time system.  (Read 5141 times)

Valguris

  • Cyborg
  • ***
  • Kyzrati Patron Bug Hunter Weekly Seed Participant Shared a Confirmed Stealth Win
  • Posts: 148
    • View Profile
Oddities of time system.
« on: August 17, 2018, 09:51:23 AM »

Since GJ mentioned peeking (https://www.reddit.com/r/Cogmind/comments/96fnpf/armchair_robotics_week_2/e4cism3/), I wanted to talk a bit more about the time system used in Cogmind. Currently each robot on its turn is assigned 100 TU (time units) and acts until it spends them all ("debt" is subtracted from future turns) and then the next robot starts its turn. This leads to a number of oddities, usually noticeable when performing actions that cost less than 100 TU:
  • Peeking -- if you're moving fast enough, you can figure out when to move through the line of sight of other robots without being spotted
  • Operators always do 2 moves at once and swarmers do 3 moves at once. Even if you are faster than them. For example let's assume that you move at 33 TU. You'll move 3 times, then an operator (~50 TU) will move twice, then you 3 times, then the operator twice and so on. Similarly with swarmers: 3 your moves, then 3 swarmer's moves; instead of 1 yours, 1 swarmer's, 1 yours, 1 swarmer's,...
  • Slow robots can surprisingly act twice in a row. You can roll at 90TU per move and keep 1 tile between yourself and a brawler (160TU), but sometimes, after your move, the brawler will get enough time to move AND smash you. Worse yet, this applies to crushers in the wastes.

I'm not sure why Cogmind isn't using a priority queue instead, where after each action (instead of spending all the time in a turn) it is evaluated who acts next. They way I understand it, such change would only affect these counter-intuitive scenarios. And, umm, make swarmers hop over eachother multiple times per turn, but hostiles hopping is another thing I have an issue with.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #1 on: August 17, 2018, 07:07:11 PM »

the brawler will get enough time to move AND smash you
There must be something else at play in this scenario, because under normal circumstances if you're just moving on wheels at 90 and they're moving at their normal speed you can always maintain one space in between and let them approach but won't be attacked.

Cogmind does use a priority queue, but it doesn't reshuffle the current actor's position until their remaining time (as much as a full turn but not necessarily a full turn) is used up. This adds a bit of unpredictability to the system. Allowing for full flexibility would be a completely different system and take a while to put together and test, not to mention change the feel of the game flow. Would be fun to experiment with it, but so many things on the list...
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

zxc

  • Cogmind
  • *****
  • 1st place in the High Scores category during Alpha Challenge 2015 1st place in the Best Escapes category during Alpha Challenge 2015 Shared a Confirmed Combat Win Shared a Confirmed Stealth Win Kyzrati Patron Bug Hunter Achievement leader in at least one category during Alpha Challenge 2015 Participated in the Alpha Challenge 2015 Wiki Contributor Weekly Seed Participant
  • Posts: 726
    • View Profile
Re: Oddities of time system.
« Reply #2 on: August 18, 2018, 12:49:36 AM »

Haven't noticed this myself but I can conceive of how this might happen:

It is turn 6.0
Brawler to act on turn 6.1
You move, it's turn 6.9
You move, it's turn 7.8
Brawler acts twice (6.1 + 1.6 = 7.7)

Edit: Before you say that this is fine because the brawler can never catch up, suppose all the events of significance start at turn 6.9 (perhaps you were fighting some other dudes and now it's just the brawler left).

You see that there the brawler is adjacent to you, but since his speed is 160 and yours is 90 he should never hit you if you move away, right?

You move away (it's now turn 7.8 ). The brawler moves and hits you.
« Last Edit: August 18, 2018, 12:55:58 AM by zxc »
Logged

zxc

  • Cogmind
  • *****
  • 1st place in the High Scores category during Alpha Challenge 2015 1st place in the Best Escapes category during Alpha Challenge 2015 Shared a Confirmed Combat Win Shared a Confirmed Stealth Win Kyzrati Patron Bug Hunter Achievement leader in at least one category during Alpha Challenge 2015 Participated in the Alpha Challenge 2015 Wiki Contributor Weekly Seed Participant
  • Posts: 726
    • View Profile
Re: Oddities of time system.
« Reply #3 on: August 18, 2018, 01:06:21 AM »

If the time system were shored up, I expect we'd see these outcomes:

  • No more peeking exploit. GJ nerf.
  • More consistent movement by enemies faster than 100 time / move (swarmers, saboteurs, operators, watchers, programmers, among others...). More predictable swarmer patrols.
  • Fast enemies better able to spot you, as it's their turn more often. Decent flight nerf.
  • Probably culls most if not all grunt hopping incidence. +10 rep with experts.
  • Rare double move by medium speed enemies like brawlers eliminated. +1 sanity for Valguris.

Sounds to me like this would score 5/5?
Logged

Valguris

  • Cyborg
  • ***
  • Kyzrati Patron Bug Hunter Weekly Seed Participant Shared a Confirmed Stealth Win
  • Posts: 148
    • View Profile
Re: Oddities of time system.
« Reply #4 on: August 18, 2018, 06:35:38 AM »

Probably culls most if not all grunt hopping incidence. +10 rep with experts.
Changing time system in this way would actually have an opposite effect. Units that move faster than 100TU would be able to hop multiple times per turn. Actual grunt hopping (and hunter hopping, and 100+TU hopping in general) would be unaffected.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #5 on: August 18, 2018, 07:13:46 AM »

Yeah I don't see how this would help grunt hopping at all. They're not even related issues--a hop is a single action.

Separately: The main thing about deep system changes like this is that you know of X issues that it could theoretically resolve and you don't know about Y issues it could create, because they haven't been created yet so you can merely speculate, compared to known issues which have been accumulated over years of play by experts. Y is of unknown size.

Not saying it's not worth a shot, just saying it may not be as good as it seems in the end.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

zxc

  • Cogmind
  • *****
  • 1st place in the High Scores category during Alpha Challenge 2015 1st place in the Best Escapes category during Alpha Challenge 2015 Shared a Confirmed Combat Win Shared a Confirmed Stealth Win Kyzrati Patron Bug Hunter Achievement leader in at least one category during Alpha Challenge 2015 Participated in the Alpha Challenge 2015 Wiki Contributor Weekly Seed Participant
  • Posts: 726
    • View Profile
Re: Oddities of time system.
« Reply #6 on: August 18, 2018, 11:30:12 AM »

I don't know what exactly causes grunt hopping (if we knew exactly, I imagine Kyzrati could've fixed it by now). What I do know is that the time system in Cogmind is strange compared with most roguelikes, so I figure there is a chance the two are related.

Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #7 on: August 18, 2018, 05:36:53 PM »

Nah, jumping is purely an AI thing, a single action where a bot decides it can path right over other bots. This is how I was able to cut down the chances of it happening, but can't catch them all because I haven't been able to repeat it since.

Quote
What I do know is that the time system in Cogmind is strange compared with most roguelikes
Cogmind's system is fairly common in roguelikes, what makes these few small issues more apparent than in these other games is that Cogmind has extremely variable action lengths over a wide range of times.

This system wasn't built specifically for Cogmind, but quickly added for the 7DRL based on a common form of time system used in other roguelikes, for example ADOM. (Because at the time I needed a simple way to convert X-Com's multi-character TU system to a real roguelike system for a single character, and had no experience writing one of my own.)

I've never actually built a time system from scratch, though doing so might be a good idea if it won't wreck a bunch of stuff and change the feel of the game, which overall is pretty good already.

I kinda like the anti-flight potential behind the idea of enemies spotting fast movers more frequently, but that will also strongly shift the stealth game from movement speed to absolute avoidance.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Shadowfury333

  • Derelict
  • **
  • Supported Cogmind Alpha Access 2015-2017 (Prime Tier)
  • Posts: 45
    • View Profile
Re: Oddities of time system.
« Reply #8 on: August 18, 2018, 07:37:01 PM »

Perhaps if you do another Polybot-like project it would be a good time to experiment, but it seems wise to keep the system as is in Cogmind at this point. Maybe a 7DRL prototype would show that a more granular system is a better system, but until then it sounds like it would just add loads of dev and testing time to fix several minor issues with the risk of creating several more issues in the process.
Logged

Trione

  • Derelict
  • **
  • Posts: 31
    • View Profile
Re: Oddities of time system.
« Reply #9 on: September 04, 2018, 01:16:55 AM »

Heya, been getting into the game (asking questions over on reddit as mute2120), and thought I'd hang out and learn here too.

The time/turn system had been really confusing me.  The upside is this thread clarified how it works.  I see two issues in the current system:

1) The game is based on turns where you have a limited amount of a time unit (TU) resource to perform actions in the turn, and knowing how many TU one has left is tactically important, not provided in game, and could be easily, though tediously calculated.
2) That enemies can only fully notice the player at the 100 TU turn changes, regardless of their stats, and feels almost 4th wall breaking, compared to the otherwise very fluid and alive feel of the world.

The way I'd thought it would work would just be if the current time is 'Y', and a bot performs an action that would cost 't' TU, then that bot would take it's next action at time 'Y + t', going after any other actions already scheduled at that time.  A system like that would fix the issue of missing info about remaining time units.  And it would make peaking not work against fast moving/acting bots, but still work against slow moving bots or those distracted taking TU intensive actions.  It would also still leave it viable to wait and move just after a slower bot to try to sneak by, but that would now be based on that bot's timing and actions, not the global frame-rate.

Just my two cents, at the moment.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #10 on: September 04, 2018, 03:43:23 AM »

Oh hey mute2120, welcome to the forums!

2) That enemies can only fully notice the player at the 100 TU turn changes, regardless of their stats, and feels almost 4th wall breaking, compared to the otherwise very fluid and alive feel of the world.
Not sure where you got that info, since the way sight knowledge works is as you might expect: enemies notice you on their turn, whenever that is.

1) The game is based on turns where you have a limited amount of a time unit (TU) resource to perform actions in the turn, and knowing how many TU one has left is tactically important, not provided in game, and could be easily, though tediously calculated.
While true, this is not very easy to calculate, and technically in order to calculate it you also have to waste real time in the game to get the timer to a referencable point, so it's not something that's often worth doing. Now a couple (?) players have gotten good at figuring it out under certain circumstances (though again it costs real game time to do this), but it's pretty rare tat anyone actually does it in a serious capacity for any length of time because it boring and not usually important. That said, before the next release I've been planning to experiment with a more flexible time system to see how that turns out, and it would probably change this aspect of time.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Trione

  • Derelict
  • **
  • Posts: 31
    • View Profile
Re: Oddities of time system.
« Reply #11 on: September 04, 2018, 04:54:24 AM »

Quote
Oh hey mute2120, welcome to the forums!

Hello!  Felt like bad form to be spamming the not super active subreddit.

Quote
That said, before the next release I've been planning to experiment with a more flexible time system to see how that turns out, and it would probably change this aspect of time.

Very cool!

Quote
While true, this is not very easy to calculate, and technically in order to calculate it you also have to waste real time in the game to get the timer to a referencable point

If one kept track from the beginning of each floor, no wasted time in game, right?

Quote
Quote from: Trione on Today at 01:16:55 AM

    2) That enemies can only fully notice the player at the 100 TU turn changes, regardless of their stats, and feels almost 4th wall breaking, compared to the otherwise very fluid and alive feel of the world.

Not sure where you got that info, since the way sight knowledge works is as you might expect: enemies notice you on their turn, whenever that is.

K, I might be misunderstanding how it actually works then.  I thought enemies' turns always come after the player runs out of TU for that turn... basically all enemies go once a turn (unless they have < -100TU and effectively skip) and get that chance to notice the player.  So the idea of peaking is basically making sure you don't accidentally run out of TU and end your turn in the open, because then other bots all get turns and will see you.

Edit: thinking about it more, the resorting of the queue might actually negate some of that...  I'm not quite sure how it works in game as is, but it seems like it could.  Hm, fascinating stuff.
Thanks for the dialogue!
« Last Edit: September 04, 2018, 05:18:59 AM by Trione »
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #12 on: September 04, 2018, 06:06:11 AM »

If one kept track from the beginning of each floor, no wasted time in game, right?
Theoretically, but that's so tedious that no one would do it on such a scale. I mean I remove "tedious optimal play" wherever I see it (there are still a couple players to address), but this one is kinda out there :P

So the idea of peaking is basically making sure you don't accidentally run out of TU and end your turn in the open, because then other bots all get turns and will see you.

Edit: thinking about it more, the resorting of the queue might actually negate some of that...  I'm not quite sure how it works in game as is, but it seems like it could.  Hm, fascinating stuff.
Thanks for the dialogue!
Right about the peeking thing, but this is a factor of your own turn, not theirs. If you then do an action which requires multiple turns, for example, like fire a volley, they can take multiple different actions and see you during any of them, whether a particular turn has passed or not. And yeah there is some queue resorting once bots have taken actions so it's not easy to predict all the other things going on.

In any case, we'll see how the attempt to create a more fluid queue goes, and what other unintended side effects that might have ::)
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Valguris

  • Cyborg
  • ***
  • Kyzrati Patron Bug Hunter Weekly Seed Participant Shared a Confirmed Stealth Win
  • Posts: 148
    • View Profile
Re: Oddities of time system.
« Reply #13 on: September 04, 2018, 07:35:13 AM »

Quote
2) That enemies can only fully notice the player at the 100 TU turn changes, regardless of their stats, and feels almost 4th wall breaking, compared to the otherwise very fluid and alive feel of the world.

Quote
Not sure where you got that info, since the way sight knowledge works is as you might expect: enemies notice you on their turn, whenever that is.

Both of you are correct? Enemies can spot you only on their turn, but all of their turns occur at Cogmind's 100 TU turn changes.

Abusing it isn't even as tedious as you seem to think. When you're moving very fast, all events happen at the same time. Like when you move at 20 TU, all other robots move at your 5th move, your energy rises at your 5th move, and your heat dissipates at your 5th move. This means that the game is making it APPARENT for when you can be spotted/shot at and it constantly reminds you, every 5 moves.

So, during my recent speedrun attempts, I actually started counting moves until the next turn change when there are hostiles in view, so I can duck into cover/use robots as cover at the right time. I literally count "1,2,3,4,duck,1,2,3,4,duck,...". :D
And when 100 isn't divisible by my movespeed, that's not a problem either. At 17 speed I have (rarely) 5 or (usually) 6 moves, so it's "1,2,3,4, duck (if they didn't act, duck again!), ...".

I kind of feel bad for bringing this topic to attention, because it's not very significant quirk of this time system, but it seems it is very hard to change (it affects so many other things that probably bugs will pop up everywhere if this system is changed). When I posted this, I thought that changing this system would be simple. But now I know that is not the case, so IMO it's better for Kyzrati to focus on other changes to the game!
Logged

Trione

  • Derelict
  • **
  • Posts: 31
    • View Profile
Re: Oddities of time system.
« Reply #14 on: September 04, 2018, 04:18:50 PM »

Quote
So, during my recent speedrun attempts, I actually started counting moves until the next turn change when there are hostiles in view, so I can duck into cover/use robots as cover at the right time. I literally count "1,2,3,4,duck,1,2,3,4,duck,...". :D
And when 100 isn't divisible by my movespeed, that's not a problem either. At 17 speed I have (rarely) 5 or (usually) 6 moves, so it's "1,2,3,4, duck (if they didn't act, duck again!), ...".

Yeah, that's the conclusion I came to as well.  Conversely, when one has movement slower than 100, it may be prudent to notice when one's turn skips are.  Also somewhat worth noting (and you're probably aware), that in addition to doing the above, if one really needed to, one could also figure out when a specific bot that is slower than 100 will have it's missed turns (a bot with speed 150 patrolling will skip 1/3 turns).  If one knows when one's turn starts, and when that bot's skip-turns are, you could plan when to use a full 2-turn advantage relative to that bot.

Quote
I mean I remove "tedious optimal play" wherever I see it (there are still a couple players to address), but this one is kinda out there :P

I quite appreciate that.  Perhaps adding one's current TU to the tactical hub would be a way to make things more clear, and playing the turn system less tedious, under the current system?

Very curious what your findings around reforming the system might be!  :)
« Last Edit: September 05, 2018, 03:06:17 PM by Trione »
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #15 on: September 04, 2018, 10:28:38 PM »

Quote
it affects so many other things that probably bugs will pop up everywhere if this system is changed
Well it's not bugs I'd be worried about--changing it is unlikely to break anything, but what it will do, to an unknown extent, is change tactics and strategy, not necessarily all for the better but who knows, it's too complex to see all the possibilities so we can only try!
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

kiedra

  • Derelict
  • **
  • Weekly Seed Participant
  • Posts: 26
    • View Profile
Re: Oddities of time system.
« Reply #16 on: November 12, 2018, 12:58:46 PM »

Perhaps adding one's current TU to the tactical hub would be a way to make things more clear
This is definitely something I would love seeing to be added.

I just read through all of this and kept thinking, why in the world do you guys not just skip a turn to know for sure that once you skipped it, you are now at timeframe 0 - to do things like moving through LOS of enemies or whatever. Don't ask me why but I just assumed it worked like that, but it actually does not. Skipping is waiting and waiting takes 100TU, good job kiedra for realizing this after 300hrs...

However, this could still be an alternative or another addition to showing one's current TU in between turns. Sort of a "wait until turn ends" along with the normal 100TU waiting, just a thought here. I guess one might argue this could be considered cheesy, since you get to wait for less than the usual required amount of time, so as a compromise I'd be fine with "waiting until the turn after", so you're technically wasting time waiting, but know for sure you are now at the beginning of a new turn. This would go well with Kyzrati's agenda of removing "tedious optimal play" and yes, I do see it does not necessarily help speedrunners.

At the moment I'm just utterly surprised this has not caused any major problems or very unpredictable outcomes of scenarios, because I use the waiting ALOT and kept thinking it would put me at the beginning of the next turn.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #17 on: November 13, 2018, 01:12:02 AM »

Meh, it doesn't really affect anything serious. It's mostly a case of some players knowing how to cheese the time system to gain an advantage in specific scenarios, but...

Quote
This is definitely something I would love seeing to be added.
...this could all very well become moot depending on the results of the experimental time system changes ;)
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #18 on: March 13, 2019, 06:46:07 AM »

That said, before the next release I've been planning to experiment with a more flexible time system to see how that turns out, and it would probably change this aspect of time.
Well, it took longer than expected to get to it, but I've finally had an opportunity to get on this. There's an experimental build up for patrons right now that replaces the time system with a completely different one, and it will likely solve any and all oddities in one go. If it works out then it'll become the final time system in all future builds. I'll also eventually be writing about it on the blog.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

muxecoid

  • Unaware
  • *
  • Posts: 11
    • View Profile
Re: Oddities of time system.
« Reply #19 on: March 14, 2019, 12:53:44 AM »

I once got hit by compactor moving twice like this... In current system it would be cool to have a "wait" action that makes you act immediately after target. Does not count as action for stabilization purposes. Makes them notice you.
« Last Edit: March 14, 2019, 01:02:30 AM by muxecoid »
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Oddities of time system.
« Reply #20 on: March 14, 2019, 03:41:37 AM »

That's getting a bit ahead of ourselves here, since we don't even know if this system is suitable yet xD. We'll have to wait and see.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon