Page 1 of 2

Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 15:00
by knorke
Games can include a file validmaps.lua that tells lobbies/players what maps the game should be played on.
At the moment, no game includes such file but I guess one reason is that currently all but one lobby ignore it anyway.
That lobby is TASClient.

validmaps.lua simply looks like:

Code: Select all

return {
   "DesertCliffsV1",
   "Eye_Of_Horus_v2",
}
and I guess that information can somehow be returned from unitsync.dll but I don't even.
(if an example mod is needed for testing I can upload something but just putting above example in some unzipped mod should work too)

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 15:43
by danil_kalina
Let Satirik tell us more about how he implemented that

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:01
by Cheesecan
knorke wrote: At the moment, no game includes such file but I guess one reason is that currently all but one lobby ignore it anyway.
Yes lobby devs have tuesday night meetings to discuss gnosis.

edit: Also are you going to update the game each time a new map is released?

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:15
by knorke
I just wanted to say that such feature exists in unitsync and that it would be cool if lobbies include it.
edit: Also are you going to update the game each time a new map is released?
If by "the game" you mean "your game", then yes. (due to certain lua blabla i added, i need to do that anyway but that is ot)
But see the linked wiki entry, validmaps is not just a static list of map names.
You can also "return playable" for all mapnames with a certain prefix ("CT_RoundhouseCanyon") and stuff like that.
And of course as we currently see, games do not need to include the file.

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:17
by Cheesecan
And you don't see a problem in having to do that?

Would be a lot better if you fetched an always up-to-date validmaps from the intertubes.

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:30
by knorke
And you don't see a problem in having to do that?
Nope.
I do not expect anybody to make maps especially for my game (though that would be nice but I am realistic) so no mapper will be disappointed by having his map not playable with my game.
Would be a lot better if you fetched an always up-to-date validmaps from the intertubes.
well if you want to add that to your lobby, would work too. Though not for LAN or offline play.
For a map to be playable with my game it also needs a config file to be included with the game. (to spawn certain stuff like captureable oil pumps, minerals and stuff) So just getting a maplist from intertubes would not be enough.

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:41
by Cheesecan
Okey, added this to my todo list.

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:44
by Satirik
http://springrts.com/dl/docs/unitsync/g ... __api.html
Cheesecan wrote:Also are you going to update the game each time a new map is released?
It's lua, and lua can retreive your map list and make either a white or black list

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:52
by knorke
Cheesecan wrote:Okey, added this to my todo list.
nice, thanks.

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:57
by koshi
Apparently I started on this a while back but abandoned it swiftly
http://cgit.springlobby.info/cgit/koshi ... 67d43e30d2
Prolly because no one had any interest in it? Does any game dev but knorke have use for this?

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 17:59
by danil_kalina
thanks

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 18:11
by Satirik
Maybe it should be renamed (in the lobby not in unitsync) to "Recommended maps" with an option to display all maps or just recommended ones

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 18:17
by FLOZi
koshi wrote:Apparently I started on this a while back but abandoned it swiftly
http://cgit.springlobby.info/cgit/koshi ... 67d43e30d2
Prolly because no one had any interest in it? Does any game dev but knorke have use for this?
Yup.

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 18:46
by zwzsg
Satirik wrote:Maybe it should be renamed (in the lobby not in unitsync) to "Recommended maps" with an option to display all maps or just recommended ones
I'd like that too.

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 19:15
by knorke
Satirik wrote:Maybe it should be renamed (in the lobby not in unitsync) to "Recommended maps" with an option to display all maps or just recommended ones
"Recommended maps" seems a bit "soft", as if those maps are "maps of the week" or something like that.
Maybe a checkbox:
[x] only show maps known to be compatible
(which you have to manually uncheck (every time? or at least for each game, because noobs.))
Basically it should be an option a player would never ever want to use and mostly be for devs or mappers.
---
I guess all games that use unique maps or rely on per-map configs would have a use for it. (so atm s44, kp, ct)

Btw, similiar to this, ValidAIs.lua would be nice to have, because an important question is "How do I make sure that a noobs first SP skirmish is not on speedmetal vs NullAI?"

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 19:30
by zwzsg
Whatever the exact wording lobby use:
- If ValidMaps.lua was strictly enforced I wouldn't use it KP
- If ValidMaps.lua was ON by default and recommended but still easily overridable I would use it for KP.

Then I understand why other mod(ders) would have a stronger stance.

As for ValidAIs.lua, yeah, need it too!

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 18 Jan 2012, 21:22
by smoth
knorke wrote:Btw, similiar to this, ValidAIs.lua would be nice to have, because an important question is "How do I make sure that a noobs first SP skirmish is not on speedmetal vs NullAI?"
do want

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 19 Jan 2012, 20:13
by Forboding Angel
koshi wrote:Apparently I started on this a while back but abandoned it swiftly
http://cgit.springlobby.info/cgit/koshi ... 67d43e30d2
Prolly because no one had any interest in it? Does any game dev but knorke have use for this?
I do *shrug*

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 03 Mar 2012, 13:38
by danil_kalina
This code below is for validmaps.lua ?

Code: Select all

/**
 * @brief Retrieve the number of valid maps for the current mod
 * @return negative integer (< 0) on error;
 *    the number of valid maps (>= 0) on success
 *
 * A return value of 0 means that any map can be selected.
 * Be sure to map the mod into the VFS using AddArchive() or AddAllArchives()
 * prior to using this function.
 */
EXPORT(int         ) GetModValidMapCount();
/**
 * @brief Retrieve the name of a map valid for the current mod
 * @return NULL on error; the name of the map on success
 *
 * Map names should be complete  (including the .smf or .sm3 extension.)
 * Be sure you have made a call to GetModValidMapCount() prior to using this.
 */
EXPORT(const char* ) GetModValidMap(int index);

Re: Dear lobby devs: please read validmaps.lua from games

Posted: 03 Mar 2012, 13:45
by koshi
yes