TeensyMud - 'A ruby mud server.'

Subject: Kill the Hamster?
Subject: Kill the Hamster?
Author: Tyche
Posted: 01/19/2006 07:28PM

I've been thinking of killing the hamster and replacing it with a smarter critter like a white rat. Let me outline this new interface to the many thousands of readers of this forum.

# Set/add a timer for an object
# [+id+] The id of the object that wants to get a timer event
# [+name+] The symbolic name of the timer event
# [+time+] The interval time in seconds of the timer event
world.set_timer(id, name, time)

# Unset/remove a timer for an object
# [+id+] The id of the object to remove a timer event
# [+name+] The symbolic name of the timer event to remove (or nil for all events)
world.unset_timer(id, name=nil)

These would be additive. You could set multiple timers on a given object for different intervals. For example:

ply = Player.new("Bob")
world.set_timer(ply.id, :hiccup, 1)
world.set_timer(ply.id, :heal, 300)
world.set_timer(ply.id, :gottapee, 7200)

Player Bob would then receive :timer events every second, every five minutes and every two hours.

How do you distinguish which timer event?

Currently the event received by an object from the hamster looks like this

nil, id, :timer, nil

The new smarter Rat timer would send more information.

0, id, :timer, :timer_name

Whaddaya think?
Better?


Oh yeah... Object 0 is going to be the World object. The World object will store some very important information about the state of the world. Important to the new rat timer, it will hold (and save) all the information about the timers.


reply
Subject: Kill the Hamster?
Author: Massaria
Posted: 01/20/2006 07:59AM

Tyche wrote:
> I've been thinking of killing the hamster and replacing it with a smarter critter like a white rat. Let me outline this new interface to the many thousands of readers of this forum.

Heh, the member list isn't too crowded, sadly, but I have been wondering how many read the forums. You must have some connection-statistics. Any 'foreign' IP's in there?

> ply = Player.new("Bob")
> world.set_timer(ply.id, :hiccup, 1)
> world.set_timer(ply.id, :heal, 300)
> world.set_timer(ply.id, :gottapee, 7200)
>
> Player Bob would then receive :timer events every second, every five minutes and every two hours.
>
> How do you distinguish which timer event?
>
> Currently the event received by an object from the hamster looks like this
>
> nil, id, :timer, nil
>
> The new smarter Rat timer would send more information.
>
> 0, id, :timer, :timer_name
>
> Whaddaya think?
> Better?
>

I'm still having problems with the timers, specifically registering and unregistering them, but my grasp on the techy stuff isn't firm enough to tell whether one implementation is better than the other (the new '@props', FX, was frustrating at first, but I suspect they're handy in the long run).
However, if the white rat will allow 1) easy un/registering and 2) different kinds of timer events, then I'd certainly say it's a step up from the hamster. In a fight, for instance, it would be handy to have a 'combat' timer with short intervals that could be easily turned on and off.

Assuming that you find it an improvement yourself, I think it's safe to say that it's a unanimous 'thumbs up' :-)

PS: Does it really have to be white? I guess they do seem somehow cleaner or more sanitary, but I've always found their beady red eyes unnerving. I gather it's a matter of association, much like the flaming stick-man - I can't help but think of that monk on the cover of Rage Against the Machines's breakthrough album. *shiver*

reply
Subject: Kill the Hamster?
Author: Tyche
Posted: 01/23/2006 04:33AM

Massaria wrote:
> Heh, the member list isn't too crowded, sadly, but I have been wondering how many read the forums. You must have some connection-statistics. Any 'foreign' IP's in there?

Yes I keep webalyzer statistics. I don't do any lookup or even post processing on them so I don't know. The stats are really skewed now because of the TeensyWeb release. Before that I was averaging around 20 unique sites a day, and I know from experience that 6 of them are just webspiders. The last few days I've gotten 300 sites a day. Response time was pretty good considering my son and his WoW? clan was eating all my bandwidth with their Teamchat.

> PS: Does it really have to be white? I guess they do seem somehow cleaner or more sanitary, but I've always found their beady red eyes unnerving. I gather it's a matter of association, much like the flaming stick-man - I can't help but think of that monk on the cover of Rage Against the Machines's breakthrough album. *shiver*

I used to have both a brown and white rat as pets when I was a kid. The brown one was a great pet, but the white one used to bite me all the time. Later upon reflection I figured it was sign of intelligence. What rat in their right mind would want me picking them up and playing with them. ;-)

I looking forward to a Feb. 2 release. So I think I'll dub the new Timer, the Groundhog in honor of GroundHog?'s Day.



reply