Here's something fun...


Clouded

 

Posted

That's actually quite awesome! Thanks!


 

Posted

A few other quick, fun facts:

  • Time in Paragon City is exactly 48 times faster than time in the real world. One Paragon City minute is 1.25 real world seconds.
  • Why 48? If you work it out, that makes a complete day/night cycle in Paragon City exactly 30 minutes of real time. Paragonian midnight occurs on the hour and half hour in the real world. Paragonian noon occurs on the 15 and 45 minute marks.
  • This means that one year (365 days) of Paragon City time happens every 7 days, 14 hours, 30 minutes of real time.
  • When we celebrate the sixth anniversary of City of Heroes going live this coming May, a Paragonian who was born the exact moment when they turned the servers on would be celebrating his or her 288th birthday. (Unless, of course, you explain the discrepancy in time scales by imagining that Earth in the CoH universe is rotating 48 times faster than our Earth, in which case it must be really hard to get a decent night's sleep in Paragon City. No wonder those citizens look so tired all the time!)
  • The day/night cycle is altered every year during the Halloween event. The clock is always "stuck" at midnight from the start to the end of the event.
  • If you click on someone whose name starts with "F" (Fred, Francine, Faustino, etc.), they will tell you what time it is in Paragon City.
  • If you take a demorecord file, the time the demorecord starts is at the very top of it, expressed as a floating point number of hours since midnight. (For example, 14.333333 would be 2:20pm.)


We've been saving Paragon City for eight and a half years. It's time to do it one more time.
(If you love this game as much as I do, please read that post.)

 

Posted

HI Tony V,

Since you have some time on your hands; would you mind mowing my lawn today?

Thanks!


 

Posted

Quote:
Originally Posted by TonyV View Post
[*]When we celebrate the sixth anniversary of City of Heroes going live this coming may, a Paragonian who was born the exact moment when they turned the servers on would be celebrating his or her 288th birthday. (Unless, of course, you explain the discrepancy in time scales by imagining that Earth in the CoH universe is rotating 48 times faster than our Earth, in which it must be really hard to get a decent night's sleep in Paragon City. No wonder those citizens look so tired all the time!)[/list]
Danged silver clockwork...


Suggestions:
Super Packs Done Right
Influence Sink: IO Level Mod/Recrafting
Random Merit Rolls: Scale cost by Toon Level

 

Posted

Quote:
Originally Posted by TonyV View Post
Hey all, I was kind of bored tonight, so I threw this together. Keep in mind that javascript isn't a language I dabble in much, so if there are bugs, oops. With that being said, maybe it will be a little bit useful, so enjoy!
I'd love to make a .NET desktop app for that. A little window to float on a second monitor.

However, I've noticed that the time isn't always the same from one zone (or zone instance) to another. How are you taking that into account?


 

Posted

Quote:
Originally Posted by TyrantMikey View Post
I'd love to make a .NET desktop app for that. A little window to float on a second monitor.

However, I've noticed that the time isn't always the same from one zone (or zone instance) to another. How are you taking that into account?
I haven't observed that. I figured out the scheme by taking demorecords from various places, including multiple zones and within a base. I haven't exhaustively checked every zone, but I would have thought that it's consistent from place to place. If anyone finds a discrepancy outside of an in-game minute or two (which could be caused by latency between my server and your browser), let me know.

Quote:
Originally Posted by Clouded View Post
Since you have some time on your hands; would you mind mowing my lawn today?
Already taken care of. Please send the goat back when he's done.


We've been saving Paragon City for eight and a half years. It's time to do it one more time.
(If you love this game as much as I do, please read that post.)

 

Posted

Are day/night cycles messed up when a ritki invasion or a zombie incursion or a banner event take place?


-STEELE =)


Allied to all sides so that no matter what, I'll come out on top!
Oh, and Crimson demands you play this arc-> Twisted Knives (MA Arc #397769)

 

Posted

No, no, and no.


 

Posted

Quote:
Originally Posted by TonyV View Post
Hey all, I was kind of bored tonight, so I threw this together. Keep in mind that javascript isn't a language I dabble in much, so if there are bugs, oops. With that being said, maybe it will be a little bit useful, so enjoy!
OK, that's definitely worth a bookmark

One quick question - is this synced up to the actual game? If so, having... Well, a real in-game watch would be VERY handy!

And, of course, thank you very much for the script


Quote:
Originally Posted by Arcanaville View Post
Samuel_Tow is the only poster that makes me want to punch him in the head more often when I'm agreeing with him than when I'm disagreeing with him.

 

Posted

Quote:
Originally Posted by Samuel_Tow View Post
OK, that's definitely worth a bookmark

One quick question - is this synced up to the actual game? If so, having... Well, a real in-game watch would be VERY handy!

And, of course, thank you very much for the script
Yes, it should be synced to the actual game. Here's how it works.

Technical details follow in the interest of finding flaws and in case someone wants to take the idea further

A week or so ago, just for the hell of it, I wanted to find out what the ratio is between time that passes in Paragon City and time that passes in the real world. By finding an NPC that started with the letter F, I could tell that it was around 1 game minute = 1 real second, but it was just a little bit off. I decided to take more accurate readings instead using demorecord files.

I marked the real time, waited a while, and took readings from demorecord files on how much in-game time passed to real time. That's where I came up with a number that was statistically equal to 48 in-game seconds passing for every real second. At first, that puzzled me, until I realized that it meant that 48 in-game hours also passed for every real hour. Aha! That works out to an in-game day (24 in-game hours) passing for every 30 real minutes.

So, I wondered, now that I know the scale, what is the offset? In other words, when does in-game midnight fall? A few /servertime commands later, I figured it that it was on every hour and on every half hour. (i.e. Midnight fell at 7:00pm real time, 7:30pm real time, 8:00pm real time, etc.)

So that's when I set about writing the script.

In the first iteration, I used javascript to calculate the number of milliseconds past the half hour, multiply it by 48, and convert it to a time of day. That worked like a charm, except that my computer's clock isn't in sync with the game server's clock. As a result, the difference between my computer's clock and the game server's clock was magnified by 48--if my clock is off by the server's clock by 90 seconds, for example, the game time of day will be off by an hour and twelve minutes. It's a good ballpark number, but I got to thinking about how it could be more accurate.

I first set about to calculate the difference between my computer's clock and the game server's clock. I didn't get very far, though, because the game server's clock only displays its time in resolution of minutes, making it pretty hard to accurately determine the exact time of the game server.

Then a thought hit me: I wonder, does the game server by any chance sync up with Internet time servers via NTP? I did a quick check, and it appeared that it does indeed. That triggered another thought: The Titan Network's server is synced up via NTP as well, so in theory our server and the game server should be on the same clock. I checked, and indeed they seem to be!

In that case, I figured, what I could do is host the page on the Titan server (on which Paragon Forge is hosted), and the server could send in javascript how many milliseconds it thinks it is past the half hour, and client-side, the difference between the Titan Server's clock and the user's clock can be calculated.

If you dig into the script, you'll see a line towards the top that looks something like this:

var time_diff = 1093807 - (new Date()).getTime() % 1800000;

The server plugged the 1093807 into that line; it is the number of milliseconds past the half hour according to its NTP-synced clock. When I loaded the page just now, the 1,093,807 ms indicates that according to the server's clock, it is 18:13.807 past the half hour (as I'm typing this, specifically, it was 11:48:13.807am EDT). It then subtracts the number of milliseconds past the half hour the clock on the user's machine reads to come up with a constant time differential, assigned to the variable time_diff. (There are 1,800,000 milliseconds in a half hour.)

If your computer's clock is, say, 10 seconds behind the server's, time_diff will be 10,000. If your computer's clock is, on the other hand, 10 seconds ahead of the server's, time_diff will be -10,000.

Once that calculation is made, it kicks off an interval timer that updates every 20 milliseconds. Each time the interval function is called, it takes your computer's clock's reading of how many milliseconds have passed since the half hour, then adds the time differential back. If your computer's clock is 10 seconds behind the server's, then the reading has 10,000 milliseconds added to it. If your computer's clock is 10 seconds ahead of the server's, then the reading has 10,000 milliseconds subtracted from it. This should sync up the reading with the server's (and thus the game server's, which syncs from the same source) idea of what time it is.

Then the number of milliseconds is multiplied by 48 and converted to a time of day that is echoed to the page.

End of technical details

Still, I'll admit that it could be just a little bit off. One thing that's not accounted for is the latency it takes for the network packets to get from the Titan Network server to your machine. Also, time synchronization via the Internet always has a little bit of "drift," so the Titan Network server and the CoH game server might be just a hair off. And remember, any time difference is magnified by 48 when translated to a game time.

Still, it's pretty damn close. In following around people whose names start with F, I've only seen it maybe at most off by one game minute--which is 1.25 real seconds out of sync. That ain't so bad, and for all practical purposes, it's well within the realm of "close enough."

If someone wants to write a desktop app for this (and I haven't ruled out doing it myself), they could simply make an NTP request to get the current time, preferably UTC, and perform the calculation that way instead of depending on the Titan Network server. Heck, I even googled javascript ntp client to see if I could do it within the code itself, which would let you actually store the thing locally and not have to pull it up from the Paragon Forge, but I didn't really see one that I liked.

I'm glad you find it bookmark-worthy. I really kinda wish that they would put it somewhere on the official site, like in a side box somewhere have a running clock showing the time in Paragon City. Maybe if enough people like this page, they'll ask me to write it for them. My price is cheap--one costume code.


We've been saving Paragon City for eight and a half years. It's time to do it one more time.
(If you love this game as much as I do, please read that post.)