How would lua lobby start the game without disconnecting
Moderator: Moderators
How would lua lobby start the game without disconnecting
Say somebody made a magic lualobby thing that runs in spring.exe
I assume it would basically be like KP's singleplayer menu but online.
At some point spring.exe will have to restart itself (Spring.Rehost with startscript I guess) to load the real game.
But then the lobby is closed and the player gets disconnected from lobby server.
zomg? Should spring.exe run twice?
I assume it would basically be like KP's singleplayer menu but online.
At some point spring.exe will have to restart itself (Spring.Rehost with startscript I guess) to load the real game.
But then the lobby is closed and the player gets disconnected from lobby server.
zomg? Should spring.exe run twice?
Re: How would lua lobby start the game without disconnecting
Well, why not just create engine commands that allow you to connect to a server, without having to restart spring or use startscripts? f.e Spring.Connect(...)/Spring.Disconnect(). The only thing is, lobby should remain while it's loading a match, and be available in the match as well (example): 
This means that some widgets should have a longer life team than a game.
In general, I'd like to see more engine lua commands, f.e the ability to add/remove teams, AIs, change game end conditions, modify unit defs, etc, while the game is running - I see no reason why it's not like that already.

This means that some widgets should have a longer life team than a game.
In general, I'd like to see more engine lua commands, f.e the ability to add/remove teams, AIs, change game end conditions, modify unit defs, etc, while the game is running - I see no reason why it's not like that already.
Re: How would lua lobby start the game without disconnecting
all of this is of course technically possible, and coding the very basics for these things is not a big thing, but if you want them to work propperly, be ready to bug hunt for a few days for eahc of these fatures, and then again bug hunt for 1, 2 or 3 years more, for seldomly happening special cases, and then be left with a few bugs still that you don't know how to reproduce really.
thing is, that currently, the engine is a process that runs for one game only. a lot of code expects that, in the engine and lso in Lua all across games, widgets (and possibly maps).
the reason we don't have all of that, is that it was not done in the beginning by SY (which even makes sense, as this stuff is useless for a demo playback tool), and it is painfull to add later on.
thing is, that currently, the engine is a process that runs for one game only. a lot of code expects that, in the engine and lso in Lua all across games, widgets (and possibly maps).
the reason we don't have all of that, is that it was not done in the beginning by SY (which even makes sense, as this stuff is useless for a demo playback tool), and it is painfull to add later on.
Re: How would lua lobby start the game without disconnecting
The thing is just reloading gamefiles and map during runtime would not even be enough.
During loading the lobby widget must stay alive all the time, also during reloading of LuaUI. Also the wudget must be able to do ping-pong even when spring almost hangs up during pathing a large map.
Otherwise the player gets disconnected from lobbyserver and nothing is won. (over just restarting spring)
To me it seems like "impossible"/not worth it restructuring would be required.
With lua sockets from abma's testversion it is technically possible to make a ingame lobby, in a realistic timeframe. Now I do not even like the idea of a spring ingame lobby, but I wonder if any of the people who demand a lua lobby ever thought of that problem? Sure, the widget could be reloaded and reinitialize some things but still problematic.
During loading the lobby widget must stay alive all the time, also during reloading of LuaUI. Also the wudget must be able to do ping-pong even when spring almost hangs up during pathing a large map.
Otherwise the player gets disconnected from lobbyserver and nothing is won. (over just restarting spring)
To me it seems like "impossible"/not worth it restructuring would be required.
With lua sockets from abma's testversion it is technically possible to make a ingame lobby, in a realistic timeframe. Now I do not even like the idea of a spring ingame lobby, but I wonder if any of the people who demand a lua lobby ever thought of that problem? Sure, the widget could be reloaded and reinitialize some things but still problematic.
Re: How would lua lobby start the game without disconnecting
I'd be happy if at first we would at least have chat relaying much like what authosts are doing for battlerooms, but for channels as well. F.e, much like you have a:, s:, and similar chat modes already, you could also have 1:, 2:, etc. for specific chat channels, :w <name>, :r and similar for private chats.knorke wrote: With lua sockets from abma's testversion it is technically possible to make a ingame lobby, in a realistic timeframe. Now I do not even like the idea of a spring ingame lobby, but I wonder if any of the people who demand a lua lobby ever thought of that problem? Sure, the widget could be reloaded and reinitialize some things but still problematic.
So upon loading a game you connect to the main server, with information about currently connected chat channels, private chats and battleroom. An example of a way to do this would be to allow lobby server sub-connections (i.e simple connections based on an already existing connection, whose identification is sent to the lobby server). And thus when the main connection (the currently existing one that lobby chats use) is terminated, all sub-connections go off as well.
Re: How would lua lobby start the game without disconnecting
I guess for such chat relaying you would need a second account. One that is logged in with your normal lobby and another for the chat thing. Or just have autohosts do it.
Re: How would lua lobby start the game without disconnecting
you could make the normal lobby a proxy and spring connects to the proxy... but yeah, really hacky. maybe this could be used as migration path to a real ingame lobby.
to do that in a clean way, i think a third luahandler has to be added:
Inside this handler you can show the game menu, load a map / connect to a server. This lua-handler has to be started as early as the engine starts and remains until the end. Imo this is a have to, as it allows a "normal" menu.
I don't think that its so hard as hoijui said because it can be implemented as optional / experimental feature, and because of this it could be added as optional feature. but thats all speculative. Truth is, it won't be easy. :-/
also luasocket isn't yet in the engine, there are still some problems to solve...
to do that in a clean way, i think a third luahandler has to be added:
Inside this handler you can show the game menu, load a map / connect to a server. This lua-handler has to be started as early as the engine starts and remains until the end. Imo this is a have to, as it allows a "normal" menu.
I don't think that its so hard as hoijui said because it can be implemented as optional / experimental feature, and because of this it could be added as optional feature. but thats all speculative. Truth is, it won't be easy. :-/
also luasocket isn't yet in the engine, there are still some problems to solve...
Re: How would lua lobby start the game without disconnecting
I think you dont need a full ingame lobby - make matchamker support only for ingame stuff.. thats simpler to do using some custom made service.
Re: How would lua lobby start the game without disconnecting
I think it is an important discussion. Not every project wants or should have the lobbies forced on them. Other games do not use this lobby stuff, it is a paradigm shift and any sort of non-standard thing(such as the lobbies as they are) can drive players off because they are unfamiliar with it.
Re: How would lua lobby start the game without disconnecting
Chat channels, private chats, real battleroom chat (not lobbies relaying stuff), which is what I was proposing really, isn't a paradigm shit at all.smoth wrote:I think it is an important discussion. Not every project wants or should have the lobbies forced on them. Other games do not use this lobby stuff, it is a paradigm shift and any sort of non-standard thing(such as the lobbies as they are) can drive players off because they are unfamiliar with it.
I can't really think of a known, newer (wc3 era+) game that doesn't have at least some sort of communication with people that aren't in the game (f.e private chats at least).
Even though I'm also ok if it's something a game designer can opt out/in, I do think it should be done on the engine level (the chat communication mechanism, not the actual display of it).
Re: How would lua lobby start the game without disconnecting
you seem to think you are the only person proposing stuff in this thread gajop.. I may have been responding to someone else.
Re: How would lua lobby start the game without disconnecting
There are ways but all seem to take years. The good thing is there is no problem to start with.
First things to realise is for what lobby is needed. Should it be some IRC window and display of all players of all games or a way to get ingame fast?
Basically a player won't really need a lobby while playing, only after the game has ended or before the online game. At the endgame the chat could just continue to come and the player list now changes according lobby players. Only problem is with current autohosts that a new player could have taken your spot but life is crual and you just need to find new battle.
Most players disconnecting from the lobby battle at the start of a game would be only a good thing, it would probably eliminate the one huge battle which sucks all players waiting for the next game.
And if some things fucks up in the first minutes of ingame there is not need for RE to lobby anymore because it is easily possible to reset the game back to start, also BrainDamege did a support for a new player to be able to take a droppen player's team.
If I remember correctly current lobby protocol just shoves all the player data on connect which is retarded. It haven't been a huge problem as of yet because any Spring game is not good enough to get over 2000 players online but thousands of players could "kill" lobbies or slowdown the server.
Would a player ever need a list of over 300 players?
First things to realise is for what lobby is needed. Should it be some IRC window and display of all players of all games or a way to get ingame fast?
Basically a player won't really need a lobby while playing, only after the game has ended or before the online game. At the endgame the chat could just continue to come and the player list now changes according lobby players. Only problem is with current autohosts that a new player could have taken your spot but life is crual and you just need to find new battle.
Most players disconnecting from the lobby battle at the start of a game would be only a good thing, it would probably eliminate the one huge battle which sucks all players waiting for the next game.
And if some things fucks up in the first minutes of ingame there is not need for RE to lobby anymore because it is easily possible to reset the game back to start, also BrainDamege did a support for a new player to be able to take a droppen player's team.
If I remember correctly current lobby protocol just shoves all the player data on connect which is retarded. It haven't been a huge problem as of yet because any Spring game is not good enough to get over 2000 players online but thousands of players could "kill" lobbies or slowdown the server.
Would a player ever need a list of over 300 players?
Re: How would lua lobby start the game without disconnecting
Pako: The idea of lua lobby was mainly to provide an API so that any game-dev could draw from it to make his own lobby suiting his own views.
Re: How would lua lobby start the game without disconnecting
Its simple, we rewrite spring in lua - problem solved.
Problem lobbydevs?
Problem lobbydevs?
Re: How would lua lobby start the game without disconnecting
not necessary on uberserver, as long as the socket remains open at the OS-level.knorke wrote:Also the wudget must be able to do ping-pong even when spring almost hangs up during pathing a large map.
Otherwise the player gets disconnected from lobbyserver and nothing is won. (over just restarting spring)
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: How would lua lobby start the game without disconnecting
Dude, why does the lobby need to remain constant while a game is running? If you want that use tasc, SL, etc.
Ideally in a game you would be either playing or chatting with the people int he game and if you want to chat with people in the lobby, *GASPED* exit the game!
Ideally in a game you would be either playing or chatting with the people int he game and if you want to chat with people in the lobby, *GASPED* exit the game!
Re: How would lua lobby start the game without disconnecting
Indeed you could pass off the socket to spring in order to keep it from closing. Also serialize the state of the lobby before connecting to the game so it can be resumed afterward just as it was.
Once you're in-game the autohost listens for commands related to your game anyway.
No b.net style messaging, but that could be implemented by creating a new service (bot) which you connect to via a widget and use by typing say /whisper <playername> <msg>. Service then forwards message as <Service>:PlayerName:Msg to playername, and vice versa.
Once you're in-game the autohost listens for commands related to your game anyway.
No b.net style messaging, but that could be implemented by creating a new service (bot) which you connect to via a widget and use by typing say /whisper <playername> <msg>. Service then forwards message as <Service>:PlayerName:Msg to playername, and vice versa.