FlagRushNetworking

oh … i trying to follow exactly the way u did in flagRush example …  but i get the output all the time but its for a short while only … i wonder where i have done wrong and will it affect the whole thing afterall? if it doesn't then i will just leave it for the time being as i can load both the client and server object into the game … now the only problem is … i cant change the location of the object - create the object in buildremoteplayer as what u did and there i try to sellocaltranslation for the object but no luck … it just stick together with my server object … btw im using same model for both server n client and i have setlocaltranslation for the obj during loading of model and in buildremoteplayer, i try to overwrite the location … any ideas what have i gone wrong? please … help in need …  :expressionless:

Well, that's pretty vague, but you should have everything you need from the example I put together.  If the FlagRushNetworking sample code works then you should be able to work from that to what you need.

Does it repeatedly output that or is it just for a short time during load?  Does it happen every time?  Do all the vehicles still synchronize properly?  Do any of them?

okay … hmmm … then can i ask something else ? for instance, if i want the bike to be able to shoot … so how can i do the bullet thingy? issit tat the server side shoot out something, then it will send out to let the client know and make the client side to create a bullet at his side? or … how you all normally do for shooting part? haha sorry bcoz im really new in game programming … :stuck_out_tongue:



urmmm … sorry … i have another question … second thing is how can i get the data of the client bike (speed, etc). In your example you building a new bike to represent the other side …  issit when connected the client will send his data to the server? then using the data and build it? sorry, i know can get this answer on the search but since there is chance, so its better to ask you directly  :stuck_out_tongue:



no matter what, thankz for the replies and helps!  :slight_smile:

bullets would very likely be a message from the client at the point the bullet is fired to the server telling it that it is firing and in what direction (the server would likely do validation on this for cheat verifications) and the server would then relay the message and time the bullet firing occurred (so as to properly sync the bullet position in time).  The server would handle actual damage taken by telling a client to take damage (this is because at any given point each client is slightly out of sync with each other and with the server so the server is the only one that can make those decisions).



I would really recommend reading up on this stuff as there is a LOT to learn about networking and game development and though much of it you can find on these forums I would recommend either getting a book or finding some tutorials online to get going with.

hey … i have problem when trying to fire a few times in sequence … this the error i received -:



java.nio.BufferOverflowException

        at java.nio.Buffer.nextPutIndex(Buffer.java:495)

        at java.nio.DirectFloatBufferU.put(DirectFloatBufferU.java:245)

        at com.jme.bounding.OrientedBoundingBox.mergeSphere(Unknown Source)

        at com.jme.bounding.OrientedBoundingBox.mergeLocal(Unknown Source)

        at com.jme.scene.Node.updateWorldBound(Unknown Source)

        at com.jme.scene.Spatial.propagateBoundToRoot(Unknown Source)

        at com.jme.scene.Spatial.propagateBoundToRoot(Unknown Source)

        at com.jme.scene.Spatial.propagateBoundToRoot(Unknown Source)

        at com.jme.scene.Spatial.updateGeometricState(Unknown Source)

        at model.SkeletalModelInstance.skinMeshes(SkeletalModelInstance.java:297)

        at model.animation.SkeletalAnimationController.animate(SkeletalAnimationController.java:233)

        at model.animation.AnimationController.update(AnimationController.java:173)

        at com.jme.scene.Spatial.updateWorldData(Unknown Source)

        at com.jme.scene.Node.updateWorldData(Unknown Source)

        at com.jme.scene.Spatial.updateGeometricState(Unknown Source)

        at com.jme.scene.Node.updateWorldData(Unknown Source)

        at com.jme.scene.Spatial.updateGeometricState(Unknown Source)

        at com.jme.scene.Node.updateWorldData(Unknown Source)

        at com.jme.scene.Spatial.updateGeometricState(Unknown Source)

        at com.jmex.game.state.BasicGameState.update(Unknown Source)

        at com.jmex.game.state.CameraGameStateDefaultCamera.update(Unknown Source)

        at com.jmex.game.state.GameStateNode.update(Unknown Source)

        at com.jmex.game.StandardGame.update(Unknown Source)

        at com.jmex.game.StandardGame.run(Unknown Source)

        at java.lang.Thread.run(Thread.java:619)



hmmmmmm … any idea ? please help!  :’(

hmmmm … i think i roughly can guess wads the problem …  :expressionless:

game.lock() / game.unlock? :o



Or GameTaskQueue?  :wink:

huh? how? what do u mean ?

wakaoz said:

huh? how? what do u mean ?

I think what darkfrog implied at was a problem with the GL thread - you should execute commands in the GL thread either by using the GameTaskQueue manager or lock/unlock. Here is a link to a connected WiKi page

Of course I do not know if he is correct or not... just parroting here :) I personally would not be able to identify this as a threading issue.

hmmmm … i quess its not the lock/unlock thingy …tho i still not sure whats the prob … haiz … client send out a signal to the server … den at the server side, when receive the signal, it then create a bullet for the client object … everything seems fine but when i fire a few times in a short period … then it will show the errors … haiz… anyone knws roughly whats the cause for java.nio.BufferOverflowException???  :?

Read up on the wiki link Mindgamer posted.  I really believe that will solve your problem.

hahaha! i got it solved! i use ChatMessage to pass my message around and it doesn't show those errors anymore!!! wuhooo !! … anyway special thanks to mindgamer and darkfrog for trying to help!  :smiley:

omg … can i ask something … ok … after i have read the page shown, i still don't get what's the lock and unlock thingy have to do with the prob … haiz … i juz call the remote player to fire up bullet … then if i continue to fire in sequence (fast) then the errors come… how does this link with lock and unlock … im sorry but  :oops:



java.nio.BufferOverflowException  :?

It most likely has to do with calling something in LWJGL from outside the OpenGL thread while the OpenGL thread is processing.

ya you are right! I got it … thankz alot!  :smiley:

hey sorry … something to ask again …  :// urmmmm … ok the the player at the other side is sychn(position, direction) but how abt animation? i need to send instructions over to play the animation myself ? any other ways of doing this?  :expressionless:

You'll either have to deal with animations based on logic in positional or other information, or you can create something like a KeyFramePlayMessage that references an Object and tells where to start playing (and potentially where to play to).  This isn't something I've needed to deal with yet, so I haven't written any code for handling that.

yup … got it thankz  XD … but one thing i wana ask… i guess im getting back what i have sent out … is tat correct?  i send a message, then at the same time i got back the msg …  :expressionless:

i think my mistake … got it solved now!  :smiley: