Page 1 of 1

[Abandoned] [Mod] Ores' Statistics [1.1.0] [ores_stats]

Posted: Sun Apr 08, 2018 09:58
by Hamlet
Image
Image
Provides informations about ores' percentages collected on map generation.

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

Dependencies: default, sfinv (found in Minetest Game)
Supported: More Ores

To update the page just switch to another tab.

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


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


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/

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

Posted: Mon Apr 09, 2018 07:09
by Andrey01
Wow! I think it is very useful mod!

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

Posted: Mon Apr 09, 2018 09:53
by AlexYst
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.

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

Posted: Mon Apr 09, 2018 12:11
by Hamlet
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.

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

Posted: Mon Apr 09, 2018 12:41
by bell07
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()

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

Posted: Mon Apr 09, 2018 12:48
by zing269
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")

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

Posted: Mon Apr 09, 2018 20:04
by Hamlet
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. :)

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

Posted: Tue May 15, 2018 12:17
by Hamlet
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. :)

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

Posted: Tue Oct 29, 2019 10:50
by Hamlet
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

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

Posted: Mon Jan 06, 2020 19:54
by Nordal
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?

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

Posted: Tue Jan 07, 2020 13:31
by Hamlet
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.

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

Posted: Tue Jan 07, 2020 18:45
by Sokomine
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.

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

Posted: Wed Jan 08, 2020 00:03
by Nordal
Thank you very much Sokomine! Your answers exactly meet the point. That's the informations I needed. :)

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

Posted: Fri Jul 10, 2020 23:12
by Hamlet
So... you are selling 1 gold ingot for 99 dirt
or maybe one chest filled of cobble for a diamond...
or exchanging a steel block for 10 coal blocks
or 10 apples for 2 steel ingots
maybe you need this:

Image

anyone interested?

EDIT: the current version doesn't have this feature, just in case...

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

Posted: Sat Jul 11, 2020 10:15
by Festus1965
I used it short,
after digging about 50.000 nodes to get a statistic about this (but I have also mithril and moreores) to make a more fair XP digging point system, depending on the % based on diamonds.

Sure, helpful, to know how much is something worth (depending also on depths digging)
The Idea is good, but missing ores, and looking through the code I didn't feel to be able to enlarge ... it

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

Posted: Mon Jul 13, 2020 12:49
by Hamlet
Festus1965 wrote:
Sat Jul 11, 2020 10:15
Sure, helpful, to know how much is something worth (depending also on depths digging)
The Idea is good, but missing ores, and looking through the code I didn't feel to be able to enlarge ... it
This mod will be completely rewritten, it is old and its code is not very good.
I will try to make it easier to add third party ores' mods, probably I will re-add native support for More Ores' silver and mithril because it seems that More Ores is widely used.

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

Posted: Thu Jul 23, 2020 10:36
by Saturn
Released v1.0.0

Added:
- Inventory's page (switch tab to update).
- Ores' relative values.
- Option to change gold's value via Settings -> All settings -> Mods -> ores_stats

Changed:
- Code rewritten from scratch.
- Version updated to 1.x, non backward compatible.

Removed:
- Console and chat output.

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

Posted: Wed Aug 19, 2020 21:45
by Saturn
Released v1.1.0

Added
- Support for "More Ores"