Author Topic: [OSP] MP COOP campaign "engine" V0.2 gamma (1.10.2013)  (Read 132393 times)

0 Members and 1 Guest are viewing this topic.

🐉TheDragon🐉

  • Master Knight
  • *
  • I am the Father of Dragons, Breaker of Chains, ...
    • View Profile
  • Faction: Nord
  • WBNW
[OSP] MP COOP campaign "engine" V0.2 gamma (1.10.2013)
« on: August 31, 2013, 01:26:02 PM »
after weeks of hard work, I finnaly managed to make a "working" multiplayer campaign mod. And i share It with you guys, so you can make others life better.
(i am a noob in presenting/explaining something, so excuse me)

THIS IS NOT A PLAYABLE VERSION YET!!!


here you can see the very old first design of multicamp


WARNING! BAD ENGLISH BELOW!!!!!!!
I must warn you now that modding this requires PHP knowledge!!! If you don't have any PHP knowledge, then quit reading this.


So first let's start with how to set up everything.
What you need to set up:
   
(click to show/hide)

   
(click to show/hide)

What you need to know about modding it:
(click to show/hide)

Client modding
(click to show/hide)

(click to show/hide)

Server modding
Your main file for modding webserver is code.php.

(click to show/hide)

(click to show/hide)

(click to show/hide)

(click to show/hide)


Here is a example of how to make and use a new event:
(click to show/hide)

(click to show/hide)


Changelog
(click to show/hide)

multiplayer campaign mod files download -> HERE .

(click to show/hide)

Credits:
*taleworlds for creating warband
*Gotha for indirectly giving me the ideea that multi camp is possible
*MadocComadrin for madmin (i took the chat presentation from there)

What you are not allowed:
it is not allowed to use scripts/part of scripts without giving credits to me

first appearence of this kind of mod was here!


Thread created in 3+ hours.
« Last Edit: April 13, 2014, 03:58:52 PM by The_dragon »

🐉TheDragon🐉

  • Master Knight
  • *
  • I am the Father of Dragons, Breaker of Chains, ...
    • View Profile
  • Faction: Nord
  • WBNW
Additional info
« Reply #1 on: August 31, 2013, 01:26:54 PM »
When you install the mod, make sure you copy the files from mod_files and paste them in the mod folder.

What to do if...
1."Desync" message show up (centered-bottom of the screen) - kepp the spacebar down for 2 seconds, then release it.The message should dissapeare.
2.I need to click multiple time to make the party move - this is something normal, it is caused by nopause mod(which keeps all the things in sync)
3.Random error messages appeares - if you didn't modified the files at all, then exit the game, then go to game folder, and send me the rgl_log.txt , along with a description of the situation
4."Waiting for confirmation screen" stays for more than 10 seconds - this is cause by a network problem.Open up a internet browser, and type in <server_ip>/test.php  (replace the <server_ip> with the server's ip). If the message " All setups are fine!" does not appeare, then there is a server issue. It can be caused by the firewall, or by using a router.



Ingame controls:
1.Register
To register an account, go to start new game->register account. Then choose your awesome name and pass, then click continue, and follow the ingame screens, until you reach the world map

2.Log in
There are 2 ways of log in:
-go to load game, select your savegame, hten hit load and log in
-go to start new game->log in forced -> and follow the ingame screens

3.Chat
The chat key is exactly the multiplayer global key (default is T)

4.Player stats
The player stats is the same as the normal mp, press Tab and you will see a list of all online players, along with their ping(many times the ping is bugged).

5.Menu
The main window is assigned to the key M. Press it once, the menu will be up, press it again, the menu will go away. From there you can choose other submenues(currently only one functionally)

6.Inventory window
The inventory window is a very basic one (many many details needs to be added, but since presentations are pain in a** for me....). You can move the items from one slot to another one, by clicking on them. When you click a slot, that slot will become red, that means that it is selected. Click it again to deselect it. Select a slot, then click on anotherone to swap the item/equip the items. At the bottom you can see the gold, and also you can see two arrows. Those arrows scrool throu items pages.

7.FPS
You can see your current FPS by pressing the key N once, then wait 1 sec, and the fps will show in a message(it is accurately, I tested it with Fraps).

Other things:
1.Currently, the inventory is synced up with the server, and if you want to test it, you need to manually add items for each player. To do that, first find his unique id, then go to players/<his unique id>  and open up the file inventory.txt . You will add the items by replacing a -1 value(or an already existing one) with the item id you want to add(the items id can be found in id_items.py in module system). Make sure that you replace the value, and not delete a '|' . The first -1 (is the first one) is hardwired, changing it will not add a intem into the game.
« Last Edit: October 02, 2013, 01:18:12 PM by The_dragon »

Zephilinox

  • Knight
  • *
  • Perisno Developer
    • Skype - Zephilinox
    • Steam - 01111010
    • Twitter - Zephilinox
    • Twitch.tv - Zephilinox
    • YouTube - Zephilinox
    • View Profile
  • Faction: Swadian
  • WB
Re: [OSP] multiplayer campaign (SP map) "engine" V0.127 gamma
« Reply #2 on: August 31, 2013, 02:00:17 PM »
Very cool :]

Hmm, plaintext passwords? IIRC PHP has multiple hashing functions you could use.
« Last Edit: August 31, 2013, 02:07:57 PM by Zephilinox »

MaHuD

  • Mr. SevenBois
  • Napoleonic Wars Moderator
  • *
    • Skype - Kroshnir
    • Twitch.tv - LordMaHuD
    • View Profile
  • Faction: Nord
  • MP nick: Hired_Blade
  • WBM&BNWWF&SVC
Re: [OSP] multiplayer campaign (SP map) "engine" V0.127 gamma
« Reply #3 on: August 31, 2013, 02:09:52 PM »
Looks interesting, I hope it works like I think it does. :)


Swyter

  • Grandmaster Knight
  • *
  • »Star Wars Conquest Dev Team Leader
    • View Profile
    • [my tiny homepage]
  • Faction: Swadian
  • MP nick: Sareth | Swyter
  • WBM&BWF&S
Re: [OSP] multiplayer campaign (SP map) "engine" V0.127 gamma
« Reply #4 on: August 31, 2013, 05:39:25 PM »
Wow, this is crazy! I don't think that you guys are getting it.
He has written his own networking layer on top of the single player module system by using the HTTP operations and a supplementary main server as middleware. Syncing, chat, movement, everything. Hats off.

The_dragon, mate. You are an pretty talented coder.
Oh, and embed the video using the Youtube tag, its a neat proof of concept.

The Bowman

  • Count
  • *
    • Steam - thebowmantw
    • View Profile
  • Faction: Khergit
  • MP nick: The_Bowman
  • WBM&BVCNWWF&S
Re: [OSP] multiplayer campaign (SP map) "engine" V0.127 gamma
« Reply #5 on: August 31, 2013, 05:42:31 PM »
I hope this gets far and of course, "more" official. :)
Coming soon since 2012. Click on the picture below to expand your expectations.


Native Scene Replacement Pack.
New release (30.12.2018).

🐉TheDragon🐉

  • Master Knight
  • *
  • I am the Father of Dragons, Breaker of Chains, ...
    • View Profile
  • Faction: Nord
  • WBNW
Re: [OSP] multiplayer campaign (SP map) "engine" V0.127 gamma
« Reply #6 on: August 31, 2013, 06:21:43 PM »
Wow, this is crazy! I don't think that you guys are getting it.
He has written his own networking layer on top of the single player module system by using the HTTP operations and a supplementary main server as middleware. Syncing, chat, movement, everything. Hats off.

The_dragon, mate. You are an pretty talented coder.
Oh, and embed the video using the Youtube tag, its a neat proof of concept.

Thank you man. I wish i could just change my username(i choosed it when i was a kid... :( )

Swyter

  • Grandmaster Knight
  • *
  • »Star Wars Conquest Dev Team Leader
    • View Profile
    • [my tiny homepage]
  • Faction: Swadian
  • MP nick: Sareth | Swyter
  • WBM&BWF&S
Re: [OSP] multiplayer campaign (SP map) "engine" V0.127 gamma
« Reply #7 on: August 31, 2013, 06:32:53 PM »
Wow, this is crazy! I don't think that you guys are getting it.
He has written his own networking layer on top of the single player module system by using the HTTP operations and a supplementary main server as middleware. Syncing, chat, movement, everything. Hats off.

The_dragon, mate. You are an pretty talented coder.
Oh, and embed the video using the Youtube tag, its a neat proof of concept.

Thank you man. I wish i could just change my username(i choosed it when i was a kid... :( )

Ask Janus, he will help you with that. By the way, keep us informed, the ping looks decent in the video, I must admit that I'm surprised, all this module system <-> HTTP/TCP <-> PHP server <-> HTTP/TCP <-> module system seemed like a lot of overhead to keep everything on sync and dandy, without many latency issues.

I also like that you are using some kind of deferred buffering using slots and then send everything together in batches. It's all a juxtaposition of something so rudimentary, complex and inventive, that how nobody else had thought about this... Well, let's just say that this is a good groundwork start.

CTCCoco

  • Knight at Arms
  • *
    • Steam - CTCCoco
    • View Profile
    • Calradia Slave Rebellion
  • Faction: Neutral
  • WBNW
Re: [OSP] multiplayer campaign (SP map) "engine" V0.127 gamma
« Reply #8 on: August 31, 2013, 06:33:21 PM »
Interesting, good work.
Calradia Slave Rebellion
Programmer, Game Developer, Modder & Webmaster

🐉TheDragon🐉

  • Master Knight
  • *
  • I am the Father of Dragons, Breaker of Chains, ...
    • View Profile
  • Faction: Nord
  • WBNW
the version from the video is an old version...that version was faster, but not optimized. The current version doesn't have a ping thing.
In the old version, i didn't used buffers, i was sending the data directly with send_message_to_url and then the string (wich wasn't optimise at all because there was a limit of sending /second , and many of the mesages was only one int and blank response). The ping thing was in a rustique way...basically the server stores the time in miliseconds, then it sends a message to client, wich tell the client to send a message back, and then it substract the saved time from current time in milisecond (i am not sure if it was divided by 2). And the result was the ping.

Swyter

  • Grandmaster Knight
  • *
  • »Star Wars Conquest Dev Team Leader
    • View Profile
    • [my tiny homepage]
  • Faction: Swadian
  • MP nick: Sareth | Swyter
  • WBM&BWF&S
the version from the video is an old version...that version was faster, but not optimized. The current version doesn't have a ping thing.
In the old version, i didn't used buffers, i was sending the data directly with send_message_to_url and then the string (wich wasn't optimise at all because there was a limit of sending /second , and many of the mesages was only one int and blank response). The ping thing was in a rustique way...basically the server stores the time in miliseconds, then it sends a message to client, wich tell the client to send a message back, and then it substract the saved time from current time in milisecond (i am not sure if it was divided by 2). And the result was the ping.

Makes sense. Have you tried anything with action mode agents? That part seems to be more tricky to get right, with position delay, viewing angle, animations, combat, actions, and so on.

🐉TheDragon🐉

  • Master Knight
  • *
  • I am the Father of Dragons, Breaker of Chains, ...
    • View Profile
  • Faction: Nord
  • WBNW
i didn't tried. I was only thinking about it, but it is too complicated to make multiplayer battle in this way (i think it is not possible to make a playable battle, because there are not enough data sended every second). I was thinking of making all the world map things in this way, and making the battles in the normal multiplayer with a dedicated server.

I will try making a mp battle in this way (i am curious how will it be :D).

GoldEagleMNE

  • Baron
  • *
    • View Profile
    • A Game of Thrones mod
  • Faction: Bandit
  • MP nick: GoldEagleMNE
  • M&BWBWF&SNW
Very nice. This is a great idea and very good job.

Swyter

  • Grandmaster Knight
  • *
  • »Star Wars Conquest Dev Team Leader
    • View Profile
    • [my tiny homepage]
  • Faction: Swadian
  • MP nick: Sareth | Swyter
  • WBM&BWF&S
i didn't tried. I was only thinking about it, but it is too complicated to make multiplayer battle in this way (i think it is not possible to make a playable battle, because there are not enough data sended every second). I was thinking of making all the world map things in this way, and making the battles in the normal multiplayer with a dedicated server.

I will try making a mp battle in this way (i am curious how will it be :D).

Just like battle time!... I'm curious too. But if the limitations imposed on the timing are so great then this is a dead end.

Syncing the bots would be a headache. Things like how to decide who is the one doing the AI simulation and relaying back and forth using stringified TCP packets is an overkill in native code, I don't want to know how that works within the M&B interpreter. *shivers*

Well. At least we have a shared multiplayer campaign, just like in Medieval II: Total War, the battles can be simulated (or optionally played in a temp server) and just enjoy the strategic part of the game, which isn't that bad. It's an attractive concept, and much better than using a web browser like Strategus or the other mod from nijis, which is a TaleWorlds dev.

🐉TheDragon🐉

  • Master Knight
  • *
  • I am the Father of Dragons, Breaker of Chains, ...
    • View Profile
  • Faction: Nord
  • WBNW
currently i managed to get around 18 succesfull transmisions per second(that means 18 things sended, 18 thing received / second, and in one thing i can send max 10 events (in the current version) ). Now i didn't tested how much it decrease if i use all 10 slots for sending (i realised that i can send how much data i want to server(i can send even 40 events at a time, if i tweak the scripts), but the receiving is only limited to 128 ints and 31 strings one time).
i was thinking of removing the AI completely from the game, and let only players to build/ make quests. Tthis is only a started mod...long way to a final version.