MP Native [WB] WarbandCoop V0.1.0 *DEAD*

Users who are viewing this thread

Hello guys!

This is the development page/topic for warband coop mod.
This mod will allow you and your friends to play together on the big world map (the map from single player), create villages, make sieges/villages raids/battles and much more.

I have managed to make a stable moddable server version (yet it doesn't have much gameplay features). The released/finished version of this mod will not be a fancy one (will not include many gameplay features) because it will tend to be a base version from which modders can start making their own coop mods (like san andreas multiplayer).

The game will work something like this:
- from the main menu choose a server (yay! server list on main menu)
- join the game via 'load savegame' function (each savegame will be considered a user profile)
- then do whatever you like on the world map (there you will meet other players)
- battles will be the most trickiest part because it will require you to exit to the main menu, then go to normal multiplayer and join the server in which the battle will be handled
- after the battle, you will need to kind of rejoin the server (it will not be handled as a rejoin... it's a bit more complicated)

If you want to know how it works, see this topic -> clicky

The server that handles the players (plus the dedicated servers that will handle the battles) is coded in C++ and it is moddable using module system.


First non battle version released! (V0.1.0 "The preview" (not alpha... not beta... not gamma))

This version is a preview of what the mod looks like (thus it does not have battle support (only world map roaming)). It is more for acomodating modders with the module system and with the way the server/client works.

Here are the downloads (module system is in the 2nd post):
- client -> http://www.mediafire.com/download/nw6mbb8lhpk53j6/coop_campaign_client.7z
- server -> http://www.mediafire.com/download/g2k3116k5jf04da/coop_campaign_main_server.7z

Client stuffs:
a. Installation
b. Creating a profile
c. Joining server
d. Random stuffs
e. Random stuffs 2

a. Installation

The installation is pretty straight forward; it is like in any other normal mods: simply unzip the archive and copy paste the folder into <game_install_folder>/Modules/
The client runs just like a normal mod (that is what I like about this... it does not require any 3rd party app for the mod to work).

b. Creating a profile

To be able to join a server, you first need a so called 'profile' (it is actually a save file).
To make one, follow these simple steps:
1. from the main menu, click on 'Select a server' button (should be the most top one)
2. in the 'Direct connection' field, write 0 and then hit 'Connect to specified IP'
3. press the button 'Back'
4. click on 'Create Character' button
5. enter your username in the username field (make sure that you don't use any fancy characters. You can only use a-z, A-Z, 0-9 and the special characters _-*[]. Also make sure that your username is not longer than 28 characters and it must contain at least one letter (as far as I remember). If you break any of the above rules, you will not be able to join the server (it should return an error)).
6. press the 'Next' button
7. choose the SECOND option (the one that is at the bottom). You must choose the second one, else you will not be able to play more that once with that character; press 'ok' after that
8. choose random skills, attributes, wep proficiencies; hit 'Done'
9. hit the 'ok', then choose a random face (doesn't matter because both, the face and the skills will be changed after you join the game); hit done
10. at this stage you should see an empty world map. Press escape, then press 'Complete character creation'
11. you should receive two messages: 'Character created!' and 'Character created successfully.'
12. done! you are now ready for the next step: joining the server

c. Joining server

To join a server you need to have at least one profile.
From the main menu hit the 'Select a server' button, then you should be able to see the sever list. From there, select a server or if you have the server's IP, you can type it in the 'Direct connect' field and then press the 'Connect to specified IP' button.
After that, click on the 'Back' button, then click on 'Join server'. Now select your profile and click 'Load'.
At this stage, you should be on the server. If the server has a password, then it will prompt you to insert it.

d. In server controls/commands

When you are in the server, you can press TAB to view the player list. The player list contains each player's id, name and ping. The ping is not the actual ping, it represents how many packets per second that player receive/transmits (it is updated each second).

You can press T for chat. You can write commands in the chat by typing a '/' in front of the message.
Right now there is only one command and that is 'login_admin'. The usage: '/login_admin <admin_password>'. (if you are a modder, you can add new commands in script 'coop_receive_player_command').

I've included some small features that allows you to spawn a party and to modify the attributes of a party (you need to be admin to have access to these features).
To spawn a party you need to hold down space and then right click on a party and select 'spawn party'. Put the party template id in the box, then hit 'spawn party' button. A party should appear at the position of the initial selected party.
To modify attributes, hold down space and right click on a party, then click on 'Party properties'. A menu should appear with multiple options. There you can modify the icon, the name, you can add member and others.

If you are a little advanced, you can use the custom network message sender (assigned to button 'm') to test new network messages (can send whatever event you want with 4 ints or with a string).

e. Main menu stuffs

On the main menu, you have the following things:
1. in the bottom left corner you can see the ip of the server that you have selected
2. in the bottom right corner you can see the current version along with a message that will inform you if there is a newer version of the mod available for download
3. in top right corner there is a button to allow you to view the 'news' (lel). The panel that appears is updated each time main menu is activated. It will contain info about changelogs, updated, bugs and other random stuffs.




Server stuffs:
a. Installation
b. Starting the server and preparation

a. Installation

The installation is pretty simple. Unzip the archive anywhere you like and done!

b Starting the server and preparation

    You start the server from coop_campaign_server.exe. This will load the config file named 'config.ini'. If the file is missing, then the server will close.
    Before you start the server, you need to configure it, so open up 'config.ini' with the most advanced text editor (plain notepad) and set up the keys that you like. One important key is the 'server_ip' key; you need to set this key to your external ip (go to google.com, then type in 'what's my ip address' and you should see your external ip there. Copy it and paste it over the default server ip).

    After messing up with config file, go ahead and open up the server. If you choosed 'add_to_server_list' to be 1, then there will be a small delay at the start of the server (to add it to the server list; the delay is there because it is done throu a blocking function... for some strange reason, std::thread is leaking memory, so I had to do it this way). 

    After the message 'Done!' appears, you can type in commands.

    There are 3 hard coded commands (quit, exit and stats) and there are more that are defined in module system (in script 'coop_receive_console_command'). Basic commands: get_server_name, get_server_password, get_admin_password, get_max_num_players, get_module_name, get_server_ip, get_add_to_server_list, set_server_name, set_server_password, set_admin_password, set_max_num_players, set_add_to_server_list.
Note: there is not 'help' command (you can add it if you want).


PS: all bugs are intended to be in the game.

The_dragon
Very special credits goes to cmpxchg8b for his amazing WSE, from which I took some ideas (mainly for module system scripts execution)
Kuba for the little pos helper (clicky)
MadVader for load game detector (clicky)

You can support me by leaving suggestions.

Feel free to ask any kind of question.
Thanks!
 
Modding

Here is the download link for the module system: http://www.mediafire.com/download/g72akubqklewbvo/warband+coop+module+system.7z
More info on the next release...
 
the method of play sounds like "battle time"
http://forums.taleworlds.com/index.php/topic,150827.0.html

so you mention "modders",  does that mean you'll provide some sort of source code?
The CONCEPT of a co-op framework is of great interest to me.

  I was expecting to have to add sockets for LAN party type access, some sort of queue manager, and some sort of listener/reply
protocol, but your framework would take that another step, which is good news.  I can only hope it doesn't require WSE which is difficult
to implement for 1.158 & up.

  It seems to me the coop mode as envisioned by battle time is still trying to make all battles player vs player; I have an idea I'll try to implement for something a little different on the client side.  But as your specialty is to smoothen the server side operations I'll be looking forward to your sources.
I'm more interested in concurrent caravans, multiple players walking in separate cities at the same time, and so on.  This requires fairly deep changes to native, which is centered on a single player.  For a server side I was hoping to have a patch server that stores the savegame information for the player and otherwise checks the runtime environment frequently for edits or changes by players.  As you said, never trust the client  :smile:

  Thanks for making this.  You're not far from me (you're in Romania).

  - GS
  dev mainly attached to Perisno .7 series project
  Sofia, Bulgaria

----
to not make 2 posts:
  What is the longest string I can send?  I'm thinking that since the server message processing bandwidth is the main limit
strings should be packed with as much information as possible at the client side: status bits, bitwise operations, all manner of tricks to put as much information into a single string and send it as one "packed message" containing many logical data fields.  If the server acted to just forward these to any other clients within say the same city ID or kingdom border or some  similar small part of the map, then the clients could unpack those updates without loading the server.

  If 18 messages can go each 6 seconds, (per client? per all nodes/players combined??  per server total???) 
    then I should have a queue manager and parser to reduce latency at each client during battles while being able to support long messages for things like savegames or dynamic patches (or for example  result of test for modification during play of the runtime environment).

  Thanks once more.
 
Well shoot I look at the Battle Time thread and stumble upon this new thread. Best of luck The_dragon you are pioneering excellent ideas. I like the idea this will be a base to be moddable with.
 
gsanders said:
so you mention "modders",  does that mean you'll provide some sort of source code?

The server that handles the players uses module system too (it has some operations like the normal module system (like math operations)), so modders can make their own mod. I will not release the source code of the server itself (at least I haven't planned to do so).

I can only hope it doesn't require WSE which is difficult to implement for 1.158 & up.
The client will not use WSE (the client mod is just a normal mod. The way it makes data transfer with the server is via the send_message_to_url operation).


What is the longest string I can send?
In the server, I set the limit to 4 * 1024 bytes (so around 4k of characters), but that limit is to the entire request (that includes the headers).

If 18 messages can go each 6 seconds, (per client? per all nodes/players combined??  per server total???) 
From my tests I get 80 - 90 requests per second, but that is only when I am alone on the server.


Thanks for the feedback, guys!
 
When I read that you discontinued your project (in the Forge) because it was not possible to accomplish in Warband, I was rather sad. The feature would be a great addition to Warband.

Now it does me good to see that you made it happen :smile:. Good work, if not extremely outstanding.
 
Back
Top Bottom