Flawless Day/Night Transitions in TGE 1.5
by Bryce "Cogburn" Weiner · 03/21/2007 (1:29 am) · 27 comments
I'll just let the video do the talking. Video codec is DivX 5
What the video doesn't say... and I will... is that John Kabus is a genius. :)
This is based on the existing EnviroTorque resource. The whole thing integrates near flawlessly with the 1.5 codebase. I'm not going to resource this just yet, because I'd like to spruce the whole thing up with Steven Peterson's EnviroTorque 2.0. Hey Steven... If you read this, drop me a line. If you don't have time to finish it, I might be able to pickup where you left off.
EDIT: At the time of the original post this didn't work client/server.... But at the time of this edit... it does. :)
What the video doesn't say... and I will... is that John Kabus is a genius. :)
This is based on the existing EnviroTorque resource. The whole thing integrates near flawlessly with the 1.5 codebase. I'm not going to resource this just yet, because I'd like to spruce the whole thing up with Steven Peterson's EnviroTorque 2.0. Hey Steven... If you read this, drop me a line. If you don't have time to finish it, I might be able to pickup where you left off.
EDIT: At the time of the original post this didn't work client/server.... But at the time of this edit... it does. :)
#2
03/21/2007 (2:08 am)
Love it! Cool stuff.
#3
03/21/2007 (3:15 am)
does it work client server? either way cool stuff :)
#4
@Adrian: Yes, it is client/server ready... I screwed something up in creating the network object (never been good at it). There's some really odd behavior via my packUpdate/unpackUpdate, but I am absolutely convinced it's because I'm doing some mask bit wrong or clamping some value or some such noob mistake. I'm hot on it's trail and I'm sure I'll have wrestled it down shortly. :)
03/21/2007 (5:22 am)
@Richard: the EnviroTorque resource allows for a custom number of seconds per game hour. If you specified 3600 seconds and the proper axis tilt, month, day, longitude & latitude, sunrise would be not only simultaneous, but at the same point on the horizon based on the day of the year.@Adrian: Yes, it is client/server ready... I screwed something up in creating the network object (never been good at it). There's some really odd behavior via my packUpdate/unpackUpdate, but I am absolutely convinced it's because I'm doing some mask bit wrong or clamping some value or some such noob mistake. I'm hot on it's trail and I'm sure I'll have wrestled it down shortly. :)
#5
I was just going to start this tonight! It was really needed for my project! Thanks again!
Jean-Pierre!
03/21/2007 (7:05 am)
Bryce! Bryce! Bryce! Great stuff!I was just going to start this tonight! It was really needed for my project! Thanks again!
Jean-Pierre!
#6
Yes, it works 100% client/server.
03/21/2007 (7:12 am)
Hehe... and 2 hours later... Chased it down. I really suck at coding networked objects. :)Yes, it works 100% client/server.
#7
03/21/2007 (9:08 am)
You should have some ambient blue light during the night really. so you have a bit more to see. Like moonlight.
#8
P.S. Networking? I love networking! :)
03/21/2007 (11:38 am)
hey Bryce, nice stuff! And yeah, at least "some" light at night would be cool.P.S. Networking? I love networking! :)
#10
I like the black night, that's what carefully used light sources are for :)
03/21/2007 (1:19 pm)
Amazing! Watch the shadow as it grows long in the eve... extremely realistic. Very very very! nice work.I like the black night, that's what carefully used light sources are for :)
#11
I can't access the resource.... is being reviewed now?
EDIT: Never mind.... it was a long night :oP
Thanks again!
JP
03/21/2007 (7:56 pm)
Hey Bryce,I can't access the resource.... is being reviewed now?
EDIT: Never mind.... it was a long night :oP
Thanks again!
JP
#12
03/22/2007 (12:19 pm)
It's posts like this that make me wish I was a programmer! I can't wait to see this as a resource, it will be fantastic!
#13
only thing I'm missing is the hills cast shadows as the sun goes down :P
but really nice man
-Paul Usul
03/22/2007 (2:03 pm)
fantastic video, good jobonly thing I'm missing is the hills cast shadows as the sun goes down :P
but really nice man
-Paul Usul
#14
I'm still convinced there's a better way to do this than as I am now, which is why I don't think I should resource this just yet.
Initially I had networked the Celestials object, but it contains more information that is required. The packet updates to move the sun were just destructive on network performance. I reverted Celestials to a CONOBJECT, and created a new NETOBJECT that did nothing but communicate the time and the current vector of of the sun at a frequency of once every 3 seconds. When the object receives an update, it forces this data into Celestials, and the client handles the rest. This improved network performance dramatically and if the client and server get drastically out of sync, the 3 second updates take care of any discrepancy. I've played with the dayLen settings to test the update frequency, and you don't notice when fxSunlight skips forward to catch up if your it's longer than 1,000 seconds. The update frequency itself is measured in game ticks and can be modified in the engine, as script based modifications may allow for abuse.
I think I may shoot John Kabus an email and run my changes by him just to make sure I'm not creating any issues in my light code modifications. I don't see any during testing, and if there are none then I'll at least resource the modifications to get the object lighting correct.
Note: Yes, I could have just modified the Celestials object to handle the network updates, but I'm awful at coding network objects. It was easier just to place it in a new object based on the TDN examples.
03/22/2007 (5:55 pm)
@Paul: Heheh me too. Trying to modify the baked lightmap dynamically is ridiculously hard and processor intensive. While it may not look right on the terrain, the overall effect of nighttime FPS combat is really what we're after. Small flaws can be suffered for the game dynamic the overall effect provides. I'm still convinced there's a better way to do this than as I am now, which is why I don't think I should resource this just yet.
Initially I had networked the Celestials object, but it contains more information that is required. The packet updates to move the sun were just destructive on network performance. I reverted Celestials to a CONOBJECT, and created a new NETOBJECT that did nothing but communicate the time and the current vector of of the sun at a frequency of once every 3 seconds. When the object receives an update, it forces this data into Celestials, and the client handles the rest. This improved network performance dramatically and if the client and server get drastically out of sync, the 3 second updates take care of any discrepancy. I've played with the dayLen settings to test the update frequency, and you don't notice when fxSunlight skips forward to catch up if your it's longer than 1,000 seconds. The update frequency itself is measured in game ticks and can be modified in the engine, as script based modifications may allow for abuse.
I think I may shoot John Kabus an email and run my changes by him just to make sure I'm not creating any issues in my light code modifications. I don't see any during testing, and if there are none then I'll at least resource the modifications to get the object lighting correct.
Note: Yes, I could have just modified the Celestials object to handle the network updates, but I'm awful at coding network objects. It was easier just to place it in a new object based on the TDN examples.
#15
Great work so far!
05/21/2007 (4:47 pm)
This still makes me drool when I look at it. Think we can get an update on progress, or be so bold as to ask for an approximate-off-the-hip-vague-to-ambiguous-wishful-thinking release date for the resource? =)Great work so far!
#18
07/20/2007 (1:51 pm)
*want* :D
#20
09/07/2007 (6:47 am)
Any new news?
Torque Owner Richard_H