Hurray! Another multiplayer clone project. :)

Discuss and distribute tools and methods for modding. Moderator - Grognak
jrb00001
Posts: 201
Joined: Fri Jan 15, 2016 2:22 pm

Re: Hurray! Another multiplayer clone project. :)

Postby jrb00001 » Mon Jan 18, 2016 9:58 pm

A first version of the pathfinding is finished. It is a simple A* so do not expect a good performance on huge maps. A small test application is included, just launch the "target/FTLMP-1.0-SNAPSHOT.jar". Leftclick sets the start tile (red), rightclick sets the destination tile. Doors have a small penalty (0.3 tiles) because it might take some time to open them.

kcd.Spektor wrote:Also you can help me if you can give me any ideas on how to implement moddable Quests with multiplayer.

My idea: There is a communications room on every ship and you can buy one for your ship in some shops. In this rooom, you can send messages to other players, who can be very far away. But you will also receive certain quests that way. Other quests are publicly available using some sort of BBS (also available in every communications room).
Technical: Quests are done on the server side. I think it would be a good idea to have a mod folder filled with jar files. During the startup of the server all jar files are scanned for mod classes and loaded using URLClassLoaders. This can be a bit tricky! Also we need a stable and documented public modding api.

kcd.Spektor wrote:Enyone has any ideas on how the game should start?
Same as in FTL - you start from selecting a premade ship?
or You start on a space station with some cash and can go either buy a ship or join someone as crew member?
Any other suggestions?

Everybody get a ship. If you do not need it, sell it! The hulls are defined server side and you have to select one of them. Then you can buy rooms, weapons, missiles, drone parts, whatever you want.

kcd.Spektor wrote:Also any quest ideas are welcome.

Some types of quests:
  • Kill a character.
  • Destroy a ship / station.
  • Protect a station.
  • Stop a fleet (very difficult, requires coop).
  • Escort a convoi.
  • Explore uncharted space.
  • Scout for enemies.
  • Generic trade missions.
  • And more...

EDIT:
Attachment failed... Here a (temporary) download link: https://files.692b8c32.de/FTLMP.zip.
kcd.Spektor
Posts: 586
Joined: Thu Nov 26, 2015 8:21 am

Re: Hurray! Another multiplayer clone project. :)

Postby kcd.Spektor » Wed Jan 20, 2016 9:46 am

personman61 wrote:Premade ships will help with balancing the game, but custom ships will fell special to each player and play through.

For now I see it like this:
Player starts at a space station with some cash.
He goes to a shop and buys a ship.
Then, when second player joins the game, he also has some cash, but instead of buying a new ship, he buys a new weapon or a better shield for example.
Then he is added to the first player's ship as a crew member.
Second player comes on board the ship, drops the systems he bought to ship's cargo bay.
Then in the captain's bridge system(piloting) or maybe some other system's interface any crew member can refit the installed systems.
And so on.

Does this sound ok?

personman61 wrote:Also think about which one will take the least amount of time and cause the least amount of bugs.

The one I've written above will require less time to implement.
Regarding bugs :) - any approach will have bugs, which I will need to iron out.
kcd.Spektor
Posts: 586
Joined: Thu Nov 26, 2015 8:21 am

Re: Hurray! Another multiplayer clone project. :)

Postby kcd.Spektor » Wed Jan 20, 2016 10:04 am

jrb00001 wrote:A first version of the pathfinding is finished. It is a simple A* so do not expect a good performance on huge maps. A small test application is included, just launch the "target/FTLMP-1.0-SNAPSHOT.jar". Leftclick sets the start tile (red), rightclick sets the destination tile. Doors have a small penalty (0.3 tiles) because it might take some time to open them.

Great! And thanks. I've downloaded the archive.
I'll check it out once I have the time.
Right now I'm focused on getting the alpha done.

jrb00001 wrote:My idea: There is a communications room on every ship and you can buy one for your ship in some shops. In this room, you can send messages to other players, who can be very far away. But you will also receive certain quests that way. Other quests are publicly available using some sort of BBS (also available in every communications room).

The idea I had was similar, The captain's bridge(piloting system) has a communication module(which can be accessed when you are in the room with the piloting system, and it's accessible even if the piloting system it self is broken).
You can use that module to exchange messages with PCs and NPCs. But only within the same sector.
The quests do not exist themselves as some separate list in some quest book.
You just receive information about something being somewhere, etc.
If you think that some message has important information in it, you can save that message to your(player's) personal log book, which you can browse/modify whenever you want.
Then using that log book, you can decide where to go to finish some quest.

jrb00001 wrote:Technical: Quests are done on the server side. I think it would be a good idea to have a mod folder filled with jar files. During the startup of the server all jar files are scanned for mod classes and loaded using URLClassLoaders. This can be a bit tricky! Also we need a stable and documented public modding api.

Quests will surely be on the server side.
But for anything that will be moddable in the game, I will use only simple text files(not jars).
This indeed will be a bit tricky, and will require a good modding api.
I haven't thought about it deeply yet, but I already have some ideas on how to make it.

jrb00001 wrote:Everybody get a ship. If you do not need it, sell it! The hulls are defined server side and you have to select one of them. Then you can buy rooms, weapons, missiles, drone parts, whatever you want.

Most probably it will be like this: Everyone get's cash, then you can buy a ship or something else.
Also you can't buy rooms, the layouts of the ships are loaded from ship models during server startup.

But I think I will make it possible to select the color of the ship when you buy it.(after alpha)

jrb00001 wrote:Some types of quests:
  • Kill a character.
  • Destroy a ship / station.
  • Protect a station.
  • Stop a fleet (very difficult, requires coop).
  • Escort a convoi.
  • Explore uncharted space.
  • Scout for enemies.
  • Generic trade missions.
  • And more...


Thanks for you'r input!
kcd.Spektor
Posts: 586
Joined: Thu Nov 26, 2015 8:21 am

Re: Hurray! Another multiplayer clone project. :)

Postby kcd.Spektor » Wed Jan 20, 2016 1:51 pm

Latest update:

1. Finished adding menu screens where you specify the IP and port of the server you want to connect to.
Image

2. And menu screen where you create your character - specify name, password and race.
Although only one race is available right now for char creation.
Image
Image

3. Last used server ip and port, and last used login are now saved and restored after game restart.

4. Fixed a few bugs.

Technically right now the game can be played by others.
But I want to finish those 3 things that are left in the list, before releasing first alpha version.

I think one/two more weeks, and it should be done. :)
jrb00001
Posts: 201
Joined: Fri Jan 15, 2016 2:22 pm

Re: Hurray! Another multiplayer clone project. :)

Postby jrb00001 » Wed Jan 20, 2016 9:24 pm

kcd.Spektor wrote:You just receive information about something being somewhere, etc.

That sounds *very* useful :D But I like the idea of exploring the universe to find new quests.

kcd.Spektor wrote:Quests will surely be on the server side.
But for anything that will be moddable in the game, I will use only simple text files(not jars).
This indeed will be a bit tricky, and will require a good modding api.
I haven't thought about it deeply yet, but I already have some ideas on how to make it.

Java classes will be much easier than textfiles. Do you want to invent your own scripting language to allow complex quests? With classes you only have to create an URLClassLoader / change the classpath. Then you can load the classes using reflection and work with them like normal classes. Security is not a problem here because a server admin will / should not install malicious mods.

kcd.Spektor wrote:Most probably it will be like this: Everyone get's cash, then you can buy a ship or something else.
Also you can't buy rooms, the layouts of the ships are loaded from ship models during server startup.

But I think I will make it possible to select the color of the ship when you buy it.(after alpha)

Good.

kcd.Spektor wrote:2. And menu screen where you create your character - specify name, password and race.
Although only one race is available right now for char creation.

How does the login work? How do you transmit and save the password? Plaintext? Please think about the security of such a system.
kcd.Spektor
Posts: 586
Joined: Thu Nov 26, 2015 8:21 am

Re: Hurray! Another multiplayer clone project. :)

Postby kcd.Spektor » Wed Jan 20, 2016 9:41 pm

jrb00001 wrote:Do you want to invent your own scripting language to allow complex quests?

Something like that, I'd rather say that it would be my own scripting pattern not language.

jrb00001 wrote:With classes you only have to create an URLClassLoader / change the classpath. Then you can load the classes using reflection and work with them like normal classes. Security is not a problem here because a server admin will / should not install malicious mods.

The idea is that if anyone want's to mod the game, he doesn't need anything special, just notepad.exe and brains. :)

jrb00001 wrote:How does the login work? How do you transmit and save the password? Plaintext? Please think about the security of such a system.

For now it's all plain and simple - just plain text no security.
At lease on early stages the game is meant to be played by some friends on a local network server.
If later I'll see that there is a big enough interest in the game that people would want to host online servers,
then I will make it more secure.
jrb00001
Posts: 201
Joined: Fri Jan 15, 2016 2:22 pm

Re: Hurray! Another multiplayer clone project. :)

Postby jrb00001 » Wed Jan 20, 2016 10:12 pm

kcd.Spektor wrote:Something like that, I'd rather say that it would be my own scripting pattern not language.

Even a scripting pattern is more than a (simple) pattern if it should be useful.

kcd.Spektor wrote:The idea is that if anyone want's to mod the game, he doesn't need anything special, just notepad.exe and brains. :)

It is possible to write java source files with notepad.exe :D You just need a jdk to compile the classes. If you bundle a jdk with the game, it would be possible to compile the classes on load! (There is a compiler api available in the jdk's).

kcd.Spektor wrote:For now it's all plain and simple - just plain text no security.
At lease on early stages the game is meant to be played by some friends on a local network server.
If later I'll see that there is a big enough interest in the game that people would want to host online servers,
then I will make it more secure.

Please show a small text about this on the registration menu. I hate applications which do not treat passwords correctly and do not even say something about it!
kcd.Spektor
Posts: 586
Joined: Thu Nov 26, 2015 8:21 am

Re: Hurray! Another multiplayer clone project. :)

Postby kcd.Spektor » Thu Jan 21, 2016 9:52 am

jrb00001 wrote:Please show a small text about this on the registration menu. I hate applications which do not treat passwords correctly and do not even say something about it!


Maybe you can find a way to make it secure?

I'm using kryonet for networking.
jrb00001
Posts: 201
Joined: Fri Jan 15, 2016 2:22 pm

Re: Hurray! Another multiplayer clone project. :)

Postby jrb00001 » Thu Jan 21, 2016 5:47 pm

kcd.Spektor wrote:Maybe you can find a way to make it secure?

I'm using kryonet for networking.

Send the password in a char[] or (UTF-8) byte[] over an encrypted connection. Then use something like this:

Code: Select all

public void onLoginReceived(LoginPacket packet) {
        // Hash the password immediately.
        String password = calculateSha512(packet.getPassword());
        // Overwrite the password (do not wait for the gc!).
        for (int i = 0; i < packet.getPassword().length; i++) {
            packet.getPassword()[i] = 0;
        }

        // Check the login / do whatever you want.
        checkLogin(packet.getUsername(), password);
    }


The encryption of the connection is not that important on a (trusted) lan. But on the internet, it is absolutely necessary. For TCP connections you could use TLS and for the UDP packets DTLS. You just need certificates for that. Maybe your own CA (and integrate it into the server browser?) for internet games and accept all certificates for private addresses? Tell me what you think about it and I will write the kryonet implementation for that.
kcd.Spektor
Posts: 586
Joined: Thu Nov 26, 2015 8:21 am

Re: Hurray! Another multiplayer clone project. :)

Postby kcd.Spektor » Thu Jan 21, 2016 8:55 pm

jrb00001 wrote:
kcd.Spektor wrote:Maybe you can find a way to make it secure?

I'm using kryonet for networking.

Send the password in a char[] or (UTF-8) byte[] over an encrypted connection. Then use something like this:

Code: Select all

public void onLoginReceived(LoginPacket packet) {
        // Hash the password immediately.
        String password = calculateSha512(packet.getPassword());
        // Overwrite the password (do not wait for the gc!).
        for (int i = 0; i < packet.getPassword().length; i++) {
            packet.getPassword()[i] = 0;
        }

        // Check the login / do whatever you want.
        checkLogin(packet.getUsername(), password);
    }


The encryption of the connection is not that important on a (trusted) lan. But on the internet, it is absolutely necessary. For TCP connections you could use TLS and for the UDP packets DTLS. You just need certificates for that. Maybe your own CA (and integrate it into the server browser?) for internet games and accept all certificates for private addresses? Tell me what you think about it and I will write the kryonet implementation for that.


I haven't really worked with encriptyon yet.
Just go ahead and make a sample encrypt/decrypt methods, and I'll try to use them.