penguin-statistics / arkplanner Goto Github PK
View Code? Open in Web Editor NEWFarming Strategy Planner for Arknights 明日方舟最优刷图策略规划
License: MIT License
Farming Strategy Planner for Arknights 明日方舟最优刷图策略规划
License: MIT License
@invisiblearts 经过寻找发现 javascript-lp-solver 这个 npm 包可以做线性规划,尝试着按照 nga 帖子里说明的思路写了个简单的 demo
这样的话就可以直接在前端计算了,不需要再依赖 python 后端,希望对你们的项目有帮助
这是D32钢、双极纳米片、聚合剂各 300 的运行结果,可能因为算法等因素的不同,和该项目的输出会略有不同
{
feasible: true,
result: 284522.80033011,
bounded: true,
'合成-D32钢': 300,
'合成-双极纳米片': 300,
'合成-聚合剂': 300,
'合成-RMA70-24': 196.71510358,
'合成-五水研磨石': 253.26606141,
'合成-三水锰矿': 300,
'合成-白马醇': 503.56911835,
'合成-改量装置': 236.47567779,
'合成-酮阵列': 259.85815714,
'合成-异铁块': 244.69642453,
'合成-提纯源岩': 300,
'合成-全新装置': 210.63986939,
'合成-酮凝集组': 324.9097497,
'合成-异铁组': 149.57573907,
'合成-聚酸酯组': 401.5665748,
'合成-糖组': 711.93773971,
'合成-固源岩组': 1938.69714146,
'合成-装置': 231.25252853,
'合成-酮凝集': 558.57447716,
'合成-异铁': 213.31308082,
'合成-聚酸酯': 707.56054782,
'合成-糖': 309.1893821,
'合成-固源岩': 704.74319605,
'4-9': 2279.44028345,
'S3-1': 1410.82271421,
'2-10': 23.07831898,
'4-5': 950.02361441,
'4-10': 1651.63237757,
'1-7': 5886.48474204,
'4-4': 1928.61763291,
'3-2': 2261.35714303,
'4-8': 1285.85093887,
'S4-1': 1800.2267325
}
将过滤stage的参数添加到api
计划出来的关卡没打到
移动端设备(尤其是IOS)也不太好跑Python
as topic, would appreciate if such an option exist, so players of different versions of the game can accommodate for events in different regions when using the ark planner
导入以下
[{"name":"D32钢","need":0,"have":5},{"name":"聚合剂","need":0,"have":1},{"name":"白马醇","need":0,"have":15},{"name":"扭转醇","need":8,"have":3},{"name":"三水锰矿","need":0,"have":2},{"name":"轻锰矿","need":10,"have":3},{"name":"五水研磨石","need":0,"have":3},{"name":"研磨石","need":6,"have":10},{"name":"RMA70-24","need":0,"have":11},{"name":"RMA70-12","need":4,"have":3},{"name":"提纯源岩","need":0,"have":4},{"name":"固源岩组","need":9,"have":22},{"name":"固源岩","need":15,"have":41},{"name":"源岩","need":10,"have":32},{"name":"改量装置","need":0,"have":2},{"name":"全新装置","need":4,"have":22},{"name":"装置","need":13,"have":36},{"name":"破损装置","need":2,"have":13},{"name":"聚酸酯块","need":0,"have":3},{"name":"聚酸酯组","need":3,"have":8},{"name":"聚酸酯","need":9,"have":11},{"name":"酯原料","need":16,"have":31},{"name":"糖聚块","need":0,"have":12},{"name":"糖组","need":3,"have":46},{"name":"糖","need":15,"have":12},{"name":"代糖","need":0,"have":12},{"name":"异铁块","need":0,"have":1},{"name":"异铁组","need":11,"have":40},{"name":"异铁","need":16,"have":2},{"name":"异铁碎片","need":9,"have":2},{"name":"酮阵列","need":0,"have":3},{"name":"酮凝集组","need":8,"have":42},{"name":"酮凝集","need":19,"have":17},{"name":"双酮","need":6,"have":16},{"name":"凝胶","need":4,"have":0},{"name":"炽合金","need":5,"have":2}]
计算输出
`合成共计消耗龙门币 13046
D32钢(2): 三水锰矿(1.6) 五水研磨石(1.6) RMA70-24(1.6)
双极纳米片(5): 改量装置(4.1) 白马醇(8.3)
聚合剂(3): 提纯源岩(2.5) 异铁块(2.5) 酮阵列(2.5)`
数据:
{"@type":"@penguin-statistics/planner/config","items":[{"id":"30135","have":8,"need":16},{"id":"30125","have":10,"need":16},{"id":"30115","have":10,"need":16},{"id":"30074","have":19,"need":40},{"id":"30073","have":123,"need":90},{"id":"30084","have":31,"need":40},{"id":"30083","have":168,"need":90},{"id":"30094","have":22,"need":40},{"id":"30093","have":112,"need":90},{"id":"30104","have":6,"need":40},{"id":"30103","have":23,"need":90},{"id":"30014","have":30,"need":40},{"id":"30013","have":66,"need":90},{"id":"30012","have":87,"need":55},{"id":"30011","have":67,"need":55},{"id":"30064","have":21,"need":40},{"id":"30063","have":68,"need":90},{"id":"30062","have":92,"need":55},{"id":"30061","have":61,"need":55},{"id":"30034","have":8,"need":40},{"id":"30033","have":63,"need":90},{"id":"30032","have":81,"need":55},{"id":"30031","have":60,"need":55},{"id":"30024","have":11,"need":40},{"id":"30023","have":66,"need":90},{"id":"30022","have":76,"need":55},{"id":"30021","have":62,"need":55},{"id":"30044","have":20,"need":40},{"id":"30043","have":184,"need":90},{"id":"30042","have":81,"need":55},{"id":"30041","have":62,"need":55},{"id":"30054","have":6,"need":40},{"id":"30053","have":51,"need":90},{"id":"30052","have":67,"need":55},{"id":"30051","have":60,"need":54},{"id":"31014","have":19,"need":40},{"id":"31013","have":71,"need":90},{"id":"31024","have":34,"need":40},{"id":"31023","have":132,"need":90},{"id":"30145","have":8,"need":16},{"id":"31034","have":26,"need":40},{"id":"31033","have":43,"need":90},{"id":"31044","have":24,"need":40},{"id":"31043","have":113,"need":90},{"id":"31054","have":2,"need":40},{"id":"31053","have":126,"need":90}],"options":{"byProduct":false,"requireExp":false,"requireLmb":false},"excludes":[]}
如题,运行后报错为:
Start to update data Tue Jan 2 19:32:34 2024.
Traceback (most recent call last):
File "E:\python_code\游戏相关\明日方舟\ArkPlanner-1.1.1\main.py", line 22, in
mp.get_plan(required_dct, owned_dct, print_output='zh', outcome=True,
File "E:\python_code\游戏相关\明日方舟\ArkPlanner-1.1.1\MaterialPlanning.py", line 479, in get_plan
green = {item['name']: '%.3f' % (float(item['value'])/Price[self.item_id_to_name[self.item_name_to_id[output_lang][item['name']]]['zh']]) for item in values[2]['items']}
File "E:\python_code\游戏相关\明日方舟\ArkPlanner-1.1.1\MaterialPlanning.py", line 479, in
green = {item['name']: '%.3f' % (float(item['value'])/Price[self.item_id_to_name[self.item_name_to_id[output_lang][item['name']]]['zh']]) for item in values[2]['items']}
KeyError: '环烃聚质'
初步猜测为新加入的几个材料没有对应的绿色材料(环烃聚质/晶体元件等)
其他信息:
owned.txt
双极纳米片 0
D32钢 5
聚合剂 4
RMA70-24 0
五水研磨石 3
三水锰矿 0
白马醇 1
改量装置 4
酮阵列 4
异铁块 16
聚酸酯块 0
糖聚块 0
提纯源岩 25
炽合金块 0
聚合凝胶 16
晶体电路 6
全新装置 135
酮凝集组 316
异铁组 33
聚酸酯组 243
糖组 97
固源岩组 374
凝胶 100
炽合金 198
RMA70-12 97
装置 313
酮凝集 581
异铁 605
聚酸酯 388
糖 416
固源岩 3729
双酮 244
异铁碎片 165
代糖 206
酯原料 267
破损装置 76
源岩 482
required.txt
聚合剂 33
双极纳米片 38
D32钢 31
晶体电子单元 39
您好,我最近也参考 graueneko 写了一个工具箱,无意间看到您的项目,十分想整合该项目的 API
我在材料计算器中已经实现了通过选择干员并设置精英化和技能来得到所需材料的功能,因此整合该项目可以变得更加懒人化(x
不知您意下如何 _(:3」∠)_
导致原因我不清楚,而且我注意到了,在切换浏览器的时候,貌似会出现这个问题?
我是说,我在用Chrome记录CN帐号的培养表,Edge记录EN帐号的。而之前我的Chrome的锰的查询是正常的,而Edge上显示的是R8-10。在刷新了Chrome的页面以后,轻锰矿在JP/EN/KR的建议关卡也变为了R8-10。
而在CN服的推荐,显示的是3-2和4-7。是不是两个服务器的推荐关卡反过来了?
It's quite often that you clicked multiple times to adjust the value of requirements and/or owned items. But when you do a refresh, it's all gone away.
Maybe we could use localStorage to save these data and have a save/load button to read/write from it.
Multiple saving slots might be better.
Auto-save might help as well.
nga讨论帖如下
https://bbs.nga.cn/read.php?tid=22027705&_ff=-34587507&page=e#pid427159938Anchor
历史经验一般是凝胶价值很高,但今天突然很低了。有人提出是数据问题。不知开issue能否提醒到你们。
According to the source code at
https://github.com/ycremar/ArkPlanner/blob/b3f4c3a267f00b7ee53b9cf0b594c683efd9b6f9/server.py#L37
the default value for store
is False
, but it has been described as True
at
https://github.com/ycremar/ArkPlanner/blob/master/API.md#L46
或者增加一个选项,有没有锡兰?
虽然加不加没有太大区别。
这次活动新的凝胶、炽合金等不在列表上
感谢
Request:
{
"owned": {
"白马醇": 1,
"扭转醇": 346,
"三水锰矿": 1,
"轻锰矿": 3,
"五水研磨石": 2,
"研磨石": 1,
"RMA70-24": 12,
"RMA70-12": 11,
"全新装置": 14,
"聚酸酯组": 12,
"糖组": 1,
"糖": 6,
"代糖": 16,
"异铁组": 2
},
"required": {
"D32钢": 4,
"白马醇": 6
},
"exp_demand": true,
"extra_outc": true,
"gold_demand": true,
"exclude": ["0-1","0-2","0-3","0-4","0-5","0-6","0-7","0-8","0-9","0-10","0-11","1-1","1-2","1-3","1-4","1-5","1-6","1-8","1-9","1-10","1-11","1-12","2-1","S2-1","2-2","S2-2","S2-3","S2-4","2-3","2-4","S2-5","S2-6","S2-7","2-5","2-7","S2-8","S2-9","2-8","2-9","S2-10","S2-11","S2-12","2-10","3-1","3-2","3-3","3-5","3-6","3-7","3-8","4-1","4-3","4-6","4-10","5-1","5-2","5-3","5-4","5-5","5-6","5-7","5-8","5-9","5-10","5-11","6-1","6-2","6-3","6-4","6-5","6-6","6-7","6-8","6-9","6-10","6-11","6-12","6-13","6-14","6-15","6-16","6-17","6-18","S3-1","S3-2","S3-3","S3-4","S3-5","S3-6","S4-2","S4-3","S4-4","S4-5","S4-6","S4-7","S4-8","S4-9","S4-10","S5-1","S5-2","S5-3","S5-4","S5-5","S5-6","S5-7","S5-8","S6-1","S6-2","S6-3","S6-4","CE-1","CE-2","CE-3","CE-4","CE-5","SK-1","SK-2","SK-3","SK-4","SK-5","LS-1","LS-2","LS-3","LS-4","LS-5","AP-1","AP-2","AP-3","AP-4","AP-5","CA-1","CA-2","CA-3","CA-4","CA-5","SA-1","SA-2","SA-3","SA-4","SA-5","SA-6"]
}
Response:
{
"cost": 0,
"gcost": 1600,
"gold": 0,
"exp": 0,
"stages": [
{
"stage": "1-7",
"count": "2934895",
"items": {
"固源岩": "3652431",
"源岩": "348011",
"破损装置": "99624",
"酯原料": "175792",
"双酮": "135663",
"异铁碎片": "136077",
"代糖": "167067"
}
},
{
"stage": "4-2",
"count": "578616",
"items": {
"糖组": "228652",
"异铁": "89142",
"异铁碎片": "74457",
"糖": "113758",
"代糖": "95903",
"糖聚块": "23164"
}
},
{
"stage": "4-4",
"count": "377043",
"items": {
"固源岩组": "8521",
"固源岩": "115518",
"源岩": "107757",
"装置": "46498",
"扭转醇": "139369",
"破损装置": "42016",
"白马醇": "18881"
}
},
{
"stage": "4-9",
"count": "267446",
"items": {
"酮凝集": "20619",
"研磨石": "6154",
"RMA70-12": "79129",
"酯原料": "107394",
"酮凝集组": "6944",
"聚酸酯组": "9275",
"聚酸酯": "24139",
"双酮": "84571",
"RMA70-24": "11665"
}
},
{
"stage": "4-5",
"count": "351521",
"items": {
"酮凝集": "32708",
"酯原料": "143691",
"酮凝集组": "108881",
"聚酸酯": "37108",
"双酮": "115610",
"酮阵列": "12747"
}
},
{
"stage": "4-8",
"count": "269222",
"items": {
"酮凝集": "18889",
"研磨石": "93397",
"RMA70-12": "5559",
"酯原料": "108351",
"酮凝集组": "7046",
"聚酸酯组": "9145",
"聚酸酯": "22712",
"双酮": "87275",
"五水研磨石": "12056"
}
},
{
"stage": "4-7",
"count": "375951",
"items": {
"固源岩组": "8681",
"固源岩": "117954",
"源岩": "104160",
"装置": "46255",
"破损装置": "41515",
"轻锰矿": "111843",
"三水锰矿": "14872"
}
},
{
"stage": "3-4",
"count": "311011",
"items": {
"全新装置": "85660",
"固源岩": "64614",
"源岩": "67642",
"装置": "26269",
"破损装置": "26948",
"酯原料": "41917",
"聚酸酯": "43063"
}
},
{
"stage": "岁过华灯",
"count": "40603",
"items": {
"酮凝集": "2196",
"固源岩": "2562",
"源岩": "3578",
"装置": "2008",
"破损装置": "2765",
"酯原料": "3415",
"聚酸酯": "2697",
"双酮": "3049",
"异铁": "2143",
"异铁碎片": "2971",
"糖": "2644",
"代糖": "3195"
}
},
{
"stage": "S4-1",
"count": "473274",
"items": {
"异铁": "73975",
"异铁碎片": "64276",
"糖": "90534",
"代糖": "78988",
"异铁组": "148327",
"异铁块": "15554"
}
},
{
"stage": "2-6",
"count": "579492",
"items": {
"固源岩": "15298",
"源岩": "237568",
"破损装置": "92034",
"酯原料": "152977",
"聚酸酯组": "209454",
"聚酸酯": "13892"
}
}
],
"syntheses": [
{
"target": "D32钢",
"count": "4",
"materials": {
"三水锰矿": "4",
"五水研磨石": "4",
"RMA70-24": "4"
}
}
],
"values": [
{
"level": "5",
"items": [
{
"name": "D32钢",
"value": "33.33"
},
{
"name": "双极纳米片",
"value": "16.67"
},
{
"name": "聚合剂",
"value": "16.67"
}
]
},
{
"level": "4",
"items": [
{
"name": "改量装置",
"value": "0.01596"
},
{
"name": "聚合凝胶",
"value": "0.00844"
},
{
"name": "炽合金块",
"value": "0.00012"
},
{
"name": "聚酸酯块",
"value": "0.00010"
},
{
"name": "提纯源岩",
"value": "0.00002"
},
{
"name": "RMA70-24",
"value": "0.00000"
},
{
"name": "糖聚块",
"value": "0.00000"
},
{
"name": "白马醇",
"value": "0.00000"
},
{
"name": "酮阵列",
"value": "0.00000"
},
{
"name": "五水研磨石",
"value": "0.00000"
},
{
"name": "三水锰矿",
"value": "0.00000"
},
{
"name": "异铁块",
"value": "0.00000"
}
]
},
{
"level": "3",
"items": [
{
"name": "全新装置",
"value": "0.00000"
},
{
"name": "固源岩组",
"value": "0.00000"
},
{
"name": "凝胶",
"value": "0.00000"
},
{
"name": "研磨石",
"value": "0.00000"
},
{
"name": "扭转醇",
"value": "0.00000"
},
{
"name": "RMA70-12",
"value": "0.00000"
},
{
"name": "酮凝集组",
"value": "0.00000"
},
{
"name": "聚酸酯组",
"value": "0.00000"
},
{
"name": "轻锰矿",
"value": "0.00000"
},
{
"name": "糖组",
"value": "0.00000"
},
{
"name": "炽合金",
"value": "0.00000"
},
{
"name": "异铁组",
"value": "0.00000"
}
]
},
{
"level": "2",
"items": [
{
"name": "酮凝集",
"value": "0.00000"
},
{
"name": "固源岩",
"value": "0.00000"
},
{
"name": "装置",
"value": "0.00000"
},
{
"name": "聚酸酯",
"value": "0.00000"
},
{
"name": "异铁",
"value": "0.00000"
},
{
"name": "糖",
"value": "0.00000"
}
]
},
{
"level": "1",
"items": [
{
"name": "源岩",
"value": "0.00000"
},
{
"name": "破损装置",
"value": "0.00000"
},
{
"name": "酯原料",
"value": "0.00000"
},
{
"name": "双酮",
"value": "0.00000"
},
{
"name": "异铁碎片",
"value": "0.00000"
},
{
"name": "代糖",
"value": "0.00000"
}
]
}
]
}
The response has some super large count for every stage it gives, and the total cost is 0.
This issue does not happen if no "exclude"
is not given in request.
The exclude list in this request is actually a whitelist for "1-7","2-6","3-4","4-2","4-4","4-5","4-7","4-8","4-9","S4-1"
. I believe there is a feasible solution by grinding 糖组
at 4-2
, 三水锰矿
at 4-7
, and 五水研磨石
at 4-8
.
Payload
{"owned":{"双极纳米片":4,"白马醇":3,"扭转醇":5,"三水锰矿":4,"五水研磨石":4,"RMA70-12":6},"required":{"D32钢":4,"双极纳米片":4,"白马醇":6,"三水锰矿":5,"轻锰矿":5,"固源岩组":8,"固源岩":5,"装置":6,"聚酸酯组":4,"聚酸酯":13,"糖组":11,"糖":11,"代糖":4,"异铁组":5,"异铁":16,"异铁碎片":5,"酮凝集":9},"exp_demand":false,"extra_outc":false,"gold_demand":true,"exclude":["5-1","5-2","5-3","5-4","5-5","5-6","5-7","5-8","5-9","5-10","5-11","6-1","6-2","6-3","6-4","6-5","6-6","6-7","6-8","6-9","6-10","6-11","6-12","6-13","6-14","6-15","6-16","6-17","6-18","S5-1","S5-3","S5-4","S5-5","S5-6","S5-7","S5-8","S6-1","S6-2","S6-3"]}
看了下代码,有很大一部分内容都是在处理 i18n,想问问为什么要在计算的逻辑里用i18n映射之后的结果来规划,而不是全程使用物品id,仅在输出的时候进行映射
The current API only accepts and uses the Chinese name of items as input and output for item objects, which is troublesome to work around for clients who are region agnostic and work with item IDs internally.
Since many other services use this API as is, I would like to suggest that an optional field, use_item_id
, of type boolean
indicating that the client wants to have the input and output be item IDs, be added to the API.
Drawbacks:
Since ArkPlanner and penguin-stats uses an item's Chinese name internally, computational work would have to be done to map item IDs to their Chinese name and vice versa. Occasional network traffic would also be incurred to fetch and keep updated the item table for doing so.
I would be happy to put up a PR for this feature if the maintainers are okay with this.
就在差不多时间,我也写了一个差不多的东西, repo 在这里。
思路也差不多,都是线性规划。
但这里还有前端网站,这就厉害了,以后会来多多参考大佬的 repo 😄
我本人没有服务器资源,所以没考虑发表的事,只想着自己用用,所以我觉得这个 repo 对大家更有用 👍
提一个我自己觉得有用所以实现了,但在这里没看到的东西。就是需要的素材几乎都是被用来培养干员的,如果可以让用户指定干员的培养计划,而不用自己计算,那用户体验说不定可以更好。
🎉
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.