Skip to content

Releases: redruin1/factorio-draftsman

2.0.3

16 Jul 18:37
Compare
Choose a tag to compare
  • Updated factorio-data to version 2.0.60 (latest)
  • Fixed #164 (Decider combinator example doesn't work)
  • Merged vjanell's pull request:
    • Fix reversed operators in DeciderCombinator __ge__ and __le__ methods
  • Fixed #178 (Entity flipping logic has multiple bugs and crashes)

2.0.2

21 Apr 01:28
Compare
Choose a tag to compare
  • Updated factorio-data to version 2.0.45 (latest)
  • Fixed #158 (Key "comparator" not found when exporting/importing Constant Combinator)
  • Fixed #157 (Incompatibility with pydantic>=2.11)

2.0.1

17 Mar 00:44
Compare
Choose a tag to compare
  • Updated factorio-data to version 2.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 API surface_conditions
  • Added Entity.is_placeable_on(), which returns false if an entity's surface_conditions prohibit their construction on a planet
  • Added utils.passes_surface_conditions(), which acts as the abstract backend which runs Entity.is_placable_on() and recipes.is_usable_on()
  • Added testing for Asteroid Collector
  • Finished implementing features for LogisticsContainers
  • quality is now an accessible and modifiable attribute of Entitys
  • Made Container.inventory_size proportional to the entity's quality
    • (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()
    • draftsman now 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

03 Jan 00:08
bed147f
Compare
Choose a tag to compare

For a more user friendly overview of some of the changes, see here.

  • Updated factorio-data to version 2.0.28 (latest)
  • Updated compatibility/defines.lua to 2.0.28 (latest)
  • Updated all prototypes to match Factorio 2.0
  • Added new prototypes in Factorio 2.0
    • AgriculturalTower
    • AsteroidCollector
    • Car
    • CargoBay
    • CargoLandingPad
    • CurvedRailA
    • CurvedRailB
    • DisplayPanel
    • ElevatedCurvedRailA
    • ElevatedCurvedRailB
    • ElevatedHalfDiagonalRail
    • ElevatedStraightRail
    • FusionGenerator
    • FusionReactor
    • HalfDiagonalRail
    • LightningAttractor
    • RailRamp
    • RailSupport
    • SelectorCombinator
    • SpacePlatformHub
    • SpiderVehicle
    • Thruster
  • Removed command line utility draftsman-update
  • Added command line utility draftsman with multiple subcommands
    • draftsman update ... for the original functionality of modifying a Factorio environment
    • draftsman list to list all mods detected under a particular environment
    • draftsman enable/disable ... enables or disables one or more mods
    • draftsman factorio-version reports or sets the version of Factorio's data
    • draftsman version reports Draftsman's own semantic version
    • Write draftsman -h or draftsman [command] -h for more information
  • Swapped from schema to pydantic
    • 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 unittest to pytest (more features with similar syntax; coverage run still works the same)
  • Changed the code to be primarily Python3 compatible with the new minimum version
  • Added extras module which implements some handy new features:
    • Added flip_belts(blueprint) which flips all belt entities inside the blueprint (preserving continuity)
  • Added a bunch of equivalent functions from the Factorio StdLib:
    • Added opposite(), next(), previous(), to_orientation(), and to_vector() to Direction
    • Added Orientation class, similar to Direction; comes with it's own suite of __add__(), to_direction(), and to_vector() helpers
    • Added constants.Ticks enumeration which contains SECONDS, MINUTES, HOURS, etc. stored as quantities of Factorio ticks
  • Added union, intersection, and difference to EntityList, TileList, and ScheduleList
  • Updated Direction to now be the Factorio 2.0 16-direction enum; use LegacyDirection for 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 WaitCondition and WaitConditions objects which keep track of train station condition trees
    • WaitConditions can be combined using bitwise and and or in order to collect them into a WaitConditions object:
    • Added WaitConditionType and WaitConditionCompareType enumerations
  • Added Collection.add_train_at_position() and Collection.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.fluids module with some useful helpers
  • Added data.planets module allowing you to access planet metadata for things like surface properties
  • Added data.items.fuels which 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 RequestItemsMixin to Locomotive, CargoWagon, and ArtilleryWagon
  • Added unknown keyword 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 InvalidEntityError and InvalidTileErrors so 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 type Container("wooden-chest") and suggest that to you instead
  • 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 examples folder which provides short descriptions for all of the examples
  • Integrated aforementioned examples into the test suite
  • Removed the area, tile_width, and tile_height properties from Blueprint, which have been replaced with get_world_bounding_box() and get_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_first method 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 index attribute to all Blueprintable types, 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 x and y attributes of both position and tile_position and have each other update in tandem
    • Made it possible to rotate objects in parent Collections as 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
  • 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_mask keys are resolved at once at the data level when you call draftsman-update, so you can query entities.raw for the correct default value
  • Bumped Lupa to 2.0 which allows me to specify Lua version 5.2 which Factorio uses (#50)
    • draftsman-update will 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-version command for draftsman-update which 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 all EntityCollection and TileCollection classes
  • Removed on_(insert/set/remove) from all Entity implementations as well (they were not used and are replaced with better things now)
  • Renamed data member to _root member on EntityList and TileList (Internal reasons)
  • Fixed issue #119

1.1.1

24 Jan 18:18
Compare
Choose a tag to compare
  • Updated factorio-data to version 1.1.103
  • Merged RosieBaish's pull request:
    • Added an extend() function to EntityList along with notes about it's performance
  • Fixed issue #101 (finally)

1.1.0

19 Sep 12:20
Compare
Choose a tag to compare

1.1.0

  • Added a number of missing prototype objects that are blueprintable:
    • SimpleEntityWithOwner
    • SimpleEntityWithForce
    • PlayerPort
  • Fixed an issue where color settings were not recognized in the settings stage (#103)
  • Fixed issue loading IndustrialRevolution modpack (regression) (#98)

1.0.6

23 Jul 21:59
Compare
Choose a tag to compare
  • Updated factorio-data to version 1.1.88
  • Updated compatibility/defines.lua to 1.1.88
  • Merged arpheno's pull request:
    • Fixed Pump so that it now correctly exports it's direction
  • Merged SIGSTACKFAULT's pull requests:
    • Fix type annotation of Tile.__init__()
    • Fix type annotation of BlueprintBook.insert()
  • draftsman-update is now (finally) able to load mods from folder directories instead of just zip archives
  • draftsman-update will now prefer mods in folders instead of zip archives if one of each type present and they have the exact same ID and version (I think this matches Factorio, create an issue if it's not)
  • Added --report command to draftsman-update that prints out a list of currently active mods and their versions (to aid in bug reports)
  • Fixed Lua defines table not being defined by the time factorio-data/core runs (#85)
  • Fixed UTF-8 BOM tokens not being properly stripped from all mod Lua files, resulting in issues when sending to Lupa (#84)
  • Changed the Lua load process a whole lot for draftsman-update, hopefully behaving more predictably and causing no regressions

1.0.5

12 Jun 17:32
Compare
Choose a tag to compare
  • Added get_blueprintable_from_JSON() and patched get_blueprintable_from_string() so that it no longer converts the string twice (accidentally)
  • Fixed issue where integer playback_volume values on programmable speakers wasn't getting coerced to a float and failing validation (#72)
  • Fixed Blueprintable objects not being correctly initialized from their constructor when JSON dicts were passed as an argument (#75)
  • Fixed OverlappingObjectsWarning being incorrectly emitted when Gates overlap StraightRails (they now are only emitted if they're not perpendicular to each other) (#76)
  • Fixed ConstantCombinator not recognizing the is_on member (#77)

1.0.4

17 May 20:35
Compare
Choose a tag to compare
  • Updated factorio-data to version 1.1.80
  • Updated compatibility/defines.lua to 1.1.80
  • Merged louga31's pull request:
    • Fix recipes so that they correctly read either internal format
  • Fixed an issue where not all entities were being assigned to entities.flippable (#61)
  • Fixed mod dependency loading (hopefully) so that it should actually handle recursive requires across an arbitrary number of different mods (#70)
  • Fixed an issue where required Lua files with a single prepended dot or slash would break the path resolution (#70)

1.0.3

13 Mar 01:33
Compare
Choose a tag to compare
  • Updated factorio-data to version 1.1.76 (latest stable)
  • Updated compatibility/defines.lua to 1.1.76 (latest stable)
  • Merged penguincounter's pull request:
    • Fixed logistics requester and buffer chest signatures not having the correct circuit_mode_of_operation key
  • Added a dump_format() method to entities that outputs a user friendly description of all of the possible key/value entries in the exported blueprint dict
    • Still needs to be done for Blueprintable; ideally there would be a Exportable parent class that would implement the madness
    • Also need to investigate faster validation options since schema is pretty slow; maybe we can unify and improve speed at the same time
  • Added a get_format() method intended to get a readable formatted string (that can easily be autogenerated at the top of each entity in the documentation! Not yet but soon)
  • Changed _exports dict to be both more user readable and only defined on a per class basis instead of a per instance basis (so memory usage should be down)
  • Prepped env.py for when Lupa version 2.0 goes live (which will resolve #50)
  • Fixed "Mining_Drones_Harder" mod not loading because of stray "__MACOSX" folder defined alongside (#55)
  • Fixed "FactorioExtended-Plus-Logistics" not loading due to internal file titled __init__.lua (#56)
  • Fixed env.extract_entities().categorize_entities() to get flags instead of assuming they exist ("flags" set is common but optional)