Author Topic: Roguelike timing systems.  (Read 25368 times)

guest509

  • Guest
Re: Roguelike timing systems.
« Reply #15 on: June 27, 2012, 09:03:49 AM »
  Oh it is. And it shows.  :-[   ;)

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #16 on: June 27, 2012, 06:36:00 PM »
AS is awesome- does a lot of work for you, but I'd recommend learning HaXe NME. It's the same syntax as AS only better in every way. They've wrapped the Flash API such that it can target multiple platforms. It's easy and accessible and more powerful- do it. www.haxenme.org.


Why the need for complex timing? How much of a role does it actually play relative to the end user as per your design?

Pretty central, I'm modelling momentum, while retaining single square movement. This requires variable time.  The player will be interacting directly with this system.


Couple of thoughts-

Modelling momentum with fixed spaces is going to get pretty wonky-- the player will have difficulty understanding whether a high-speed object is moving 3 or 4 tiles on the next turn, when it may make a significant difference. Perhaps even more importantly is where the high-speed object is going to be 3 turns from now. A game that is very sensitive to physics can work perfectly fine in a turn-based environment, but in a rigid playing field (tiled) it may not be a great idea.

In Dwarf Fortress, when multiple objects are standing on top of each other the UI spins a line {"|","/","-","\","|","/","-","\"} on that tile to toggle between the two symbols. You might draw from that and cycle through how many tiles an object is going to move for the next three turns. This way you can fairly represent acceleration and velocity. IE- an object is moving 9 tiles over 2 turns- the player needs to know that it is moving 5 tiles on the next turn, 4 on the turn after, and 5 on the turn after that. If the object is accelerating, it may move 5 tiles on the next turn, 5 tiles on the turn after, and 6 tiles on the turn after that. If you associate colors- like red is next turn, yellow is the turn after, and green is a turn after that-- you might have a clear way of giving information to the player.

At this point, however, you save computations by making your physical calculations work relative to tiles. You could use a 6ftx6ft space to define a tiled space and do real calculations, but the player, even if he's a physicist, isn't going to know whether you're calculating movement over real-time or over tiles.

Omnomnom

  • Rogueliker
  • ***
  • Posts: 79
  • Karma: +0/-0
    • View Profile
    • Email
Re: Roguelike timing systems.
« Reply #17 on: June 27, 2012, 11:42:46 PM »
I implemented variable length actions and tried it out but I am disappointed about the results and am thinking of implementing a much simpler system. It's good simulation wise but it gets unintuitive and very complicated from a gameplay perspective. Take this example:

player time to move one tile = 1
player time to melee attack neighbouring tile = 0.5
bird time to move one tile = 0.4

What the player sees if they move about is that the bird alternates between moving 2 and 3 tiles at a time: 2,3,2,3,2,3

Now if the player switches to melee attacking something (not the bird) the bird will appear to slow down: 1,1,1,2,1,1,1,2

This highlights two problems (in my opinion). First the bird slowing down is unintuitive. Why would a bird appear to slow when the player attacks and speed up when they move? This expects the player to understand the whole relative time thingy.

Second that 1,1,1,2 staggering...the player can't predict movement in this system because look there are three 1s in a row and you might think the next movement of the bird will be one tile...but no it suddenly seems to jump 2. Okay that's a common problem and a minor one, but it does limit predictability.

The biggest problem I see is that the player is expected to make critical survival decisions based on time, yet variable length actions obfuscates how time works in the game and forces them to run complicated calculations upon detailed statistics. For example imagine the player is being chased by a tiger and needs to work out if they have time to throw a javelin at the tiger and still be able to flee to a door 10 tiles away in time how do they do that? The tiger moves 121% as fast as the player. Throwing a javelin takes 78% as long as moving a tile. They are going to need a calculator. They could just guess, and that's how I would play, but I would do so knowing that my method of play was "lazy" and I was playing with a sub-optimal strategy. After losing a few times I might just decide I will never win unless I bother running all the calculations...

Another problem I found was kiting:

player time to move one tile = 1
player time to melee attack neighbouring tile = 0.8
orc time to move one tile = 1
orc time to melee attack neighbouring tile = 1

So now if the player times this right they can can wait for the orc to walk up to them, melee attack and the orc doesn't get a chance to react before the player gets to move again. The player then steps backwards and avoids the orcs attack. But this kiting only works if you time it right, which means the player has to calculate it. But this is fine because it's a simulation - except if it's a proper simulation the player should be able to choose how long they wait. Ie a variable "wait" action. Press that '.' key and get a little input field asking how many "turn units" you want to wait. 0.2 please. And now this game is just getting too complicated.

All these things can be worked around somewhat. But I am beginning to lean towards uber simplicity of just having all actions of all creatures take the same amount of time, or multiples of 2. At least that is predictable and perhaps that's what matters most of all? It's not like variable action lengths are easy to implement either. Knowing what I do now I wouldn't have bothered.

Same story with field of vision...I spent too long reading about permissive field of view and that digital one, and turns out the far more basic method is "better".


kraflab

  • Rogueliker
  • ***
  • Posts: 454
  • Karma: +0/-0
    • View Profile
    • kraflab.com
Re: Roguelike timing systems.
« Reply #18 on: June 28, 2012, 01:39:29 AM »
player time to move one tile = 1
player time to melee attack neighbouring tile = 0.8
orc time to move one tile = 1
orc time to melee attack neighbouring tile = 1

0.0 : player attack : PO
0.8 : player move : P_O
1.0 : orc move : PO
1.8 : player attack : PO
2.0 : orc attack : PO

I don't see a problem here, since they move at the same speed.  The player will get extra attacks as time goes on, but it's not like the orc won't get to attack, unless I am just misreading your system.  The player attacks faster so the advantage is and should be there.

I also don't have a problem with things "slowing down" when attacking versus moving.  As long as the player knows attacking is faster than moving that should be fine.

The 1,1,1,2 thing I agree is a problem, although I think that strongly depends on your game as a whole in terms of whether or not it will be a serious problem.  Here's a solution from the world of trpgs:

Turn List:
You
Orc
Orc
You
Orc
Orc
You
Orc
Orc
Orc

A simple list of turns can make it easier to plan ahead.  This is perfect and works wonderfully if every action creature x makes takes y amount of time.  If attacking and moving can vary in time then it's a little harder to make a deterministic turn loop, but it's probably doable in some fashion.

george

  • Rogueliker
  • ***
  • Posts: 201
  • Karma: +1/-1
    • View Profile
    • Email
Re: Roguelike timing systems.
« Reply #19 on: June 28, 2012, 06:37:14 AM »
I did a little survey of RL time implementations some time ago,

http://kooneiform.wordpress.com/2009/04/14/roguelike-turn-based-time/

I think it'd be wise to heed the advice to reflect the mechanics in the UI.

Destroid

  • Newcomer
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #20 on: June 28, 2012, 07:00:11 AM »
I understand the interface I'm planning is quite counter intuitive and will need quite a lot of UI aids for the player.  I'll post up my prototype when I've implemented a timing system in it.  I don't mind if the game will be a bit more ponderous than the usual RL because I'm aiming for a more tactical experience, under the roguelike control scheme.

Not all of the problems pointed out will apply though, as I am planning to have a 0s (or perhaps very small) attack time cost, and run attacks on a separate cooldown to movement.  This is to allow you to fight and move at the same time, creating a positioning game.  With regard to movement - it won't have an actual move cost, the time that passes each movement turn will be the amount of time it takes for you to traverse a single square.  Your movement input adds velocity to your current velocity, and then your avatar is moved one square according to that velocity.

Destroid

  • Newcomer
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #21 on: June 28, 2012, 08:06:00 PM »
http://www.mediafire.com/?h6nm8m88bafha6c

You'll need flash player to run it.  The rounding is dodgy at the moment, but don't mind that.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #22 on: June 28, 2012, 10:44:51 PM »
It works.

I can't reasonably determine how fast I'm going.

Max velocities would be nice.

Destroid

  • Newcomer
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #23 on: June 29, 2012, 05:44:13 AM »
It works.

I can't reasonably determine how fast I'm going.

Max velocities would be nice.

Yep, it doesn't have very useful UI aids yet.  But it's running on the time system I proposed, even if it's only keeping track of the player at the moment.  I'll implement a monster, attack and something to make it easier to see where you are going next.
« Last Edit: June 29, 2012, 06:07:46 AM by Destroid »

purestrain

  • Rogueliker
  • ***
  • Posts: 172
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #24 on: June 30, 2012, 06:50:03 AM »
Stop using grid based movement

Destroid

  • Newcomer
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #25 on: June 30, 2012, 12:46:49 PM »
If I did that I would need a more sophisticated control scheme, or it would just be odd.

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #26 on: June 30, 2012, 05:47:51 PM »
If I did that I would need a more sophisticated control scheme, or it would just be odd.

It's more odd on a grid.

Not much more sophisticated, you just need angular momentum.

Destroid

  • Newcomer
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Roguelike timing systems.
« Reply #27 on: June 30, 2012, 06:01:41 PM »
I'm not worried about the computational side of it, the thing that I like about the RL interface is that it's very quick and simple to use.  If I move away from a grid to a continuous 2d plane I need to allow for a lot more variety of inputs, and without discrete locations player mental gymnastics are more complex.

Of course, the current in my prototype is by no means easy to use, but at least it's different.  If I switched to continuous position variable time doesn't really make any sense, and that's the interesting part about this idea to me.