spring / menu-game.sdd

1 stars 1 forks source link

"game selection menu" with startscripts and Spring.Reload() #1

Closed knorker closed 9 years ago

knorker commented 9 years ago

tl;dr http://youtu.be/YNCj50dmgB8

game SELECTION menu instead of match SETUP

If one thing was learned early in discussion of singleplayer it is this:

any meaningful single player interface has to be tailored to each game specifics anyway. ( https://springrts.com/phpbb/viewtopic.php?f=10&t=24628&p=458938#p458938 )

Making one menu that allows to SETUP a match (map, game, AIs, modoptions, missions...) of every game seems impossible: games have too different needs with regard to which AI or maps should be allowed. Or how their missions/tutorials/menu works like. Or even just the graphical style.

So instead the menu could present a neutral CHOICE of games. The chosen game is launched and can then handle the finer details (map, AIs,..) itself.

DEMO VIDEO

http://youtu.be/YNCj50dmgB8 what video shows: 1) From a list of games "Kernel Panic" is selected & started. 2) Then from the KP-menu a KP-mission is played. 3) After some playing, the KP-menu is opend and KP is exited. This returns to the game-menu. 5) Now a different game "Spring Tanks" is started. 6) A skirmish is played from the ST-menu. 7) After some playing, the ST-menu is opend and ST is exited. This returns to the game-menu, again.

FILES

menu-game2.sdd.zip https://drive.google.com/file/d/0B_RsfS6gZgyLSFVSQ1E0UzFrOFk/view?usp=sharing unpacked to springcontent\games\menu-game2.sdd\

For testing also needed are games that have the "return-to-menu" functionality and a map.

1) map "Ternion" - http://springfiles.com/spring/spring-maps/ternion 2) game "Spring Tanks" - http://packages.springrts.com/builds/springtanks-7.0.sdz 3) unofficially modified game "Kernel Panic" - https://drive.google.com/file/d/0B_RsfS6gZgyLZGFZSHp6b2hZa00/view?usp=sharing 4) tested with spring_{develop}98.0.1-375 5) not strictly required: at least one map that KP/ST use.

Note that only "Kernel Panic" & "Spring Tanks" actually work in the example, "BA" and "NOTA" are just added to show the idea.

STANDARDS / open questions

While technically things can already work, there remain some questions where a common solution/cooperation is needed.

HOW IS THE LIST OF GAMES IN MENU CREATED?

It is not feasible that the menu-game lists every mod that the user has installed because: -some mods have no singleplayer -dozen of different versions per mod, only latest version should be shown

Atm it is just a hard-coded table in widgets\tp_gameselection_menu_demo.lua like this:

games = {
...
    {name="Kernel Panic",
    text="Digital warfare in cyberspace.",
    archive="kernel_panic_4.6_edit.sd7"
    },
...

Possible other ways are: a) game-makers can edit the menu-game b) menu-game can somehow download a new list c) menu-game/spring.exe learns to use rapid tags, like kernel-panic:stable instead of kernel_panic_4.6.sd7 and then also somehow download the file.

HOW IS A GAME STARTED

Atm there is simply a hardcoded start-script like this: ´´´ [game] { Mapname=Ternion; GameType=XYZ.sdz]] } .... ´´´ The "GameType"-tag is inserted according to selected game. Then Spring.Reload(startscript) loads the game.

NOTE: I did not manage to make a shorter, more "minimal" startscript. (Kloot's example pastebin expired... https://springrts.com/phpbb/viewtopic.php?f=86&t=32893&start=20#p564834 )

HOW DOES A GAME KNOW IF TO OPEN ITS MENU?

The game has to decide if to show its single-player menu or not. For ex. in a multiplayer-match the SP-menu should of course not show.

One way would be game-menu launches the game with a special parameter. For example a modoption in the startscript. In chats between Carrepairer, zwzsg, knorke this was decided as good solution: https://springrts.com/phpbb/viewtopic.php?f=64&t=30376&p=543251&hilit=spmenu#p543251 (however beside brief testing in KP, ST and weblobby never really implented anywhere because among other things Spring.Restart was broken at that time.)

Either way: This is something that needs to be decided.

HOW DOES THE PLAYER RETURN FROM PLAYING TO THE MENU?

Again with a startscript and Spring.Reload() Basically instead of Spring.SendCommands ("forcequit") games would change their Quit-button to this:

function returnToSpringGameSelectionMenu ()
-------------------
--startscript to return the "select game mod" TEST
startScript = [[
[game]
{
Mapname=Ternion;
GameType=menu-game2.sdd;
....
]]
Spring.Reload (startScript)
end

That is a rather small change, see kernel_panic_4.6_edit.sd7\LuaUI\Widgets\kp_spring_direct_launch.lua :

local function Quit()
--  Spring.SendCommands("quit")
--  Spring.SendCommands("quitforce")
returnToSpringGameSelectionMenu()
end

Or L142 as another example: https://code.google.com/p/springtanks/source/diff?spec=svn11&r=11&format=side&path=/trunk/luaui/widgets/tp_singleplayermenu.lua

-> A standard-way must be decided. (for example a standard startscript) ->Should the engine ever be changed to include some menu-game, and should this menu-game replace the current "spring.exe beach menu" then maybe this might be enough: Spring.SendCommands ("reloadforce") or something

knorker commented 9 years ago

note 1: This is just "quick & dirty demo" of the general thing. Of course in the menu many things could be blocked (like F1-F4 keys, "fighting" the camera,..) but think it is obvious how those can be done. code itself is also just thrown together, some important parts (like mentioned above) need decisions before they can be made better...

note 2: I checked out the menu-game.sdd from this github, but it did not load. Seems there are too many files missing. After some tries to add things like depend="cursors.sdz" I gave up and: -used the "B mod" from springABC as base. -added chiliUI by downloading https://github.com/jk3064/chiliui/archive/master.zip As result there are probally some unnessecary files.

abma commented 9 years ago

the default engine menu should allow both imo (game selection AND match setup)

also it should be able to download game/map(s), connect to lobby, configure settings, etcetc.

why do you want to restrict the default menu to game selection only?

also most games atm don't have a menu.

knorker commented 9 years ago

the default engine menu should allow both imo (game selection AND match setup)

Why?

Giving the player easy access to play games as they were designed to be played, with tutorials, missions, maplist, working AI etc should imo be by far the most important goal.

also most games atm don't have a menu.

1) Game has no menu = game has no singleplayer content = why should a player who wants to play SP care about it? 2) "ATM" = it will change.

why do you want to restrict the default menu to game selection only?

Explained in the first section "game SELECTION menu instead of match SETUP": Games have different needs for menus. Compare the menus of KP, GRTS, ST: despite being very prototype-ish they are already very different. Should more singleplayer content be made (tutorials, missions) then that trend will continue and menus will become even more tailored to their games.

Even if some standards could be agreed on -- like validmaps.lua, validAIs.lua, which modoptions to hide (many mods have lots of debug stuff that players should not see) -- etc: The one-fits-all will NEVER be as good as a SP menu made to fit the game.

With a one-fits-all-menu missions are limited to something that works with some to-be-agreed standard, which must be fairly limited to avoid feature-creep. So it might just be a boring dropdown-menu or something.

On other hand, a game-tailored is free to do what the creator imagines. A campaign could look like this: http://fc03.deviantart.net/fs70/i/2013/041/3/b/campaign_mission_selection_by_skihaas1-d5uj2f9.jpg or http://www.androidtapp.com/wp-content/uploads/2013/01/Ant-Raid-Level-select.png

A one-fits-all pregame setup is limited to setup modoptions in some un-attractive, general ways. A game-tailored pregame setup can look like this: http://www.notadota.com/sites/default/files/styles/800x600/public/field_image/lobby.jpg

http://quickgamer.net/wp-content/uploads/2013/12/League-of-War-squad-setup.jpg

http://www.matchstickeyes.com/wp-content/uploads/2014/08/WALB-Starter-Deck-West-Germany-1024x576.jpg

That are just two examples where it is impossible to standardize. Offer an example-menu, if you want, similiar to how there are example widgets. Thinking that all games to use the same things is a dead end and short sighted.

Of course there can be other buttons, like "edit engine settings." Or even some "one-fits-all" fallback for unsupported games, although imo that would be little more than a noob-trap. mock-up: sp menu with other stuff

MP-lobbies: They could be much more player-friendly if they were tailored to one game, too. (that trend is also already visible with zero-K lobby and NOTA lobby. ) But not fragmenting the online playerbase too much over minor things is maybe more important. It is a borderline case. However, it is unrelated to SP.

There should probally also be some way to acess the old beach-menu, because it is important for modding/troubleshoting. Could be a startparameter "spring.exe --oldmenu" or similiar.

abma commented 9 years ago

sorry, there is no need for discussion any more. the suggestion i made allows to implemnt your stuff and my stuff, no need to discuss whats right or wrong, it just needs to be made.

knorker commented 9 years ago

Is it worth the time to figure out how pull-requests or commiting works?

Or (since currently menu-game.sdd is empty anyway) is https://drive.google.com/file/d/0B_RsfS6gZgyLSFVSQ1E0UzFrOFk/view?usp=sharing enough?

Or will it be blocked anyway?

It is obviously not perfect but maybe "better than nothing" and there is two example mods to test with.

gajop commented 9 years ago

No idea if it would be accepted or not if a pull request were to be made, but it certainly won't be accepted (or probably even looked at) until it is. Even if it's bad, some parts of it could be used -> so do it.

knorker commented 9 years ago

things already moved on and so did i.