你是否曾尝试培育一匹优秀的 Minecraft 马,并心想:“为什么我不能比刷出鞘翅更快地培育出它!”?动物遗传学(Animal Genetics)正是为此而生!该模组引入了真实的遗传数学逻辑,适用于猪、羊、牛、马、炽足兽、狐狸、狼等更多生物。通过选择性育种,你可以让动物具备你所期望的任何特性。
动物遗传学的机制非常简单,唯一的难点在于遗传算法。首先繁殖两只动物,并产生若干后代。每个后代都会混合双亲的基因。如果你只选择拥有你 desired 性状(例如速度)的后代进行繁殖——比如选出两只最快的后代作为下一代父母——然后重复此过程,直到你培育出一头比喷气机还快的猪!
基因组
你可能会问:有多少性状受遗传控制?每种动物都有 5 个基因组,这些基因组字面上就是它们的遗传数据(管理员可以通过命令查看遗传数据)。它们分别是:速度基因组、力量基因组、健康基因组、跳跃基因组和视觉基因组。
速度
控制生物的移动速度。你可以让生物慢到无法移动,也可以让它快过使用鞘翅的速度。
力量
控制攻击伤害、体型大小以及掉落物的数量。它甚至会增加鸡产蛋的数量!如果生物的力量值极高,它们会踩碎经过的树叶;力量再高一些,还能撞断栅栏。需要注意的是,生物的最小和最大体型分别为原始的 0.25 倍和 2 倍。掉落物乘数的最大值是 4,最小值是 0。掉落物倍增和体型变化需要安装 Pekui 模组。
健康
控制生物的生命值。最大值约为 35,最小值为 1。
跳跃
仅对马生效。可以控制跳跃高度,范围从完全无法跳跃到能跳 25 格高。
视觉
因生物而异。对于马,它控制颜色;对于狐狸,控制毛色;对于兔子,控制颜色和是否为“杀手兔”;对于熊猫,控制其性格等。它还存储突变信息。
突变
当你繁殖两只动物时,它们会混合双亲的性状,并对基因组的部分区域进行随机突变。每个基因组上有 5 个基因,会产生极端的正面或负面效果。这意味着,只有通过突变才能获得极端数值。也就是说,只能通过繁殖获得(因为自然生成的生物不会获得突变)。
然而,对于视觉基因组,有 5 个突变基因编码了超能力。
飞行/无坠落伤害
使可骑乘的生物在骑乘时能够飞行,同时使不可骑乘和可骑乘的生物都不受坠落伤害。如果未安装 Pekui 模组,飞行速度会变慢。如果在 1.19.4 之前使用数据包,可能不生效,但通常不会造成大问题。
火焰抗性
拥有永久的火焰抗性。
水下呼吸
拥有永久的水下呼吸能力。
冰霜行者
永久拥有冰霜行者附魔效果。
再生
拥有永生的生命恢复效果。
管理员控制与设置
该数据包还在 OP 菜单中添加了许多设置。如果你在创造模式下并拥有命令权限,可以使用 OP 菜单。只需输入 /trigger op_menu。将鼠标悬停在菜单中的设置上会显示其功能说明。这里有各种各样的设置,从禁用视觉基因组对不同生物颜色的影响,到禁用特殊突变。这允许你根据服务器的需求调整数据包的平衡性。此外还有一些小工具,例如查看附近生物基因组的命令,或者重置其基因组。
极客技术细节
我首先以记分板的形式存储遗传信息。我想设为遗传性的每个性状对应两个记分板,例如:雄性速度记分板和雌性速度记分板。然后,我使用二进制转十进制转换器,将记分板中的十进制数转换为 1 和 0 的列表。接着合并雌雄双方的记分板。例如:雄性 9 -> 01001,雌性 8 -> 01000。合并后的速度遗传信息为:02001。
当世界加载时,我有一个随机数生成器,生成 31 个不同的 1 和 0,然后将它们组合成一个单一的十进制数。之所以选择 31,是因为这是记分板中能存储的最大二进制数。
老实说,生物的视觉外观是最难实现的功能之一。如果要准确模拟,我需要特定的基因产生特定的效果,并且这些效果要与其他基因的效果相互作用。因为在现实世界中就是这样运作的:基因 1、2、3 控制马匹的深色程度,基因 5、6、7 控制是否有斑点,等等。基本上,基因的效应越混乱,基因之间的抵消或辅助作用就越复杂,互动越多,对于一款方块游戏来说就越逼真。
当读取遗传信息并应用实际效果时,我将十进制数转换回二进制,并对每一位应用不同的效果。值得注意的是,这里使用的是来自雌性和雄性双方合并后的遗传信息,因此每个位置的值可能是 0、1 或 2。如果第一位是 0,则增加 0.1 的速度;如果第一位是 1,则减少 0.1 的速度;如果第一位是 2,则增加 0.5 的速度。
Have you ever tried to breed a good minecraft horse and thoght? Why cant i breed one faster then a elytra! Well animal genetics fixes that for you! Along with introducing real genetic math to pigs, sheep, cows, horses, striders, foxes, wolves, and more! Animal genetics makes it possible to selectivly breed animals to do whatever you desire.
The mechanics of animal genetics are simple enough, only the math for genetics is complex. First breed 2 animals, and make several babies, each of these babies will have the genes of the 2 parents mixed, if you only breed the babies that have the trait you desire, lets say speed, then you get the 2 fastest babies and make the next generation, then repeat until you have a pig faster then a jet!
Genomes
Well how many traits are controlled by genetics you may ask? There are 5 genomes in each animal, these genomes literally are there genetic data(admins can view the genetic data with a command). The speed genome, the strength genome, the health genome, the jump genome, and the visual genome.
Speed
Controls the speed of the mob, you can make a mob so slow it cant move, or a mob so fast its faster then a elytra.
Strength
Controls attack damage, size, and amount of drops a mob gives. It will even increase the number of eggs a chicken lays! If a mob has a enormous amount of strength, they will break leaves they walk into, even more strength, and they will break fences. It is to note that the min and max size a mob can have is 0.25x, and 2x respectively. The max drop multiplier is 4, min is 0. Multiplication of drops, and changes in size require the pekui mod.
Health
Controls mob health. Max of ~35, min of 1.
Jump
Only works for horses, this can control the jump hight, ranging from being incapable of jumping, to jumping 25 blocks.
Visual
Changes from mob to mob. For horses, it controls there color. For foxes, there colors. Rabbits, colors, and if they are a killer rabbit. Pandas, there personality. Etc. They also store the mutations.
Mutations
Whenever you breed 2 animals, they will mix the 2 parents traits, and randomly mutate parts of the genome. There are 5 genes on each genome that give exstreme positive, or negitive effects. Meaning, its only via mutations can you get exstreme values. Meaning, only thru breeding.(As when natrually spawned, they don't get mutations)
However, for the visual genome, there is superpowers encoded into the 5 mutation genes.
Flight/No Fall Damage
Makes rideable mobs capable of flight when ridden, as well as making non-rideable and rideable mobs not take fall damage. Fight is slower when pekui is not installed. May not work if you are using the datapack before 1.19.4. However should not cause big issues.
Fire Resistance
They have permanent fire resistance.
Water Breathing
They have permanent water breathing.
Frost Walker
Permanent frost walker.
Regeneration
They have permanent regeneration.
Admin Control & Settings
This datapack also adds many settings to the op menu. If you are in creative mode, and have access to commands, you can use the op menu. Simply type "/trigger op_menu". If you hover over the settings in the menu they tell you what they do. There are all kinds of settings. From disabling the visual genome from effecting different mobs colors, to disabling special mutations. This allows you to balance the datapack to your own servers needs. As well as a few smaller tools like a command to view the genome of a nearby mob. Or reroll there genome.
Nerdy Technical Details
I first store the genetic information in the form of a scoreboard. 2 per trait i want to make genetic. EG: a speed male scoreboard, a speed female scoreboard. Then i use a binary to decimal converter to convert the base 10 number in the scoreboard into a list off 1's & 0's. Then combine the female and male scoreboard. EG: 9 male -> 01001, 8 female -> 01000. Then combined the speed gentic info is: 02001.
When the world starts, i have a random number generator that generates 31 diffrent 1's and 0's, then i combine them into a single base 10 number. The reason for 31, is that's the maximum binary number you can store in a scoreboard.
Honestly the visual apperences of the mobs were one of the harder fetures to do. If i want to be acurate i need specifc genes to have specific effects that interact with other genes effects. As thats how its done irl. Gene1,2,3 controls the darkness of the horse, 5,6,7 controls whether it has spots or not, etc. Basically the more chaotic you make the genes effects, the more the effects of the genes counter, or help each other, the more they intract, the more acurate it will be for the purposes of a block game.
When its time to read the genetic info, and use it to apply real effects, i turn the base 10 number into binary and for each digit, i apply a diffrent effect. Its important to note that the combined genetic info from both the female side, and male side is used, meaning 3 values, 0, 1, 2. If 0 in the first digit, add 0.1 speed. If 1 in the first digit, add -0.1 speed. If 2 in the first digit, add 0.5 speed.
评论 0
登录后参与评分
还没有评论,来抢沙发吧