Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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 2242 times)
0 Members and 1 Guest are viewing this topic.
Offline MoO_coW

Junior Newbie




Java games rock!


« Posted 2003-03-10 02: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 Member




586: The average IQ needed to understand a PC


« Reply #1 - Posted 2003-03-10 05: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 09: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 Member




586: The average IQ needed to understand a PC


« Reply #3 - Posted 2003-03-10 09: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 21: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.

 

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

The first screenshot will be displayed as a thumbnail.

ctomni231 (34 views)
2014-07-18 06:55:21

Zero Volt (30 views)
2014-07-17 23:47:54

danieldean (25 views)
2014-07-17 23:41:23

MustardPeter (27 views)
2014-07-16 23:30:00

Cero (42 views)
2014-07-16 00:42:17

Riven (44 views)
2014-07-14 18:02:53

OpenGLShaders (32 views)
2014-07-14 16:23:47

Riven (31 views)
2014-07-14 11:51:35

quew8 (30 views)
2014-07-13 13:57:52

SHC (66 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!