Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ Time issue.
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Longbow
(102 posts) Bio
|
Date
| Thu 02 Jun 2005 09:28 PM (UTC) |
Message
| I'm trying to slow down how fast hours go by in my MUD. Talking to someone means a whole day(or two, or three) will pass, which I hardly think is very realistic.
Now correct me if I am wrong but the time is handled in db.c, which around line 500 has this code:
{
long lhour, lday, lmonth;
log_string("Setting time and weather");
lhour = (current_time - 650336715)
/ (PULSE_TICK / PULSE_PER_SECOND);
time_info.hour = lhour % 24;
lday = lhour / 24;
time_info.day = lday % 35;
lmonth = lday / 35;
time_info.month = lmonth % 17;
time_info.year = lmonth / 17;
Now I think this is where you change the time but I'm not sure. Would somebody explain to me how I might go about slowing it down a bit?
Thanks and Godbless,
Longbow | Top |
|
Posted by
| Dralnu
USA (277 posts) Bio
|
Date
| Reply #1 on Thu 02 Jun 2005 09:32 PM (UTC) |
Message
| I don't know exactly, but I'd like to find out how to do it myself... | Top |
|
Posted by
| Ithildin
USA (262 posts) Bio
|
Date
| Reply #2 on Fri 03 Jun 2005 06:08 AM (UTC) |
Message
| Search for pulse_tick in mud.h. Then change seconds_per_tick to a higher number if you want slower ticks. make and then boot up. | Top |
|
Posted by
| Gatewaysysop2
USA (146 posts) Bio
|
Date
| Reply #3 on Fri 03 Jun 2005 07:17 AM (UTC) |
Message
| Just wondering, but won't doing that result in longer wait times for anything else that depends on ticks? Might end up with ungodly regeneration times if someone really increases this, no?
I realize the original post was about adding realism, but in context I thinking that one could easily take this too far. It might be nice that people's conversations don't span days, but I doubt anyone wants to wait a real hour or two for their chars to heal up, versus a couple of game hours.
I dunno, just my $.02 if anyone cares. ;) |
"The world of men is dreaming, it has gone mad in its sleep, and a snake is strangling it, but it can't wake up." -D.H. Lawrence | Top |
|
Posted by
| Samson
USA (683 posts) Bio
|
Date
| Reply #4 on Fri 03 Jun 2005 11:31 AM (UTC) |
Message
| Indeed. Changing pulse_tick just to get calendar advancement to move slower is a bad idea since that variable affects pretty much everything that has to do with the game. Things ranging from regen rates to the lag time for the WAIT_STATE macro to spell affects.
The best option for this situation would be to separate the time updates from the rest of the system and put them in their own pulse timer. Then you can tweak and adjust how fast or slow time moves without affecting everything else. | Top |
|
Posted by
| Dralnu
USA (277 posts) Bio
|
Date
| Reply #5 on Fri 03 Jun 2005 03:51 PM (UTC) |
Message
| What about adding another pulse variable, and replace pulse_tick in the calendar update? | Top |
|
Posted by
| Longbow
(102 posts) Bio
|
Date
| Reply #6 on Fri 03 Jun 2005 06:52 PM (UTC) |
Message
| As to whether or not it slows down how fast you heal I don't mind that. I've played a rp MUCK for a long time and healing wasn't instantaneous there, in fact rather a slow business unless you had healing potions. I'm mixing some of the elements of the MUCK and some from the MUD to create a SLUDGE :)
I haven't explored the database much yet as I'm still pretty new to smaug and even if I could read it I don't have time. Would there be any other major affects of changing the time besides those which affect spells? My game doesn't currently use spells so I'm not too worried about that. I would assume it would affect hunger and thirst, but that's just as well. Folks are always getting hungry too quick.
Now if this changes waaay too much I could try adding another pulse variable, but I'd appreciate it if someone would explain how to go about doing that.
Thanks and Godbless,
Longbow | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #7 on Fri 03 Jun 2005 07:13 PM (UTC) |
Message
| Simply healing is not the only thing that pulses handle. It also handles mob updates and more important things, so I suggest not changing the pulse. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Robert Powell
Australia (367 posts) Bio
|
Date
| Reply #8 on Fri 03 Jun 2005 11:25 PM (UTC) Amended on Sat 04 Jun 2005 03:13 AM (UTC) by Robert Powell
|
Message
| Time update is called from pulse_point, just make a new pulse and adjust the numbers below till you find that your time now updated at a rate that suites your mud.
You could also increase PULSE_TICK a little tho i wouldnt go much over 90 seconds, its just too long a wait for anything to happen.
static int pulse_newTIME;
if ( --pulse_newTIME <= 0 )
{
pulse_newTIME = PULSE_TICK * 3; //Ajust this to suit, Tommi of EldhaMUD
time_update ( );
}
|
Just a guy having a bit of fun. Nothing more, nothing less, I do not need I WIN to feel validated. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
26,312 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top