Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (468)
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  
  Make the game before or durring the multi-player code ?  (Read 1628 times)
0 Members and 1 Guest are viewing this topic.
Offline TorakTu

Junior Newbie





« Posted 2013-01-20 22:39:42 »

I am just not sure which direction to go with this. I am not sure if I should write the multiplayer code.. to connect client / server first.. using simple text.. and then build it up.. and try to make the game based off that foundation. OR should I make the game..  as if its a single player, and then add multi-player once all the game is fleshed out ?
Offline Jimmt
« League of Dukes »

JGO Kernel


Medals: 119
Projects: 4
Exp: 3 years



« Reply #1 - Posted 2013-01-20 23:37:22 »

If you already have a solid understanding of networking and have made working games with it then I would suggest making the game itself first. If you have no experience in networking/have never made a game example then just write a test program; you don't want to try to implement multiplayer for the first time in a full-fledged game.
Offline Varkas
« Reply #2 - Posted 2013-01-21 14:28:08 »

Usually I started with the the network communication layer. Most games work well with a datagram-like API for the networking, so unless you know that your game needs srtreaming, make an datagram (message packet) transport API first and test it thoroughly.

Then make the game on top of that.

if you are about to implement game logic which needs to be (somewaht) secure to hackers, make sure it will only happen server side. Clients are much easier to hack into than your server logic.

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline delt0r

JGO Coder


Medals: 22


Computers can do that?


« Reply #3 - Posted 2013-01-21 14:43:11 »

Get something playable first. Always. That means single player without networking. Then once you have game play etc worked out, if it even works, adding networking its not that hard. Or more importantly, no harder than starting with networking. Only that when you start with networking you spends hour, days and weeks to get networking going and you still don't have a game at all.

I have no special talents. I am only passionately curious.--Albert Einstein
Offline Varkas
« Reply #4 - Posted 2013-01-21 14:46:59 »

I find it's easier to debug and test modules if they are developed independently. But game-first can works as well, if you keep a reasonable separation of logic, data and view. If you entangle these too much you don't find a good place later where to put the networking layer in.

That's why I advice to develop the networking first. If you have it already, you will design the game so that networking is actually possible with the design. It's be a pity if you have a game, designed for multiplayer, but with code that can't be network-enabled without big rewrites.

if (error) throw new Brick(); // Blog (german): http://gedankenweber.wordpress.com
Offline Best Username Ever

Junior Member





« Reply #5 - Posted 2013-01-21 17:09:01 »

Make a game with a common control system for either single player keyboard/mouse input or network communication. Then develop either control module in whatever way you please.
Offline 65K
« Reply #6 - Posted 2013-01-21 19:46:04 »

OR should I make the game..  as if its a single player, and then add multi-player once all the game is fleshed out ?
Definitely not - as that would result in a complete rewrite. You don't just add multiplayer functionality to a game. It is a completely different beast.

Offline wreed12345

JGO Knight


Medals: 22
Projects: 2
Exp: 2 years


http://linebylinecoding.blogspot.com/


« Reply #7 - Posted 2013-01-21 19:50:03 »

I have never done any network programming before, do you guys have any good ideas of where to learn some game networking concepts?

Offline Agro
« Reply #8 - Posted 2013-01-21 20:36:33 »

Well, I would make the game first. Then I would completely work on a separate networking base. then slowly integrate it into the game, and slowly add what you need, then optimize. I like to work separately so I can ensure it will be as efficient as possible and things are taken step-by-step.

Offline deepthought
« Reply #9 - Posted 2013-01-21 23:28:27 »

Get your game working first, but design it so you can easily add multiplayer.

what I'm doing for Captain Failure is:

If you're playing locally, the client creates the server, keeps a reference to it, and calls a method to give the server input state. The client also has a Vector declared thet is set to reference the server's entity container for drawing.

If you're on a network, the client connects to the server, and sends input over the network. the networking code on the server calls the aforementioned input method.  The client's entities array is updated over the network by spawn messages, position messages, etc.

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
class client
{
vector entities;
server serv;

init()
{
// initialize opengl, etc.
if(singleplayer)
{

serv=new server();
entities=serv.entities;
}
else
{//open network connection
entities = new Vector();

}
}

loop()
{
// get input

// for each in entities draw()

if(singleplayer)
{
serv.giveinput(input state);
}
else
{
//send input over network
// update entities from network
}

}

class server
{
Vector entities;

init()
{
if(!local)
{
// open network
}
}

loop()
{

if(!local)
{//get input over network
//giveinput(input state)
// update entities
// send entity state over network
}
}

jocks rule the highschools. GEEKS RULE THE WORLD MWAHAHAHA!!
captain failure test game
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Keleben

Innocent Bystander





« Reply #10 - Posted 2013-01-25 13:49:21 »

I think designing the game to be multiplayer from the beginning is the better way. It doesn't really complicate design too much and may even force you to adopt a clean structure for your code.

As suggest deepthought, just be sure to have two buffers with inputs and renderingState yoy manipulate by direct reference, and integrate networks transfert betweens clients and servers buffers later.
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.

theagentd (6 views)
2014-04-24 23:00:44

xsi3rr4x (83 views)
2014-04-15 18:08:23

BurntPizza (75 views)
2014-04-15 03:46:01

UprightPath (86 views)
2014-04-14 17:39:50

UprightPath (69 views)
2014-04-14 17:35:47

Porlus (86 views)
2014-04-14 15:48:38

tom_mai78101 (109 views)
2014-04-10 04:04:31

BurntPizza (169 views)
2014-04-08 23:06:04

tom_mai78101 (265 views)
2014-04-05 13:34:39

trollwarrior1 (217 views)
2014-04-04 12:06:45
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!