Docs: add a living faq document for sharing dev solutions (#3156)
* adding one faq :) * adding another faq that links to the relevant file * add lined line breaks between questions and lower the heading size of the question so sub-divisions can be added later * missed some newlines * updating best practice filler method * add note about get_filler_item_name() * updates to wording from review * add section to CODEOWNERS for maintainers of this doc * use underscores to reference the file easier in CODEOWNERS * update link to be direct and filter to function name
This commit is contained in:
		
							parent
							
								
									496f0e09af
								
							
						
					
					
						commit
						deae524e9b
					
				| 
						 | 
				
			
			@ -1,8 +1,8 @@
 | 
			
		|||
# Archipelago World Code Owners / Maintainers Document
 | 
			
		||||
#
 | 
			
		||||
# This file is used to notate the current "owners" or "maintainers" of any currently merged world folder. For any pull
 | 
			
		||||
# requests that modify these worlds, a code owner must approve the PR in addition to a core maintainer. This is not to
 | 
			
		||||
# be used for files/folders outside the /worlds folder, those will always need sign off from a core maintainer.
 | 
			
		||||
# This file is used to notate the current "owners" or "maintainers" of any currently merged world folder as well as
 | 
			
		||||
# certain documentation. For any pull requests that modify these worlds/docs, a code owner must approve the PR in
 | 
			
		||||
# addition to a core maintainer. All other files and folders are owned and maintained by core maintainers directly.
 | 
			
		||||
#
 | 
			
		||||
# All usernames must be GitHub usernames (and are case sensitive).
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -226,3 +226,11 @@
 | 
			
		|||
 | 
			
		||||
# Ori and the Blind Forest
 | 
			
		||||
# /worlds_disabled/oribf/
 | 
			
		||||
 | 
			
		||||
###################
 | 
			
		||||
## Documentation ##
 | 
			
		||||
###################
 | 
			
		||||
 | 
			
		||||
# Apworld Dev Faq
 | 
			
		||||
/docs/apworld_dev_faq.md @qwint @ScipioWright
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
# APWorld Dev FAQ
 | 
			
		||||
 | 
			
		||||
This document is meant as a reference tool to show solutions to common problems when developing an apworld.
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
### My game has a restrictive start that leads to fill errors
 | 
			
		||||
 | 
			
		||||
Hint to the Generator that an item needs to be in sphere one with local_early_items
 | 
			
		||||
```py
 | 
			
		||||
early_item_name = "Sword"
 | 
			
		||||
self.multiworld.local_early_items[self.player][early_item_name] = 1
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
---
 | 
			
		||||
 | 
			
		||||
### I have multiple settings that change the item/location pool counts and need to balance them out
 | 
			
		||||
 | 
			
		||||
In an ideal situation your system for producing locations and items wouldn't leave any opportunity for them to be unbalanced. But in real, complex situations, that might be unfeasible.
 | 
			
		||||
 | 
			
		||||
If that's the case, you can create extra filler based on the difference between your unfilled locations and your itempool by comparing [get_unfilled_locations](https://github.com/ArchipelagoMW/Archipelago/blob/main/BaseClasses.py#:~:text=get_unfilled_locations) to your list of items to submit
 | 
			
		||||
 | 
			
		||||
Note: to use self.create_filler(), self.get_filler_item_name() should be defined to only return valid filler item names
 | 
			
		||||
```py
 | 
			
		||||
total_locations = len(self.multiworld.get_unfilled_locations(self.player))
 | 
			
		||||
item_pool = self.create_non_filler_items()
 | 
			
		||||
 | 
			
		||||
while len(item_pool) < total_locations:
 | 
			
		||||
    item_pool.append(self.create_filler())
 | 
			
		||||
 | 
			
		||||
self.multiworld.itempool += item_pool
 | 
			
		||||
```
 | 
			
		||||
		Loading…
	
		Reference in New Issue