RazvanM Posted May 21, 2013 Share Posted May 21, 2013 (edited) I would also like to join in, as long as it is a serious proposal and not a dream someone has. To me the biggest question is how to manage the simulator at the server and client levels and coordinating the entities and events across them. Seems as though you would need a 'server" version of the simulator so you can run it alongside a "client" version on the same machine. The "client" version of the simulator would run in "passive mode" and just receive the changes provided by the "server" version via the lan/net. @WrathOf Regarding the simulation part, I think you are complicating things at least that is how I see it now, you don't really need a separate server to run the simulation, as long as the map loaded is the same (meaning the same gametime, the same everything) I do not see a problem running the simulation client side. True the next big question would be how to synchronize the events, what happens if two people cut a tree at the same time, you would need to send between clients the "cut" action (with the ent id) so it would take "7.5" swings for a big tree, obviously it goes down, and events are sent between clients that an entity has been removed (based id). As long as time passes the same for both clients the simulations can run locally.Running locally means that you do not have to store additional data in the map, you just have one playerinfo (yours). When a client connects, you just spawn another "wilson" prefab and stream events to that prefab based on what you receive from the client. You could also mark this entity with some tag so chester will not follow him, it will follow only you, and so on regarding other "specific player" things.Also I agree the biggest challenge would be the networking code, and synchronizing events.PS.If it really needs to be client / server, than you could make one client the server (all others will connect to it) after that you (server) will be responsible for sending game time synchronization, the clients will ask you for ids and so on. In both cases you don't need a stand alone server.I do not know if you can change the simulation time from lua, I am 99% sure you can because you have a gametime in the save file. Hmmmmmm. Edited May 21, 2013 by RazvanM Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176015 Share on other sites More sharing options...
tehMugwump Posted May 21, 2013 Share Posted May 21, 2013 I'm for it. It would extend DS's game life almost indefinitely.But, do you think this is even possible without the Devs offering up a copy of the game code? Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176199 Share on other sites More sharing options...
masamunefr Posted May 21, 2013 Share Posted May 21, 2013 Sadly I don't have the experience/skill to help...But gl for it anyways ! We're all behind u : D Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176219 Share on other sites More sharing options...
RazvanM Posted May 21, 2013 Share Posted May 21, 2013 (edited) I'm for it. It would extend DS's game life almost indefinitely.But, do you think this is even possible without the Devs offering up a copy of the game code?Well I really did not investigate to see what the simulation engine is exposing, even if it does not expose everything we need, we still would not need the source code, the devs should add more hooks for us to use (again IF we don't have everything we need already to control the simulation). One thing they should add is socket support, I saw a thread somewhere that this is not included.The thing that must be decided first is the number of people.- 2 persons -> a simple one - one connection should suffice, and spam events between clients- 2-4 persons -> a connection- one - one (peer 2 peer)Advantages- Still the easiest way to do it, just spam commands between clients- No server to go down (the rest of the players can continue if someone is dropped)Disadvantages- More network traffic- Who has the map to be played ?- Who has the best data in case of problems with synchronizations ?- Problems with placing entities ? - unique ID's, this probably can be solved by telling each client from where to start the id count- normal server - clientAdvantages- Synchronization issues would be solved easily- No problems with the generation of id's- Smaller traffic for clientsDisadvantages- In case it goes down (or exits), everyone is out.- More people -> Server - client is the best wayIn both cases, I do not think the synchronization issue is that bad (both run at the same speed). It's really not FPS where a fraction of a second matters, it is also not so action packed, if a delay of 1ms - 10ms - 50ms....???ms happens between the action of player 1 and being viewed in the screen of player 2, I don't think it would be a problem. Regarding game time synchronization well I do not know if you can go back in time, so the player with the greatest game time has priority, the rest would just have to accelerate to that time.These are just first impressions, I did not investigate to much, so if I am wrong please correct me. Edited May 21, 2013 by RazvanM Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176241 Share on other sites More sharing options...
Mustard Posted May 21, 2013 Share Posted May 21, 2013 I don't know about 100 people, but four would probably work. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176246 Share on other sites More sharing options...
_-_-_ Posted May 21, 2013 Share Posted May 21, 2013 I don't know about 100 people, but four would probably work.4 probably max. It dos'nt seem very umm "legit" with more than that. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176250 Share on other sites More sharing options...
Zuljin Posted May 21, 2013 Share Posted May 21, 2013 Well I really did not investigate to see what the simulation engine is exposing, even if it does not expose everything we need, we still would not need the source code, the devs should add more hooks for us to use (again IF we don't have everything we need already to control the simulation). One thing they should add is socket support, I saw a thread somewhere that this is not included.The thing that must be decided first is the number of people.- 2 persons -> a simple one - one connection should suffice, and spam events between clients- 2-4 persons -> a connection- one - one (peer 2 peer)Advantages- Still the easiest way to do it, just spam commands between clients- No server to go down (the rest of the players can continue if someone is dropped)Disadvantages- More network traffic- Who has the map to be played ?- Who has the best data in case of problems with synchronizations ?- Problems with placing entities ? - unique ID's, this probably can be solved by telling each client from where to start the id count- normal server - clientAdvantages- Synchronization issues would be solved easily- No problems with the generation of id's- Smaller traffic for clientsDisadvantages- In case it goes down (or exits), everyone is out.- More people -> Server - client is the best wayIn both cases, I do not think the synchronization issue is that bad (both run at the same speed). It's really not FPS where a fraction of a second matters, it is also not so action packed, if a delay of 1ms - 10ms - 50ms....???ms happens between the action of player 1 and being viewed in the screen of player 2, I don't think it would be a problem. Regarding game time synchronization well I do not know if you can go back in time, so the player with the greatest game time has priority, the rest would just have to accelerate to that time.These are just first impressions, I did not investigate to much, so if I am wrong please correct me.Interesting ... Are you proposing a connection without external server? I mean ... something like a LAN? Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176270 Share on other sites More sharing options...
RazvanM Posted May 21, 2013 Share Posted May 21, 2013 (edited) @Zuljin Well I'm just saying that you don't really need a headless server, each client has the simulation engine running, you just need to synchronize between them. So it depends on what you mean by "external" server .If you mean what I think you mean, than yes, I am proposing a "LAN" type connection, you just need to know the IP of the server. Edited May 21, 2013 by RazvanM Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176280 Share on other sites More sharing options...
no_signal Posted May 21, 2013 Share Posted May 21, 2013 @Zuljin Well I'm just saying that you don't really need a headless server, each client has the simulation engine running, you just need to synchronize between them. So it depends on what you mean by "external" server .If you mean what I think you mean, than yes, I am proposing a "LAN" type connection, you just need to know the IP of the server.The main problem is how are you going to connect to the internetyou can't use socket.lua and you can't load a dll to connect to the internet.If they add socket.core.dll back to the game you could.Bigfoot sad he might add it if people want it http://forums.kleientertainment.com/showthread.php?19006-Moding-help Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176319 Share on other sites More sharing options...
RazvanM Posted May 21, 2013 Share Posted May 21, 2013 [MENTION=26201]no_signal[/MENTION] Thank you for finding the thread , that is probably the most important thing we need from the devs, as I said in a previous post "One thing they should add is socket support, I saw a thread somewhere that this is not included.". Thanks for adding it . Perhaps they will add it back.Regarding loading dll's hmmmm, and I had an ideea to use .NET to create a map browser to be used in game, well that is out the window . Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176324 Share on other sites More sharing options...
no_signal Posted May 21, 2013 Share Posted May 21, 2013 (edited) [MENTION=26201]no_signal[/MENTION] Thank you for finding the thread , that is probably the most important thing we need from the devs, as I said in a previous post "One thing they should add is socket support, I saw a thread somewhere that this is not included.". Thanks for adding it . Perhaps they will add it back.Regarding loading dll's hmmmm, and I had an ideea to use .NET to create a map browser to be used in game, well that is out the window . so i figured out a way around the problemI'll test it out. Edited May 22, 2013 by no_signal Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-176598 Share on other sites More sharing options...
RazvanM Posted May 22, 2013 Share Posted May 22, 2013 so i figured out a way around the problemI'll test it out.Cool , let us know the results, bad / good does not matter, you could also tell us how you wanted to do it if it does not work, perhaps we can come up with a solution eventually. [MENTION=2]Bigfoot[/MENTION] Please add the socket support, it is the most important thing to start going forward, no_signal is searching for another solution, I think the easiest way is for you guys to add that. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177124 Share on other sites More sharing options...
RazvanM Posted May 22, 2013 Share Posted May 22, 2013 so i figured out a way around the problemI'll test it out.Cool , let us know the results, bad / good does not matter, you could also tell us how you wanted to do it if it does not work, perhaps we can come up with a solution eventually. [MENTION=2]Bigfoot[/MENTION] Please add the socket support, it is the most important thing to start going forward, no_signal is searching for another solution, I think the easiest way is for you guys to add that. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177602 Share on other sites More sharing options...
RazvanM Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=26201]no_signal[/MENTION], I did some tests, and I managed to load the luanet.dll (it loads and I can create .NET objects, the app crashes when I try to show something, however that is not the point currently), some things that must be done- New dll's must be in a new folder "lualib" under "bin"- You need lua51.dll and lua5.1.dll placed in the bin folderAlso sockets work.The code bellow was placed in main.luadata/scripts/main.lua(140,1) loaded lua net, created form Wilson P. Higgsburydata/scripts/main.lua(141,1) 0.033333335071802data/scripts/main.lua(148,1) Using host '127.0.0.1' and port 13...data/scripts/main.lua(154,1) closedThe folder structure-bin-lualib-socketcore.dllluanet.dlllua51.dlllua5.1.dllrequire "luanet"luanet.load_assembly "System.Windows.Forms"Form = luanet.import_type "System.Windows.Forms.Form"form = Form()form.Text = STRINGS.CHARACTER_NAMES.wilsonprint("loaded lua net, created form "..form.Text)print(TheSim:GetTickTime())local socket = require"socket"local host = "127.0.0.1"local port = 13host = socket.dns.toip(host)local udp = socket.udp()print("Using host '" ..host.. "' and port " ..port.. "...")udp:setpeername(host, port)udp:settimeout(3)local sent, err = udp:send("anything")if err then print(err) os.exit() endlocal dgram, err = udp:receive()if not dgram then print(err) os.exit() endprint(dgram) Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177212 Share on other sites More sharing options...
RazvanM Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=26201]no_signal[/MENTION], I did some tests, and I managed to load the luanet.dll (it loads and I can create .NET objects, the app crashes when I try to show something, however that is not the point currently), some things that must be done- New dll's must be in a new folder "lualib" under "bin"- You need lua51.dll and lua5.1.dll placed in the bin folderAlso sockets work.The code bellow was placed in main.luadata/scripts/main.lua(140,1) loaded lua net, created form Wilson P. Higgsburydata/scripts/main.lua(141,1) 0.033333335071802data/scripts/main.lua(148,1) Using host '127.0.0.1' and port 13...data/scripts/main.lua(154,1) closedThe folder structure-bin-lualib-socketcore.dllluanet.dlllua51.dlllua5.1.dllrequire "luanet"luanet.load_assembly "System.Windows.Forms"Form = luanet.import_type "System.Windows.Forms.Form"form = Form()form.Text = STRINGS.CHARACTER_NAMES.wilsonprint("loaded lua net, created form "..form.Text)print(TheSim:GetTickTime())local socket = require"socket"local host = "127.0.0.1"local port = 13host = socket.dns.toip(host)local udp = socket.udp()print("Using host '" ..host.. "' and port " ..port.. "...")udp:setpeername(host, port)udp:settimeout(3)local sent, err = udp:send("anything")if err then print(err) os.exit() endlocal dgram, err = udp:receive()if not dgram then print(err) os.exit() endprint(dgram) Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177690 Share on other sites More sharing options...
Handsome Matt Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=23863]RazvanM[/MENTION] that is very nice information! Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177382 Share on other sites More sharing options...
Handsome Matt Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=23863]RazvanM[/MENTION] that is very nice information! Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177860 Share on other sites More sharing options...
iceage32 Posted May 22, 2013 Share Posted May 22, 2013 I don't know I may be idiot but I still can't get the socket working. Only thing that I'm not sure of is what is lua51.dll Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177395 Share on other sites More sharing options...
iceage32 Posted May 22, 2013 Share Posted May 22, 2013 I don't know I may be idiot but I still can't get the socket working. Only thing that I'm not sure of is what is lua51.dll Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177873 Share on other sites More sharing options...
RazvanM Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=3332]Handsome Matt[/MENTION] thank you, I do not know the consequence of running two lua engines in the same process? (Game , and external lua5.1), so this is just a find does not mean it is the solution, I still believe that the devs should add the socket support. Honestly I don't know anything about lua, I had trouble writing a simple for loop. [MENTION=42463]iceage32[/MENTION] Let's not derail this thread, post any questions on the thread you started, I will see it and answer there. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177404 Share on other sites More sharing options...
RazvanM Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=3332]Handsome Matt[/MENTION] thank you, I do not know the consequence of running two lua engines in the same process? (Game , and external lua5.1), so this is just a find does not mean it is the solution, I still believe that the devs should add the socket support. Honestly I don't know anything about lua, I had trouble writing a simple for loop. [MENTION=42463]iceage32[/MENTION] Let's not derail this thread, post any questions on the thread you started, I will see it and answer there. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177882 Share on other sites More sharing options...
Handsome Matt Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=23863]RazvanM[/MENTION] I don't it actually creates another Lua state, since you can still access all the normal globals. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177410 Share on other sites More sharing options...
Handsome Matt Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=23863]RazvanM[/MENTION] I don't it actually creates another Lua state, since you can still access all the normal globals. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177888 Share on other sites More sharing options...
no_signal Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=26201]no_signal[/MENTION], I did some tests, and I managed to load the luanet.dll (it loads and I can create .NET objects, the app crashes when I try to show something, however that is not the point currently), some things that must be done- New dll's must be in a new folder "lualib" under "bin"- You need lua51.dll and lua5.1.dll placed in the bin folderAlso sockets work.The code bellow was placed in main.luadata/scripts/main.lua(140,1) loaded lua net, created form Wilson P. Higgsburydata/scripts/main.lua(141,1) 0.033333335071802data/scripts/main.lua(148,1) Using host '127.0.0.1' and port 13...data/scripts/main.lua(154,1) closedThe folder structure-bin-lualib-socketcore.dllluanet.dlllua51.dlllua5.1.dllrequire "luanet"luanet.load_assembly "System.Windows.Forms"Form = luanet.import_type "System.Windows.Forms.Form"form = Form()form.Text = STRINGS.CHARACTER_NAMES.wilsonprint("loaded lua net, created form "..form.Text)print(TheSim:GetTickTime())local socket = require"socket"local host = "127.0.0.1"local port = 13host = socket.dns.toip(host)local udp = socket.udp()print("Using host '" ..host.. "' and port " ..port.. "...")udp:setpeername(host, port)udp:settimeout(3)local sent, err = udp:send("anything")if err then print(err) os.exit() endlocal dgram, err = udp:receive()if not dgram then print(err) os.exit() endprint(dgram)cool you got it workingbut you're linking to a different instance of lua and that may cause a crash. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177414 Share on other sites More sharing options...
no_signal Posted May 22, 2013 Share Posted May 22, 2013 [MENTION=26201]no_signal[/MENTION], I did some tests, and I managed to load the luanet.dll (it loads and I can create .NET objects, the app crashes when I try to show something, however that is not the point currently), some things that must be done- New dll's must be in a new folder "lualib" under "bin"- You need lua51.dll and lua5.1.dll placed in the bin folderAlso sockets work.The code bellow was placed in main.luadata/scripts/main.lua(140,1) loaded lua net, created form Wilson P. Higgsburydata/scripts/main.lua(141,1) 0.033333335071802data/scripts/main.lua(148,1) Using host '127.0.0.1' and port 13...data/scripts/main.lua(154,1) closedThe folder structure-bin-lualib-socketcore.dllluanet.dlllua51.dlllua5.1.dllrequire "luanet"luanet.load_assembly "System.Windows.Forms"Form = luanet.import_type "System.Windows.Forms.Form"form = Form()form.Text = STRINGS.CHARACTER_NAMES.wilsonprint("loaded lua net, created form "..form.Text)print(TheSim:GetTickTime())local socket = require"socket"local host = "127.0.0.1"local port = 13host = socket.dns.toip(host)local udp = socket.udp()print("Using host '" ..host.. "' and port " ..port.. "...")udp:setpeername(host, port)udp:settimeout(3)local sent, err = udp:send("anything")if err then print(err) os.exit() endlocal dgram, err = udp:receive()if not dgram then print(err) os.exit() endprint(dgram)cool you got it workingbut you're linking to a different instance of lua and that may cause a crash. Link to comment https://forums.kleientertainment.com/forums/topic/12935-question-the-multiplayer-mod-is-it-possible/page/5/#findComment-177892 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now