[DONE] Spring.LoadMap - Page 2

[DONE] Spring.LoadMap

A place for offers of Bounties and discussion of funded proposals.
User avatar
Silentwings
Moderator
Posts: 3432
Joined: 25 Oct 2008, 00:23

Re: [Funded] Spring.LoadMap

Post by Silentwings » 13 Jan 2015, 20:26

Ok, awesome, in that case my preference would be for Spring.Reload("startScript") as the priority, since afaics thats strictly greater flexibility and its naturally compatible with ZKs mission editor. smoth?
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: [Funded] Spring.LoadMap

Post by smoth » 13 Jan 2015, 20:36

I hate zk's mission approach, I do not use ZKL, I intend on using lualobby and whatever gajop cooks up as far as his mission system goes.
Kloot wrote:
smoth wrote:I still want to know if we can have a table to carry data between maploads or would GG/WG be already persistent? What would be reloaded at map load? What would be kept? 2 important questions IMO
As things stand now, it will actually be the same amount of work to implement a general Spring.Reload(setupScript) (functionally similar to but less crude than Spring.Restart, and covers the first extension in Silentwing's OP) as it will be to add Spring.LoadMap(mapName), which means that you could use the setup-script to carry data forward.
When I say a table I figure that would be as flexible as can be. Keep in mind my game DOES NOT even use spring's internal resources. for me most things are lua driven. There may already be a mechanism for it. so if there is a string in the setup-script(whatever that would look like) I can always parse that into a table as long as I can access that in lua, that is all I care about, I am not picky kloot.

Not sure if you can answer this but will this be able to keep a lualobby connection(because of no script reset) open during load or will there be a sort of general gadget/widget/wupget script reset after the map loads?
0 x

User avatar
Silentwings
Moderator
Posts: 3432
Joined: 25 Oct 2008, 00:23

Re: [Funded] Spring.LoadMap

Post by Silentwings » 13 Jan 2015, 20:39

I hate zk's mission approach, I do not use ZKL,
My point is the ZK mission editor (which is standalone) can generate a startscript and matching (mutator) sdz that run the mission. The mission can then be used independently of any ZK infrastructure, so it is viable as a general tool. This is also a natural format for missions in general imo.
if there is a string in the setup-script(whatever that would look like)
There are custom player params in the start script - SPADS passes in tables of data that way (for players trueskill values) so I'm sure it could done in e.g. custom params of gaia.
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: [Funded] Spring.LoadMap

Post by smoth » 13 Jan 2015, 20:45

so is this script going to require us writing to and reading a file or is it some variable/table we read?
0 x

User avatar
Silentwings
Moderator
Posts: 3432
Joined: 25 Oct 2008, 00:23

Re: [Funded] Spring.LoadMap

Post by Silentwings » 13 Jan 2015, 20:48

Players custom params can be read with

Code: Select all

customtable = select(10,Spring_GetPlayerInfo(playerID))
and it is there as a lua table. I am not sure what it looks like inside the startscript, but I doubt its anything hard to make.
0 x

Kloot
Spring Developer
Posts: 1842
Joined: 08 Oct 2006, 16:58

Re: [Funded] Spring.LoadMap

Post by Kloot » 15 Jan 2015, 21:25

FWIW this is now ready for preliminary testing.

Due to http://springrts.com/mantis/view.php?id=4607 builds are unavailable, so for the time being your only option is to self-compile them.

Besides the Spring.Reload callout, the branch also adds quit-to-menu functionality which is accessible by:

1) typing /reloadforce into the console, or
2) bringing up the quit-box (shift+esc) and choosing "quit to menu", or
3) hitting alt+shift+esc

(if you want to do this programmatically, passing an empty string to Spring.Reload has the same effect)

Fun fact: a new demo will be created every time you trigger a reload, so all the usual goodies like letting players share their campaign progress are possible too.
0 x

Kloot
Spring Developer
Posts: 1842
Joined: 08 Oct 2006, 16:58

Re: [Funded] Spring.LoadMap

Post by Kloot » 16 Jan 2015, 19:56

backers: please test http://springrts.com/dl/buildbot/defaul ... 266/win32/ (with thanks to abma)
0 x

abma
Spring Developer
Posts: 3493
Joined: 01 Jun 2009, 00:08

Re: [Funded] Spring.LoadMap

Post by abma » 16 Jan 2015, 22:23

hmm, on linux things behave weird to me:

Code: Select all

/quit seems to be ignored
ESC is ignored (it shows up with /keydebug enabled as action=crudemenu)
alt+shift+esc is ignored, too, but maybe captured by the windowmanager
shift-esc is ignored
/quit & /forcequit are ignored, too it seems
/reloadforce works, i get into the menu. didn't test the script way (yet)

using 98.0.1-304-g9160266

hmm, did i fuck up keyboard settings maybe?!
0 x

Kloot
Spring Developer
Posts: 1842
Joined: 08 Oct 2006, 16:58

Re: [Funded] Spring.LoadMap

Post by Kloot » 16 Jan 2015, 22:38

I removed /quit because that only aliased to /quitforce (there has never been a "forcequit"), it was not a real action. You just need to rebind Esc, by default it should trigger /quitmessage unless you have ancient bindings.

Most *nix window managers indeed capture Alt (which is a PITA), on Windows it should work though.
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: [Funded] Spring.LoadMap

Post by smoth » 17 Jan 2015, 01:57

so we can use a spring.reload call to change maps in that test version? What is it you want us to try out? I am kinda confused
0 x

Kloot
Spring Developer
Posts: 1842
Joined: 08 Oct 2006, 16:58

Re: [Funded] Spring.LoadMap

Post by Kloot » 17 Jan 2015, 02:36

You can change the map (or reload the current one) and the game, teams and allyteams, etc.

This example might make it more obvious.

Mess around with gametype and mapname, see if it crashes or behaves funnily, that kind of thing.

If no bugs turn up, then the branch is essentially ready to be merged and what remains is polish (if and where needed).
0 x

User avatar
Silentwings
Moderator
Posts: 3432
Joined: 25 Oct 2008, 00:23

Re: [Funded] Spring.LoadMap

Post by Silentwings » 17 Jan 2015, 18:26

Ok, I did some testing and it looks great! The vanilla example from above worked and I also successfully reloaded BAR from its usual state into a BAR campaign mission that was made with the ZK mission editor.

The infolog (http://pastebin.com/a1Udz5FF) contained one odd thing (this one is the from the vanilla example modified to reload BA 8.06).

[code]
[f=0000000] Warning: Overwriting command: viewfps
[f=0000000] Warning: Overwriting command: viewta
[f=0000000] Warning: Overwriting command: viewspring
[f=0000000] Warning: Overwriting command: viewrot
[f=0000000] Warning: Overwriting command: viewfree
[f=0000000] Warning: Overwriting command: viewov
[f=0000000] Warning: Overwriting command: viewtaflip
[f=0000000] Warning: Overwriting command: toggleoverview
[f=0000000] Warning: Overwriting command: togglecammode
[f=0000000] Warning: Overwriting command: viewsave
[f=0000000] Warning: Overwriting command: viewload
[f=0000000] Game::LoadInterface (Camera&Mouse): 75 ms
[f=0000000] Game::LoadInterface (Console): 9 ms
[f=0000000] Warning: Overwriting command: bind
[f=0000000] Warning: Overwriting command: unbind
[f=0000000] Warning: Overwriting command: unbindall
[f=0000000] Warning: Overwriting command: unbindkeyset
[f=0000000] Warning: Overwriting command: unbindaction
[f=0000000] Warning: Overwriting command: keydebug
[f=0000000] Warning: Overwriting command: fakemeta
[f=0000000] Warning: Overwriting command: keyload
[f=0000000] Warning: Overwriting command: keyreload
[f=0000000] Warning: Overwriting command: keysave
[f=0000000] Warning: Overwriting command: keyprint
[f=0000000] Warning: Overwriting command: keysyms
[f=0000000] Warning: Overwriting command: keycodes
[f=0000000] [KeyBindings] Warning: Bind: could not parse key: Alt+Shift+esc[/code]

which occured only after the reload. (Note that there is also http://springrts.com/mantis/view.php?id=4648 visible in the infolog, but those errors occur in the current develop too).

So far I only tried "nice" things. I'll have a go at breaking it in the next few days. (Do you want Spring.Reload stuff reported to this thread or mantis?)
0 x

Kloot
Spring Developer
Posts: 1842
Joined: 08 Oct 2006, 16:58

Re: [Funded] Spring.LoadMap

Post by Kloot » 17 Jan 2015, 20:22

Fixed, new build can be grabbed here: http://springrts.com/dl/buildbot/defaul ... 140/win32/ http://springrts.com/dl/buildbot/defaul ... b78/win32/ http://springrts.com/dl/buildbot/defaul ... 14c/win32/

If you find anything serious it's best to use mantis, but for minor issues this thread is fine too.
Last edited by Kloot on 20 Jan 2015, 12:51, edited 1 time in total.
0 x

abma
Spring Developer
Posts: 3493
Joined: 01 Jun 2009, 00:08

Re: [Funded] Spring.LoadMap

Post by abma » 19 Jan 2015, 18:31

minor:

spring-headless --test-creg "fails":

Code: Select all

14: Warning: CREG Results: 14 of 198 classes are broken
14: Error: 13 broken classes of CREG ignored
http://buildbot.springrts.com/builders/ ... uilds/2717

(either increase # of ignored classes or fix one class which got broken)

couldn't find any other issue (yet). looks great, thanks!
0 x

abma
Spring Developer
Posts: 3493
Joined: 01 Jun 2009, 00:08

Re: [Funded] Spring.LoadMap

Post by abma » 29 Jan 2015, 00:26

ok, today i found more time to test it a lot better. i found some bugs which kloot fixed, and now everything seems to work. i've used kernel panic for testing as it already has a menu which uses Spring.Restart() (which internally uses the same function as Spring.Reload())


from my point everything here worked pretty well.

thoughts from kloot & funders?

what could be the next project?
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: [Funded] Spring.LoadMap

Post by smoth » 29 Jan 2015, 01:14

I am still not sure how to use it, did we end up getting the ability to specify the script with load? I don't really understand. forgive me, I could probably read the code to get the commands but IRL is pulling hard and I just cannot prioritize this.
0 x

abma
Spring Developer
Posts: 3493
Joined: 01 Jun 2009, 00:08

Re: [Funded] Spring.LoadMap

Post by abma » 29 Jan 2015, 01:17

smoth wrote:I am still not sure how to use i
this is how:

Code: Select all

Spring.Reload("<copy and paste script.txt here>")
0 x

User avatar
smoth
Posts: 22295
Joined: 13 Jan 2005, 00:46

Re: [Funded] Spring.LoadMap

Post by smoth » 29 Jan 2015, 01:21

oh my god!?!? it is that simple? I can just build string, fire string into command!?!??! HOLY!

So wait I thought mod and map options don't work? can't I put them in the script text?
0 x

abma
Spring Developer
Posts: 3493
Joined: 01 Jun 2009, 00:08

Re: [Funded] Spring.LoadMap

Post by abma » 29 Jan 2015, 01:39

its more the question what you can't do:

https://github.com/spring/spring/blob/d ... Format.txt

this should allow missions in a nice way without the need of doing a full restart of spring. see the kernel panic missions/menu.
0 x

User avatar
Silentwings
Moderator
Posts: 3432
Joined: 25 Oct 2008, 00:23

Re: [Funded] Spring.LoadMap

Post by Silentwings » 29 Jan 2015, 09:50

thoughts from kloot & funders?
I think it went extremely well. We got the best result that was originally discussed in terms of functionality, which afaics will be used in the single player mode of every Spring game. Thanks Kloot!

It might be useful for future bounties to know that you can send money without only tiny charges (and without needing the name/address of the recipient) using TransferWise within the EU and from anywhere to anywhere using PayPal.
what could be the next project?
From the point of view of single player stuff, the natural next step is pr-downloader support from Lua, which is already wip by gajop. For LuaLobby, I guess a big issue is wanting to have persistent LuaSocket connections through the reload.

There are a few of things that I expected to come up as bounty discussions but which didn't. I'm not particularly attached to any of them, I just had the impression that others might be:
(1) Mesh deformation.
(2) Support for more model formats.
(3) A unified map making tool.
I don't know about either of these to make a well defined bounty project out of them, or even judge if its they are reasonable goals. They should have their own thread if anyone wants to try and organize them ;)
0 x

Post Reply

Return to “Bounty Offers”

cron