Mythruna
April 23, 2024, 05:23:48 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1] 2 3
  Print  
Author Topic: Thanksgiving Week Redux...  (Read 29570 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: November 27, 2012, 01:27:07 AM »

As many of you already know, I took last week off from my day job.  Partially because we had a ton of family coming into town for the holidays and partially because I wanted to focus on some bigger Mythruna pieces that require undivided attention.

For the most part, this was a good call.  I waded into working on the physics engine with a fully aggressive unrealistic schedule that was torn to shreds within hours of beginning. Smiley  But, I was able to get some stuff accomplished that would have been difficult otherwise.  (Mostly because these things can turn out to be so difficult that I find excuses to avoid them.)

So, when chained to my desk and forced to stare at the problem for hours and hours, I eventually made progress in certain areas that are both critical and paint-peelingly boring to develop.

The goal for the week was to develop the networking layer for the physics engine.  There are some pretty hard requirements on how this must perform and operate and I'd been dragging my feet on it for a long time.  Furthermore, usually every time I pick up the physics engine code again it takes a few days to wrap my brain around what it's doing.

On the first Saturday, I resurrected the old combat prototype that I was working on some time back that never actually got any combat features except throwing chairs around.  This prototype uses the main Mythruna game engine like a library and the main engine had changed quite a bit over the last year.  It took me the better part of Saturday to get "CombatRuna" running again but at least I could test that the physics engine was still operating.

From there, I developed a simple prototype for ultimately testing network physics.  It's just a simple top-down view of a world with some rollable objects.  WASD controls another little block that can run around and push into these objects (and get pushed back, too)... more on that in a second.

One of the critical features of a networked physics engine for a fully open sandbox world is the ability to partition space into "zones" and reliably, accurately, and most of all, performantly keep track of objects in motion.  There could be 10s of thousands of objects in the world but the physics engine only needs to worry about the objects that are in motion and the objects nearby that it might collide with.  So the world is divided into zones and collision space partitioned accordingly.

I spent all day Sunday designing this piece from my high level notes.  I was hours into one detailed design before completely scrapping it.  There is no way that it would ever perform well.  The strains of hundreds or thousands of objects being moved 60 times a second and requiring figuring out which zone they are in, notifying interested systems, etc. is a problem trickier than it might at first seem.  The second design made it to implementation before I got far enough down in the weeds to know that it would have a completely different set of problems.  The third design took a different approach and centralized the problems of the second to a more manageable place and it still took me 4-5 hours of design to feel like I'd tackled the issue in an elegant way.

All of that being said, I now at least have a fully functioning zone management system that has almost 0 overhead.  Furthermore, it can be used for both network area of interest reduction (the original problem) and collision space activation (the problem I realized this could solve only after I'd implemented it).  The current way I do collision detection relies on the fact that the player is always watching his zone and the zones around him... this is why you can bump into a table that sticks into your zone from the zone next to you.  This approach actually wouldn't work for collision with physics objects in motion because it's too expensive to keep 9 zones active just for one little moving object.  Anyway, the zone manager solves this problem because objects can be in more than one zone at a time while they straddle the borders.  But I digress.

There were also a few ancillary problems I solved along the way (this one I promised to get back to above).  Player movement is kind of an interesting one.

In the version of the game that you guys play, your input directly controls the location of the camera and there is sort of a light player-specific physics applied to those inputs.  The problem is that it is then completely impossible to have the player affected by the other physical objects around him.  Players can't bump into each other but more importantly, a rolling boulder would go right through the player... and most critically to me, you couldn't stand on a moving ship without falling off.

The more immediate problem was what happens when a player walks into an object that can move.  If it doesn't push the player back appropriately then the physics engine easily runs into cases that are impossible to solve (and lead to explosive results).  For example, if you slide into a chair and push it against the wall... you can keep pushing into the chair if it's not pushing back and the physics engine doesn't know how to resolve this chair+wall+immovable force problem.

As it turns out, making the player a physical object just like the others is kind of tricky.  Instead of setting absolute position and rotation, the player inputs apply accelerations to the player's physical object.  I will tell you that moving yourself with just acceleration and trying to get a similar affect to what we have now is not as straight forward as it may seem.

...but at least I was able to get something working.  It was very educational, also.

By the time I had that working and a proper zone manager design partially implemented, the holidays were full-on upon me and I had limited time to get back to coding.  Still, at this point, I have my simple test app and the zone manager fully implemented.  

The next piece will be the actual networking part that packages up the state of a player's zone and sends it to them many times a second.  I'm sure this will present its own surprises but I feel like a) I've already implemented the hard part, and b) the network speed test I put out some time back already had some nice compact state transmission code.  In this case, it's not as much a matter of making it work but in keeping the packet size down to minimum levels.  So hopefully it is more straight-forward than what I've already accomplished.

I wish I had better news than that but some progress is better than no progress.  I hope to get the networking prototype finished in the next week or so and then I can put something out for the donators to help me test.  After that, it's just a matter of integrating it into the regular engine.
Logged
FutureB
Donators
Hero Member
***
Posts: 512


RAWR


View Profile
« Reply #1 on: November 27, 2012, 01:52:09 AM »

that all sounds good paul Tongue reading it even tho i dont understand it because im newb made me feel good about your game and the future it will have :]
Logged


Say the opposite of these words:
1)Always.
2)Coming.
3)From.
4)Take.
5)Me.
6)Down.
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #2 on: November 27, 2012, 01:54:26 AM »

that all sounds good paul Tongue reading it even tho i dont understand it because im newb made me feel good about your game and the future it will have :]

Heheh... verbal diarrhea is a constant problem for me.  And I didn't even mention that I got sick over the weekend... Smiley
Logged
FutureB
Donators
Hero Member
***
Posts: 512


RAWR


View Profile
« Reply #3 on: November 27, 2012, 03:05:25 AM »

Paul i think when your sick its natural to have diarrhea  Grin
Logged


Say the opposite of these words:
1)Always.
2)Coming.
3)From.
4)Take.
5)Me.
6)Down.
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #4 on: November 27, 2012, 05:04:58 AM »

Working on the hard parts first is always a good idea in my opinion. Well done Paul!
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
BigredRm
Donators
Sr. Member
***
Posts: 379


<-o Word up goes to that modern man o->


View Profile
« Reply #5 on: November 27, 2012, 05:47:51 AM »

Great read.
Logged

Visit Iron Island @ 1708,702
Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #6 on: November 27, 2012, 01:42:16 PM »

"Great Read." indeed! Glad to hear about the physics, but sad to hear how hard it is! Some other 'prototype game' have been having very similar problems, but got something... simple out... I would LOVE it if you had a ship that could ACTUALLY move, and your character not fly into space! xD... I hate that in games such as GMod, or Blockade Runner.

Once you get those issues out, those games will see this and go "Quick guys, someone offer to help him, then steal the code and bring it back!" :3... That's not nice, but I can't help thinking so many companies will see your game, and see ALL those things they wanted to do, but didn't want to do it because "it was to hard. I didn't have enough time to do it." type stuff!

Yes you will have other game companies loving your game, and see your work in other games. :3... I can see it now... Actually, I already have, I'm from the future.
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #7 on: November 27, 2012, 04:49:33 PM »

Quote from: Teknonick
Yes you will have other game companies loving your game, and see your work in other games. :3... I can see it now... Actually, I already have, I'm from the future.
Wow..

1.) Excellent read, the first thing that i actually thoroughly read on Mythruna.

2.) Paul, I loved seeing you use the feature of throwing chairs, all though if you allow that, that will be just another way to grief.

3.) If you allow players to have a static position, not much movement, but have correct collision, i would love it. the only bother is static position, making it look like lag so..

4.) Physics engine is going to be amazing.

Good luck Paul! I have faith in you and I expect extremely great things from you as your knowledge is extremely superior to that of many!
Logged
FutureB
Donators
Hero Member
***
Posts: 512


RAWR


View Profile
« Reply #8 on: November 27, 2012, 05:01:10 PM »

Quote from: Teknonick
Yes you will have other game companies loving your game, and see your work in other games. :3... I can see it now... Actually, I already have, I'm from the future.
Wow..

1.) Excellent read, the first thing that i actually thoroughly read on Mythruna.

2.) Paul, I loved seeing you use the feature of throwing chairs, all though if you allow that, that will be just another way to grief.

3.) If you allow players to have a static position, not much movement, but have correct collision, i would love it. the only bother is static position, making it look like lag so..

4.) Physics engine is going to be amazing.

Good luck Paul! I have faith in you and I expect extremely great things from you as your knowledge is extremely superior to that of many!

maybe you should start reading all posts thoroughly and then you might have less questions about them :]
Logged


Say the opposite of these words:
1)Always.
2)Coming.
3)From.
4)Take.
5)Me.
6)Down.
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #9 on: November 27, 2012, 05:02:53 PM »

.. great idea troll -_-
Logged
Sean
Donators
Hero Member
***
Posts: 598



View Profile
« Reply #10 on: November 27, 2012, 08:17:51 PM »

When the RPG elements roll in griefing wont be an issue.
Logged

"People willing to trade their freedom for temporary security deserve neither and will lose both." - Benjamin Franklin
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #11 on: November 27, 2012, 09:12:39 PM »

When the RPG elements roll in griefing wont be an issue.
agreed. not to mention that you cant grief on a single player game, which is all i'll be doing on mythruna for much of the beginning.
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #12 on: November 27, 2012, 09:40:42 PM »

When the RPG elements roll in griefing wont be an issue.
agreed. not to mention that you cant grief on a single player game, which is all i'll be doing on mythruna for much of the beginning.

The nice thing is that if you just decide one Saturday that you want to co-op with a buddy, it will be no problem to run a server for a while on that same world you've been playing.  Hmmm... though I may have to add some special utility function for transferring your character.  (Currently the single player character is always different than the server player database... not a hard fix though.)
Logged
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #13 on: November 28, 2012, 05:13:49 AM »

When the RPG elements roll in griefing wont be an issue.
agreed. not to mention that you cant grief on a single player game, which is all i'll be doing on mythruna for much of the beginning.

The nice thing is that if you just decide one Saturday that you want to co-op with a buddy, it will be no problem to run a server for a while on that same world you've been playing.  Hmmm... though I may have to add some special utility function for transferring your character.  (Currently the single player character is always different than the server player database... not a hard fix though.)
this will be especially awesome once my dad and little brother get the game and we all start going on adventure through mythruna together! i will probably make a video series outa that. I tell them how awesome this game is gonna be but until its muuuch farther in developement, i won't suggest anyone download it. the few people i did tell to download said "it sucked" blah blah just because you put up an unfinished pre alpha download. *cough losers cough*
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #14 on: November 28, 2012, 12:33:42 PM »

this will be especially awesome once my dad and little brother get the game and we all start going on adventure through mythruna together! i will probably make a video series outa that. I tell them how awesome this game is gonna be but until its muuuch farther in developement, i won't suggest anyone download it. the few people i did tell to download said "it sucked" blah blah just because you put up an unfinished pre alpha download. *cough losers cough*

Heheh.  Some people have no vision. Smiley  For other games, I'm more of the "get it when it's finished" guy too unless I can feel like a part of the community.  So I really appreciate all of you who play and contribute to the discussions.
Logged
Pages: [1] 2 3
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!