Client side texture caching PATCH + win32build added

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

Client side texture caching PATCH + win32build added

by sapier » Fri Dec 23, 2011 21:18

Hello,

Problem:
loading textures everytime you start minetest takes too much time in case you have hires textures.

Suggestion:
Adding support for client side caching of textures, only submiting textures needed by client. To avoid outdated textures on client, at each login a hash summ of each textures is sent by server.
-> Client only downoads missing textures or textures with different hash
Last edited by sapier on Sun Jan 01, 2012 18:01, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
dannydark
Member
 
Posts: 428
Joined: Fri Aug 12, 2011 21:28

by dannydark » Fri Dec 23, 2011 21:22

I'm sure I've seen someone mention this already in IRC but either way I agree. +1
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Fri Dec 23, 2011 21:26

+1 I like this idea!
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
RAPHAEL
Member
 
Posts: 627
Joined: Tue Nov 01, 2011 09:09

by RAPHAEL » Fri Dec 23, 2011 21:49

+1 as well
"Before you speak, ask yourself: Is it kind, is it true, is it necessary, does it improve upon the silence?"
My mods: http://goo.gl/n4kpn
(Currently Various, Industrial, Fakeblocks, Jail, MoarCraft, Christmas, Replicator, minetest dev installer for linux, bash mod installer, windows mod installer)
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sat Dec 24, 2011 07:08

+1 as well. This would allow the use of client-side texture packs again. The server should also have the ability to force a texture pack, but only if the client agrees, like showing a dialog:
"This server forces the texturepack "ThisPackName". Do you want to use it?"
 

User avatar
Staffs
Member
 
Posts: 329
Joined: Thu Aug 04, 2011 13:16

by Staffs » Sat Dec 24, 2011 13:44

+1 I like this idea!
I love mods :D
 

User avatar
neko259
Member
 
Posts: 769
Joined: Sun Jun 19, 2011 06:51

by neko259 » Sat Dec 24, 2011 13:57

+1 but add an option for choosing max texturepacks count. Because if I'll visit too much servers, I'll have gigabytes of textures.
Bitcoin donations: 18r66dJmUjwTmWRTFnorpGMzs8d4B8jzbw
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sat Dec 31, 2011 16:01

I'm going to write a patch for the simple solution:

(1)Server sends TextureAnnouncement containing md5 sum, name and path information
(2)Client checks TextureAnnouncements against localy cached textures
-->loads textures matching announcement
-->creates texture request for required ones
(3)Client->Server (LIST OF TEXTURES)
(4)Server: Send textures requested
DON'T mention coding style!
(c) sapier all rights reserved
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Jan 01, 2012 12:48

here's the patch, tested on linux only please have a look at it.

<removed use later patch>

There are a number of "problems" with it:

-requires mods to follow naming conventions.
eg all textures have to be named <modname>_something.png as textures with same name will get transfered every time

-adds another library dependecy to openssl

-breaks protocol compatibility to current minetest
Last edited by sapier on Sun Jan 01, 2012 23:01, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
Hackeridze
Member
 
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Sun Jan 01, 2012 14:30

sapier wrote:There are a number of "problems" with it:

-requires mods to follow naming conventions.
eg all textures have to be named <modname>_something.png as textures with same name will get transfered every time

Bad
My game: RTMG
GENTOO USER
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Jan 01, 2012 15:06

@Hackeridze even you obviously don't like me i wish you a happy new year.
You should have TRIED it before complaining you would have noticed:

1)What you call "bad" currently doesn't apply to ANY default texture nor to any of the more than 30 mod's I've tested.

2)It's not at all a better solution to download ALL textures every time than downloading a single conflicting texture more than once

3)Exactly the same naming convention is already in place for entity names so it wouldn't be that hard to remember.
Last edited by sapier on Sun Jan 01, 2012 15:15, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Jan 01, 2012 17:36

As noone seems to want to compile by her/himself I've compiled it for win32.

The client will work with current official minetest server but obviously you won't have any benefit doing this.

I didn't test if standard client will work with this server but i don't expect it to work.

http://www.mediafire.com/?81uj93j6jekdp7d
DON'T mention coding style!
(c) sapier all rights reserved
 

celeron55
Member
 
Posts: 430
Joined: Tue Apr 19, 2011 10:10

by celeron55 » Sun Jan 01, 2012 18:36

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-adds another library dependecy to openssl


WTF? Why?

That is not going to get into upstream because of making building on Windows crap.
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Jan 01, 2012 19:17

openssl on windows isn't more complicated than using gettext in windows.
I didn't do a windows build or edit a cmake file before an got it built within an hour.

But I know you don't like to add library dependencys to minetest that's why i didn't even expect you to add it upstream. It's just a proof of concept.

The reason I added openssl is i required a reliable hash algorithm to decide if a texture within the client cache matches the one present on server. If anyone does want to implement md5 or any other hash algorithm himself it it wouln't be much of an effort to switch to that algorithm.

I personaly don't like reinventing the wheel, especially if its something critical as an hash algorithm.

On the other hand, having some sort of cryptographic library available in minetest wouldn't be that bad in my opinion. At least it would reduce the amount of work to add a secure password system.

EDIT1:
The changes i did to build on windows (additional to downloading openssl windows build)
http://www.mediafire.com/?57n7c552787s9q7
Last edited by sapier on Sun Jan 01, 2012 19:31, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Sun Jan 01, 2012 23:00

Switched from openssl md5 hash to minetest included sha1 hash thus removing the openssl dependency

http://pastebin.com/bShyhRwF
Last edited by sapier on Mon Jan 02, 2012 00:53, edited 1 time in total.
DON'T mention coding style!
(c) sapier all rights reserved
 

User avatar
dannydark
Member
 
Posts: 428
Joined: Fri Aug 12, 2011 21:28

by dannydark » Mon Jan 02, 2012 04:54

Nice work mate ^_^ I grabbed the links you posted on IRC earlier to test and works very nicely.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 2 guests

cron