Writing onto paper

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

Writing onto paper

by randomproof » Thu Nov 17, 2011 20:35

Has anyone thought about the idea of writing onto paper. My thought is that it would work just like setting text on signs, but you would do it from the inventory screen. Mainly I think this would be good for writing down the locations of interesting places and that you could give them to other players. The thing is that you wouldn't be able to stack them in the inventory so maybe also a type of container could be made that would work like a chest but only could hold papers.
 

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

by Staffs » Thu Nov 17, 2011 20:56

And to make it more intersting you can write on paper lots of times but you cannot delete what you wrote :D
I love mods :D
 

User avatar
sdzen
Member
 
Posts: 1170
Joined: Fri Aug 05, 2011 22:33

by sdzen » Thu Nov 17, 2011 21:55

why not have books actually have text in them I thought this would relate to the topic if I am wrong tell me
[h]Zen S.D.[/h] The next generation of tranquility!
malheureusement mon français n'est pas bon :<
Owner of the Zelo's
In game name: MuadTralk, spdtainted, sdzen, sd zen, sdzeno
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Thu Nov 17, 2011 22:28

I would think that you would want the amount of text that you can attach to some paper be small so as to prevent people trying to fill servers with useless data. Same issue with signs I would imagine. I notice that in constants.h there is #define SIGN_TEXT_MAX_LENGTH 50 but it is not being used.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Thu Nov 17, 2011 22:29

sdzen wrote:why not have books actually have text in them I thought this would relate to the topic if I am wrong tell me


I would think more about writing on the paper and using books to hold many papers.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Thu Nov 17, 2011 22:56

I've pulled a fork from git and I'm going to start working on this. What I am going to do first is create a new item called "writeable paper" that is unstackable in the inventory and when you right-click on it the text input from signs will popup and when you hover the mouse over it will show the text on it.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Fri Nov 18, 2011 19:29

Ok, so I have some working code.

https://github.com/randomproof/minetest

How it works:
To get writable just put a piece of paper in the center of the crafting area and you will get 1 writable paper(not stackable). I might change this to also require a lump of coal. To change the text on the paper right-click on it twice in the inventory window. Right now it only takes 1 line of text. I'll have to look into how to do multi-lined text. Oh, and you will need build priv to edit papers and anyone can edit any papers.

Todo:
I need to look into changing the way the text is sent to the server because right the length is sent in binary and the server is printing the binary to the terminal and this may cause problems. Also the binary length is written in to the players file and that could also cause problems. And As I said above I need to look into how to do multi-lined text.
Last edited by randomproof on Fri Nov 18, 2011 19:31, edited 1 time in total.
 

Roflo
Member
 
Posts: 51
Joined: Sun Nov 06, 2011 16:31

by Roflo » Sat Nov 19, 2011 00:55

randomproof: you should add a link to your branch in the patchset page of the Wiki:
http://test.mine.bz/wiki/doku.php?id=patchsets

(in the In Progress section; until it's finished)
.. that way people will know that you're working on it.
Unless otherwise specified: I use linux and run (and compile) the latest dev.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Sat Nov 19, 2011 05:30

Roflo wrote:randomproof: you should add a link to your branch in the patchset page of the Wiki:
http://test.mine.bz/wiki/doku.php?id=patchsets

(in the In Progress section; until it's finished)
.. that way people will know that you're working on it.


Done!
 

Maelstrom
Member
 
Posts: 15
Joined: Sat Nov 26, 2011 17:52

by Maelstrom » Sat Nov 26, 2011 19:13

Well it would be a good Idea, but there would be a problem:
Books should inherit more text than a lone sign, bookshelves should support more books.

To say it bluntly, it would surpass the Index of a sign or a chest really fast. A solution would be to use the Index of an Item as a footnote to link directly to a Textfile and let the clients read the file out for the text, but this has a flaw of not unlimited. Some crazy guy will build the Library of Alexandria and crack the Index Limit for the Footnotes.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Sun Nov 27, 2011 16:58

Maelstrom wrote:Well it would be a good Idea, but there would be a problem:
Books should inherit more text than a lone sign, bookshelves should support more books.

To say it bluntly, it would surpass the Index of a sign or a chest really fast. A solution would be to use the Index of an Item as a footnote to link directly to a Textfile and let the clients read the file out for the text, but this has a flaw of not unlimited. Some crazy guy will build the Library of Alexandria and crack the Index Limit for the Footnotes.

I think that is getting way more complicated than it needs to be. The idea of storing the text in a file instead of in memory is a good idea though. Instead of using a text file I would suggest using a separate SQLite database and have another index based on something like the date or what map section it is in or who created/edited it last.

The main problem is of a way to prevent someone from overloading the server with text. Someone could make tons of writable paper and cause the server to have to load massive amounts of stuff into memory when someone walks into an area. Reading text from a file only when someone reads a page is a good way to prevent this. The only problem now would be to prevents that person from filling up the disk space on the server.
 

Maelstrom
Member
 
Posts: 15
Joined: Sat Nov 26, 2011 17:52

by Maelstrom » Mon Nov 28, 2011 20:03

randomproof wrote:I think that is getting way more complicated than it needs to be. The idea of storing the text in a file instead of in memory is a good idea though. Instead of using a text file I would suggest using a separate SQLite database and have another index based on something like the date or what map section it is in or who created/edited it last.

The main problem is of a way to prevent someone from overloading the server with text. Someone could make tons of writable paper and cause the server to have to load massive amounts of stuff into memory when someone walks into an area. Reading text from a file only when someone reads a page is a good way to prevent this. The only problem now would be to prevents that person from filling up the disk space on the server.


One possible way would be only accepting written Books in bookshelves. Using books on a standing bookshelf would create a Book with Title and a limited capacity of text. One bookshelf can hold about 8 books until full and limiting the possible abuse.

To use another sqlite database is a great Idea. Didn't thought of that. If written Books can only exist in bookshelves, it is possible to use the x,y,z coordinates of the Block for the index.

What do you think: Disassembling the Bookshelf should destroy the books? It would make room inside the sqlite database. :)
 

Wolfgang
Member
 
Posts: 37
Joined: Thu Jun 23, 2011 11:21

by Wolfgang » Mon Nov 28, 2011 21:27

Bookshelves get stolen even faster than Mese.
 

Maelstrom
Member
 
Posts: 15
Joined: Sat Nov 26, 2011 17:52

by Maelstrom » Tue Nov 29, 2011 00:18

Some people would even steal dirt just to mess with people. Not a reason to ignore the Idea.
 

randomproof
Member
 
Posts: 214
Joined: Thu Nov 17, 2011 06:31

by randomproof » Tue Nov 29, 2011 06:05

From a coding and usability standpoint I would rather keep things simple. I also want there to be a reason in the game for any new stuff. The writable paper allows me to note the coordination of certain features in the game so I can find them later. Adding the ability to add massive amounts of text should have a function. I like the idea of making easier to read and more functional signs(I am calling these posters in the code I am working on so as not to conflict with the existing signs). Possibly with simple HTML or BBCode rendering. That could serve in providing information to people using internet server or as a mechanism for displaying tutorial information in a single player game.
 


Return to Minetest Features

Who is online

Users browsing this forum: Google [Bot] and 8 guests

cron