Re: [Warzone-dev] Map packs

2009-02-14 Thread Dennis Schridde
Am Samstag, 14. Februar 2009 08:40:30 schrieb Kreuvf:
 bugs buggy wrote:
  Inside the .info file itself would be all the author's name, and
  whatever else info the map pack creator wants to put inside it.  The
  game wouldn't ever read the contents of that file though.

 http://developer.wz2100.net/wiki/Organization_Proposal (it's a bit fucked
 up due to the move from mediawiki to tracwiki)
There is an even older proposal which deals with that already. It involves a 
Lua file storing some basic information about a .wz file, like author, 
license, included maps, etc. I even made a testing implementation looong time 
ago, but I cannot find it anymore. Possibly there is some info on this list 
about it.
So the idea is not new, just no one came around to implement it yet.

--DevU


signature.asc
Description: This is a digitally signed message part.
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread Giel van Schijndel
On Sat, Feb 14, 2009 at 02:19:28PM +0100, Dennis Schridde wrote:
 Am Samstag, 14. Februar 2009 08:40:30 schrieb Kreuvf:
 bugs buggy wrote:
 Inside the .info file itself would be all the author's name, and
 whatever else info the map pack creator wants to put inside it. The
 game wouldn't ever read the contents of that file though.

 http://developer.wz2100.net/wiki/Organization_Proposal (it's a bit
 fucked up due to the move from mediawiki to tracwiki)
 
 There is an even older proposal which deals with that already. It
 involves a Lua file storing some basic information about a .wz file,
 like author, license, included maps, etc.

I prefer using Lua instead of JSON syntax for the simple reason that the
syntax is quite similar but for Lua we don't need to implement any
parser ourselves.

 So the idea is not new, just no one came around to implement it yet.

It's hardly new indeed, and from what I recall it seems to be that every
time it was brought up we came to the conclusion that it's PhysicsFS'
API that was the limiting factor in implementing such a proposal.

So I suggest that this time we should be prepared to look past the
limitations of PhysicsFS and if necessary should be prepared to extend
PhysicsFS' API where required, obviously this should be done in
coordination with the PhysicsFS developers. To conclude: we shouldn't
let ourselves be limited by PhysicsFS' API.

-- 
Giel


signature.asc
Description: Digital signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread bugs buggy
On 2/14/09, Kreuvf kre...@warzone2100.de wrote:
 bugs buggy wrote:
   Well, seems that we can't use physFS to read a archive within a archive.
   We also can't tell what is the file for said map pack easily.

 You could do it the way Black NEXUS did it, although this surely has several
  drawbacks: http://wow-projekt.bplaced.net/warzone2100/black_nexus_mp1.wz


That is one of things that is crashing us now.
Host has that map pack.
User connecting don't.
game tries to send map, but since, it is in the map pack, it has no
idea how to deal with it, and it can't find anything to send.
If we send false on that condition, then the User still don't have the
map, and it requests the map again, and we run into a infinite loop.

My patch right now, has a force exit() to the host, since *all*
players must have that map pack to work correctly.
The other option would be to kick the user that don't have the map
pack.  And since we can't send messages on a kick, they will try to
connect again  again...

Which is the lesser of two evils?


   Inside the .info file itself would be all the author's name, and
   whatever else info the map pack creator wants to put inside it.  The
   game wouldn't ever read the contents of that file though.

 http://developer.wz2100.net/wiki/Organization_Proposal (it's a bit fucked up 
 due
  to the move from mediawiki to tracwiki)


   Would this be a good way to handle it?

 Could be wise to make a more general decision on it as you may want to bundle
  several mods as well.

  - Kreuvf

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread Zarel
2009/2/14 bugs buggy buginato...@gmail.com:
 That is one of things that is crashing us now.
 Host has that map pack.
 User connecting don't.
 game tries to send map, but since, it is in the map pack, it has no
 idea how to deal with it, and it can't find anything to send.
 If we send false on that condition, then the User still don't have the
 map, and it requests the map again, and we run into a infinite loop.

 My patch right now, has a force exit() to the host, since *all*
 players must have that map pack to work correctly.
 The other option would be to kick the user that don't have the map
 pack.  And since we can't send messages on a kick, they will try to
 connect again  again...

 Which is the lesser of two evils?

Well, first, we should fix that: Add the ability to send a message on
a kick, and depending on the message, have the client not
auto-reconnect.

And then, if each map contains its filename, they could all contain
the map pack name, and then the host could just send the entire map
pack to everyone.

- Zarel

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread Dennis Schridde
Am Samstag, 14. Februar 2009 15:29:52 schrieb Giel van Schijndel:
 I prefer using Lua instead of JSON syntax for the simple reason that the
 syntax is quite similar but for Lua we don't need to implement any
 parser ourselves.
Especially since we already link against Lua anyway.
Maybe I even find my code from back then, but even if, I am unsure whether 
everyone will like it. I would like Gerard, or someone else with experience in 
storing data in Lua, to have a look through it.

 On Sat, Feb 14, 2009 at 02:19:28PM +0100, Dennis Schridde wrote:
  So the idea is not new, just no one came around to implement it yet.

 It's hardly new indeed, and from what I recall it seems to be that every
 time it was brought up we came to the conclusion that it's PhysicsFS'
 API that was the limiting factor in implementing such a proposal.
I am not so sure. In fact the proposal originally was just about metadata, and 
module loading (dependency handling, dependencies between models and textures, 
etc), not about figuring out where a file comes from.
In fact I am not sure why the proposal for the latter, which I gave on the 
physfs mailinglist, does not work... Maybe someone can elaborate on that...


--DevU


signature.asc
Description: This is a digitally signed message part.
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread Dennis Schridde
Am Samstag, 14. Februar 2009 21:29:02 schrieb bugs buggy:
 On 2/14/09, Kreuvf kre...@warzone2100.de wrote:
  bugs buggy wrote:
Well, seems that we can't use physFS to read a archive within a
archive. We also can't tell what is the file for said map pack easily.
 
  You could do it the way Black NEXUS did it, although this surely has
  several drawbacks:
  http://wow-projekt.bplaced.net/warzone2100/black_nexus_mp1.wz

 That is one of things that is crashing us now.
 Host has that map pack.
 User connecting don't.
 game tries to send map, but since, it is in the map pack, it has no
 idea how to deal with it, and it can't find anything to send.
Why do we not just send just the binary data? I mean, we can load the map 
apparently. We can transmit blobs over the network, too. Everyone can receive 
blobs. We should be able to feed a datastructure with that blob. And then save 
it in a cache file for later reuse.
Does that not sound ok? Are there issues with that approach?

--DevU


signature.asc
Description: This is a digitally signed message part.
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread Dennis Schridde
Am Samstag, 14. Februar 2009 22:01:49 schrieb Zarel:
 Well, first, we should fix that: Add the ability to send a message on
 a kick, and depending on the message, have the client not
 auto-reconnect.
Different ticket, but it sound useful, yes.

 And then, if each map contains its filename, they could all contain
 the map pack name, and then the host could just send the entire map
 pack to everyone.
There is a nice utility which could break your dreams: mv
These assumptions may be violated by it:
 * each map contains its filename
 * they contain the map pack name

--DevU


signature.asc
Description: This is a digitally signed message part.
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread bugs buggy
On 2/14/09, Dennis Schridde devuran...@gmx.net wrote:
 Am Samstag, 14. Februar 2009 21:29:02 schrieb bugs buggy:

  On 2/14/09, Kreuvf kre...@warzone2100.de wrote:
bugs buggy wrote:
  Well, seems that we can't use physFS to read a archive within a
  archive. We also can't tell what is the file for said map pack easily.
   
You could do it the way Black NEXUS did it, although this surely has
several drawbacks:
http://wow-projekt.bplaced.net/warzone2100/black_nexus_mp1.wz
  
   That is one of things that is crashing us now.
   Host has that map pack.
   User connecting don't.
   game tries to send map, but since, it is in the map pack, it has no
   idea how to deal with it, and it can't find anything to send.

 Why do we not just send just the binary data? I mean, we can load the map
  apparently. We can transmit blobs over the network, too. Everyone can receive
  blobs. We should be able to feed a datastructure with that blob. And then 
 save
  it in a cache file for later reuse.
  Does that not sound ok? Are there issues with that approach?

  --DevU

That is a ton more work, to send mapname/*.* and then recreate the
mapname.addon.lev file so the game can find it.
Right now, they merged the info from all the *.addon.levs into one
huge *.addon.lev file.

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread bugs buggy
On 2/14/09, Dennis Schridde devuran...@gmx.net wrote:
 Am Samstag, 14. Februar 2009 15:29:52 schrieb Giel van Schijndel:

  I prefer using Lua instead of JSON syntax for the simple reason that the
   syntax is quite similar but for Lua we don't need to implement any
   parser ourselves.

 Especially since we already link against Lua anyway.
  Maybe I even find my code from back then, but even if, I am unsure whether
  everyone will like it. I would like Gerard, or someone else with experience 
 in
  storing data in Lua, to have a look through it.


   On Sat, Feb 14, 2009 at 02:19:28PM +0100, Dennis Schridde wrote:

   So the idea is not new, just no one came around to implement it yet.
  
   It's hardly new indeed, and from what I recall it seems to be that every
   time it was brought up we came to the conclusion that it's PhysicsFS'
   API that was the limiting factor in implementing such a proposal.

 I am not so sure. In fact the proposal originally was just about metadata, and
  module loading (dependency handling, dependencies between models and 
 textures,
  etc), not about figuring out where a file comes from.
  In fact I am not sure why the proposal for the latter, which I gave on the
  physfs mailinglist, does not work... Maybe someone can elaborate on that...


From the physfs ML:
If you know where you mounted the directory/archive, you should be able to
reconstruct the full path. (Maybe there is also a function to give you the
mountpoint of an archive, I do not know that off hand.)

virtual_filename;
archive_filename = getRealDir(...);
archive_mountpoint = figure_out_mountpoint(archive_filename);
relative_filename = subst(archive_mountpoint, , virtual_filename);
full_filename = archive_filename + relative_filename;

But generally I assume it is discouraged to care about the real filename,
since this complicates the whole stuff, also in places where you might
not yet think about.

After we get the RealDir(), we then enumerate all files in that directory.
We would have to read each archive to find the map in question.
What happens if more than one map pack has the same map name? Physfs
can't tell us which it is reading from, so what would we do in that
case?

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread Dennis Schridde
Am Samstag, 14. Februar 2009 23:18:51 schrieb bugs buggy:
 On 2/14/09, Dennis Schridde devuran...@gmx.net wrote:
  Am Samstag, 14. Februar 2009 21:29:02 schrieb bugs buggy:
   On 2/14/09, Kreuvf kre...@warzone2100.de wrote:
 bugs buggy wrote:
   Well, seems that we can't use physFS to read a archive within a
   archive. We also can't tell what is the file for said map pack
   easily.

 You could do it the way Black NEXUS did it, although this surely has
 several drawbacks:
 http://wow-projekt.bplaced.net/warzone2100/black_nexus_mp1.wz
   
That is one of things that is crashing us now.
Host has that map pack.
User connecting don't.
game tries to send map, but since, it is in the map pack, it has no
idea how to deal with it, and it can't find anything to send.
 
  Why do we not just send just the binary data? I mean, we can load the map
   apparently. We can transmit blobs over the network, too. Everyone can
  receive blobs. We should be able to feed a datastructure with that blob.
  And then save it in a cache file for later reuse.
   Does that not sound ok? Are there issues with that approach?
 
   --DevU

 That is a ton more work, to send mapname/*.* and then recreate the
 mapname.addon.lev file so the game can find it.
 Right now, they merged the info from all the *.addon.levs into one
 huge *.addon.lev file.
There was a proposal to remove the need for those files. ;)

--DevU


signature.asc
Description: This is a digitally signed message part.
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-14 Thread Dennis Schridde
Am Samstag, 14. Februar 2009 23:18:51 schrieb bugs buggy:
 On 2/14/09, Dennis Schridde devuran...@gmx.net wrote:
  Am Samstag, 14. Februar 2009 21:29:02 schrieb bugs buggy:
   On 2/14/09, Kreuvf kre...@warzone2100.de wrote:
 bugs buggy wrote:
   Well, seems that we can't use physFS to read a archive within a
   archive. We also can't tell what is the file for said map pack
   easily.

 You could do it the way Black NEXUS did it, although this surely has
 several drawbacks:
 http://wow-projekt.bplaced.net/warzone2100/black_nexus_mp1.wz
   
That is one of things that is crashing us now.
Host has that map pack.
User connecting don't.
game tries to send map, but since, it is in the map pack, it has no
idea how to deal with it, and it can't find anything to send.
 
  Why do we not just send just the binary data? I mean, we can load the map
   apparently. We can transmit blobs over the network, too. Everyone can
  receive blobs. We should be able to feed a datastructure with that blob.
  And then save it in a cache file for later reuse.
   Does that not sound ok? Are there issues with that approach?
 
   --DevU

 That is a ton more work, to send mapname/*.* and then recreate the
 mapname.addon.lev file so the game can find it.
 Right now, they merged the info from all the *.addon.levs into one
 huge *.addon.lev file.
There was a proposal to remove the need for those files. ;)
(Though, again, originaly for a different reason.)

--DevU



signature.asc
Description: This is a digitally signed message part.
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


[Warzone-dev] Map packs

2009-02-13 Thread bugs buggy
Well, seems that we can't use physFS to read a archive within a archive.
We also can't tell what is the file for said map pack easily.

I was thinking since we look for *.addon.lev files anyway, we could
also check for map_pack_name.info (or whatever) and then we can use
physFS getRealDir() to find the directory that is in, and use
'map_pack_name', append .wz to it, stick this in some global map
storage array, and then if the game can't find mapname.wz, we look in
the global map storage array for the correct name to use, then we can
send the whole thing that way.

Inside the .info file itself would be all the author's name, and
whatever else info the map pack creator wants to put inside it.  The
game wouldn't ever read the contents of that file though.

Would this be a good way to handle it?
Or do we just not allow map packs at all, and just have mapname.wz as
the only supported map that the game can send?

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Map packs

2009-02-13 Thread Kreuvf
bugs buggy wrote:
 Well, seems that we can't use physFS to read a archive within a archive.
 We also can't tell what is the file for said map pack easily.
You could do it the way Black NEXUS did it, although this surely has several
drawbacks: http://wow-projekt.bplaced.net/warzone2100/black_nexus_mp1.wz

 Inside the .info file itself would be all the author's name, and
 whatever else info the map pack creator wants to put inside it.  The
 game wouldn't ever read the contents of that file though.
http://developer.wz2100.net/wiki/Organization_Proposal (it's a bit fucked up due
to the move from mediawiki to tracwiki)

 Would this be a good way to handle it?
Could be wise to make a more general decision on it as you may want to bundle
several mods as well.

- Kreuvf

___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev