[Mod] Ores' Statistics [0.2.0] [ores_stats]

Do you use this mod?

Yes, I find it useful.
1
100%
No, it is useless.
0
No votes
 
Total votes : 1

User avatar
Hamlet
Member
 
Posts: 695
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

[Mod] Ores' Statistics [0.2.0] [ores_stats]

by Hamlet » Sun Apr 08, 2018 09:58

Image
Provides informations about ores' percentages collected on map generation.

Version: 0.2.0
Source code's license: EUPL v1.2 or later.

Dependencies: default module (found in Minetest Game)

Advanced option: Settings -> All Settings -> Mods -> orestats

How to use:
Open the chat window, type the command /orestats help
To show ores’ statistics in the chat window: /orestats chat
To show ores’ statistics in the console window: /orestats console


Downloads:
Archives: .zip .tar.gz
Source code: GitHub


Installation

Unzip the archive, rename the folder to ores_stats and place it in
../minetest/mods/

If you only want this to be used in a single world, place it in
../minetest/worlds/WORLD_NAME/worldmods/

GNU+Linux - If you use a system-wide installation place it in
~/.minetest/mods/

For further information or help see:
https://wiki.minetest.net/Installing_Mods/
Attachments
orestats.png
(17.48 KiB) Not downloaded yet
Last edited by Hamlet on Fri Nov 08, 2019 14:12, edited 11 times in total.
 

User avatar
Andrey01
Member
 
Posts: 2338
Joined: Wed Oct 19, 2016 15:18
Location: Russia, Moscow
GitHub: Andrey2470T
In-game: Andrey01
 

User avatar
AlexYst
Member
 
Posts: 90
Joined: Fri Mar 20, 2015 01:24
GitHub: y-st
IRC: AlexYst
In-game: AlexYst

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by AlexYst » Mon Apr 09, 2018 09:53

Nice! I've frequently wondered about the ore distribution percentages; usually when I'm trying to decide on craft recipes in mods, as I try to balance the cost with the usefulness.
 

User avatar
Hamlet
Member
 
Posts: 695
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by Hamlet » Mon Apr 09, 2018 12:11

Thanks to both for your appreciation. :)

I've started this mod thinking about commerce: how many iron ingots for a gold ingot? And how many gold ingots for a diamond?

Indeed it can be used for other purposes: checking the effective percentage of a newly introduced ore or node, testing a map generator, and so on.

Currently it lacks a database: a text file in the world's directory where the collected data could be saved for later reference. I don't know how to deal with files input-output, thus at the moment nothing is recorded.

I've planned to extend the available commands, by introducing a converter; example:
-> /orestats diamond steel
<- "a diamond is worth X steel ingots"

If anyone is willing to help, s/he's very welcome.
 

bell07
Member
 
Posts: 582
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by bell07 » Mon Apr 09, 2018 12:41

For misc development tests I wrote QA-Block that is able to call misc lua checks / files. For development testing reason may you can write a Check-file for qa-block.

The most checks does just a print() that is wrote to the logfile and redirected to chat. But some (if usefull) does write to world directory. For example the intllib_pot_file_converter.lua that you can use to look how writting files works. It is easy, just write strings as textfile-lines using the IO write method
Code: Select all
-- Expamle is smart_inventory groups texts
local filename_po = minetest.get_worldpath().."/converter_out.po"
local file_po = io.open(filename_po, "w")

for key, text in pairs(smart_inventory.txt) do
   file_po:write('msgid "'..key..'"\n')
   file_po:write('msgstr "'..text..'"\n')
   file_po:write('\n')
end
file_po:close()
Last edited by bell07 on Mon Apr 09, 2018 18:54, edited 1 time in total.
 

zing269
Member
 
Posts: 97
Joined: Sat Apr 30, 2016 19:10

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by zing269 » Mon Apr 09, 2018 12:48

Hamlet wrote:Thanks to both for your appreciation. :)
Currently it lacks a database: a text file in the world's directory where the collected data could be saved for later reference. I don't know how to deal with files input-output, thus at the moment nothing is recorded.


You could use mod_storage:

Code: Select all
ore_store = minetest.get_mod_storage()
...
ore_store:set_float("coal_percent",coal_percent)
...
coal_percent = ore_store:get_float("coal_percent")
 

User avatar
Hamlet
Member
 
Posts: 695
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.1.0] [ores_stats]

by Hamlet » Mon Apr 09, 2018 20:04

Thanks for your input, so far I'm rewriting the mod from scratch because I wrote it a month ago when I didn't knew about hardware colorization and some other things.

I've tried the mod_storage method, and I'm happy with it as there is no performance hit. :)
 

User avatar
Hamlet
Member
 
Posts: 695
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.1.1] [ores_stats]

by Hamlet » Tue May 15, 2018 12:17

Released v0.1.1

- rewritten from scratch
- temporarily removed support for third party ores
- check the first post for more info

This version is meant to be used by singleplayers and/or mod developers.
The whole code has been rewritten to allow developers to easily and quickly add support for their own ores; it is self explanatory ("self commented") and broken into various sections (variables, functions, etc.) to make the customization process as easy as possible.

Before you think "I'll add <ore_name_here>" check this viewtopic.php?f=47&t=20105 because it seems that there's already a ton. :)
 

User avatar
Hamlet
Member
 
Posts: 695
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.2.0] [ores_stats]

by Hamlet » Tue Oct 29, 2019 10:50

Released v0.2.0

Added:
- Support for translations.

Changed:
- License changed to EUPL v1.2.
- mod.conf set to follow MT v5.x specifics.

Removed:
- Support for MT v0.4.x
 

Nordal
Member
 
Posts: 76
Joined: Mon Jul 30, 2018 15:46
Location: Germany
GitHub: Nordall

Re: [Mod] Ores' Statistics [0.2.0] [ores_stats]

by Nordal » Mon Jan 06, 2020 19:54

I am interested in your mod, but I fearr I will ask some questions now to understand it, that unmask me as very uninformed.
Is the map generated completely if you create a new world?
Or are subunits like mapchunks and areas generated if the player enters them for the first time?
If you change the distribution of ores in a mob after creating a new world, will the changes take effect?
 

User avatar
Hamlet
Member
 
Posts: 695
Joined: Sat Jul 29, 2017 21:09
Location: Lombardy, Italy
GitHub: h4ml3t
IRC: H4mlet

Re: [Mod] Ores' Statistics [0.2.0] [ores_stats]

by Hamlet » Tue Jan 07, 2020 13:31

Nordal wrote:I am interested in your mod, but I fearr I will ask some questions now to understand it, that unmask me as very uninformed. [...]


You should ask those questions to "Mr. Mapgen" (as Rubenwardy once called him), that is, paramat.
I only have a vague idea of how map generation and ores' distribution works, someone could skin me and put me into a barrel of salt, should I write something not exactly exact.
 

Sokomine
Member
 
Posts: 3951
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine

Re: [Mod] Ores' Statistics [0.2.0] [ores_stats]

by Sokomine » Tue Jan 07, 2020 18:45

Nordal wrote:Is the map generated completely if you create a new world?

No, that's not possible. Even large servers which have run for a long time have only a tiny fraction of the possible map generated - and that takes up several GB of space.

Nordal wrote:Or are subunits like mapchunks and areas generated if the player enters them for the first time?

That's how it is: When a player comes near or a mod initiates generation, that mapchunk will be created and stored in a database.

Nordal wrote:If you change the distribution of ores in a mob after creating a new world, will the changes take effect?

They will take effect - in newly generated mapchunks. A mapchunk is usually 5x16 nodes wide in each direction. Already generated mapchunks are not affected. Thus, if you add a new mod that adds new things at mapgen time to an already existing world, you've got to explore new land in order to see those changes.
A list of my mods can be found here.
 

Nordal
Member
 
Posts: 76
Joined: Mon Jul 30, 2018 15:46
Location: Germany
GitHub: Nordall

Re: [Mod] Ores' Statistics [0.2.0] [ores_stats]

by Nordal » Wed Jan 08, 2020 00:03

Thank you very much Sokomine! Your answers exactly meet the point. That's the informations I needed. :)
 


Return to Mod Releases



Who is online

Users browsing this forum: No registered users and 19 guests