"Abusing" signs_lib - unlimited text length ...

mycomments2017
New member
 
Posts: 1
Joined: Tue May 08, 2018 13:27

"Abusing" signs_lib - unlimited text length ...

by mycomments2017 » Fri May 18, 2018 09:49

Hello, just trying to experiment here ... if I were to change MAX_INPUT_CHARS variable from '600' to say '65535' in signs_lib mod (https://github.com/minetest-mods/signs_lib/blob/master/init.lua#L249) - am I to expect crashes? bad surprises?
Thanks
 

User avatar
Krock
Developer
 
Posts: 3875
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: "Abusing" signs_lib - unlimited text length ...

by Krock » Fri May 18, 2018 11:12

Quickly tested this in a local world, using the Lorem Ipsum to generate a lot of text quickly.
So I've ended up with 65535 characters on a single sign - then I increased the limit - even 327k lines don't affect the gameplay as long you don't point a the sign.
Never point at the sign. Only masochists do that.
The infotext which is drawn at the upper left side of the screen slows down the rendering process a lot, and thus causes a massive frame drop. It seems to draw the entire text even though its visual space is limited and thus, only the first few hundred characters can be read.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
stu
Member
 
Posts: 878
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: "Abusing" signs_lib - unlimited text length ...

by stu » Fri May 18, 2018 18:06

Krock wrote:So I've ended up with 65535 characters on a single sign - then I increased the limit - even 327k lines don't affect the gameplay as long you don't point a the sign.
Never point at the sign. Only masochists do that.

LOL, although that is rather impressive. Did you happen to note how much memory was consumed?
 

User avatar
Krock
Developer
 
Posts: 3875
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: "Abusing" signs_lib - unlimited text length ...

by Krock » Fri May 18, 2018 18:22

stu wrote:Did you happen to note how much memory was consumed?

192 MiB (before: a bit less than 192 MiB).
In other words: No noticeable memory consumption (RAM). This seems also logical because the sign limits the columns and lines to create the text entity texture. Also the infotext is just a string variable which doesn't result in loading any additional media and is rendered directly.
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
stu
Member
 
Posts: 878
Joined: Sat Feb 02, 2013 02:51
Location: United Kingdom
GitHub: stujones11

Re: "Abusing" signs_lib - unlimited text length ...

by stu » Fri May 18, 2018 18:31

Krock wrote:[his seems also logical because the sign limits the columns and lines to create the text entity texture.

Ah, so extending the number of input character does not really gain you anything, the real limit is actually the maximum number of columns and rows. I have never really studied the signs_lib code but It clearly performs a lot better than I would have imagined :)
 


Return to Modding Discussion



Who is online

Users browsing this forum: No registered users and 2 guests