Mythruna

Development => Blog => Topic started by: pspeed on June 01, 2013, 12:13:43 AM



Title: Progress...
Post by: pspeed on June 01, 2013, 12:13:43 AM
So, life has been pretty "one thing after another" lately but I have been able to make some progress.

Tonight, I finally got all major features of the new light propagation system working.  It was like pulling teeth because I hate working on lighting.  Cellular automata at this level is notoriously difficult to debug but it's a bit easier than it used to be.

The old engine did all of the lighting on the "back end".  Ultimately the light values were part of the blocks themselves though it was encoded separately.  On the plus side, in multiplayer, lighting was only calculated once and then sent out to everyone.  On the down side, since the lighting values were saved with the blocks then any errors were persistent.  It also made ever doing smooth lighting (or even better optional smooth lighting) nearly impossible.

The new engine chooses to use the space on the back end to store more general data about a cell.  Instead of storing the lighting it stores things like where the solid visible sides are based on the surrounding blocks... and it stores which direction light can travel into and out of a cell.

This information is much easier to calculate and of much more general use to the engine.  The solid side masks, for example, are used by the physics engine for collision detection.  The "light masks" can be used for AI pathfinding, light propagation... even sound, smell, water, and smoke propagation.  (all of which are on the to-do list... sound propagation coming sooner rather than later).

However, the new architecture then heavily favors calculating lighting on the client, ie: in the graphics layer.  This meant that I really couldn't use any of the old code.  (Which had the benefits of not porting those long-standing bugs over.)

On the plus side, the lighting calculations are much faster overall.  The light masks make this sort of propagation really straight forward now since the "which way can light pass" is baked into the world.  Also, geometry/mesh generation is greatly simplified and faster because of the solid side data baked in.  On my system, in many cases it now only takes 4 or 5 milliseconds to recalculate the lighting and rebuild the geometry when a lighting value changes (block added/removed, light added/removed, etc.)

Also, because the lighting is handled externally to the world it means that I can someday potentially make it perception based.  Perhaps certain races see some lighting colors better than others, etc..

The big deal will be dynamic lighting.  I can fully add lights to the view now without them being part of the world as blocks.  So while I'm not yet at the point where I can add player carried torches or blueprint objects providing light to the scene, it's now totally doable.  Not even tricky.

Like physics integration, this is a pretty major milestone because it was one of those systems that was completely different than what came before.  A lot of things to come will get some reworking or at the very least a new UI... and those are their own level of fun+perfectionist-compulsion, but they are still relatively straight forward.  Put some music on and hammer through it.

For this next "equivalence" release, I think the only major milestone left of the "big" size is the networking.  Very little of that will port over because I plan to widen the "logging in stage" to handle character creation a little more robustly and the physics networking integration will be a significant effort... also, while I'm rebuilding it I will try to add the auto-reconnect feature that is really missing right now for when the connection blips.

The rest of the stuff: porting the blueprint editor, property system, object action scripts, etc.. is more straight forward.  I'm trying to at least have equivalent functionality to the last version before releasing.  Even if climbing is broken and there are nitpicky physics bugs.  We'll figure something out.

A year is too long.


Title: Re: Progress...
Post by: Sean on June 01, 2013, 07:29:00 AM
This seems to me you are hinting a public update soon?? :)


Title: Re: Progress...
Post by: pspeed on June 01, 2013, 08:24:22 AM
This seems to me you are hinting a public update soon?? :)

I hope so.  There is still a lot of work to do so it's anyone's guess what "soon" means.  There will be one or two private updates before that.

When I get the new builder wand done and tweak the physics a little then I'll probably put out another donators-only release.


Title: Re: Progress...
Post by: BigredRm on June 01, 2013, 09:04:27 AM
Love the update.  Thanks


Title: Re: Progress...
Post by: Michael on June 01, 2013, 11:28:38 AM
Thank you for the update, I never knew that the lighting was actually attached to the blocks.
I hope you enjoy your programming!


Title: Re: Progress...
Post by: BenKenobiWan on June 01, 2013, 02:44:20 PM
Thanks for the update!
Does this mean that the lighting will be somewhat faster, more flexible client-side, and more realistic?


Title: Re: Progress...
Post by: pspeed on June 01, 2013, 08:35:52 PM
Thanks for the update!
Does this mean that the lighting will be somewhat faster, more flexible client-side, and more realistic?

Probably not more realistic.  There are limitations to the approach.

Faster, yes... though not in a way that the player would notice except for now I can do things with it that I couldn't before.  From the player's perspective, lighting was fast enough before.

I forgot to mention that the new system also supports colored lighting.  That's in and already working.


Title: Re: Progress...
Post by: Michael on June 02, 2013, 09:35:58 AM
Thanks for the update!
Does this mean that the lighting will be somewhat faster, more flexible client-side, and more realistic?

Probably not more realistic.  There are limitations to the approach.

Faster, yes... though not in a way that the player would notice except for now I can do things with it that I couldn't before.  From the player's perspective, lighting was fast enough before.

I forgot to mention that the new system also supports colored lighting.  That's in and already working.
I just love the updates on new engines, tells us what you and the community can do that we couldn't do before with a new engine.


Title: Re: Progress...
Post by: ebag51 on June 02, 2013, 09:56:47 AM
one more update closer to survival and npcs  :)


Title: Re: Progress...
Post by: belgariad87 on June 03, 2013, 09:09:18 AM
thanks for the update, Paul. I look forward to the day when all these are done and we can get to the good stuff  :)


Title: Re: Progress...
Post by: Sean on June 03, 2013, 11:27:08 AM
thanks for the update, Paul. I look forward to the day when all these are done and we can get to the good stuff  :)
The one thing about programming that turns me off the most is all of the BORING stuff that needs to get done before the good parts.


Title: Re: Progress...
Post by: pspeed on June 03, 2013, 11:56:54 AM
thanks for the update, Paul. I look forward to the day when all these are done and we can get to the good stuff  :)
The one thing about programming that turns me off the most is all of the BORING stuff that needs to get done before the good parts.

Heheh.  Normally it's not quite this bad.  The things that I've already done three times before with much pain have already had all of the life sucked out of them.  Up until now, lighting has been my least favorite thing to debug.  Testing is difficult and there are so many edge cases.  The new algorithm is simpler and I built a lot of trace logging into it that I can turn on and off as needed.  That's helped a lot.


Title: Re: Progress...
Post by: belgariad87 on June 04, 2013, 04:09:03 AM
thanks for the update, Paul. I look forward to the day when all these are done and we can get to the good stuff  :)
The one thing about programming that turns me off the most is all of the BORING stuff that needs to get done before the good parts.

Heheh.  Normally it's not quite this bad.  The things that I've already done three times before with much pain have already had all of the life sucked out of them.  Up until now, lighting has been my least favorite thing to debug.  Testing is difficult and there are so many edge cases.  The new algorithm is simpler and I built a lot of trace logging into it that I can turn on and off as needed.  That's helped a lot.
Paul, i think the only problem here is that you are TOO good at your job.


Title: Re: Progress...
Post by: Michael on June 04, 2013, 09:22:05 AM
thanks for the update, Paul. I look forward to the day when all these are done and we can get to the good stuff  :)
The one thing about programming that turns me off the most is all of the BORING stuff that needs to get done before the good parts.

Heheh.  Normally it's not quite this bad.  The things that I've already done three times before with much pain have already had all of the life sucked out of them.  Up until now, lighting has been my least favorite thing to debug.  Testing is difficult and there are so many edge cases.  The new algorithm is simpler and I built a lot of trace logging into it that I can turn on and off as needed.  That's helped a lot.
Paul, i think the only problem here is that you are TOO good at your job.
You can never be too good..


Title: Re: Progress...
Post by: Teknonick on June 04, 2013, 11:40:07 AM
thanks for the update, Paul. I look forward to the day when all these are done and we can get to the good stuff  :)
The one thing about programming that turns me off the most is all of the BORING stuff that needs to get done before the good parts.

Heheh.  Normally it's not quite this bad.  The things that I've already done three times before with much pain have already had all of the life sucked out of them.  Up until now, lighting has been my least favorite thing to debug.  Testing is difficult and there are so many edge cases.  The new algorithm is simpler and I built a lot of trace logging into it that I can turn on and off as needed.  That's helped a lot.
Paul, i think the only problem here is that you are TOO good at your job.
You can never be too good..
Except for when you're Paul. If we don't watch him, he might take over the world and go power crazy. :O!


Title: Re: Progress...
Post by: Michael on June 04, 2013, 09:12:16 PM
thanks for the update, Paul. I look forward to the day when all these are done and we can get to the good stuff  :)
The one thing about programming that turns me off the most is all of the BORING stuff that needs to get done before the good parts.

Heheh.  Normally it's not quite this bad.  The things that I've already done three times before with much pain have already had all of the life sucked out of them.  Up until now, lighting has been my least favorite thing to debug.  Testing is difficult and there are so many edge cases.  The new algorithm is simpler and I built a lot of trace logging into it that I can turn on and off as needed.  That's helped a lot.
Paul, i think the only problem here is that you are TOO good at your job.
You can never be too good..
Except for when you're Paul. If we don't watch him, he might take over the world and go power crazy. :O!
He's got too much work to do with his family :P


Title: Re: Progress...
Post by: BigredRm on June 05, 2013, 05:47:30 AM
(http://i.imgur.com/gohkG.png)