Multiplayer Planet Trading Game [Kroynet] - Update 4: 02/01/15

I’ve recently been messing around with the Kryonet library and decided to make a multiplayer, planet trading game. Inspired by Eve Online and Tribal Wars. This started out as a server/client test; but turned into a slightly functional, pretty ugly looking game.

I’ve been making this up as I go along, but here’s what I’m planning. Some of these points have been already implemented.

  • The server generates a galaxy which contains regions.
  • Regions contain sectors and sectors contain star systems. Star systems can spawn with 0-5 planets.
  • Planets have types (Gas, lava, ocean, terran, etc), different types spawn different resources.
  • When a player logs in for the first time, they are assigned a random starting planet.
  • They have to build factories to harvest the resources and turn them into goods.
  • Goods are used to build factories and can be traded.
  • Players can trade goods and planets.
  • The server dynamically loads in items, resources and buildings from text files. Allowing the server to be highly customisable.
  • Generates in a vaguely-galaxy-like-shape.
  • Local system map which displays planets in star system.
  • And thats all I have so far…

A small galaxy (0.2mb) with the 487 planets in 164 star systems takes 2.95 seconds to generate. A larger galaxy (6.4mb) with 15,203 planets in 6133 systems took 76 seconds to generate.

EDIT:
Instead of attaching big ass pictures to this post, I’ll give you the link to an imgur album: http://imgur.com/a/KHQFX. I will be updating this with the latest images. I’ll attach any small images that will fit on this post.

I’m not to sure what kind of resources,goods or factories I could have.

What I’d like to add

  • Proper GUI, currently I’m using Java Graphics to render everything.
  • Random events, natural disasters?
  • Guilds/corporations/groups. Players join together to pool their resources.
  • Maps. Render the local map to find nearby planets and players.
  • Ships/transport ships. Transport goods between planets? Attack player owned planets? Scout out other planets for resources?
  • Highscores. List of all players and their total worth? Player profiles?

I may be biting off more than I can chew here, but its a fun project. I’d love to hear your suggestions/comments/criticism. I’ll release the source code when I am less ashamed of it, its very messy and I just want to get the functionally working.

Thanks!

Update 1: 10/12/14

  • Game now loads in resources from text files, populates planets with them.
  • Game also loads factory types, can now build factories on planets.
  • Tested connecting to a remote computer (gave friend a client), not local host. Successfully connected to my server!
  • More to come soon.

Update 2: 17/12/14

b9uepfHfPvk

Update 3: 30/12/14

7io4SPgXDrw

This is how the server generates the galaxy:

Bonus gif

Update 4: 02/01/15
STAR SYSTEM MAPS! You can now view the planets in your star system. More info in the imgur album above &^^.
Bonus gif

We can’t really give proper feedback without ability to try the game, but it looks pretty good, from what I see here!

I’d love to get my hands on this one! keep updating, and hopefully get a download up (:

I’ll get a download up soon hopefully, though I’m pretty busy at work over Christmas. I’m glad you guys like it so far!

Just posted an update video above (May still be processing).

Sweet. may i ask what your plans are in terms of visuals. this is a cool concept on its own, and many visual applications could work with it.

At the moment I’m going to stick with using Java 2D graphics, but I’d like to switch to something like LWJGL for the UI.

Seems like a really cool idea! you should also make it so the factory’s cost to run to add more dificulty

Thanks! I’m glad you like it, I am thinking of doing something like that. Probably need energy to run (not credits if that what you meant), like solar power maybe.

New update video in the first post, progress made with the marketplace.

What network lib are you using, i have been hunting around for a good one. I gave up on kyronet because it was laggy and am currently using jexxus but it is only a basic framework with hardly any flexibility

Kryonet? Laggy? Weird! I’ve used it before and it worked perfectly.

It only sent a a packet to see if the server was alive and the lag on the server end was crazy

I’m using Kryonet. How was it lagging like crazy?

I was useing a slightly old build and i found a while loop in a while loop in the lib and it was causing hell on my server, i fixed it now :slight_smile:

I seen, i feel like a mong after posting it xD, if posible could i see one of your send/request classes so i can see how more complex ones are structured?

In my Server/Client listeners received(Connection c, Object o) methods I have lists of:

if(o instanceof PacketType){
    //Something
    return;
}

Not sure of any other way I could do it.

Thanks man! now i cant seem to get a connection to last fml :L
00:00 INFO: [kryonet] Connecting: localhost/127.0.0.1:54555/54777
00:00 INFO: [kryonet] Connection 1 connected: localhost/127.0.0.1
00:00 INFO: [kryonet] Connection 1 disconnected.

Lets have a look at your code?

I fixed ot, after a lot of trials and tribulations i realised my timeout was wayyyy to low and now i am pinging a keep alive packet to keep them both connected