Mythruna

Development => Blog => Topic started by: pspeed on December 10, 2012, 02:31:23 PM



Title: Networking, steps forward and backwards...
Post by: pspeed on December 10, 2012, 02:31:23 PM
The networking of the physics engine has been taking me longer than I wanted.  There are a lot of details that have to be perfect or the whole thing comes crashing down.

I already posted before about my trials and tribulations with zone management.  So far that design has held up very well.

I've been through similar ups and downs with the networking layer.  I alternate between feelings of excitement about how much I'm able to encode in a single tiny message and feelings of dread that there is some critical thing I've forgotten.  For the most part, I've been plodding ahead.

Last night I got almost the full loop-back working.  Every piece was/is in place except the actual sending the messages over the wire.  The mobile objects are zone-managed, their state per-player is packaged up, network state messages are generated, they are looped back to the client code, and the client unpacks them and the data is still accurate.  I've done everything except actually apply it to the visuals.

Despite the progress I was making this weekend, there was some nagging doubt in my mind since last week that there was a critical element I was forgetting.  By the weekend, this was a looming shadow casting a pall over all of the progress I was making.  I went to bed last night feeling accomplished but somehow wholly unsatisfied. 

Upon waking up this morning it finally occurred to me what the issue was.  And it's kind of a serious one.  The sad thing is that I had small comments and notes floating around that were sort of poking at the problem but it didn't all click until this morning when I swung my legs out of bed.

The issue is surmountable.  In fact, solving it will make some other things easier and the network protocol ends up even tighter after this.  I think most of my tricking infrastructure even gets to live and become simplified.  The client code becomes a little more complicated but it's all in the interest of keep the network protocol as tight as possible.

The other benefit is that I get nice meta-information about connection throughput.  Not only will I know exact ping times but also the exact number of messages dropped or late.  So there is that.

I was trying to get this wrapped up in time for integration with real Mythruna over the Christmas holidays.  We'll have to see if that can still happen, now.


Title: Re: Networking, steps forward and backwards...
Post by: belgariad87 on December 10, 2012, 02:55:55 PM
The networking of the physics engine has been taking me longer than I wanted.  There are a lot of details that have to be perfect or the whole thing comes crashing down.

I already posted before about my trials and tribulations with zone management.  So far that design has held up very well.

I've been through similar ups and downs with the networking layer.  I alternate between feelings of excitement about how much I'm able to encode in a single tiny message and feelings of dread that there is some critical thing I've forgotten.  For the most part, I've been plodding ahead.

Last night I got almost the full loop-back working.  Every piece was/is in place except the actual sending the messages over the wire.  The mobile objects are zone-managed, their state per-player is packaged up, network state messages are generated, they are looped back to the client code, and the client unpacks them and the data is still accurate.  I've done everything except actually apply it to the visuals.

Despite the progress I was making this weekend, there was some nagging doubt in my mind since last week that there was a critical element I was forgetting.  By the weekend, this was a looming shadow casting a pall over all of the progress I was making.  I went to bed last night feeling accomplished but somehow wholly unsatisfied. 

Upon waking up this morning it finally occurred to me what the issue was.  And it's kind of a serious one.  The sad thing is that I had small comments and notes floating around that were sort of poking at the problem but it didn't all click until this morning when I swung my legs out of bed.

The issue is surmountable.  In fact, solving it will make some other things easier and the network protocol ends up even tighter after this.  I think most of my tricking infrastructure even gets to live and become simplified.  The client code becomes a little more complicated but it's all in the interest of keep the network protocol as tight as possible.

The other benefit is that I get nice meta-information about connection throughput.  Not only will I know exact ping times but also the exact number of messages dropped or late.  So there is that.

I was trying to get this wrapped up in time for integration with real Mythruna over the Christmas holidays.  We'll have to see if that can still happen, now.
(http://www.downshifters.in.ua/wp-content/uploads/2012/10/good-news.jpg)
it will be the best present i will be getting


Title: Re: Networking, steps forward and backwards...
Post by: Sean on December 10, 2012, 03:25:41 PM
I'm glad you found the problem. I've always found 'sleeping on it' to be the best course of action.


Title: Re: Networking, steps forward and backwards...
Post by: pspeed on December 10, 2012, 03:27:39 PM
I'm glad you found the problem. I've always found 'sleeping on it' to be the best course of action.

Yeah, I'd been sleeping on the problem for a week or more.  Doesn't always work on my schedule. :)

Now that I've found the problem, now I need to actually solve it. :)


Title: Re: Networking, steps forward and backwards...
Post by: BigredRm on December 11, 2012, 05:07:36 PM
The networking of the physics engine has been taking me longer than I wanted.  There are a lot of details that have to be perfect or the whole thing comes crashing down.

I already posted before about my trials and tribulations with zone management.  So far that design has held up very well.

I've been through similar ups and downs with the networking layer.  I alternate between feelings of excitement about how much I'm able to encode in a single tiny message and feelings of dread that there is some critical thing I've forgotten.  For the most part, I've been plodding ahead.

Last night I got almost the full loop-back working.  Every piece was/is in place except the actual sending the messages over the wire.  The mobile objects are zone-managed, their state per-player is packaged up, network state messages are generated, they are looped back to the client code, and the client unpacks them and the data is still accurate.  I've done everything except actually apply it to the visuals.

Despite the progress I was making this weekend, there was some nagging doubt in my mind since last week that there was a critical element I was forgetting.  By the weekend, this was a looming shadow casting a pall over all of the progress I was making.  I went to bed last night feeling accomplished but somehow wholly unsatisfied. 

Upon waking up this morning it finally occurred to me what the issue was.  And it's kind of a serious one.  The sad thing is that I had small comments and notes floating around that were sort of poking at the problem but it didn't all click until this morning when I swung my legs out of bed.

The issue is surmountable.  In fact, solving it will make some other things easier and the network protocol ends up even tighter after this.  I think most of my tricking infrastructure even gets to live and become simplified.  The client code becomes a little more complicated but it's all in the interest of keep the network protocol as tight as possible.

The other benefit is that I get nice meta-information about connection throughput.  Not only will I know exact ping times but also the exact number of messages dropped or late.  So there is that.

I was trying to get this wrapped up in time for integration with real Mythruna over the Christmas holidays.  We'll have to see if that can still happen, now.
+1


Title: Re: Networking, steps forward and backwards...
Post by: pspeed on December 12, 2012, 04:32:48 AM
And tonight I learned what happens when two objects occupy the exact same space at the exact same time... in a physics engine.  Hint: Very Bad Things.

Fixing things in the physics engine is NOT EQUAL to making progress on networking... but is still necessary.


Title: Re: Networking, steps forward and backwards...
Post by: Iggyjeckel on December 12, 2012, 06:48:35 AM
Distortion of reality, cows living undergound, giraffe swimming in the ocean, fish..flying with the penguins.

And people, oh we sad pathetic creatures...shun human interaction, speak with our fingers and talk to our reflection



Thanks paul for destroying the poor fabric of time and space


Title: Re: Networking, steps forward and backwards...
Post by: BenKenobiWan on December 12, 2012, 09:35:59 AM
Lol


Title: Re: Networking, steps forward and backwards...
Post by: Michael on December 12, 2012, 02:11:15 PM
ROFL


Title: Re: Networking, steps forward and backwards...
Post by: Moonkey on December 12, 2012, 02:24:20 PM
Paul's computer should have exploded into a black-hole. No fireworks show? :(


Title: Re: Networking, steps forward and backwards...
Post by: Sean on December 12, 2012, 05:39:10 PM
Not until an error in the engine causes the division of zero.


Title: Re: Networking, steps forward and backwards...
Post by: Moonkey on December 12, 2012, 06:44:33 PM
Not until an error in the engine causes the division of zero.
0/0 = 0. *check*

Edit: No black-hole.


Title: Re: Networking, steps forward and backwards...
Post by: BenKenobiWan on December 12, 2012, 06:47:20 PM
Not until an error in the engine causes the division of zero.
0/0 = 0. *check*

Edit: No black-hole.
Technically infinity.


Title: Re: Networking, steps forward and backwards...
Post by: Sean on December 12, 2012, 07:26:44 PM
Not until an error in the engine causes the division of zero.
0/0 = 0. *check*

Edit: No black-hole.
Technically infinity.
^Which includes negative numbers and decimals. :3


Title: Re: Networking, steps forward and backwards...
Post by: Teknonick on December 13, 2012, 03:10:53 PM
Not until an error in the engine causes the division of zero.
0/0 = 0. *check*

Edit: No black-hole.
Technically infinity.
^Which includes negative numbers and decimals. :3
The answer to every question that CANNOT be answered is: BLACK HOLE!!!

Anyway, I want to see a video of what happens xD Is it like in other games, or is it something NEW that people will be like "I WANT TO BUY THIS GAME, JUST CUS OF THAT-O-BUG!!!" type-o-the-thing?
Also, release a Physics Engine release, with a discloser saying: VERY UNSTABLE, your computer may explode into a Blackhole with the slight chance of you being sucked into it if your CPU is equal to 0/0, or less... or more... or some other direction of calculation!


Title: Re: Networking, steps forward and backwards...
Post by: pspeed on December 13, 2012, 03:22:48 PM
Not until an error in the engine causes the division of zero.
0/0 = 0. *check*

Edit: No black-hole.
Technically infinity.
^Which includes negative numbers and decimals. :3
The answer to every question that CANNOT be answered is: BLACK HOLE!!!

Anyway, I want to see a video of what happens xD Is it like in other games, or is it something NEW that people will be like "I WANT TO BUY THIS GAME, JUST CUS OF THAT-O-BUG!!!" type-o-the-thing?
Also, release a Physics Engine release, with a discloser saying: VERY UNSTABLE, your computer may explode into a Blackhole with the slight chance of you being sucked into it if your CPU is equal to 0/0, or less... or more... or some other direction of calculation!

Nothing so interesting.  For a second you see the world and then you see blackness.  And then I spent the next three hours bug hunting.


Title: Re: Networking, steps forward and backwards...
Post by: Teknonick on December 13, 2012, 03:28:53 PM
Not until an error in the engine causes the division of zero.
0/0 = 0. *check*

Edit: No black-hole.
Technically infinity.
^Which includes negative numbers and decimals. :3
The answer to every question that CANNOT be answered is: BLACK HOLE!!!

Anyway, I want to see a video of what happens xD Is it like in other games, or is it something NEW that people will be like "I WANT TO BUY THIS GAME, JUST CUS OF THAT-O-BUG!!!" type-o-the-thing?
Also, release a Physics Engine release, with a discloser saying: VERY UNSTABLE, your computer may explode into a Blackhole with the slight chance of you being sucked into it if your CPU is equal to 0/0, or less... or more... or some other direction of calculation!

Nothing so interesting.  For a second you see the world and then you see blackness.  And then I spent the next three hours bug hunting.
FTW xD... It doesn't just SPAZ? lol... Anyway, did you find that bug? Or did yo- *Trips over Bug*


Title: Re: Networking, steps forward and backwards...
Post by: pspeed on December 13, 2012, 03:42:31 PM
FTW xD... It doesn't just SPAZ? lol... Anyway, did you find that bug? Or did yo- *Trips over Bug*

The object that the camera was locked to ended up at NaN, NaN, Nan... so couldn't see anything else.

I did find the bug and fixed the symptoms at least.  I mean, I fixed the problem of contact resolution when two objects of the same size + shape exactly occupy the same spot and rotation.  In this case, the distance between them was 0 so the code the determines where the contact point was and in which direction just needed to be tweaked to handle that case.

There was still some other bug where applying friction was messed up.  I never did figure out why exactly a certain value goes negative even after the above fix but I did add a check for when the relative planar impulse is 0... no friction necessary in that case anyway.


Title: Re: Networking, steps forward and backwards...
Post by: Michael on December 13, 2012, 04:20:56 PM
could you do a do-while loop and say something like:
Code:
do {
(code)
} while (x == [negative operator command thingy]) x++;
?


Title: Re: Networking, steps forward and backwards...
Post by: BenKenobiWan on December 13, 2012, 06:24:20 PM
could you do a do-while loop and say something like:
Code:
do {
(code)
} while (x == [negative operator command thingy]) x++;
?
Code:
Do {
X++
} while (x < 0)
I think that's how your code should be. In C++, anyway.
It probably isn't what you'd want in Paul's case, though.


Title: Re: Networking, steps forward and backwards...
Post by: Michael on December 13, 2012, 06:44:19 PM
lol you messed up ben.
1.) you put a capital 'x' and a lowercase 'x' so one x won't be affected.
2.) Forgot semicolons ;)
3.) 'Do' should be lowercase, 'do'

Should be:
Code:
do {
x++;
} while (x < 0);


Title: Re: Networking, steps forward and backwards...
Post by: pspeed on December 13, 2012, 07:39:21 PM
"Sir, we have this red blinking light on the console."
"Well, just cover it with a piece of tape then."

:)


Title: Re: Networking, steps forward and backwards...
Post by: Michael on December 13, 2012, 09:34:32 PM
lol i don't get it but yet I laughed  :-\


Title: Re: Networking, steps forward and backwards...
Post by: BenKenobiWan on December 13, 2012, 10:07:44 PM
lol you messed up ben.
1.) you put a capital 'x' and a lowercase 'x' so one x won't be affected.
2.) Forgot semicolons ;)
3.) 'Do' should be lowercase, 'do'

Should be:
Code:
do {
x++;
} while (x < 0);
I am ashamed and/or rusty. The capital letters were due to my iPad, so I can't be blamed for that, but I forgot semicolons! :o


Title: Re: Networking, steps forward and backwards...
Post by: Moonkey on December 13, 2012, 10:34:23 PM
lol you messed up ben.
1.) you put a capital 'x' and a lowercase 'x' so one x won't be affected.
2.) Forgot semicolons ;)
3.) 'Do' should be lowercase, 'do'

Should be:
Code:
do {
x++;
} while (x < 0);
I am ashamed and/or rusty. The capital letters were due to my iPad, so I can't be blamed for that, but I forgot semicolons! :o
You noob! What if the fate of the world depended on your Ipad?! Answer: We are all doomed.


Title: Re: Networking, steps forward and backwards...
Post by: Michael on December 15, 2012, 01:40:27 PM
lol you messed up ben.
1.) you put a capital 'x' and a lowercase 'x' so one x won't be affected.
2.) Forgot semicolons ;)
3.) 'Do' should be lowercase, 'do'

Should be:
Code:
do {
x++;
} while (x < 0);
I am ashamed and/or rusty. The capital letters were due to my iPad, so I can't be blamed for that, but I forgot semicolons! :o
You noob! What if the fate of the world depended on your Ipad?! Answer: We are all doomed.
iPad* spell it right >:/


Title: Re: Networking, steps forward and backwards...
Post by: Moonkey on December 16, 2012, 01:03:09 PM
lol you messed up ben.
1.) you put a capital 'x' and a lowercase 'x' so one x won't be affected.
2.) Forgot semicolons ;)
3.) 'Do' should be lowercase, 'do'

Should be:
Code:
do {
x++;
} while (x < 0);
I am ashamed and/or rusty. The capital letters were due to my iPad, so I can't be blamed for that, but I forgot semicolons! :o
You noob! What if the fate of the world depended on your Ipad?! Answer: We are all doomed.
iPad* spell it right >:/
Not if I'm counting it as a noun. And I'm not nerdy. *winks*

Edit: And I don't like Ipads.


Title: Re: Networking, steps forward and backwards...
Post by: Michael on December 16, 2012, 01:41:00 PM
lol you messed up ben.
1.) you put a capital 'x' and a lowercase 'x' so one x won't be affected.
2.) Forgot semicolons ;)
3.) 'Do' should be lowercase, 'do'

Should be:
Code:
do {
x++;
} while (x < 0);
I am ashamed and/or rusty. The capital letters were due to my iPad, so I can't be blamed for that, but I forgot semicolons! :o
You noob! What if the fate of the world depended on your Ipad?! Answer: We are all doomed.
iPad* spell it right >:/
Not if I'm counting it as a noun. And I'm not nerdy. *winks*

Edit: And I don't like Ipads.
nor do i, but spell it right, it looks weird iPad not Ipad


Title: Re: Networking, steps forward and backwards...
Post by: Iggyjeckel on December 16, 2012, 03:11:08 PM
Not a fan od apple so i will probably never own an eyePad


Title: Re: Networking, steps forward and backwards...
Post by: Sean on December 16, 2012, 06:30:06 PM
(http://i00.i.aliimg.com/photo/v0/117329244/Eye_Pads_Non_Wooven_.jpg_250x250.jpg)
They look kind of uncomfortable.  Am I right?


Title: Re: Networking, steps forward and backwards...
Post by: Moonkey on December 17, 2012, 12:37:55 AM
(http://i00.i.aliimg.com/photo/v0/117329244/Eye_Pads_Non_Wooven_.jpg_250x250.jpg)
They look kind of uncomfortable.  Am I right?
You could crash while driving a car and using an ļpad. *true story*


Title: Re: Networking, steps forward and backwards...
Post by: Iggyjeckel on December 17, 2012, 07:07:31 AM
I heard the ayePad was quite agreeable


Title: Re: Networking, steps forward and backwards...
Post by: Moonkey on December 17, 2012, 03:45:10 PM
I heard the ayePad was quite agreeable
Aye.