Newsgroups: rec.games.roguelike.development
From: Elsairon <narius.vari...@gmail.com>
Date: Fri, 1 Aug 2008 13:51:17 -0700 (PDT)
Local: Fri, Aug 1 2008 4:51 pm
Subject: My thoughts on Time/Speed
A Speed/Time System
=-=-=-=-=-=-=-=-=-= I'm finishing up a design for my time system. So far I Here is the system I thought of over the last couple days. (After writing this out to understand my design, I decided =-=-=-=-=-=-=-=-=-= I'm using a segmented time system. It incorporates ideas This has two benefits IMO. One, mobs don't ever have too much energy. The system won't Two, I don't have to compare an energy total with n number When a mob acts, the action costs them exertion, depending Each segment mobs of speed n recover 1 point of exertion, Heartbeats (Which track absolute time) are in their own Of course most effects won't trigger every heartbeat, this I've decided that when starting a new level, the player I'm going to start with ten basic speeds. I'm not sure how I split the segments into Speeds. Where in each segment, only HB = Heartbeat HB, 10, 9, 8, 7, 6, 5 =-=-=-=-=-=-=-=-=-= After looking over my design, I came to a better =-=-=-=-=-=-=-=-=-= Turn Sequence: 1. Heartbeat (Tracks absolute time, and triggers absoulte 2. Process active mobs/effects If a mob has <= 0 exertion, it gets to act, and then its =-=-=-=-=-=-=-=-=-= That gives me the coding simplicity of I-go-U-go, allows for -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Ray Dillinger <b...@sonic.net>
Date: Fri, 01 Aug 2008 20:25:05 -0700
Local: Fri, Aug 1 2008 11:25 pm
Subject: Re: My thoughts on Time/Speed
Elsairon wrote: Okay, let me ask if I understand. Your basic repeating sequence > When a mob acts, the action costs them exertion, depending > on conditions, skills, equipment, creature type, etc. > Each segment mobs of speed n recover 1 point of exertion, or "round" is divided into ten segments. For all N in the range from 0 to 10, monsters of speed N get "processed" on each of N more-or-less equally spaced segments in a round. (note: "zero" speed is for paralyzed or petrified creatures) Processing involves checking the exertion total to see if it's Right? You've got a fixed sequence in which different-speed monsters Consider a player at speed 4 facing a pack of monsters who all This gets spread out somewhat by moves taking more than one Consider a small refinement in your timing system where each You wind up processing monsters when it isn't their turn a lot. Having a 'nextturn' field in the monster records rather than your > I've decided that when starting a new level, the player This is highly abusable. It makes a character on the stairs > will always act first, regardless of how slow the player is. invulnerable. A character who repeatedly goes up/down/up/down becomes untouchable, and may take opportunistic potshots at liesure. > I'm going to start with ten basic speeds. I'm not sure how There is a standard terminology. You've divided the round into > to describe the order/sequence of which mobs regain their > exertion points when, so I'll give a small illustration. ten segments. speed 10 gets pulses on segments 0-9. speed 9 gets pulses on segments 0-1 & 3-9. speed 8 gets pulses on segments 0, 2-5, & 7-9. Etc. > That gives me the coding simplicity of I-go-U-go, allows for This is one of the simplest time systems that supports both > dynamic changes of mob speeds for free and no anomalous double > moves. Also mobs have a hard cap of one action per heartbeat, > unless their action is an explicit 'double-move'. actions of varying length and actors of varying speeds. It'll work. Bear You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Elsairon <narius.vari...@gmail.com>
Date: Fri, 1 Aug 2008 21:54:25 -0700 (PDT)
Local: Sat, Aug 2 2008 12:54 am
Subject: Re: My thoughts on Time/Speed
> On Aug 1, 11:25 pm, Ray Dillinger <b...@sonic.net> wrote: Thats correct. All monsters of speed n get processed on a > Elsairon wrote: > > When a mob acts, the action costs them exertion, depending > > on conditions, skills, equipment, creature type, etc. > > Each segment mobs of speed n recover 1 point of exertion, > Okay, let me ask if I understand. Your basic repeating sequence segment, with segments of different speeds spread apart as equally as possible. > Processing involves checking the exertion total to see if it's Yes. > zero or less. If not, you subtract one from the exertion total. > If so, the monster has an opportunity to act. When the monster > acts, the "cost" of its action (time taken, relative to its own > speed) is added to its exertion total. > Right? Yes. I planned to give all non-player mobs a starting amount of exertion. This staggers their action times, as you say. > You wind up processing monsters when it isn't their turn a lot. I considered doing it this way. In the past I had monsters > I guess that's okay; most roguelike games do it. But if you > know the monster's speed and how many segments it will need to > recover from its action, you can calculate the heartbeat on > which it will next act immediately rather than just subtracting > one each time you see it. Then, instead of looking for zero, > you look for nextturn <= turncount. scheduled on thier next action time. However this meant if/when the monsters speed changed, I needed to reschedule them, and I didn't know how to do that. So I put this off til later (now). This exertion idea was the first one that I came up with to > Having a 'nextturn' field in the monster records rather than your I like the idea of not processing something when it's not that > current 'exertion' field allows you to keep a schedule sorted by > time of next action, which is the first step to *NOT* needing to > process anything when it's not that thing's turn. things turn. I'll have to work out how to calculate what turn that thing would act on when/if that things speed changes. Which adds more complexity (for me). > > I've decided that when starting a new level, the player Thats true, and I want the player to have at least one turn to > > will always act first, regardless of how slow the player is. > This is highly abusable. It makes a character on the stairs act without getting one-shotted by a monster or group of monsters. Perhaps forcing the player to get the first turn, the first > > I'm going to start with ten basic speeds. I'm not sure how Good to know. > > to describe the order/sequence of which mobs regain their > > exertion points when, so I'll give a small illustration. > There is a standard terminology. You've divided the round into > > That gives me the coding simplicity of I-go-U-go, allows for I think I'll take a look at implementing a system where the > > dynamic changes of mob speeds for free and no anomalous double > > moves. Also mobs have a hard cap of one action per heartbeat, > > unless their action is an explicit 'double-move'. > This is one of the simplest time systems that supports both > Bear monsters get sorted and activated based on their time of next action. This would speed up processing and in general a more efficient solution than polling though each segment list and processing each mob. I'll need to work out how to re-schedule mobs whose speed Thanks for the feedback, I appreciate it. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Ray Dillinger <b...@sonic.net>
Date: Sat, 02 Aug 2008 15:03:02 -0700
Local: Sat, Aug 2 2008 6:03 pm
Subject: Re: My thoughts on Time/Speed
Elsairon wrote: Still not quite the same thing. Let me break it down this >> On Aug 1, 11:25 pm, Ray Dillinger <b...@sonic.net> wrote: >> You've got a fixed sequence in which different-speed monsters >> act within a given segment, which will give some rather dire >> anomalous results about monsters of like speed all getting >> processed together. >> Consider a small refinement in your timing system where each >> monster has an "offset" into the round, between 0 and 9 inclusive, >> and gets processed that many heartbeats *after* the monsters with >> offset zero. > Yes. I planned to give all non-player mobs a starting amount > of exertion. This staggers their action times, as you say. way: Suppose you've got a player with speed 8 and a pack of 30 monsters all with speed 9. Suppose your monsters are all repeating some action that takes 3 pulses to complete, and you start them out with some random starting amount of exertion between zero and two to stagger out their moves. At the same time, the player is also repeating actions that take 3 pulses. Now, what winds up happening is that every time the speed 9 P: . 1 2 3 4 . 6 7 8 9 . 1 2 3 4 . 6 7 8 9 . 1 2 3 4 . 6 7 8 9 The 3-round sequence of completed moves where monsters starting y z x A y z x B y z x y C z x D y z x y E x y z F x y z G x y z H x Analysis of the 8 intervals: Now, the totals are right: the monsters are completing 9 actions It's a lot like different wavelengths causing both constructive The effect becomes less pronounced the more pulses actions take; has to contain sufficient information to allow you to efficiently change the action's place in the time queue. Here's the math for calculating the monster's nextturn time on a Newnextturn = (Oldnextturn - currenttime) * (Oldspeed/Newspeed) Bear You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Elsairon <narius.vari...@gmail.com>
Date: Sat, 2 Aug 2008 18:55:34 -0700 (PDT)
Local: Sat, Aug 2 2008 9:55 pm
Subject: Re: My thoughts on Time/Speed
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Ray Dillinger <b...@sonic.net>
Date: Sat, 02 Aug 2008 21:28:45 -0700
Local: Sun, Aug 3 2008 12:28 am
Subject: Re: My thoughts on Time/Speed
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Elsairon <narius.vari...@gmail.com>
Date: Sat, 2 Aug 2008 23:36:50 -0700 (PDT)
Local: Sun, Aug 3 2008 2:36 am
Subject: Re: My thoughts on Time/Speed
So much for online usenet interfaces, anyway, I had
a backup of my reply so let's try again. <snip analysis> >Now, the totals are right: the monsters are completing 9 actions Hmm. I guess for a more fair system, I'll need to factor this in. >while the player completes 8. But the ratios are wrong. If the >timing system was working fairly, 9/8 of the speed-9 monsters would >be completing their actions between each player action. Instead, >the fractions range from 2/3 to 4/3, which looks to the player >like a massed double move. In fact, the 4/3 fraction gets repeated >twice in a row in this example, which is very deadly. This is >caused by ratio jitter because of the fixed order of processing >where all monsters of like speed are processed together. >It's a lot like different wavelengths causing both constructive >and destructive interference making waveforms in a "beat" frequency. >The effect becomes less pronounced the more pulses actions take; >the system actually becomes fair (or close enough as to not matter) >when the actions that are being repeated take 9 or more pulses to >complete. As I was considering different amounts of exertion, I realized that the greater the exertion amount, the less pronounced the speed differences would be in any given unit of time. I'll have to get more monsters of different types into the solve an example I made up, for changing speeds but I hadn't broken it down this cleary. I'm thinking the segmented time system I've been considering is I did a little reseach on priority queue's last night, and Either way, I'm planning to throw the time system behind Events will need to be able to schedule themselves, and Il have to have a way to handle events that are no longer Thanks Again. -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Ray Dillinger <b...@sonic.net>
Date: Sun, 03 Aug 2008 09:15:04 -0700
Local: Sun, Aug 3 2008 12:15 pm
Subject: Re: My thoughts on Time/Speed
Elsairon wrote: Actually, not really. What becomes less pronounced with actions > Bear wrote: >>The effect becomes less pronounced the more pulses actions take; >>the system actually becomes fair (or close enough as to not matter) >>when the actions that are being repeated take 9 or more pulses to >>complete. > Hmm. I guess for a more fair system, I'll need to factor this in. taking more pulses to complete is the jitter. What you've proposed is actually a fine system; you just need to be aware that if actions get too short (not enough exertion) the jitter factor can become severe. If you make your shortest action 9 pulses (or cost 9 exertion) what you've got is completely fair. But don't overdo it; the length of actions is also how many times you have to process a monster when it isn't that monster's turn. > I'll have to get more monsters of different types into the Right. Never underestimate the value of playtesting. > system and test the speed differences in gameplay. > I'm thinking the segmented time system I've been considering is Baloney. It's fine. Just don't let the actions be too short > not really going to be precise enough to ensure accuracy. for it. > I did a little reseach on priority queue's last night, and One of my rewrites used a priority queue for the schedule. > it seems that that might be the best way to go. Rescheduling in a priority queue is really annoying, because My current schedule structure is an array of pointers, each Performance is hash-table like, but that's because I designed > Either way, I'm planning to throw the time system behind Right. That's really the fundamental thing a good time system > an interface so the game can ask for 'do_next_event(), so > I'll be able to change the time system later. needs to deliver. The Next Action. > Il have to have a way to handle events that are no longer No need to get complicated about that; you could just mark them > valid also as invalid and leave them in the queue until they get "executed" (and of course, when they get executed, nothing happens). Bear You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Soyweiser <soywei...@gmail.com>
Date: Mon, 4 Aug 2008 06:21:20 -0700 (PDT)
Local: Mon, Aug 4 2008 9:21 am
Subject: Re: My thoughts on Time/Speed
On Aug 1, 10:51 pm, Elsairon <narius.vari...@gmail.com> wrote:
> A Speed/Time System Hi Elsairon, > =-=-=-=-=-=-=-=-=-= > <snip> > That gives me the coding simplicity of I-go-U-go, allows for > -- The creation of a speed time system was also something I was thinking When do you plan to process these status effects? I could think of a There is something to say for each system. Having faster mobs consume There are some things that must be considered, if you process And you must also be careful that certain effects are not processed In a "you go, I go" system (with no increased speeds) you would be } But, this will cause some problems, what if the action of one mob causes another mob to lose its items on which there is an effect. (For example: mob a disarms mob b of his burning torch, preventing the running of mob b's statusEffectProcessing() for the item, causing it to skip a turn of burning). And in other systems, without game rounds, the simple once per game ( (1) http://roguebasin.roguelikedevelopment.org/index.php?title=An_elegant... How are you planning to handle these type of events? I'm not really I understand that this is a little bit offtopic, but it was something You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
Newsgroups: rec.games.roguelike.development
From: Paul Donnelly <paul-donne...@sbcglobal.net>
Date: Mon, 04 Aug 2008 13:17:43 -0500
Local: Mon, Aug 4 2008 2:17 pm
Subject: Re: My thoughts on Time/Speed
Perhaps you could throw status effects into the mix with the player
and NPCs, since you (presumably) already have a system for making events occur at a certain rate. Same with projectiles and explosions. Status effects could be a sort of noncorporeal monster that either deals poison damage or dies (if its time is up), projectiles could be like a very fast monster with special movement logic, and explosions could be a sort of multi-square monster that develops a little more every time it gets a turn (the most complex to add, probably). As a bonus, assuming monsters can pick up items, explosions could carry items with them using that same code. It would take a bit more work on the system up front, but now a fast You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||
| Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy |
| ©2009 Google |