Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (601)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
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  
  Game networking?  (Read 2511 times)
0 Members and 1 Guest are viewing this topic.
Offline MoO_coW

Junior Newbie

Java games rock!

« Posted 2003-03-10 01:25:50 »

Ok, so im not to java and new to these boards and have a question about a game im working on. My game im working on is basically an overhead view of tanks, right now its pretty basic and I just have some blocks that shoot some projectiles but its set up to accept alot more. I know its going to be networked so i figure it will probly be best to do it now while its a smaller program. Im working out of Deitel and Deitels 5th edition of Java: how to program. Its a really good book and im using the TicTacToe multi threaded server that has 2 client applets connect to it source code. I experimented with basic server client stuff and have gotten stuff connected over the internet or anything but ive read all i can find and when i went to impliment my game as a server that has two applets connect and i found that I had no idea at all how to implement this. How I have it now I have a Tank1(player1) and Tank2(player2) classes that extend from a main Tank class, I also have a projectile class and put it all together in the main. I have no idea what the Server side should be doing and keeping track of, and I have no idea what the client should be doing and there relationship together. Can anyone help me out with setting up a server/client for this game, I know I haven't given alot of usefully information and its being long winded but ANY help would be VERY apreciated. Thanks alot! And if it would help at all I can get my source code up, or the applet of what I have. Thanks again
Offline Backmask

Junior Devvie

586: The average IQ needed to understand a PC

« Reply #1 - Posted 2003-03-10 04:33:04 »

Well I have a go on answering your questions.

The game logic should always be controlled by the server (that makes cheating alot harder for the clients). So in your case the server should hold the positions of the players tanks, direction they are heading, projectiles they have shoot and so fourth.

The client shouldn't hold anything, it should only draw the tanks and projectiles in the positions that the server tells the client to do.

When a player moves the client should send the new position of the player to the server. The server validates the new position, to prevent cheating (for example jumping across the battlefield). The server then send the new position to the clients so they can update there game field. The same method applies for projectiles.

Thats the basic concept. Any more questions?

Offline MoO_coW

Junior Newbie

Java games rock!

« Reply #2 - Posted 2003-03-10 08:36:13 »

Thanks a ton, thats exactly what I was looking for, im sure I will have more questions as I try and impliment it today but thanks alot for the help.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Backmask

Junior Devvie

586: The average IQ needed to understand a PC

« Reply #3 - Posted 2003-03-10 08:38:24 »

if you need answer for more questions feel free to contact me by icq, mail etc (see my profil). I am of course reading this forums often so posting more questions here I properbly answer to  Smiley

Offline MoO_coW

Junior Newbie

Java games rock!

« Reply #4 - Posted 2003-03-11 20:10:40 »

Ok, The last part that im "missing" in understanding this all is how do I determine how the different threads interact with eachother, like what needs to be in its own thread and what doesnt and how they fit together in reading in the data and exicuting it, and also im a little confused on when you take in data how do you deal with say, having the possability of it being a mouse click, or a a key press, or a string, or whatever the user is doing without actually knowing what it is? Should I have say the client send a string and then have the server take in that string and depending on what it is do the required task? Thanks alot guys for any help
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Riven (23 views)
2015-07-27 16:38:00

Riven (13 views)
2015-07-27 15:35:20

Riven (18 views)
2015-07-27 12:26:13

Riven (8 views)
2015-07-27 12:23:39

BurntPizza (24 views)
2015-07-25 00:14:37

BurntPizza (36 views)
2015-07-24 22:06:39

BurntPizza (20 views)
2015-07-24 06:06:53

NoxInc (23 views)
2015-07-22 22:16:53

NoxInc (14 views)
2015-07-22 22:13:39

Jesse (36 views)
2015-07-22 03:10:36
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
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!