Networking Add On V2.5 - Development

(agoose77) #1

Hi everyone,

I’m working on a new update to the “new multiplayer add-on for BGE”. The original add-on was a fun experiment, but severely limited in what could be achieved. The limitations included:

  • No central server authority - connections cannot be prevented, nor interest management, nor central state (preventing desync).
  • No fine-grained control of individual properties
  • Forced to use properties to invoke events, for all clients
  • Lack of role-information to add additional control over data & function transmission.
  • Weak notion of connected clients/
  • Large data size (using JSON).
  • Poor extensibility due to monolithic facade-like plugins.
    And so the list continues. The new version of the add-on leverages my network libraries(http://github.com/agoose77/PyAuthServer/) which fully supports scripting of network objects, and address the problems above!

Version 2.0+ of this addon offered much more power, but was error-prone and confusing. The new addon will offer a more sensible API and better performance.
***
***Installation
[old] Read here for an installation guide

If all works successfully, there will be a new option in the scene properties at the bottom for networking. Otherwise, check the console window (Windows: Window/Toggle System Console, Linux /MacOSX requires launching from terminal).

***Usage
Some notes:

  • You will need to manually create a network_data folder in the same directory as your working blend file. This is for a number of practicality reasons.
  • This is an early release, so expect bugs, and report them, ideally with blend files and a brief description of what you’re trying to do, and what you did to produce the issue. Use the Addon-> Report bug button.

There will be a growing number of tutorial videos on using this system here

Attachments



0 Likes

Making a multiplayer game
(Flarp) #2

This is crazy cool dude! Thanks for sharing! This will be so useful in the future!

0 Likes

(Smoking_mirror) #3

Really great, thanks for taking the time to do this. I’m sure one day I’ll get aroung to making a multiplayer game.

0 Likes

(agoose77) #4

My pleasure, thanks for the feedback!

A new tutorial is up for team assignment: https://www.youtube.com/watch?v=oFOvCB58Bx4&feature=youtu.be

I’m also creating example folders which build up specific features that a multiplayer game might require.

0 Likes

(yghtim) #5

Hey man, i have been using youre other addon in all many games since you released your first one, and i must say, so far i have not found any limitations at all!

Using your mod and NOTHING but Logic bricks, i succesfuly made a game where you could:

Choose a server on the menu
look for other players and start the match once you found one
Get a server list and even view how many players are in that current server
Get notifications every time somebody joins, leaves, gets killed or respawn
Customise your own character and other players see you exacly like you customized your own character
and alot of other different stuff

But really, if you could make your addon even more advanced, i have no words.
Your addon is the absolutely best thing that have ever happend to the blender game engine!

Im not gay but ,if i saw you in real life, i would give you a kiss!

0 Likes

(agoose77) #6

That’s really interesting, I’d love to see your work!

I’ve now implemented a message handler to allow network object spawners to communicate directly with the last spawned objects, which gives a lot more control to the logic bricks in general (though only applicable for network objects).
This was required for respawning, which is now functional.

There are a few things yet to do, concerning position smoothing which is currently non-functional.

0 Likes

(BluePrintRandom) #7

How would I pipe a list through a server to a actor on another client?

My system uses

Move!=“Empty”----------python(move)
Act!= “Empty”-----------(Act)
if X changed--------(mouseAim)
if Y changed---------/

Was this design choice naive?

It works great for swapping actors in my game, but will it be ok for multiplayer?

0 Likes

(agoose77) #8

You probably wouldn’t want to send a list like that, though you could.

Ideally, movement would be handled server-side, which would require some move prediction functionality, but for now it’s not possible to perform rewind, so it’s best to do this all client side.

0 Likes

(agoose77) #9

New updates add some features:

  1. Call template class methods using messages
  2. WIKI basic documentation
  3. Netmode selection in-game
  4. Support for “static” network objects that exist at runtime start
  5. Support for respawning and initialisation of newly spawned objects
  6. Editor scripts reloaded from disk before runtime & on blend load (to ensure updates are applied to old projects)

There are likely other features that have been omitted from this changelist.

0 Likes

(agoose77) #10

Whoops!

It seems that the addon wasn’t working when you install it, because of a restricted BPY context.
I’ve now modified the addon so it doesn’t touch the files of the object until pre-game. You can now install it!

I’ve also added a group operator to group network objects (either use the space bar menu, or scene properties “Network” panel.
On top of this, only the network scene may now export network objects, and the network panel for the object is disabled if it does not belong to the network scene.

The documentation (and bug tracker) button in the addons menu also works, if you need to access some information concerning addon usage / report a bug.

0 Likes

(BluePrintRandom) #11

is there any way to run dummy clients locally?

or even a real client as a process to test out networking in general?

like open the client, move them etc?

0 Likes

(agoose77) #12

If you use localhost for the connection IP address, then it will run locally, rather than through the network. You’ll need to run a second instance, for testing.

In other news, I’ve added some safeguards in case you delete the dispatcher. If that happens, you wouldn’t be able to use the messaging interface (RPC calls, connection management etc), so it would appear broken. Now, the addon reads an assets.blend file, and copies the dispatcher from there, if necessary. It uses a property stored on the dispatcher object, so it may be renamed, and modified, but not deleted (a process which will recreate the dispatcher).

I’ve also added support for choosing when to replicate properties - the “is_initial” and “is_owner” parameters, which are implemented as buttons.

0 Likes

(AlexWDesign) #13

grade job,

when we use the some map, the other must behave the same .blend map file¿

M.f.G

Alex.W

0 Likes

(agoose77) #14

Yes, they must use the same asset files (in theory). There’s nothing stopping you from using different files, as long as every network object has an equivalent in the other blend file, and each object has the same network information (attributes, RPC calls, roles etc).

I wouldn’t advise this though - it’s generally best to reuse the file where possible.

0 Likes

(nixodemus1) #15

I’m sorry but im having trouble implementing the addp-on. i followed your instructions directly and the add on shows up, but when i click the box to check mark it, it says that there is an error and that there is no module called game_system. However, when i check back to the zip file, the folder is right there. so i do not understand what is wrong. Please help. Thank you.

0 Likes

(agoose77) #16

I have written a reply to your inbox, but I’ve also updated the main post with the new documentation. Thanks!

0 Likes

(agoose77) #17

I’ve added a pop-up message to indicate if the addon is out-of-date (or the network system). This is designed to ensure everyone runs working code. At the moment, this doesn’t treat the network code as a versioned dependency, so it always wants both to be fully up to date.

0 Likes

(CG Sky) #18

This is cool! Will have to try this out soon.

0 Likes

(NID Graphics) #19

Very very cool! This could be awesome!

0 Likes

(CG Sky) #20


I´m getting this error when I try activating the addon. Also the console stays empty if I type import network.

0 Likes