Player always center of newton world.

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Player always center of newton world.

Postby Overhertz » Sat Mar 17, 2012 5:15 am

Hello there, I am currently working on a new MMORPG, and i would like to use Newton for the client-side physics, but what i must first check or figure out, is there a way to always keep an object in the center of the NewtonWorld....

so for example, there is 100 boxes in a world size 100x100, 1 of the boxes will stay always in the center but should still respond to all other objects correctly, and when other objects leave the newton world, they should still have a callback for left newton world.... Is this possible? if so how, and thanks.

-OverHertz
Ziron Programming Language
Download the Assembler HERE
User avatar
Overhertz
 
Posts: 112
Joined: Mon Jul 06, 2009 11:19 am

Re: Player always center of newton world.

Postby Julio Jerez » Sat Mar 17, 2012 10:21 am

I do not see why that will not be possible?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Player always center of newton world.

Postby Overhertz » Sat Mar 17, 2012 11:22 am

i did not say it won't be possible, i'd just like to know for sure it can be done with newton, i guess you just answered that question, could you give me an idea how i will accomplish this task with newton?

the idea behind the centered player is that client side will allow for objects to enter into his "client" side physics world, allowing each client to simulate his/her physics, because the new game i'm working on at our company has an infinite size space (really infinite).

thanks in advance,

-OverHertz
Ziron Programming Language
Download the Assembler HERE
User avatar
Overhertz
 
Posts: 112
Joined: Mon Jul 06, 2009 11:19 am

Re: Player always center of newton world.

Postby Julio Jerez » Sat Mar 17, 2012 11:53 am

To get this clear.
are you saying that you are going to have a uninverse where each playe will be it own world at tah center, and every one else will revolve around the player?
say for example there are 100 players in teh universe you will have 100 worlds, and in each world the few players tha are around the one world owner?
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Player always center of newton world.

Postby Overhertz » Sat Mar 17, 2012 12:42 pm

yes that is correct, so each client will have their own newton world, and each of the other players will be entered into each others world as other physical entities (when they come into range of the players world) allowing for each client to run their own physic calculations (the server will do a very basic physics run, since it will hold 10000's of clients, it needs to use a minimal of cpu time)
Ziron Programming Language
Download the Assembler HERE
User avatar
Overhertz
 
Posts: 112
Joined: Mon Jul 06, 2009 11:19 am

Re: Player always center of newton world.

Postby Julio Jerez » Sat Mar 17, 2012 1:56 pm

Oh I see you want to have a loca world on each client, and somehow keep a data base tha manage thes world in some server.
you can do that with no too moch effre usin teh newton tool.

here is what I would do. but firs first desging idea so that wa are all clear.

-you need to seperare the server and the client code.
-you need to stablish teh comsept of fisical adress and local adress of a object. tehr si no such thong as infinite world bu ther artte certannly very big number an dnewton can hel;p with that.


let of define the physical adress:
physical adress is the absult pointion of a cliedn in teh contune universe. yo ucn arepsenat that with a double oir you can represen it with a extbned presiontion numbe liek teh newton
dgGoogel class that let you use unlimite presiotion floats numbers.

in your selver code, yo cna impelemet a class call clint proxy, thsi si the represention of a client body in the continue world,
the client proxy postion can be decompose into two part, the segment and the segment offset.

teh equation to express the locatiopnb of a body is

physicsadreess = segmnet * quadrantSize + segmentoffest.
the cuadrant size an arbitrary world size locla word size. an dteh ossefty is the frcation on the segement.

The server side code cna work liek this.

in conteian the conatinue workd of all proxy, and it keep track how many each enety position on each segment.

say you have machine A, whi has clint A.
the serve will detemenine teh serve will knwo what cuatadr that emety occupy in the universe
for simplicity le us say the work si 2d,
the number of adjecent cuadrand aroun tha player is is 9, and sine the cunadr are large enuoght to be cointaint all interation of negight but no lareg enught to generate jitter.
for each adjacent cuadrant the selerve will calculate the local adress
segmentoffest = physicsadreess - segmnet * quadrantSize.
when the phsics adress of that pelen is outsode teh 9 boundaries around that universe, the player it mina it overlap a new negboard so teh selere remove that object fornm ClienA and added to the new neighbound
the adress is always local on each client,
went the client iselft crosses it own word size, the selver recalculate it position and the position of all negiborgd.
teh clint do no have to be teh oprigin an dI do no recomend that because it can mak eteh server to work very hard if there are too many bodies.

with a good data structue that keep coherance all these chnage can be incramental and you can maintaion as many client as you have memory in your server.


This is a planned feature to be soppoetr in newton 300, but not for mutiplayer code, but for streaming very large worlds.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Player always center of newton world.

Postby Overhertz » Sat Mar 17, 2012 2:58 pm

"tehr si no such thong as infinite world"

well actually our company has overcome such limitations, we have developed an engine that can have a true infinite world with a small overhead (obviously limited to the memory installed on the server system)
and I'm talking about a world that you could fly in a straight line for several years in real-time.

But still our requirement is for each client to have their own small physical world (client-side) - this is what makes it possible for a seamless infinite world for the clients - the server provides required physical body updates based on clients physical world parameters. So if it is possible for the player to stay center of their newton world, I'd love to know how to do this with newton without causing problems concerning the physics reactions :)

Thanks again for your time.

-OverHertz
Ziron Programming Language
Download the Assembler HERE
User avatar
Overhertz
 
Posts: 112
Joined: Mon Jul 06, 2009 11:19 am

Re: Player always center of newton world.

Postby Julio Jerez » Sat Mar 17, 2012 3:25 pm

Overhertz wrote:"So if it is possible for the player to stay center of their newton world, I'd love to know how to do this with newton without causing problems concerning the physics reactions :)


I told you, in the server you need to have a physical absulte adress whith is the absolete position of teh player in the universe.
The server know that lcation calculated the relative locations of the player on the client. all of the client neigborgh are update by the server.

But like I say if you make the client to be teh center of the world, tnan teh selrve will have to do lot and lot of updates.
it is better to have aisland size and the 8 possible island neiborgh (in 2d) or 27 neigborg (in 3d) and update when bodies cosses those boudaries.
This is a thecnique that operating system uses to mapping diffrent prosses in the same memory, also the x87 segment architectecture implemented for years.
in both cases they use a granulatity, beacuse otherwise the virtual memory manager will kill the system doing update each time avery time an item move.

each client will have in own owner that can move locally insidde its works, and upadte only wen it cross it word size,
plsue teh immidatye nighbod island tha ge update win vistors form adjacen isalen enetr and exit that world.
it should be strighfporqred to ge it going.
that way and add and removing obvjects can happen at much lower rate, give teh engine the chaneg to maintain contact perssitance and onley update with position update are made.

I do no see any problem with doin that.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Player always center of newton world.

Postby Overhertz » Sat Mar 17, 2012 3:52 pm

This would pose problems for our engine since our server checks an offset location of the player to be able to enter new players into the clients game based on visual range, if the player is at the end of his world (center) - baring in mind there is 3 dimensional movement, (so 27 worlds) - it would be a difficult task to calculate the position on which world the other players should appear.

The server does minimal physics and uses much lower bandwidth, with our current physics engine, it is not a problem, but to save time and speed up development we want to use an external physics library. Once we finish fixing a few other issues i will begin implementing Newton physics and see how things go, I guess i will still search for a possibility to keep the player centered, since our system already works like this, but if all else fails, i will look into changing this if necessary.

I will reply to this thread if/when i make progress in regards to this, Thanks

-OverHertz
Ziron Programming Language
Download the Assembler HERE
User avatar
Overhertz
 
Posts: 112
Joined: Mon Jul 06, 2009 11:19 am

Re: Player always center of newton world.

Postby Julio Jerez » Sat Mar 17, 2012 5:23 pm

not, not 27 worlds, one world with 28 overalping neigborghs.
the implementaion should lead to the theoretical lowest and most optimal bandwith, this is a common problem on topology of graphs.

but fi you has a solution than I am glad you do.
Julio Jerez
Moderator
Moderator
 
Posts: 12426
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron