Merge XP and Enchanting from Crafter-minetest #841
Labels
No Label
#P1 CRITICAL
#P2: HIGH
#P3: elevated
#P4 priority: medium
#P6: low
#Review
annoying
API
bug
code quality
combat
commands
compatibility
configurability
contribution inside
controls
core feature
creative mode
delayed for engine release
documentation
duplicate
enhancement
environment
feature request
gameplay
graphics
ground content conflict
GUI/HUD
help wanted
incomplete feature
invalid / won't fix
items
looking for contributor
mapgen
meta
mineclone2+
Minecraft >= 1.13
Minecraft >= 1.17
missing feature
mobile
mobs
mod support
model needed
multiplayer
Needs adoption
needs discussion
needs engine change
needs more information
needs research
nodes
non-mob entities
performance
player
possible close
redstone
release notes
schematics
Skyblock
sounds
Testing / Retest
tools
translation
unconfirmed
mcl5
mcla
Media missing
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: VoxeLibre/VoxeLibre#841
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Wuzzy please revise possibility of merging https://git.minetest.land/Wuzzy/MineClone2/src/branch/enchanting
a127136c60
@Wuzzy please revise the possibility of merging https://git.minetest.land/Wuzzy/MineClone2/src/branch/enchantingto Merge Enchanting from Crafter-minetestMerge Enchanting from Crafter-minetestto Merge XP and Enchanting from Crafter-minetestI already made enchanting: https://github.com/EliasFleckenstein03/mcl_enchanting
My version is way closer to the original, but it'll need to rewrite it so most of the enchantments are done using item metadata in favor of static itemdefs (some enchants like efficiency need to be static tho) and make it possible to apply multible enchants to an item.
I suggest that we take the XP from crafter and the enchanting from my mod (I'll work on it in the next time).
This file is the only Crafter enchanting stuff, no prob to replace it. I planned to improve it further (yesterday I made some textures, 1, 2 and minor code change) so thank you for informing about your work, I will better add pistons protection and node timers support.
Please write if I can help you somehow with the mod, really can't wait to test it, it looks more fundamental than this one.
Nice, thanks. I propose to only focus on the experience in this branch and ignore the enchantment table. That way, the enchanting table can be developed independently.
Problems:
The
/xp
command spawns entities instead of adding the XP directly. This can lead to problems if you specify a huge number.The
/xp
command does not support negative numbers to reduce your XP./xp MyName
does not work.Player should keep experience when
mcl_keepInventory=true
.I suggest to grant the XP directly with the
/xp
command instead of dropping orbs. It's better for performance.I suggest to use
xp
as group name instead ofexperience
because it's needed so often.I like the enchanting table texture, it is better than that of Pixel Perfection.
To determine the gravity, please use
tonumber(minetest.settings:get("movement_gravity"))) or 9.81
.Please use
z_level
for all HUD elements (seelua_api.txt
) to make sure the HUDs are rendered in correct order.WTF?!
mcl_experience
is not the place to replace the health HUD bar, it should not be part of the branch.Please specify the license version.
Is there any reason why XP are stored in mod storage instead of per-player meta? Did you test the performance of the two options and compare?
Final note: A hint for you: For development, set
chat_log_level
to"warning"
. This will post warnings in your chat, so you will catch them immediately.Some things of listed by you are pretty clear for me, but I need a day or two to understand and implement/fix the others.
I shall test it because I have the same questions. Yes it is odd and controversal but I kept it just because 'why not', I belive, if Crafter will further improved, it might be useful to keep some principals of the code... These ideas came to me when I explored the differences of mesecons...
I think it's related to this part of Lua docs:
"A common idiom in Lua is
This code creates a local variable, foo, and initializes it with the value of the global variable foo. That idiom is useful when the chunk needs to preserve the original value of foo even if later some other function changes the value of the global foo; it also speeds up access to foo."
Have no idea whether it can speed up the something in Minetest, so I'll check it too and report.
Doesn't MineClone use the textures from the Pixel Perfection Texture Pack?
I just read the other issue about enchanting and found out about the
set_tool_capabilities
method for ItemStacks. This makes things so much easier ... I'll not start working on it right now tho as I got exams next week (I'm 15 and have school).The only thing I dont know yet is how can durability be dynamically implemented.
It would be kinda useful if End Crystals get merged before I start the work on enchantments so I can just use my fork of MineClone for the enchanting thingy. (I origially wanted to wait until End Crystals are done before I open an issue about enchanting.)
Also, should I include the Crafter XP in my fork or will that be done by one of you?
@Wuzzy
Per-player meta is faster or sometimes they have equal performance, I ran 10000 load/save iterations 20 times, accessing the mod storage was never faster, so I change it to player's meta.
Maybe it is because of string concatenating with "xp_level" and etc. I didn't try to remove it.
@EliasFleckenstein03
I like merging :) Fixing things mentioned above is about 75% ready. I debug and explore z-level. But I don't think it has any meaning because there won't be problems with merging further unless you change the stuff that I change, and vise versa. I'm not planning to touch enchanting for now, respecting your work, and I wish you a good luck with exams.
@Wuzzy
At least this code speedifies the execution for me:
I ran two blocks of code and compared the results:
Local version is faster almost all the time. Maybe because of the shorter name? :)
Code marked as WTF by Wuzzy is actually useless, it doesn't produce any speedups.
I pushed the update to the branch,
290893355b
I think I added everything but:
and not debugged too much for now, but playable.
I've got a question. For enchanting, do we need to manipulate the
level
orxp
value which is significally greater? Or both of them? I'll read the wiki laterOK, I have merged the experience mechanism, but with changes:
hud_add
for the level text and the XP bar eachI keep this issue open in case there is still something you want to say or do.
As only the
xp
is stored in player meta, I recommend only touching thexp
value. The level is directly derived from the total XP count, so storing the level as well would be redundant.But since enchantments cost levels, not XP, I think a good solution would be to write a helper function does the neccessary calculations for "paying" a specific number of levels for a given player.
Great!
I was too stupid and updated the branch too, with leftovers of the things mentioned above,
30d9e54803
It's kinda wooops :) Anyway I'm taking a pause for some hours for sleeping... Hope it will be not as hard to merge later...
By the way I checked the wiki, we should use:
from outer mods. Don't consider XP, only the level.
Best regards.
P. S. I'd like to fix furnaces the same way as
/xp
command does, to update player experience directly without dropping the orbs, and the wiki says:So @Wuzzy couldn't you please maybe give a name for some additional group for these purposes? I'm not pretty sure but how else it could be done :)
So I have merged the rest. And I noticed mining ores doesn't drop XP, neither in Creative Mode or non-Creative Mode.
As for furnaces: No, let them drop XP orbs, for consistency.
The reason why I requested to prevent XP orb drop with
/xp
was prevent excessive entity spawning.And I did some tiny leftovers :) Really I like the speed of you work. Much better than it is in Minetest repo. Thank you for that.
Mining ores (iron and gold) revoked according the wiki and MC but didn't you try to dig coal or redstone? - They're okay for me.
Exactly.
@EliasFleckenstein03 please use:
I'm not too much happy that
temp_pool.bar_step
is float now, I'd prefer it would be int for integer calculation with some additional variable to check with and move the bar forward on excess, but I don't want to make it right now, it can make the code less clear, maybe later. @Wuzzy you may close the issue and delete 'enchanting' branch if you want.P. S. Furnaces surrounded by XP orbs look awesome. I like it too much. It isn't as in MC but still! :) But it has a problem - orbs will disappear after some time and if the player won't gather them in time they won't give the experience at all.
Hey,
Then testing xp, I found a strange bug:
After killing mobs, I went to the place where all xp orbs dropped and xp bar becomme more full. After xp bar is full this append.
Sure I saw the same many times during debugging process but now I can't reproduce.
I fixed some bugs and committed the fixes, it can be related,
9f98117328
Orb maximum age now can be set up in line 6
@AFCMS
Seems I just forgot that each taking of orbs is a separate thread :)
So one thread may significally change the level while another is still trying to render the value (especially if you taking the bath of the orbs).
I tried to consider that in the function of addition,
38ad237d92
Thank you for the report.
Since XP were merged, I close this issue now. For further development, open a new issue. For bugs about XP, open a new issue.
KTHXBAI.
@EliasFleckenstein03 in case if you read this...
Pixel Perfection texture pack by XSSheep currently has Creative Commons Attribution-Share Alike 4.0 International License which allows to adapt — remix, transform, and build upon the material for any purpose with such minimum limitation as giving a credit, etc. and I think Wuzzy is giving appropriate credit mentioning Pixel Perfection and its creator XSSheep here and there.
So I think we aren't limited by Pixel Perfection.
Of course we can't take textures from Minecraft :) But nothing prevents to draw the own. Maybe even better than in Minecraft.
What I meant is just that we should use the textures from Pixel Perfection rather than drawing or own for the purpose of consistency.
If you only worry about Pixel Perfection consistency which looks dead for me... (respectfully).MineClone 2 has its own consistency, it slightly differs anyway.I wonder what textures you'd choose if wouldn't think about that at all?
Actually if it were up to me I would not provide any textures at all but instead provide an installation script that downloads the default minecraft ressourcepack from a random website (I'm sure there is a site providing this), and then generates the textures using the texture pack converter (ofc the converter would need to be extended for this). I think just using an open Minecraft texture pack is fine as well tho.
I believe that MineClone2 can have its own way, some textures are pretty good.
Random providers are appropriate for inside usage only, it won't okay if I publicly list the server with MC textures.