Dear lobby devs: please read validmaps.lua from games

Dear lobby devs: please read validmaps.lua from games

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

Moderators: Moderators, Lobby Developers

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

Dear lobby devs: please read validmaps.lua from games

Post 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)
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

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

Post by danil_kalina »

Let Satirik tell us more about how he implemented that
User avatar
Cheesecan
Posts: 1571
Joined: 07 Feb 2005, 21:30

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

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

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

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

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

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

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

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

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

Post by Cheesecan »

Okey, added this to my todo list.
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

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

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

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

Post by knorke »

Cheesecan wrote:Okey, added this to my todo list.
nice, thanks.
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

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

Post 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?
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

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

Post by danil_kalina »

thanks
Satirik
Lobby Developer
Posts: 1688
Joined: 16 Mar 2007, 18:27

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

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6193
Joined: 29 Apr 2005, 01:14

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

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

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

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

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

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

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

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

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

Post 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
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14637
Joined: 17 Nov 2005, 02:43

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

Post 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*
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

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

Post 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);
User avatar
koshi
Lobby Developer
Posts: 1059
Joined: 14 Aug 2007, 16:15

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

Post by koshi »

yes
Post Reply

Return to “Lobby Clients & Server”

cron