(all lobbies) lobbies and ingame menus/singleplayer

(all lobbies) lobbies and ingame menus/singleplayer

Discuss development of lobby clients, server, autohosts and auto-download software.

Moderators: Moderators, Lobby Developers

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

(all lobbies) lobbies and ingame menus/singleplayer

Post by knorke »

Dear lobby & mod devpeoplepersons,

Some years ago spring games got an awesome innovation:
Built-in singleplayer menus!
With these lua'ed menus players can select missions or set up skirmishes.

short version: Lobbies need to make these menus available to players.

Image
others:
http://media.indiedb.com/images/games/1 ... n00489.png
&
http://h-4.abload.de/img/spmenuwse0.png

Since the moddevs have full control over the menus they made, they can ensure players can for example not select any AIs that will not work with the game.

So all very nice but big problem:
How does the player get into these ingame-menus?
He has to start spring.exe, select mod, select map, click start.
Seems simple but...

Problems with that:
Average player might not find spring.exe, especially if it was automatically downloaded like some lobbies now can.
After start, the spring.exe menu ("the beach") comes up which is like a silly pre-menu to get into real menu. For example you have to select a map and AI just so the game and its menu will start.


How it could work:
In the lobby is a button "Launch internal game menu"
After clicking, spring starts with the game selected and the game's menu takes it from there.

Details
Spring must be started a script.txt, so that chosen game will be launched. Since the AI, map etc in that script.txt does not really matter it can maybe something generic. Or would it be good if this launchscript was somehow read from modfile?
But basically no complicated stuff is required:
Just a button that launches spring with the mod selected.

Other possible solutions which are not as good:
"Lobby XY already has a singplayer menu"
Why it is not good:
These menus look different in every lobby.
There is little control that would prevent players from setting up games that will not work. ("game vs allied NullAI and everybody starts in the same spot")


"Why don't game makers make their own installer, then you can include a singleplayer.exe like this one: http://springrts.com/phpbb/viewtopic.ph ... nu#p458934"

Why it is not good:
Lobbies can already download the game file, engine and maps and update all that. Making own installer means reinventing all that. It might also only work on one OS while they are already lobbies for every OS. There is no need to make new installers: Almost all is already done, just needs to be put together.

To me it seems like an potential easy way to improve Spring?
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by CarRepairer »

knorke and I cannot figure out how to launch spring so it goes directly to KP's lua menu.
cleanrock
Former Engine Dev
Posts: 115
Joined: 21 Feb 2009, 07:42

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by cleanrock »

I think it would work with 94.1 with --game and --map but the "Spring Direct Launch 2" widget fails on 94.1:

$ spring --game "Kernel Panic 4.4" --map "Corrupted Core"
...
[f=0000000] [widgets.lua] Error: Error in Initialize(): [string "LuaRules/Gadgets/libs/FillModSpecific.lua"]:5: attempt to perform arithmetic on a nil value
[f=0000000] [widgets.lua] Error: Removed widget: Spring Direct Launch 2
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by knorke »

the "Spring Direct Launch 2" widget fails on 94.1:
yes, something with how engine version numbering scheme changed. So in principle nothing too dramatic.
knorke and I cannot figure out how to launch spring so it goes directly to KP's lua menu.
It is something which modoptions are (not) set but the detection could be changed anyway.
Atm it is a bit hacky with assumption that modoptions will be empty table (or nil, dont remember) on direct launch.

My suggestion is a modoption "showingamemenu" set by script.txt when spring is launched.
The mods detection would then be

Code: Select all

if modoptions.showingamemenu == true then
..show the menu..
else
...it is a normal multiplayer game, dont show menu..
end
But excact name of modoption and such can be discussed of course..

I just remembered that not all games do/will have such ingame menus.
The lobby must be able to know which games needs to show a "go to ingame menu."
Maybe read it from modinfo.lua or some other file? Also if the mod can tell "menu yes/no" it could maybe also tell other things, like its startscript..

Would be interessting to read opinions from other lobby and game devs :)
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by Silentwings »

I would be very glad if lobbies could do this, too!
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by zwzsg »

cleanrock wrote:I think it would work with 94.1 with --game and --map but the "Spring Direct Launch 2" widget fails on 94.1:

$ spring --game "Kernel Panic 4.4" --map "Corrupted Core"
...
[f=0000000] [widgets.lua] Error: Error in Initialize(): [string "LuaRules/Gadgets/libs/FillModSpecific.lua"]:5: attempt to perform arithmetic on a nil value
[f=0000000] [widgets.lua] Error: Removed widget: Spring Direct Launch 2
Yeah, Spring 94 version is "94", while my widget expect "94.0", so my code crashes. I fixed it on my local version, but I have other problems that prevent me from releasing a KP compatible with Spring 94.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by knorke »

In chat with Carrepairer and zwzsg we come to this conclusion:

The singleplayer menu should show/disable on this condition:

Code: Select all

if ((Spring.GetModOptions()["XXX"] or not Spring.GetModOptions()["spmenu"]) and #Spring.GetPlayerList()>1) then
 Spring.Echo("singleplayermenu removed because multiplayer")
 widgetHandler:RemoveWidget()
spmenu = a modoption that the lobby sets when it launches the game. (does not exist in modoptions.lua of mod, it is just for this)
XXX = Any modoption a exists in the mod. For example kernel panic uses "ons", spring tank uses "gametimelimit"

It seems a bit strange but appearently this way is best, for example it still works when started via spring.exe (or via existing sp-launchers)

----

In its singleplayer menu weblobby now has a button "Launch game directly"
I tested it with spring tanks and it worked.
Once rapid is set up I will upload that mod version.

A few points mentioned in chat:
1) Would be nice if lobby could read a singleplayer_startscript.txt from mod.sdz and use that. Carrepairer wanted to look into it.

2) Until lobby can read such script, the game can still Spring.Restart itself with whatever script it wants. For example if there is supposed to be a "background battle game" running in menu. A bit silly that this would restart Spring twice, but for now good enought.

3) Atm weblobby seems to launch with the map "5", maybe because it is first one in maplist? A default map should be decided/created (tiny 2x2 map for faster loading of menu) or check if spring can somehow be started without map. (the new map generator thing?)

4) Spring.Restart has engine problems that block all this a bit: http://springrts.com/mantis/view.php?id=3840
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by Silentwings »

Would be nice if lobby could read a singleplayer_startscript.txt from mod.sdz and use that. Carrepairer wanted to look into it.
This! This seems to me by far the cleanest and easiest way to incorporate single player modes & missions into lobbies. I would definately use this for the ba:r missions/campaign if it existed.

Also it would be useful to have a setting in the .sdz that told the lobby whether to display this sdz as a mod or not (to prevent Mission 1/2/3/4/5.... and cluttering up the mod list if not wanted).

Would be nice to have Spring.Restart problems fixed (http://springrts.com/mantis/view.php?id=3840) since as far as I can see that's pretty much essential to mission based stuff. DeadNightWarrior came across the same issue on one of the engine testing threads.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: (all lobbies) lobbies and ingame menus/singleplayer

Post by knorke »

Silentwings wrote:Also it would be useful to have a setting in the .sdz that told the lobby whether to display this sdz as a mod or not (to prevent Mission 1/2/3/4/5.... and cluttering up the mod list if not wanted).
Already possible: modtype = 0 in
http://springrts.com/wiki/Modinfo.lua should make it hidden
I agree with the rest of course.
Post Reply

Return to “Lobby Clients & Server”