Re: [SMAUG] Don't understand math behind time_info (update)
Re: [SMAUG] Don't understand math behind time_info (update)
under
static int pulse_second;
add
static int pulse_time;
under
if ( --pulse_violence <= 0 )
{
pulse_violence = PULSE_VIOLENCE;
violence_update ( );
}
add
if ( --pulse_time <= 0 )
{
pulse_time = 1200; // Roughly 5 minutes
time_update ( );
weather_update ( ); // You may or may not want this here.
}
Then find:
time_update ( );
weather_update ( );
In the
if ( --pulse_point <= 0 )
Check, and comment them out, or delete them.
This will make every hour take roughly five minutes.
Change the rollover numbers in time_update to the number of days/months/etc
Then in act_info.c you update day_name and month_name to contain the correct
number elements, then in do_time you correct all the moduli
(time_info.hour % 12 == 0) ? 12 : time_info.hour % 12,
time_info.hour >= 12 ? "pm" : "am",
day_name[day % 7],
day, suf,
month_name[time_info.month],
Hours would become 11 assumably, and what you do with days is up to you. years
are unhandled at present.
You can add your own read/write routine to the mud to record the
hour/month/day/year.
Some MUDs store it in sysdata rather than finding their own place to put it, but
it's up to you if you want to save the sysdaya every time an 'hour' passes and
time_update is called, or only save on reboots, etc.
----- Original Message -----
From: "Noah Leavitt" <noahleavitt555@yahoo.com>
To: "Eos" <Smaug@auricmud.com>
Sent: Wednesday, March 30, 2005 6:27 PM
Subject: Re: [SMAUG] Don't understand math behind time_info (update)
| But according to your reply I was wrong after all?
| Thanks a lot, though. Smaug is a lot hairier then I
| would have thought. =/ I'll try to do what you said.
| What exactly was my original solution doing? Merely
| generating a new random time? Ow lol.
|
| -Ombrenuit
|
| --- Eos <Smaug@auricmud.com> wrote:
| > It's simply generating a semi random hour/month/day
| > within the constraints of
| > the arrays designed for those purposes.
| > That only sets the time as of loading the mud. It
| > doesn't have anything to do
| > with the actual passage of time, or the speed at
| > which time passes.
| >
| > All of that is handled by
| >
| > time_update()
| > In update.c
| >
| > To establish what you want, you need to move
| > time_update() out of pulse_point
| > into it's own sub-handler that is accurate to the
| > durations you want.
| >
| > Additionally, to preserve continuity you'll need to
| > save the 'current' time
| > regularly, and read it back in on loadup, instead of
| > just randomly creating a
| > default time like SMAUG does.
| >
| >
| >
| > ----- Original Message -----
| > From: "Noah Leavitt" <noahleavitt555@yahoo.com>
| > To: "SML" <smaug@realms.game.org>
| > Sent: Wednesday, March 30, 2005 9:01 AM
| > Subject: [SMAUG] Don't understand math behind
| > time_info
| >
| >
| > | My goal is to change the time settings on the
| > | codebase, and to do this somehow I have to change
| > | time_info's data.
| > | I want to somehow implement this system:
| > |
| > | 1 year (12 months or 360 days)=4 weeks
| > | 1 season(3 months)= 1 week
| > | 1 month(30 days)= 2.3 days (or 55.2 hours or 3312
| > | minutes)
| > | 1 day (22 hour day) = 110.4 minutes
| > | 1 hour = 5 minutes (roughly)
| > |
| > | However, I don't understand in db.c how time_info
| > gets
| > | the hour by finding the remainder of an of the
| > | equation:
| > | (time(0) - 650336715) / 70) % 24; Can anyone
| > explain
| > | the math behind this so that I might be able to
| > | incoporate my system?
| > |
| > |
| > |
| > |
| > | __________________________________
| > | Do you Yahoo!?
| > | Yahoo! Mail - You care about security. So do we.
| > | http://promotions.yahoo.com/new_mail
| > |
| > |
| >
| >
|
| __________________________________________________
| Do You Yahoo!?
| Tired of spam? Yahoo! Mail has the best spam protection around
| http://mail.yahoo.com
|
|