How would lua lobby start the game without disconnecting

How would lua lobby start the game without disconnecting

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

How would lua lobby start the game without disconnecting

Post by knorke »

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?
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How would lua lobby start the game without disconnecting

Post by gajop »

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): Image
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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: How would lua lobby start the game without disconnecting

Post by hoijui »

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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: How would lua lobby start the game without disconnecting

Post by knorke »

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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How would lua lobby start the game without disconnecting

Post by gajop »

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.
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.
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.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: How would lua lobby start the game without disconnecting

Post by knorke »

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.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: How would lua lobby start the game without disconnecting

Post by abma »

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...
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: How would lua lobby start the game without disconnecting

Post by Licho »

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.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: How would lua lobby start the game without disconnecting

Post by smoth »

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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: How would lua lobby start the game without disconnecting

Post by gajop »

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.
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.
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).
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: How would lua lobby start the game without disconnecting

Post by smoth »

you seem to think you are the only person proposing stuff in this thread gajop.. I may have been responding to someone else.
Pako
Posts: 174
Joined: 12 Jul 2009, 18:57

Re: How would lua lobby start the game without disconnecting

Post by Pako »

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?
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: How would lua lobby start the game without disconnecting

Post by zwzsg »

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.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10452
Joined: 24 Jan 2006, 21:12

Re: How would lua lobby start the game without disconnecting

Post by PicassoCT »

Its simple, we rewrite spring in lua - problem solved.


Problem lobbydevs?
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: How would lua lobby start the game without disconnecting

Post by aegis »

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)
not necessary on uberserver, as long as the socket remains open at the OS-level.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: How would lua lobby start the game without disconnecting

Post by Forboding Angel »

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!
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

Re: How would lua lobby start the game without disconnecting

Post by Cheesecan »

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.
Post Reply

Return to “Lua Scripts”