Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  DataInput vs. ByteArrayInput, and more...  (Read 1714 times)
0 Members and 1 Guest are viewing this topic.
Offline MickeyB

Senior Member




my game will work, my game will work!


« Posted 2002-12-27 17:49:39 »

I am converting a mud server to send data for a very simple, real-time 3rd person shooter.  The max game board will support 16 players(8 to a side)  I need to send location data, and projectile data to the clients.  

Which is prefered...?

(acutally 2 questions here)
1. server loops thru all players every 30 millisecs(or so) and on each player loop thru all players sending location data or what?

2.  use a DataInput(Output)Stream or ByteArrrayInput(Output)Stream or what?

apologiies for the vagueness.

M

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline MickeyB

Senior Member




my game will work, my game will work!


« Reply #1 - Posted 2003-01-02 16:32:45 »

should the client only send data to server when it makes a move ore on a continual basis thru a thread loop.?

I am trying to smooth out my motion on data returned from the server.

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Offline MickeyB

Senior Member




my game will work, my game will work!


« Reply #2 - Posted 2003-01-03 14:28:10 »

ok, should I use behaviors to make moves after data comes from server or just run the transform after each piece of data from server is collected?  

Also, how can I capture the radians as a double from an existing TransformGroup?

I can get the x, y and z, but since I am using DataOutPutStream(for now) I need to send the angle as a double.

M

MickeyB

Current Project: http://www22.brinkster.com/mbowles/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Pyros

Senior Newbie




Let's make Java games rock !


« Reply #3 - Posted 2003-01-03 15:15:58 »

Quote
should the client only send data to server when it makes a move ore on a continual basis thru a thread loop.?


It really depends on the kind of game. If fast action is required, a loop may be better, because sometimes the network isn't working optimally, then if a package sent to one client is lost on the way, the client might not know something is happening, but the loop will send update info soon so the client will catch up even after a network clitch.

If you use a protocol that assures everyone gets every package of information before the action continues, you can do it without the loop.

Maybe you should implement both and try them out, which one actually works faster when YOU have done them? Such different modules mean a bit more work, but not much compared to all the other work you're going to do on the game, so it might be a worthwile learning experience for you to try them both.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Get high quality music tracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (35 views)
2013-05-17 21:29:12

alaslipknot (44 views)
2013-05-16 21:24:48

gouessej (73 views)
2013-05-16 00:53:38

gouessej (73 views)
2013-05-16 00:17:58

theagentd (81 views)
2013-05-15 15:01:13

theagentd (75 views)
2013-05-15 15:00:54

StreetDoggy (117 views)
2013-05-14 15:56:26

kutucuk (141 views)
2013-05-12 17:10:36

kutucuk (141 views)
2013-05-12 15:36:09

UnluckyDevil (151 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.093 seconds with 21 queries.