For a more user friendly overview of some of the changes, see here.
- Updated
factorio-data
to version2.0.28
(latest) - Updated
compatibility/defines.lua
to2.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 subcommandsdraftsman update ...
for the original functionality of modifying a Factorio environmentdraftsman list
to list all mods detected under a particular environmentdraftsman enable/disable ...
enables or disables one or more modsdraftsman factorio-version
reports or sets the version of Factorio's datadraftsman version
reports Draftsman's own semantic version- Write
draftsman -h
ordraftsman [command] -h
for more information
- Swapped from
schema
topydantic
- 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
topytest
(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
- Added a bunch of equivalent functions from the Factorio StdLib:
- Added
opposite()
,next()
,previous()
,to_orientation()
, andto_vector()
toDirection
- Added
Orientation
class, similar toDirection
; comes with it's own suite of__add__()
,to_direction()
, andto_vector()
helpers - Added
constants.Ticks
enumeration which containsSECONDS
,MINUTES
,HOURS
, etc. stored as quantities of Factorio ticks
- Added
- Added
union
,intersection
, anddifference
toEntityList
,TileList
, andScheduleList
- Updated
Direction
to now be the Factorio 2.0 16-direction enum; useLegacyDirection
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
andWaitConditions
objects which keep track of train station condition treesWaitConditions
can be combined using bitwiseand
andor
in order to collect them into aWaitConditions
object:- Added
WaitConditionType
andWaitConditionCompareType
enumerations
- 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.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
toLocomotive
,CargoWagon
, andArtilleryWagon
- 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
andInvalidTileErrors
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 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
examples
folder which provides short descriptions for all of the examples - Integrated aforementioned examples into the test suite
- Removed the
area
,tile_width
, andtile_height
properties 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_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 allBlueprintable
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
andy
attributes of bothposition
andtile_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
- 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_mask
keys are resolved at once at the data level when you calldraftsman-update
, so you can queryentities.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 fordraftsman-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 allEntityCollection
andTileCollection
classes - Removed
on_(insert/set/remove)
from allEntity
implementations as well (they were not used and are replaced with better things now) - Renamed
data
member to_root
member onEntityList
andTileList
(Internal reasons) - Fixed issue #119