Releases: redruin1/factorio-draftsman
Releases · redruin1/factorio-draftsman
3.3.0
- Updated
factorio-datato version2.0.76(latest) - Added
ConstantCombinator.add_signalandConstantCombinator.get_signal- These make simple cases of setting a unique signals in a constant combinator much easier since you don't have to do the signal section management yourself
- Added
sqrt_lut.pyandtedius_inserters.pyto./examples - Merged Snagnar's pull request:
- Selector combinator
count_inputs_signalshould becount_signal
- Selector combinator
- Fixed #217 (Turret
priority_listshould bepriority-list)
3.2.0
- Updated
factorio-datato version2.0.71(latest) - Updated
Splitterto be circuit connectable (Factorio2.0.67) - Made more
SignalFilterattributes optional, bringing it more in line with how Factorio operates - Removed several hacks working around a bug in
attrs- Minimum
attrsversion is now25.4.0
- Minimum
- Fixed issues hidden by the hacky workaround of above bug
- Added (mostly) correct collision boxes for all new rail entities (
[Elevated]StraightRail,[Elevated]HalfDiagonalRail,[Elevated]CurvedRailA,[Elevated]CurvedRailB) - Fixed #205 (Cannot create or load an interrupt with targets)
- Fixed #207 (TypeError running README example)
- Removed validator issuing
GridAlignmentWarnings (possibly temporarily) due to lack of contextual information needed to make them useful
3.1.1
3.1.0
3.0.1
- Updated
factorio-datato version2.0.64(latest stable) - Added
--ownsand--no-dlcarguments todraftsman updateanddraftsman.environment.run_data_lifecycle()(#184) - Added command
just benchmarkwhich will run a suite of benchmarks and record the result in a.benchmarksfolder - [PERF] Improved
ManualSection.get/set_signal()for requester chests and constant combinators - [PERF] Implemented a special
SpatialDataStructurefortiles, leading to ~16x speedup on adding tiles to blueprints - Fixed #185 (Load order inconsistencies/disparity on non-trivial mod lists)
3.0.0
- Updated
factorio-datato version2.0.63(latest stable) - Switched from
pydantictoattrs;- A much better fit for Draftsman's scope, much more flexible, and much less boilerplate to maintain
- Clearer distinction between loading steps:
- Constructors are for initializing Draftsman objects
from_dict()andfrom_string()methods are for importing from raw JSON/Blueprint Stringto_dict()andto_string()methods are for exporting to raw JSON/Blueprint String- Hooks are defined outside of the class scope which converts the raw JSON format to the internal Python object form
- This now means that the Python objects are not strictly tied to the JSON format, which means they can deviate for ease of use/performance reasons
- Conversion functions are separate from validation, meaning shorthands can be resolved even with validation functions turned off
- Draftsman entities can now handle importing/exporting between Factorio 1.0 and Factorio 2.0 blueprint string formats
- Simply specify
version=(1, 0)orversion=(2, 0)in any ofto/from_dict()orto/from_string()methods - While serialization/deserialization is correctly implemented, migration from an old to new string is not (fully) implemented, and so some parts will still have to be done manually
- For example, Draftsman will not convert a 1.0
"filter-inserter"into a 2.0"fast-inserter"for you
- For example, Draftsman will not convert a 1.0
- Simply specify
- Added tests to validate the exported formats of all objects match the above JSON schemas, on both game versions
- Added
draftsman.constants.InventoryTypewhich is part of defines - Changed the constant
ValidationMode.NONEto be the more explicitValidationMode.DISABLED - Removed the
validate_assignmentattribute entirely- Instead, validation is now on a global flag (until there is a good reason for it not to be); makes things much simpler
- Global flag can be acquired with
draftsman.validators.get_mode()and set withdraftsman.validators.set_mode(...) set_mode()can also be used as a context manager:# Default validation level is `STRICT` assert draftsman.validators.get_mode() is ValidationMode.STRICT with draftsman.validators.set_mode(ValidationMode.DISABLED): # No validators are run inside this block assert draftsman.validators.get_mode() is ValidationMode.DISABLED # Validation state returns to whatever it was set before assert draftsman.validators.get_mode() is ValidationMode.STRICT
- Calling a objects
validate()method is now guaranteed to also validate all of its children - Removed
RequestItemsMixinand implemented it directly inEntity(since all entities can request construction items) - Removed
__factorio_version__and__factorio_version_info__- Users should instead use
draftsman.data.mods.versions["base"]if you want to query the current Factorio version; this gives you the flexibility to change Factorio version midway through scripts (if necessary)
- Users should instead use
- Added
tilestoGroups(#118)Blueprint.entitiesis now 1-dimensional- A new attribute
Blueprint.groupsnow holds children associated with that blueprintblueprint = Blueprint() group = Group() group.entities.append("blah", position=...) blueprint.groups.append(group)
blueprint.entities[("a", "b", "c")]is nowblueprint.groups["a"].groups["b"].entities["c"], which is more explicit and allows for accessing the newly addedtilesattribute- However, ID-sequences are still permitted in function calls, a la:
blueprint.add_circuit_connection("red", ("a", "b", "c"), ("x", "y", "z"))
- Tidied up the build system
- Removed
setup.pyin favor of more modernpyproject.toml - You can now use
justwith draftsman to run common CI commands, see new README
- Removed
- Made docs pass and fixed code coverage
- Wrote an obnoxious amount of new and updated documentation
- Fixed an issue where certain mods would no be displayed correctly as disabled when using
draftsman list - Fixed #182 (Failing to update with any mods, with an AttributeError caused by an internal function.)
2.0.3
2.0.2
2.0.1
- Updated
factorio-datato version2.0.41(latest) - Added
planets.get_surface_properties()which grabs a dict of surface properties with valid defaults - Added
Entity.surface_conditions, which maps directly to the Factorio APIsurface_conditions - Added
Entity.is_placeable_on(), which returns false if an entity'ssurface_conditionsprohibit their construction on a planet - Added
utils.passes_surface_conditions(), which acts as the abstract backend which runsEntity.is_placable_on()andrecipes.is_usable_on() - Added testing for
Asteroid Collector - Finished implementing features for
LogisticsContainers qualityis now an accessible and modifiable attribute ofEntitys- Made
Container.inventory_sizeproportional to the entity'squality- (note that all quality modifiers are not yet available)
- Merge RosieBaish's pull request:
- Add logic to allow mods with different special characters
- Merge Gavinp's pull requests:
- Add test for creating items with position
- Add test for recycler
get_world_bounding_box() draftsmannow prints usage/help on empty args.
- Fixed #142 (Logistics containers not importing properly)
- Fixed #121 (Support for Bob's Inserters)
- Fixed #151 (Severe Performance degradation when using
add_circuit_connection)
2.0.0
For a more user friendly overview of some of the changes, see here.
- Updated
factorio-datato version2.0.28(latest) - Updated
compatibility/defines.luato2.0.28(latest) - Updated all prototypes to match Factorio 2.0
- Added new prototypes in Factorio 2.0
AgriculturalTowerAsteroidCollectorCarCargoBayCargoLandingPadCurvedRailACurvedRailBDisplayPanelElevatedCurvedRailAElevatedCurvedRailBElevatedHalfDiagonalRailElevatedStraightRailFusionGeneratorFusionReactorHalfDiagonalRailLightningAttractorRailRampRailSupportSelectorCombinatorSpacePlatformHubSpiderVehicleThruster
- Removed command line utility
draftsman-update - Added command line utility
draftsmanwith multiple subcommandsdraftsman update ...for the original functionality of modifying a Factorio environmentdraftsman listto list all mods detected under a particular environmentdraftsman enable/disable ...enables or disables one or more modsdraftsman factorio-versionreports or sets the version of Factorio's datadraftsman versionreports Draftsman's own semantic version- Write
draftsman -hordraftsman [command] -hfor more information
- Swapped from
schematopydantic- Format for specifying schemas is now much clearer
- Both blueprintables and entities now share the same exporting code, overall making more sense
- Can now create a JSON schema of any entity or blueprintable (by calling
Object.json_schema()), which can be exported and used in any other program that reads JSON schema(!) - However, minimum Python version is now 3.7 to support type hints
- Switched from
unittesttopytest(more features with similar syntax;coverage runstill works the same) - Changed the code to be primarily Python3 compatible with the new minimum version
- Added
extrasmodule which implements some handy new features:- Added
flip_belts(blueprint)which flips all belt entities inside the blueprint (preserving continuity)
- Added
- Added a bunch of equivalent functions from the Factorio StdLib:
- Added
opposite(),next(),previous(),to_orientation(), andto_vector()toDirection - Added
Orientationclass, similar toDirection; comes with it's own suite of__add__(),to_direction(), andto_vector()helpers - Added
constants.Ticksenumeration which containsSECONDS,MINUTES,HOURS, etc. stored as quantities of Factorio ticks
- Added
- Added
union,intersection, anddifferencetoEntityList,TileList, andScheduleList - Updated
Directionto now be the Factorio 2.0 16-direction enum; useLegacyDirectionfor the old enumerations - Added
TrainConfiguration, which allows you to specify entire trains with strings like"1-4-1"and customize them on a per-car basis - Added
WaitConditionandWaitConditionsobjects which keep track of train station condition treesWaitConditionscan be combined using bitwiseandandorin order to collect them into aWaitConditionsobject:- Added
WaitConditionTypeandWaitConditionCompareTypeenumerations
- Added
Collection.add_train_at_position()andCollection.add_train_at_station()to make placing trains easier - Added
Collection.find_trains_filtered()to allow users to search Blueprints/Groups for trains of particular types - Added
RailPlanner(finally) - Added
data.fluidsmodule with some useful helpers - Added
data.planetsmodule allowing you to access planet metadata for things like surface properties - Added
data.items.fuelswhich is dict of sets of item names that fall under their respective fuel categories - Added data functions
signals.add_signal(),tiles.add_tile(),entities.add_entity(), etc. which allow you to add entities on the fly (primarily for Factorio environment compatibility) - Added
RequestItemsMixintoLocomotive,CargoWagon, andArtilleryWagon - Added
unknownkeyword to all entity/tile creation constructs which allows the user to specify what should happen when draftsman encounters an entity it doesn't recognize - Changed
InvalidEntityErrorandInvalidTileErrorsso that they now try to detect a similar tile/entity name and display that information to the user in the error message- For example, if you accidentally type
Container("wodenchest"), it will realize you probably meant to typeContainer("wooden-chest")and suggest that to you instead
- For example, if you accidentally type
- Added a bunch of new documentation to document the above
- Added a bunch of new examples to test out the above new features
- Added a fixture that ensures that Draftsman is running a vanilla configuration before running tests, and exits if it detects that it is not the case.
- Added a new command line option for
draftsman-update--lua-version, which prints the version of Lua currently being used for debugging compat issues - Added a README.md to the
examplesfolder which provides short descriptions for all of the examples - Integrated aforementioned examples into the test suite
- Removed the
area,tile_width, andtile_heightproperties fromBlueprint, which have been replaced withget_world_bounding_box()andget_dimensions()- These attributes are no longer cached in the blueprint and have to be recalculated each time such information is desired
- However, this means that it only has to be calculated when the user actually wants it, instead of every time a user adds a new entity/tile to a blueprint
- The user has a better idea of when they can cache the blueprint's dimension to reduce calculation, so it's deferred to the user
- By making them functions it also makes it abundantly clear that calling them is not likely
O(1)
- Added the
get_firstmethod to the defaults for the name of every entity- This means that if a data configuration has zero entities of a particular type, using a default name will result in a palatable error instead of something cryptic
- Added
indexattribute to allBlueprintabletypes, which allows the end user to customize the index in a parent BlueprintBook manually
(Still autogenerated based on list order if unspecified, but now can be overridden) - Added data functions
signals.add_signal(),tiles.add_tile(),entities.add_entity(), etc. which allow you to add entities on the fly (primarily for Factorio environment compatibility) - Fixed a bunch of warts in the API:
- Added the ability to modify
xandyattributes of bothpositionandtile_positionand have each other update in tandem - Made it possible to rotate objects in parent
Collectionsas long as they're either square or rotated such that they preserve their original footprint (akin to Factorio) - Added
__eq__operators to pretty much all draftsman things (Entity,EntityList,TileList,ScheduleList,Schedule,WaitConditions, etc.) - Added more professional
__repr__functions to pretty much all draftsman things as well
- Added the ability to modify
- Normalized all import filenames to use underscores consistently (potentially breaking change!)
- Finished up documentation on
DeconstructionPlanner - [PERF] Reduced memory consumption by up to ~80 percent(!) (This also made it quite a bit faster to boot)
- Made it so that default
collision_maskkeys are resolved at once at the data level when you calldraftsman-update, so you can queryentities.rawfor the correct default value - Bumped Lupa to 2.0 which allows me to specify Lua version 5.2 which Factorio uses (#50)
draftsman-updatewill issue a warning if it cannot specify the correct Lua version: It'll still try to load and may still work anyway, but it's not guaranteed to\
- Added
--factorio-versioncommand fordraftsman-updatewhich either displays the current Factorio version or sets it to a specific Github tag - Patched InvalidModVersionError for now (#51)
- Removed
on_(tile/entity)_(insert/set/remove)from allEntityCollectionandTileCollectionclasses - Removed
on_(insert/set/remove)from allEntityimplementations as well (they were not used and are replaced with better things now) - Renamed
datamember to_rootmember onEntityListandTileList(Internal reasons) - Fixed issue #119