Sign in to follow this  

KryoNet help

This topic is 2057 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just started working on a game in Java using Slick2d and I want to make the game multiplayer. I don't need to make anything massive, I just want to make a basic RPG to see how it works and I thought it would be cool if I could make it so that I could give a copy to my friend so he can see what I'm doing(he just started programming). I think it would be a pretty good learning experience as well for myself. I'm thinking of using KryoNet for it because I don't want to do it from scratch. Does anyone know how I should start with this? Any tutorials? Also, what will I need to change in my game as it is? Right now I haven't done a lot, just got a sprite moving around a tileBased map with basic collision with tiles and the outside of the map. Another thing, would I make a separate project for the client and one for the server? Also where would I add the client/server in my slick2d statebasedgame?

Sorry for the cluster of questions, I just kind of spewed ideas onto my keyboard.

Thanks in advance.

Share this post


Link to post
Share on other sites
By "Project" I assume you mean in an IDE such as Eclipse.
There are two basic ways to do it.
One is to build everything as one application, which you start up in "server" or "client" mode, and when in "server" mode, it doesn't render, and when in "client" mode, it doesn't listen for new connections (for example.)
The other is to use THREE projects. One library project for "Common," which contains all the code that needs to be known by both client and server -- data structures, game rules, etc. Then one application project for "server" that uses the "common" library and adds only the server-application-specific bits, and another application for "client" that also uses the "common" library and adds only the client-application-specific bits.

Share this post


Link to post
Share on other sites
There are two ways you can learn this:

1) Read other people's code that already does the same thing.
For example, the source for Quake (and Quake II, and Quake III, and now Doom III) is open source. It may not be easy to get into, but it's probably really rewarding once you do. Nothing worthwhile was ever easy :-)

2) Try it yourself, and measure/observe whether it works. When it doesn't, quantify the failure, and go back to doing it differently, compensating for that failure. Repeat.

In reality, you'll probably need to do both.

Share this post


Link to post
Share on other sites

This topic is 2057 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this