| 
									
										
										
										
											2022-08-15 23:47:32 +02:00
										 |  |  | # apworld Specification
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Archipelago depends on worlds to provide game-specific details like items, locations and output generation. | 
					
						
							| 
									
										
										
										
											2023-07-09 18:04:24 +02:00
										 |  |  | Those are located in the `worlds/` folder (source) or `<install dir>/lib/worlds/` (when installed). | 
					
						
							| 
									
										
										
										
											2022-12-08 02:57:49 +01:00
										 |  |  | See [world api.md](world%20api.md) for details. | 
					
						
							| 
									
										
										
										
											2022-08-15 23:47:32 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | apworld provides a way to package and ship a world that is not part of the main distribution by placing a `*.apworld` | 
					
						
							|  |  |  | file into the worlds folder. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-09 18:43:39 +02:00
										 |  |  | **Warning:** apworlds have to be all lower case, otherwise they raise a bogus Exception when trying to import in frozen python 3.10+! | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-15 23:47:32 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | ## File Format
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-09 18:43:39 +02:00
										 |  |  | apworld files are zip archives, all lower case, with the file ending `.apworld`. | 
					
						
							| 
									
										
										
										
											2022-08-15 23:47:32 +02:00
										 |  |  | The zip has to contain a folder with the same name as the zip, case-sensitive, that contains what would normally be in | 
					
						
							|  |  |  | the world's folder in `worlds/`. I.e. `worlds/ror2.apworld` containing `ror2/__init__.py`. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Metadata
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | No metadata is specified yet. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Extra Data
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The zip can contain arbitrary files in addition what was specified above. | 
					
						
							| 
									
										
										
										
											2022-09-18 00:00:54 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ## Caveats
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-15 10:07:42 -06:00
										 |  |  | Imports from other files inside the apworld have to use relative imports. e.g. `from .options import MyGameOptions` | 
					
						
							| 
									
										
										
										
											2022-09-18 00:00:54 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-11-15 10:07:42 -06:00
										 |  |  | Imports from AP base have to use absolute imports, e.g. `from Options import Toggle` or | 
					
						
							|  |  |  | `from worlds.AutoWorld import World` |