zturtleman / spearmint

Spearmint — an updated id Tech 3 engine for continuing the classics and creating new games.
https://clover.moe/spearmint
GNU General Public License v3.0
239 stars 27 forks source link

Allow pure servers to auto download models that the server has when on a LAN as well as on the Internet #267

Open rawr51919 opened 8 years ago

rawr51919 commented 8 years ago

When connecting to an Internet server, the auto-download function downloads models used by the server, but when you connect to a LAN, the auto-download feature doesn't auto download missing models from the server (the connecting client uses the default model instead). Can you make it so that way it will auto download models used by the server on a LAN connection as well as missing maps, @zturtleman? ioquake3 & legacy Q3A both suffer from this model auto-downloading weirdness, as well as Spearmint.

zturtleman commented 8 years ago

This isn't an Internet vs LAN thing. The server only advertises referenced pk3s to clients. In ioquake3 & legacy Q3A all pk3s in fs_game directory get marked as referenced but only pk3s that the server reads files from get marked in baseq3. In Spearmint, only pk3s that the server reads files from get marked (regardless of game directory). Player models are entirely client side, server doesn't read their files.

This is one of the side affects of not having real addon management.

rawr51919 commented 8 years ago

But what if someone wanted your model while you're hosting a LAN on your server over on their side, @zturtleman? They should be able to download that model from the LAN server as well. This was a side effect that was bugging me. The server should check to see if the model exists on the connecting client (& has the same checksum as the server), then if it doesn't or if the model checksum doesn't match the server's on that client's side, that client will auto-download the server copy from said server if either the first is true or if the second is true.

On 6/12/16, ZTM notifications@github.com wrote:

This isn't an Internet vs LAN thing. The server only advertises referenced pk3s to clients. In ioquake3 & legacy Q3A all pk3s in fs_game directory get marked as referenced but only pk3s that the server reads files from get marked in baseq3. In Spearmint, only pk3s that the server reads files from get marked (regardless of game directory). Player models are entirely client side, server doesn't read their files.

This is one of the side affects are not having real addon management.


You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/zturtleman/spearmint/issues/267#issuecomment-225450066

zturtleman commented 8 years ago

Yes, I understand why you reported this.

This can be done by having the Game VM list directories in models/players/ and read animation.cfg in each. If this was added, someone may eventually open an issue because all player models are forced to be downloaded by clients. Could add a cvar for enabling/disabling it, but what about other model, sound, or graphics pk3s? They won't be downloadable.

Instead of slapping on an opt-in quick fix for one special case it would be nice to handle general cases. However, I'm not sure what the solution is. An option to make all the pk3s be marked as reference? Personally I have more addon players than maps and I wouldn't want either type to be auto downloaded when I'm connecting from another device on my LAN (though, I'm generally just testing not playing the game so I may be bias).

I think I'd like the client to be able to choose what if any pk3s they download via the UI, instead of a global auto download option. I would have a separation between referenced and optional pk3s in the UI. How should server determined which are offered? If someone has 100 addon pk3s, there is no way to know which ones are actually going to be used and the user might not want to download all of them. Maybe a cvar for recommended pk3s? So 'required' and 'recommended' download options? And it's kind of like, maybe I should wait until I replace the UI to add this. I wrote some related thoughts on downloads at #94.

rawr51919 commented 8 years ago

This should only download models that the connecting client either doesn't have or has but the checksum is different than that of the server copy.

zturtleman commented 8 years ago

That is how downloading pk3 files always works.

rawr51919 commented 8 years ago

When reading the animation.cfg, it should also check the connecting client's fs_game directory to see if the affected model's animation.cfg exists & has the same checksum as the server copy. If one or the other apply, then it will begin the download of the affected model.

zturtleman commented 8 years ago

Only pk3s are downloaded, not individual files. If server touched animation.cfg in all player directories it would reference all pk3s containing player models. The existence and checksum of the pk3 is checked by the client if the server references the pk3. If one or the other apply, then client will begin the download of the affected pk3 file. I don't need a literal explication of how to make client download files it does not have or have a different checksum.

You want all player models be to downloaded and I do not. I acknowledge it would be desirable in some situations. I think should be a client option. But instead of adding an "auto download player models" option I'd rather have a general system that can download pk3s that do not have a player model as well (such as sound or other graphic pk3s). However, I'm not interested in designing and implementing that feature at this time.

rawr51919 commented 8 years ago

That was the point of the "Automatic Downloading" option in the menu @zturtleman, but it seems that it might need some more scrutiny as you said.