世界地图格式

来自Arcaea中文维基
< User:在咕咕咕的咕子
在咕咕咕的咕子讨论 | 贡献2024年8月6日 (二) 01:12的版本 (fix,信息解析后面再写)


  • 本页保持孤立!

阅前提示

本页面记载的是Arcaea移动版服务器中存放的世界模式地图的格式。
地图实际上为一份json文档,其格式要求较为严格,如果您想要编写地图的话,请确保您拥有扎实的json编写基础。
如果您有能力做到自己建立一个Arcaea服务器游玩,本页面兴许可以在您编写地图时提供帮助。

代码解析

框架

一张地图的总体框架如下。

{
    // map data
}

在地图中,也会保存着地图中台阶的信息,每个台阶的编写框架如下:

{
    "steps": [
        {
            // step 1
        },
        {
            // step 2
        }, ...
    ]
}

细节解析

  • 地图信息内可能会出现众多数据,可能会出现的数据格式如下:
    • string -- 字符串 例:"this is a string"
    • int -- 整数 例:616
    • float -- 浮点数 例:123.456
    • boolean -- 布尔值 例:true(是),false(否)

对于一张地图,可以填写的所有信息如下。(地图信息允许乱序排放,并没有强制的排序要求)

{
   "map_id": string,
   "is_legacy": boolean,
   "is_repeatable": boolean,
   "is_beyond": boolean,
   "beyond_health": int,
   "character_affinity": [
       int, ...
   ],
   "affinity_multiplier": [
       float, ...
   ],
   "is_breached": boolean,
   "disable_over": boolean,
   "new_law": string,
   "chapter": int,
   "available_from": int,
   "available_to": int,
   "require_type": string,
   "require_id": string,
   "require_value": int,
   "requires": [
       {
           "type": string,
           "id": string,
           "value": int
       }, ...
   ],
   "requires_any": [
       {
           "type": string,
           "id": string,
           "value": int
       }, ...
   ],
   "require_localunlock_songid": string,
   "require_localunlock_challengeid": string,
   "coordinate": string ("x,y"),
   "step_count": int,
   "custom_bg": string,
   "stamina": int,
   "chain_info": {
       "id": string,
       "index": int
   },
   "steps": [
       {
           // step 1
       },
       {
           // step 2
       }, ...
   ]
}

在地图中,每个台阶可以填写的所有信息如下。(与地图信息相同,台阶信息也允许乱序排放,没有强制排序的需求)

{
   "position": int,
   "capture": int,
   "items": [
       {
           "type": string,
           "id": string,
           "amount": int
       }
   ],
   "restrict_id": string,
   "restrict_ids": [
       string, ...
   ],
   "restrict_type": string,
   "restrict_difficulty": int,
   "step_type": [
       string, ...
   ],
   "speed_limit_value": int,
   "plus_stamina_value": int
}

地图信息

普通地图:

{
    "map_id": "example",
    //地图ID str 必需字段
    //请确保输入的map_id与所对应的地图文件名相同
      
    "is_legacy": false,
    //是否启用Legacy地图机制 bool
    //于1.7.0新增
      
    "is_repeatable": true,
    //是否启用无限地图机制 bool
      
    "is_beyond": false,
    //是否启用Beyond地图机制 bool
    //于3.0.0新增
      
    "beyond_health": 100,
    //Beyond地图/Breach地图的总百分比 int
    //于3.0.0新增
      
    "character_affinity": [
    ],
    //Beyond地图的相性契合搭档 [int, ...]
    //于3.0.0新增
      
    "affinity_multiplier": [
    ],
    //Beyond地图的相性契合加成 [float, ...]
    //于3.0.0新增
    
    //character_affinity与affinity_multiplier的照应关系为:
    //设character_affinity为[0, 1],character_affinity为[1.0, 1.5]
    //那么该地图的相性契合信息为:{0: 1.0, 1: 1.5}
    
    "is_breached": false,
    //是否启用Breach地图机制 bool
    //于5.3.0新增
    
    "disable_over": false,
    //是否禁止Overdrive参与PROG计算 bool
    //于5.3.0新增
    
    "new_law": "",
    //Breach地图的法则 str
    //于5.3.0新增
    
    //法则类型(5.3.0:
    //over100_step50 PROG = OVER + STEP/2
    //frag50 PROG x= FRAG
    //lowlevel PROG x= max(1.0, 2.0 - 0.1 x LEVEL)
    //antiheroism PROG = OVER - ||OVER-FRAG|-|OVER-STEP||
      
    "chapter": 0,
    //地图章节 int 必需字段
      
    //特殊类章节:
    //0 活动 Event
    //1001 Beyond
    
    //普通章节:以1开始为第一章
    //Breach章节:以2001开始为第一章
      
    "available_from": -1,
    //从X时开始可用 int 必需字段
    //填写10位/16位时间戳,-1表示一直可用
    //于1.5.2新增
      
    "available_to": -1,
    //经过X时后关闭 int 必需字段
    //填写10位/16位时间戳,-1表示一直不关闭
    //于1.5.2新增
    
    "require_type": "",
    //解锁时所需物品的类型 str
          
    //解锁类型(5.3.0):
    //pack 曲包(配合require_id使用)
    //character 角色(616没用过,配合require_id使用)
    //single 单曲(配合require_id使用)
    //fragment 残片(配合require_value使用)
    //chart_unlock 解锁谱面(配合require_id使用,格式为[SongID]+[ratingClass]
    //chapter_step 章节步数(配合require_value使用)
    //chapter_maps 完成地图(配合require_value使用,目前只出现在Beyond背景地图中)
      
    "require_id": "",
    //解锁时需要开启的对应物品ID str/[str, ...]
    //[str, ...]形式于3.10.0新增,后续在4.2.0添加普通地图的显示
      
    "require_value": 0,
    //解锁时需要花费的对应物品的数量 int
    //与require_type语句相连,只有前置语句填写到指定数据后才能发挥作用
    //也与requires语句相连,只有前置语句不存在时才能发挥作用
      
    "requires": [
		{
		}
	],
    //解锁时所需的多个物品 [{str: 'str | int', ...}, ...]
    //dict中可填入type/id/value三个键,值类型与上述require前缀相同
    //该语句的解锁条件优先于require_type/id/value
    //于4.2.0新增
    //使用例:
    //"requires": [
	//	  {
    //	    "type": "pack",
    //  	"id": "base",
    //      "value": 0
    //    }
    //]
      
    "require_localunlock_songid": "",
    //需要本地解锁XXX歌曲的任意难度 str
    //填写指定歌曲ID,用来判断本地是否解锁了指定歌曲的任意难度
    //判断解锁方式:寻找本地"un"文件中[SongID]|[ratingClass]|[UnlockType]所有的解锁条件,如果其中一条"complete"被设为成功值,则解锁
    //于1.5.0新增
      
    "require_localunlock_challengeid": "",
    //需要本地通过XXX异象 str
    //填写指定异象ID,用来判断本地是否通过了指定歌曲的异象
    //判断解锁方式:寻找本地"un"文件中[AnomalyID]_challenge|0|102解锁条件,如果"complete"被设定为0或不存在,默认不解锁
    //于1.6.0新增
      
    "coordinate": "0,0",
    //地图在对应章节应用的X/Y坐标 str 必需字段
    //前者代表X,后者代表Y
    //X为正数时向右,为负数时向左
    //Y为正数时向上,为负数时向下
      
    "step_count": 22,
    //地图总步数 int 必需字段
      
    "custom_bg": "",
    //地图所使用的背景 str
    //如果不填写,则默认使用章节背景
    //填写后,游戏会自动查找位于img/world中的[value].jpg
    //于1.8.3新增
      
    "stamina_cost": 2,
    //在该地图内游玩一次所需要的体力 int
    //也会影响Play+的体力消耗
      
    "chain_info": {},
    //用来声明该地图所在的Chain {str: 'str | int', ...}
    //可以填入id与index两个键,值类型分别为str与int
    //id为所在Chain,index为解锁顺序(从1开始)
      
    "curr_position": 0,
    "curr_capture": 0,
    "is_locked": false,
    //没用
      
    "steps": [
    //该地图的台阶设置 [dict, ...] 必需字段
		{
			"position": 0,
			//台阶的点位 int
			//可随意填写,设定为相同的值都可以正常读取
      
			"capture": 5
			//台阶的步数 int
		},
		{
			"position": 1,
			"capture": 5,
			"items": [{}]
			//奖励 [{str: 'str | int', ...}]
			//此处为空,直接删除也可达成同效果
		},
		{
			"position": 2,
			"capture": 5,
			"items": [
				{		
					"type": "character"
					"id": "0"
					//角色
					//type: str, id: str
					//id对应CharacterID
				}
			]
		},
		{
			"position": 3,
			"capture": 5,
			"items": [
				{
					"type": "world_song",
					"id": "shadesoflight"
					//世界解锁类型的歌曲/难度
					//type: str, id: str
					//id对应SongID
					//如需解锁难度,在SongID末尾添加对应ratingClass数字即可
				}
			]
		},
		{
			"position": 4,
			"capture": 5,
			"items": [
				{
					"type": "single",
					"id": "auxesia"
					//单曲
					//type: str, id: str
					//id对应SongID
				}
			]
		},
		{
			"position": 5,
			"capture": 5,
			"items": [
				{
					"type": "fragment",
					"amount": 616
					//残片
					//type: str, amount: int
				}
			]
		},
		{
			"position": 6,
			"capture": 5,
			"items": [
				{
					"type": "memory",
					"amount": 616
					//记忆源点
					//type: str, amount: int
					//616没用过,但存在
				}
			]
		},
		{
			"position": 7,
			"capture": 5,
			"items": [
				{
					"type": "core",
					"id": "core_generic",
					"amount": 1
					//核心
					//type: str, id: str, amount: int
					//id对应CoreID
          
					//核心种类(5.2.6):
					//core_generic 以太之滴 Ether Drop
					//core_hollow 中空核心 Hollow Core
					//core_desolate 荒芜核心 Desolate Core
					//core_chunithm CHUNITHM 核心 CHUNITHM Core
					//core_crimson 深红核心 Crimson Core
					//core_ambivalent 悖异核心 Ambivalent Core
					//core_scarlet 绯红核心 Scarlet Core
					//core_groove 音炫核心 Groove Core
					//core_binary 双生核心 Binary Core
					//core_colorful 缤纷核心 Colorful Core
					//core_umbral 暗影核心 Umbral Core
					//core_sunset 暮色核心 Sunset Core
					//core_course_skip_purchase 次元结晶 Warped Shard
				}
			]
		},
		{
			"position": 8,
			"capture": 5,
			"items": [
				{
					"type": "pack",
					"id": "base"
					//曲包
					//type: str, id: str
					//id对应PackID
					//NS端专属,在移动端也存在,但使用移动端显示时会崩溃
				}
			]
		},
		{
			"position": 9,
			"capture": 5,
			"items": [
				{
					"type": "world_unlock",
					"id": "scenery_chap1"
					//世界解锁相关
					//type: str, id: str
					//目前只能添加背景
					//于3.0.0新增
		
					//章节背景(4.4.4):
					//scenery_chap1 失落的世界 Lost World
					//scenery_chap2 谜域的界外 Outer Reaches
					//scenery_chap3 聚合的塔尖 Spire of Convergence
					//scenery_chap4 沉眠的回声 Dormant Echoes
					//scenery_chap5 无央的决裂 Boundless Divide
					//scenery_chap6 遗忘的构念 Forgotten Construct
					//scenery_chap7 回首的天际 Horizon of Anamnesis
					//scenery_beyond Beyond Beyond
				}
			]
		},
		{
			"position": 10,
			"capture": 5,
			"items": [
				{
					"type": "anni5tix",
					"amount": 1
					//五周年兑换券
					//type: str, amount: int
					//于3.12.2新增
				}
			]
		},
		{
			"position": 11,
			"capture": 5,
			"restrict_id": "shadesoflight",
			"restrict_type": "song_id"
			//限制游玩指定曲目
			//restrict_id: str, restrict_type: str
			//restrict_id对应SongID
		},
		{
			"position": 12,
			"capture": 5,
			"restrict_ids": [
				"shadesoflight",
				"sayonarahatsukoi"
			],
			"restrict_type": "song_id"
			//限制游玩指定的多首曲目
			//restrict_ids: [str, ...], restrict_type: str
			//restrict_ids对应SongID
		},
		{
			"position": 13,
			"capture": 5,
			"restrict_id": "base",
			"restrict_type": "pack_id"
			//限制游玩指定曲包
			//restrict_id: str, restrict_type: str
			//restrict_id对应PackID
		},
		{
			"position": 14,
			"capture": 5,
			"restrict_difficulty": 2
			//限制游玩指定难度
			//restrict_difficulty: int
			//restrict_difficulty对应ratingClass
			//于3.10.0新增
		},
		{
			"position": 15,
			"capture": 5,
			"step_type": [
				"randomsong"
			]
			//随机曲目
			//step_type: [str, ...]
			//曲目列表会显示特殊曲目(ID:random)
		},
		{
			"position": 16,
			"capture": 5,
			"step_type": [
				"speedlimit"
			],
			"speed_limit_value": 65
			//流速限制
			//step_type: [str, ...], speed_limit_value: int
			//speed_limit_value为对应流速x10后的数字
		},
		{
			"position": 17,
			"capture": 5,
			"step_type": [
				"plusstamina"
			],
			"plus_stamina_value": 12
			//体力奖励
			//step_type: [str, ...], plus_stamina_value: int
			//plus_stamina_value对应增加体力
		},
		{
			"position": 18,
			"capture": 5,
			"items": [
				{
					"type": "fragment",
					"amount": 616
				}, 
				{
					"type": "memory",
					"amount": 616
				}
			]
			//设置多个奖励
			//游戏内实际只显示第一个奖励
		},
		{
			"position": 19,
			"capture": 5,
			"restrict_id": "base",
			"restrict_type": "pack_id",
			"step_type": [
				"randomsong"
			]
			//限制曲包+随机曲目混搭
		},
		{
			"position": 20,
			"capture": 5,
			"restrict_ids": [
				"tempestissimo",
				"testify"
			],
			"restrict_type": "song_id",
			"step_type": [
				"randomsong",
				"plusstamina",
				"speedlimit"
			],
			"restrict_difficulty": 3,
			"plus_stamina_value": 2,
			"speed_limit_value": 25,
			"items": [
				{
					"type": "fragment",
					"amount": 2000
				}
			]
			//限制歌曲+限制难度+随机曲目+体力奖励+流速限制+残片奖励混搭
		},
		{
			"position": 21,
			"capture": 0,
			"items": [
				{
					"type": "core",
					"id": "core_generic",
					"amount": 5
					//最后一格请设置至少一个奖励
				}
			]
		}
	]
}

Beyond地图的台阶排列与普通地图不同:

{
    "map_id": "example",
    "is_beyond": true,
    //是否启用Beyond地图机制 bool
      
    "beyond_health": 150,
    //Beyond地图的总百分比 int
      
    "character_affinity": [
		0,
		1
	],
    //Beyond地图的相性契合搭档 [int, ...]
      
    "affinity_multiplier": [
		1.0,
		1.5
	],
    //Beyond地图的相性契合加成 [float, ...]
      
    "chapter": 1001,
    //地图章节 int
      
    "available_from": -1,
    "available_to": -1,
    "require_id": "shadesoflight2",
    //解锁时需要开启的对应物品ID str/[str, ...]
      
    "require_type": "chart_unlock",
    //解锁时所需物品的类型 str

    "coordinate": "0,0",
    "step_count": 5,
    //地图总步数 int
    
    "stamina_cost": 3,
    //在该地图内游玩一次所需要的体力 int
      
    "curr_position": 0,
    "curr_capture": 0,
    "is_locked": false,
    "steps": [
		{	
		//使用正常地图语句,如要正确配置请从结尾Step开始编辑
			"position": 0,
			//最低点,用于标记开头
        
			"capture": 50
			//以beyond_health的值为被减数,与所有capture相加后的和相减,结果为0则配置成功
			//或者确保全部capture的值相加起来等于beyond_health的值
		},
		{
			"position": 1,
			"capture": 25,
			"items": [
				{
					"type": "fragment",
					"amount": 616
				}
			]
			//剩余点的计算原理与二点相同
		},
		{
			"position": 2,
			//标记二点
        
			"capture": 25,
			//以capture的值为减数,与一点得出的百分比相减,得出本点百分比
			//一点从100%开始,相减后得到结果75,则本点从75%开始
        
			"items": [
				{
					"type": "core",
					"id": "core_generic",
					"amount": 1
				}
			]
			//奖励只会在本点开始时领取
		},
		{
			"position": 3,
			//标记一点

			"capture": 50,
			//以capture的值为减数,将其与beyond_health的值相减,得出本点百分比
			//此地图的beyond_health为150,相减后得到结果100,则本点从100%开始
        
			"restrict_id": "shadesoflight",
			"restrict_type": "song_id"
			//普通/特殊限制格会在到达下一点前一直有效
		},
		{
			"position": 4,
			//最高点,用于标记奖励
        
			"capture": 0,
			//确保capture0
        
			"items": [
				{
					"type": "world_song",
					"id": "shadesoflight3"
				}
			]
		}
	]
}

Breached地图的台阶排列与普通地图不同:

{
    "map_id": "example",
    "is_beyond": true,
    //是否启用Beyond地图机制 bool
      
    "beyond_health": 200,
    //Beyond地图/Breach地图的总百分比 int
      
    "character_affinity": [
    ],
    //Beyond地图的相性契合搭档 [int, ...]
      
    "affinity_multiplier": [
    ],
    //Beyond地图的相性契合加成 [float, ...]
    
    "is_breached": true,
    //是否启用Breach地图机制 bool
    
    "disable_over": true,
    //是否禁止Overdrive参与PROG计算 bool
    
    "new_law": "over100_step50",
    //Breach地图的法则 str
      
    "chapter": 2001,
    //地图章节 int 必需字段
      
    "available_from": -1,
    "available_to": -1,
    "require_type": "chart_unlock",
    //解锁时所需物品的类型 str
      
    "require_id": "inkarusi2",
    //解锁时需要开启的对应物品ID str/[str, ...]
      
    "coordinate": "0,0",
    "step_count": 6,
    //地图总步数 int 必需字段
      
    "stamina_cost": 3,
    //在该地图内游玩一次所需要的体力 int
      
    "curr_position": 0,
    "curr_capture": 0,
    "is_locked": false,
    "steps": [
        // 打印出每个点百分比的Python代码示例:
        // current_health = 0
        // steps = [dict, ...]  # 即为地图的steps
        // for step in steps:
        //     current_health += step['capture']
        //     print(f"Pos {step['position']}: {current_health}%")
        {
            "position": 0,
            //标记一点
            
            "capture": 50
            //以此点的百分比为减数,将其与下一点的百分比相减,得出capture的值
            //初始进度固定0%,设下一点的百分比为50%,相减后得50,即为capture的值
        },
        {
            "position": 1
            //标记二点
            
            "capture": 50,
            //以此点的百分比为减数,将其与下一点的百分比相减,得出capture的值
            //由一点的capture可知,一点的百分比与本点的百分比的差为50,则本点的百分比为50%
            
            "items": [
                {
                    "type": "core",
                    "id": "core_generic",
                    "amount": 2
                }
            ]
			//奖励只会在本点开始时领取
        },
        {
            "position": 2,
            //标记三点
            
            "capture": 50,
            //以此点的百分比为减数,将其与下一点的百分比相减,得出capture的值
            //由二点的capture可知,二点的百分比与本点的百分比的差为50,则本点的百分比为100%
            
            "items": [
                {
                    "type": "fragment",
                    "amount": 500
                }
            ],
            "restrict_ids": [
                "memoryfactory",
                "lumia",
                "pragmatism",
                "paradise",
                "flashback",
                "flyburg",
                "partyvinyl",
                "nirvluce",
                "blossoms",
                "romancewars",
                "moonheart",
                "syro",
                "nexttoyou",
                "memoryforest",
                "guardina",
                "inkarusi",
                "mazenine",
                "themessage",
                "sulfur",
                "etherstrike",
                "fractureray",
                "solitarydream"
            ],
            "restrict_type": "song_id",
            "restrict_difficulty": 2
			//普通/特殊限制格会在到达下一点前一直有效
        },
        {
            "position": 4,
            "capture": 50,
            "items": [
                {
                    "type": "core",
                    "id": "core_generic",
                    "amount": 2
                }
            ],
            "restrict_ids": [
                "memoryfactory",
                "lumia",
                "pragmatism",
                "paradise",
                "flashback",
                "flyburg",
                "partyvinyl",
                "nirvluce",
                "blossoms",
                "romancewars",
                "moonheart",
                "syro",
                "nexttoyou",
                "memoryforest",
                "guardina",
                "inkarusi",
                "mazenine",
                "themessage",
                "sulfur",
                "etherstrike",
                "fractureray",
                "solitarydream"
            ],
            "restrict_type": "song_id",
            "restrict_difficulty": 2
        },
        {
            "position": 5,
            //终点,用于标记奖励
            
            "capture": 0,
			//确保capture0
            
            "items": [
                {
                    "type": "world_song",
                    "id": "inkarusi3"
				}
			]
		}
	]
}