- Change return type of
Structure::destroy
fromi8
toResult<(), ErrorCode>
- Change inner u8 of
RoomCoordinate
to private - Use
f64
instead ofu64
to work around bindgen expectingBigInt
return values
- Add
s7_score_cycle_at_tick
seasonal constant function to reflect the reversed score cycle in season 7 - Add indexing implementations for
RoomCoordinate
andRoomXY
as well asXMajor
/YMajor
wrapper types to control which indexing approach is used; switch to using these forLocalCostMatrix
andLocalRoomTerrain
- Add
RoomOffset
type representing a difference between coordinates and associated functions for manipulatingRoomCoordinate
andRoomXY
cargo-screeps
is no longer supported as a deployment method,wasm-bindgen
as of 0.2.93 generates code that needs transpiled; see the starter project's README for migration instructions- Change return type of
RoomXY::get_range_to
and input type ofRoomXY::in_range_to
to u8
- Make
RoomName::from_packed
andRoomName::packed_repr
public - Add constants to
season_1
module representing the Season 1 score cycle mechanic
- Temporarily pin to wasm-bindgen 0.2.92 due to incompatible generated javascript
- Update for new string enum implementation in wasm-bindgen 0.2.93
- Move crate constant
ROOM_AREA
to extra constants module and make public
- Add function
Direction::iter
which returns an iterator over all theDirection
enum values - Add function
RoomXY::neighbors
which returns an iterator over all the valid neighbors of a givenRoomXY
position - Add static function
LocalCostMatrix::new_with_value
which returns aLocalCostMatrix
with every position set to a givenu8
value - Implement
JsCollectionIntoValue
andJsCollectionFromValue
forIntershardResourceType
andu32
to allowgame::resources()
return value to be used as expected - Add static function
RoomXY::new
to allow creating a newRoomXY
fromRoomCoordinates
- Add static function
RoomXY::checked_new
to allow creating a newRoomXY
from a (u8, u8) pair, while checking the validity of the coordinates provided - Add function
RoomXY::towards
which returns aRoomXY
between twoRoomXY
positions, rounding towards the start position if necessary - Add function
RoomXY::between
which returns aRoomXY
between twoRoomXY
positions, rounding towards the target position if necessary - Add function
RoomXY::midpoint_between
which returns theRoomXY
midpoint between twoRoomXY
positions, rounding towards the target position if necessary - Add function
RoomXY::offset
which modifies aRoomXY
in-place by a (i8, i8) offset - Add function
RoomXY::get_direction_to
which returns aDirection
that is closest to a givenRoomXY
position - Add function
RoomXY::get_range_to
which returns the Chebyshev Distance to a givenRoomXY
position - Add function
RoomXY::in_range_to
which returns whether the Chebyshev Distance to a givenRoomXY
position is less-than-or-equal-to a given distance - Add function
RoomXY::is_near_to
which returns whether a givenRoomXY
position is adjacent - Add function
RoomXY::is_equal_to
which returns whether a givenRoomXY
position is the same position - Implement the
PartialOrd
andOrd
traits forRoomXY
- Implement the
Add<(i8, i8)>
,Add<Direction>
,Sub<(i8, i8)>
,Sub<Direction>
, andSub<RoomXY>
traits forRoomXY
- Change return type of
Flag::name
andStructureSpawn::name
toString
fromJsString
- Change name of
LocalRoomTerrain::get
toget_xy
for consistency withRoomTerrain
- Change name of
constants::extra::CONSTRUCTION_SITE_STOMP_RATIO
toCONSTRUCTION_SITE_DROP_RATIO
- Remove features
generate-pixel
andinter-shard-memory
, use themmo
feature instead - Place
game::cpu::{shard_limits, unlocked, unlocked_time, set_shard_limits, unlock}
functions behind themmo
feature - Change return type of
game::{construction_sites, structures}
toJsHashMap<ObjectId<_>, _>
instead ofJsHashMap<RawObjectId, _>
- Add functions
game::creeps_jsstring
,game::flags_jsstring
,game::power_creeps_jsstring
, andgame::spawns_jsstring
to get the object asJsHashMap<JsString, _>
instead ofString
- Add function
game::market::orders_jsstring
to get the object asJsHashMap<JsString, MyOrder>
- Add function
name_jsstring
toSharedCreepProperties
trait,Flag
, andStructureSpawn
- Add function
raw_memory::segments_jsstring
to get the object asJsHashMap<u8, JsString>
- Add
RoomTerrain::get_xy
which takes aRoomXY
instead of a coordinate pair - Add
RoomCoordinate::is_room_edge
,RoomXY::is_room_edge
, andPosition::is_room_edge
- Add new extra constant
constants::extra::CONTROLLER_DOWNGRADE_PROGRESS_RATIO
, which is the percentage toward the previous level that a downgrading controller's progress is set to - Add new extra constants
constants::extra::{MOVE_COST_PLAIN, MOVE_COST_ROAD, MOVE_COST_SWAMP}
- Add constant
screeps::constants::resources::RESOURCES_ALL
(also accessible asscreeps::RESOURCES_ALL
) that contains every resource type - Add function
StoreObject::resource_types
to get the types of resources that a store can hold- This can be used with a
StructureObject
asStoreObject::try_from(structure_object).map(|store| store.resource_types())
which returns aResult<&'static [ResourceType], StoreObjectConversionError>
- This can be used with a
- Add missing
StoreObject::Reactor
to theseasonal-season-5
feature - Implement
Serialize
andDeserialize
forRoomStatus
- Add function
JsHashMap::entries
- Implement
JsCollectionFromValue
forDirection
,ObjectId<_>
- Implement
Debug
forRouteStep
- Made the
AttackController
event deserialize correctly
- Change
PhantomData
inscreeps::local::ObjectId
to better modelObjectId
's relationship with the wrapped type.- This allows
ObjectId
to beSend + Sync
regardless of the wrapped type
- This allows
- Update
enum-iterator
to 2.0
- Add
StructureObject::as_repairable
matching related functions for other object traits - Add implementations of
TryFrom<AccountPowerCreep>
andAsRef<AccountPowerCreep>
forPowerCreep
- Add implementation of
From<PowerCreep>
forAccountPowerCreep
- Add
constants::extra::NOTIFY_MAX_LENGTH
with the length of allowed input togame::notify
- Remove
HasNativeId
,MaybeHasNativeId
,HasTypedId
, andMaybeHasTypedId
traits, adding their functions to theHasId
andMaybeHasId
traits- Renamed
native_id
/try_native_id
tojs_raw_id
/try_js_raw_id
for consistency with the other trait functions
- Renamed
- Remove
Resolvable
trait, moving its functionality toMaybeHasId
- Remove
ObjectWithId
andObjectWithMaybeId
enums - Remove
Option<_>
for style options onMapVisual
, fixes all visuals failing to render if one without style was used - Remove
score
,symbols
, andthorium
features, moving all items they enabled to their respectiveseasonal-season-1
,seasonal-season-2
, andseasonal-season-5
features - Add
Repairable
trait, and change target type forCreep::repair
andStructureTower::repair
to?Sized + Repairable
to match ergonomics of similar functions
- Fix
raw_memory::set_public_segments
andset_default_public_segment
argument conversion
- A number of functions on
StructureController
now returnOption<u32>
to account for cases where they may be undefined:progress
,progress_total
,ticks_to_downgrade
, andupgrade_blocked
- An undefined
hits
orhitsMax
value on an invulnerable wall or certain controllers will no longer cause a panic when building in dev mode - Fixed incorrect JavaScript field name on
StructurePortal::destination()
getter
- Simplification of cost matrix types and traits:
- Remove
SparseCostMatrix
, to be moved toscreeps-game-utils
crate - Remove
LocalCostMatrix::merge_from_dense
/merge_from_sparse
- Remove
CostMatrixSet::set_multi
and replaceCostMatrixSet::set
withset_xy
- Add
CostMatrixGet
trait withget_xy
function - Remove
HasLocalPosition
trait with no implementations
- Remove
- Change
TOWER_OPTIMAL_RANGE
andTOWER_FALLOFF_RANGE
types tou8
andTOWER_FALLOFF
type tof64
- Changed
RoomTerrain::new
andgame::map::get_room_terrain
return type toOption<RoomTerrain>
, returningNone
when the specified room is outside the server's map - Changed
game::map::get_room_status
return type toOption<RoomStatusResult>
, returningNone
instead of the previous behavior of returning an artificial 'normal' status for rooms outside the server's map - Remove
constants::math::control_points_for_gcl
andpower_for_gpl
- moved to newscreeps-game-utils
crate
- Implement
JsCollectionIntoValue
forDirection
, making theJsHashMap
returned bygame::map::describe_exits
able to be used - Handle object return properly from
RoomTerrain::get_raw_buffer_to_array
when built in dev mode
- Add new geometry helper functions to
Direction
:is_diagonal
,is_orthogonal
,multi_rot
,rot_cw
, androt_ccw
- Add
checked_add
andsaturating_add
functions toRoomCoordinate
andRoomXY
, as well aschecked_add_direction
andsaturating_add_direction
toRoomXY
- Fix incorrect setter name on
visualize_path_style
causing the setting to not work OwnedStructure
,OwnedStructureObject
, andOwnedStructureProperties
'smy
method now correctly handles the value being undefined.- This fixes a panic on checking
my
for unowned controllers. (again)
- This fixes a panic on checking
- Use constant values compatible with the game for serializing
PowerCreepClass
, andIntershardResourceType
, andPart
as string - note that if you've stored any of these values, they will fail to parse after updating! - Removed
FromStr
impl onPart
and replace with automatically-generated implementations for all string-represented constant enums, as well as addingDisplay
implementation MapVisualShape::text
andMapVisual::text
style
arguments changed to be typeOption<MapTextStyle>
- The map visual APIs use a different set of options than room visuals, so they need to be a different type to express those options
- Note that all color settings for map visuals are much more restrictive: they only accept colors
of the form
#FF22DD
, no web-style color names
- Change
Room::find_exit_to
input type from&JsString
toRoomName
- Add
local::serde_position_packed
module, for use with thewith
serde attribute, allowing serialized positions to be stored as packed even with human-readable serializers - New types
MapFontStyle
,MapFontVariant
,MapTextStyle
for use in the changes to map visuals - Newly public functions
RoomName::x_coord
andRoomName::y_coord
to get the position of a room in the world map - Add
LocalRoomTerrain
, a wrapper in wasm memory of the data in aRoomTerrain
object.
- Fix incorrect return values in
StructureType::initial_hits
andResourceType::boost
constant functions - Use
std::Cow
in custom deserialization process forStructureType
andResourceType
to fix failures when deserializing in some cases, like fromserde_json::Value
- Move
game::gcl::total_for_level
toconstants::math::control_points_for_gcl
and movegame::gpl::total_for_level
toconstants::math::power_for_gpl
- Change
constants::math::power_for_gpl
to returnu128
to allow for valid values to be calculated for all possible inputu32
values - Rename
RoomObject::pos
toRoomObject::js_pos
to avoid confusion withHasPosition::pos
and remove the possibiliy for differing behavior based on whether the trait was imported - Change
Source::ticks_to_regeneration
andMineral::ticks_to_regeneration
return types toOption<u32>
, returningNone
when the timer isn't active instead of panic - Change
RoomTerrain::new
room name argument type from&JsString
toRoomName
- Add
RoomName::checked_add
to allow a math to be done on the position of the room on the map without the potential to panic that theops::Add
implementation has - Add
const
to most functions representing constants, so they can be evaluated during compile - Fix incorrect value of
constants::extras::FLAG_NAME_MAX_LENGTH
- now 100, previously 60 - Add new extra constant
constants::extras::POWER_CREEP_CARRY_CAPACITY_PER_LEVEL
- Fix potential for panic in store functions when called with resource types that the store isn't currently valid for
- Revert
RoomTerrain::get_raw_buffer
return type fromResult<Uint8Array, ErrorCode>
back to pre-0.13Uint8Array
, since it can't error when called with no destination - Add
sim
feature, which enables the sim-related special case name ofsim
for a room at the coordinates of W127N127 (allowing for bots to be built to not include that support)
- Add
?Sized
toSharedCreepProperties::withdraw
andtransfer
methods to allow dynamic use
- Remove
ReturnCode
and replace withResult<(), ErrorCode>
- Change
RoomPosition
andPosition
methodslook
andlook_for
to return aResult
instead of panicking when used in room not visible in the current tick - Remove re-exports of
constants::find::Find
andconstants::look::Look
enums and mark them as hidden from docs, since they're likely to cause confusion and not generally needed
- Add feature
unsafe-return-conversion
that allows skipping bounds checks on return codes for all game functions using integer return codes, risking undefined behavior for values outside the expected range - Add
Position::checked_from_world_coords
allowing an error return instead of a panic for out of bounds coordinates - Add
Position::checked_add
andPosition::checked_add_direction
, alternatives toAdd<_>
which can error
- Fix panic when accessing the store of a creep while spawning
- Fix js property mapping for
crate::raw_memory::ForeignSegment::id
- Add custom implementation of
Debug
forRoomName
showing the non-packed name - Add implementation of
From<ExitDirection>
forExit
- Added extra constants for CPU cost per intent,
INTENT_CPU_COST
, and the range of creeps' ranged actions,CREEP_RANGED_ACTION_RANGE
- Add undocumented
LOOK_REACTORS
season 5 constant
- Add
HasNativeId
andTransferable
traits toReactor
- Add
Transferable
andWithdrawable
traits to season 1 and 2 object types
- Remove
Density::iter_values
, update documentation to indicateenum_iterator::all
should be used instead - Move
CostMatrixSet
andHasLocalPosition
traits fromcrate::objects
tocrate::traits
- Add
Creep::claim_reactor
function for season 5 - Add
Density::thorium_amount
function with additional season 5 constants - Implement
From<Direction>
for(i32, i32)
, as well asAdd<Direction>
andSub<Direction>
forPosition
, to support using directions for position math
- Fix
SearchOptions
not mapping to camel-cased field names when converting to js object. Fixespathfinder::search
not using the specified settings formax_ops
,plain_cost
, etc.
- Reorganize
crate::objects
module with some new public sub-modules to group them logically, with all of their contents re-exported to maintain compatibiltiy with existing imports
- Move
crate::inter_shard_memory::InterShardMemory::*
tocrate::inter_shard_memory::*
and movecrate::raw_memory::RawMemory::*
tocrate::raw_memory::*
for consistency - Update
enum-iterator
to 1.4 (IntoEnumIterator
trait replaced withSequence
) - Remove re-exports of
game::*
,pathfinder::*
, andraw_memory::*
to resolve name conflict and simplify crate namespace
- Implement
TryFrom<JsString>
forRawObjectId
- Implement
FromStr
forJsObjectId
- Implement
BODYPARTS_ALL
,RESOURCES_ALL
, andCOLORS_ALL
constants usingenum-iterator
- Implement
std::error::Error
forOutOfBoundsError
, to make it more ergonomic to use with other error types - Added
Default
derivation forRoomCoordinate
andRoomXY
- Added
Thorium
resource,Reactor
room object, and relevant constants and formulas for season 5; addedthorium
feature which enablesReactor
andThorium
, and theseasonal-season-5
feature which enables the seasonal constants as well as thethorium
feature
- Fix
TextStyle::stroke_width
andTextStyle::background_padding
functions setting incorrect values
- Update
serde-wasm-bindgen
to 0.5
- Convert from stdweb to wasm-bindgen as underlying framework. While extensive effort was put into keeping the API as similar as possible to prior versions, breaking changes are present throughout the API as well as associated representations, such as resource types' serialized values; bots still using stdweb APIs should target version 0.9.
- Fixed
Room::serialize_path
andRoom::deserialize_path
, which are static methods and don't exist on instances ofRoom
objects themselves - Changed
BuildEvent
to match what's returned by the game, which doesn't match the documentation - Add the
generate-pixel
,inter-shard-memory
, andscore
features which enable features not present in all server environments - Add the
mmo
feature which activates thegenerate-pixel
andinter-shard-memory
because these interfaces don't exist on private servers - Add the
seasonal-season-1
feature for season 1, which activates thescore
feature - Add the
symbols
feature to support season 2 - Add the
seasonal-season-2
feature for season 2, which activates thesymbols
feature
- Change
game::inter_shard_memory::get_local
andget_remote
to returnOption<String>
, accounting for cases where they have not been set (breaking) - Remove
constants::INVADER_CORE_EXPAND_TIME
, replaced by per-levelconstants::invader_core_expand_time
- Add the ability to mark a room as impassable when using the pathfinder. Converts callback
functions for room cost to use
SingleRoomCostResult
andMultiRoomCostResult
as appropriate
- Add
AccountPowerCreep::cancel_delete
, which allows cancelling pending deletion of a power creep - Add
StructureType::controller_structures
, which translates theCONTROLLER_STRUCTURES
constant, the number of each structure allowed at a given RCL - Add missing
constants::MARKET_MAX_ORDERS
,constants::MARKET_ORDER_LIFE_TIME
, andconstants::HARVEST_DEPOSIT_POWER
- Add the
parse_display::Display
trait to type constant enums which currently implementparse_display::FromStr
, allowing reversal of the conversion from native to constant string - Add new
IntershardResourceType::CPUUnlock
,IntershardResourceType::Pixel
, andIntershardResourceType::AccessKey
resources - Add
game::cpu::generate_pixel
andconstants::PIXEL_CPU_COST
- Update
constants::PIXEL_CPU_COST
to match game balance change
- Change
game::inter_shard_memory
functions to avoid panicking on private servers where the interface doesn't exist - Update
constants::stronghold_rampart_hits
function with updated values from rebalancing - Corrected value of
constants::RAMPART_HITS_MAX_RCL5
andconstants::POWER_SPAWN_HITS
- Fixed
Position::get_direction_to
which always returned the opposite of what it should - Fixed deserialization of
EVENT_POWER
andEVENT_TRANSFER
events
- Remove deprecated
game::map::is_room_available
, use newget_room_status
instead - Move creep functions which are implemented identically on power creeps to
SharedCreepProperties
trait - Update integer representation of
IntershardResource::SubscriptionToken
to move out of conflict with normal resources to allow parsing market orders which might have either - Update
game::market
functions to be able to work with intershard orders and transactions for them, makingRoomName
optional in many cases as it's not used for intershard transactions - Update field visibility on
game::market
structs used as return values to public, update to native types forResourceType
andRoomName
values, and make a number of fields optional for compatibility with intershard orders - Update
game::market::create_order
to use the currently documented object syntax and newMarketResourceType
to specify resource - Update
game::market::calc_transaction_cost
to work withRoomName
instead of&Room
to avoid requiring visibility of both rooms - Change
game::map::describe_exits
to useRoomName
instead ofString
for values - Remove
StructurePowerSpawn::power
andpower_capacity
(replaced withHasStore
functions) - Remove explicitly implemented
Creep::energy
function which used deprecated.carry
, now using theenergy
implementation fromHasStore
- Change
RoomObjectProperties::room
to returnOption<Room>
to handle the cases that the base game API leaves it undefined: for construction sites and flags in non-visible rooms - Add
MarketResourceType
enum, which can wrap either aResourceType
orIntershardResourceType
and switch to using it forgame::market
endpoints which accept either type - Change
StructureTerminal::send
to take the destination room name asRoomName
instead of&str
- Change
game::market::get_all_orders
to accept anOption<MarketResourceType>
as a filter since this is optimized in the server code - Change
HasStore::store_free_capacity
to returni32
, handling potential negative values due to expiration ofOPERATE_STORAGE
- Change
constants::GCL_POW
to f64 from f32 due to slightly incorrect calculations when using this from f32 to calculate GCL levels - Remove explicit
ticks_to_decay
implementations onStructureContainer
andTombstone
, use the implementation onCanDecay
instead - Change
game::cpu::limit
,tick_limit
,bucket
,shard_limits
, andset_shard_limits
to useu32
fromf64
- Add
RoomVisual
, rendering primitives (Circle
,Line
,Rect
,Poly
,Text
). - Add Visual rendering primitive enum for storage and batching.
- Add
MoveToOptions::visualize_path_style
to allow for path visualization of movement system. - Add
ResourceType::reaction_components
function translating theREACTIONS
constant - Add
ResourceType::commodity_recipe
function andFactoryRecipe
struct translating theCOMMODITIES
constant - Add
ResourceType::boost
function translating theBOOSTS
constant - Add
game::map::get_room_status
as interface to newGame.map.getRoomStatus
function - Add
StructureLab::reverse_reaction
as interface to newreverseReaction
- Add
effects
to room objects, allowing access to the effects applied on room objects which are used by both strongholds and power creeps. NewEffectType
enum returned by this call represents theNaturalEffectType
(for stronghold effects) orPowerType
(for power creeps) - Add
game::gpl::level
,game::gpl::progress
andgame::gpl::progress_total
- Add
StructureController::is_power_enabled
- Add
game::power_creeps
access, which returns a specialAccountPowerCreep
reference due to the fact that these power creeps may not be spawned on the current shard and allow spawning. UseAccountPowerCreep::get_power_creep
which returnsOption<PowerCreep>
to get the living power creep, if spawned on the current shard. - Add
PowerCreepClass
enum to represent power creep classes, currently onlyOperator
- Add
game::market::get_history
andgame::market::OrderHistoryRecord
exposing newgetHistory
API function - Add
Creep::move_pulled_by
which allows a creep to accept another creep's attempt topull
- Add
SearchOptions::max_cost
to limit the maximum path cost for pathfinder searches - Add
RoomTerrain::get_raw_buffer_to_array
to load a room's terrain into an existing[u8; 2500]
- Add
game::gcl::total_for_level
andgame::gpl::total_for_level
which calculate the total lifetime points required for a given level of GCL or GPL - Add
CostMatrixSet
trait to allow applying costs to a cost matrix generically
- Fix
Room::find_path
function call to underlying javascript - Fix typo in
Position::create_named_construction_site
and work around screeps bug inRoom::create_named_construction_site
by passing x and y instead of position object - Fix javascript associated object name for
StructureSpawn::spawning
- Correct swapped return types for
Mineral::density
andMineral::mineral_amount
and add a workaround for some private servers returning floating pointmineralAmount
values - Fix typo in
StructureController::reservation
ticks_to_end return value - Fix reversed conversion of
TOUGH
andHEAL
parts - Fix
OwnedStructureProperties::has_owner
to correctly return false for unowned structures - Work around a case where
map::describe_exits
would panic when a private server returns null for an unavailable room - Change
Source
andMineral
ticks_to_regeneration
functions to return 0, preventing panics in cases where the game API returns negative or undefined values - Fix visibility of struct fields on
MapRoomStatus
andRoomRouteStep
- Add
total_available_size
field togame::cpu::HeapStatistics
- Add missed
StructureFactory::level
function to determine a factory's level (orNone
if a power creep has not yet usedOPERATE_FACTORY
) - Change
pathfinder::search_many
to return an incomplete result when called with no goals to prevent a panic due to unexpected return data from javascript. - Change
MemoryReference::get
to return a generic error type - Change
StructureLab::mineral_type
to returnOption<ResourceType>
, avoiding panic when labs are empty
- Update
StructureTower::attack
andheal
to allow targeting power creeps, and updaterepair
to acceptStructureProperties
matchingCreep::repair
- Update
Creep::heal
andranged_heal
to target anything with theSharedCreepProperties
trait to allow use on power creeps
- Remove
CanStoreEnergy
trait, moving all structures and creeps toHasStore
, migrating from deprecated Screeps API endpoints to new.store
API (breaking)- Remove
Creep::carry_total
,Creep::carry_types
,Creep::carry_of
- Remove
StructureLab::mineral_amount
,StructureLab::mineral_capacity
- Remove
StructureNuker::ghodium
,StructureNuker::ghodium_capacity
- Change
HasStore::store_capacity
to use new API and now takesOption<ResourceType>
- Add
HasStore::store_free_capacity
andHasStore::store_used_capacity
, which both takeOption<ResourceType>
- Remove
- Change return type of
game::rooms::keys
fromVec<String>
toVec<RoomName>
- Change
HasCooldown
trait to apply to objects withRoomObjectProperties
instead ofStructureProperties
due to addition ofDeposit
objects - Fix
Position::in_range_to
to be inclusive, to match documentation and JS behavior
- Add new
StructureFactory
andStructureInvaderCore
structure types - Add a number of new constants related to factory operation and strongholds
- Add new resource types for factory commodities
- Add
Deposit
objects and related find/look constants - Add
Ruin
objects and related find/look constants - Change
Creep.harvest
to work with any harvestable object type;Deposit
,Mineral
, andSource
- Add
ObjectId<T>
, a typed binary object ID, andRawObjectId
, an untyped binary object ID- untyped ids can be converted to typed freely - the type is purely for type inference
RoomObject::id
now returnsObjectId<Self>
, and anuntyped_id
function is added for retrieving an untyped idgame::get_object_typed
now takesObjectId<T>
, andgame::get_object_erased
is now generic, taking either id type- both types are 12 bytes large, and can represent all hex-formatted object IDs from the official server, the default private servers backend and the private server with ags131's mongodb mod
- Add support for accessing intershard resource amounts, which currently only includes subscription
tokens, under
game::resources
. - Implement
PartialOrd
andOrd
forPosition
,RoomName
,RawObjectId
andObjectId
. See documentation for ordering specifications.
- Fix typos in JavaScript code for
game::market::get_order
andNuke::launch_room_name
- Fix
Creep::body
crashing if body contained non-boosted parts - Fix JS syntax error in
Creep::move_to_with_options
- Remove usage of internal
stdweb
macros, which break with stdweb version changes - Rename incorrectly spelled
Density::probabilitiy
toprobability
. - Rename incorrectly spelled
Nuke::lauch_room_name
tolaunch_room_name
. - Rename constants with typo
SPAWN_RENEW_RATION
andLINK_LOSS_RATION
toSPAWN_RENEW_RATIO
andLINK_LOSS_RATIO
respectively
- Add a number of modules grouping constants together, such as
constants::creep
for creep related constants orconstants::minerals
for mineral related constants. - Remove remaining usages of internal
get_from_js!
macro, as it was minimally useful - Improve syntax and consistency of some internal macros
- Change
LocalRoomName
's orientation so that north is negative and south is positive. This is a breaking change forLocalRoomName::from_coords
, fields and add/sub implementations (#200) - Rework
LocalRoomPosition
to use a singleu32
as its representation, matching the Screeps' server's optimizations, and implement math utilities for it. (#203)LocalRoomPosition
, nowPosition
, implementsAdd<(i32, i32)>
for altering world coordinates, and has methods likefrom_world_coords
andworld_coords
. SeePosition
documentation.
- Merge
LocalRoomPosition
andRoomPosition
into one efficient, local,Position
type. (#206)- Game methods dealing with coordinates now take something which can produce a local
Position
, and will only have to upload a singleu32
to JavaScript to call it. Position
methods dealing with math between positions are now implemented in pure-Rust code- An alias
type RoomPosition = Position;
has been added to reflect the JS API
- Game methods dealing with coordinates now take something which can produce a local
- Rename
LocalRoomName
toRoomName
, use in APIs, and optimize representation:- It is now a 16-bit sized structure, one very efficient to get from a
Position
(#209) - It's now used in all API bindings referencing room names (#217)
- It is now a 16-bit sized structure, one very efficient to get from a
- Make
StructureSpawn::spawning
anOption<Spawning>
to reflect reality - Fix prices returned from
game::market
APIs being integers rather than floats (breaking) (#179) - Use
OrderType
rather thanString
fororder_type
fields ofTransactionOrder
,Order
andMyOrder
. (breaking) (#213) - Work around bug where IntelliJ-Rust didn't understand
screeps::game::*
modules created by a macro, even with experimental engine enabled (#197) OwnedStructureProperties
'smy
method now correctly handles the value being undefined. This fixes a panic on checkingmy
for unowned controllers (#189)StructurePortal
no longer implementsOwnedStructure
andAttackable
. (#190)- Collections provided by
Game
now implement thehashmap
function to retrieve both keys and values at once. (#194) - Allow accessing fields of the
Bodypart
struct. (#215) - Implement
Clone
forStructure
- Update
screeps::game::market::OrderType
derives to match other constants changed in the constants overhaul last update (#213) - Split cargo-screeps out into a separate repository
- Mark most constant functions as inlinable (#221)
- Misc. documentation improvements.
- Add
game::cpu::halt
binding forGame.cpu.halt
(#210) - Add
Creep::pull
binding forCreep.pull
(#210)
Serialize
andDeserialize
format changed for most constants and forLocalRoomPosition
(breaking)- constants now always serialize as integers (see the module doc) (#164)
LocalRoomPosition
will now serialize differently depending on whether the format is readable (see theLocalRoomPosition
doc) (#171)
constants-serde
feature removed in favor of always implementing Serialize and Deserialize for constants. (#164)- Add methods for retrieving coords from
RoomPosition
(#145) - Implement
Hash
for most constants (#148) - Add equality checking between strings and
LocalRoomName
(#149) - Add
raw_memory::drop_segment
(#160) - Add
inter_shard_memory
(#163) - Change
MemoryReference::get
andget_path
to returnOption<T>
(breaking) (#169) - Add
Display
implementations forDirection
andLocalRoomPosition
- Fix visibility of
LocalRoomNameParseError
,Bodypart
,MoveToOptions
andPortalDestination
(#134) - Fix
Creep::get_active_bodyparts
(#147) - Fix
CostMatrix
upload method (#150) - Fix typos in
StructureController
getters (#151) - Fix
RoomPosition::try_from
conversion (#152) - Fix errors on successful flag creation (#157)
- Fix
ConstructionSite::structure_type
,Mineral::mineral_type
andStructureLab::mineral_type
(#173) - Change many
StructureController
properties toOption
s to reflect reality (breaking) (#162) - Migrate to Rust 2018 (#161)
- Improve code reuse and reduce total amount of code (#164, #166, #175)
Thanks to @ASalvail, @Dessix and @mettke for contributing to this release.
- Allow simulation room when using local room names (#106)
- Add
Room::look_for_at_xy
(#104) - Take
&T
inRoom::create_construction_site
andlook_for_at
rather thanT
forT: HasPosition
(breaking) (#105) - Remove unnecessary allocation from PathFinder and Room.find calls (#112)
- Add
Neg
implementation forDirection
allowing unary minus to reverse direction (#113) - Add
JsVec
structure for transparently wrapping typed JavaScript arrays without immediately unwrapping them. (#114) - Switch to
num-derive
for deriving number->enum transitions (previouslyenum-primitive
) (#116) - Fix inability to decode
Structure
at all (#119) - Remove
Sized
bound onRoomObjectProperties
and addSizedRoomObject
trait - Add utility methods for turning
Structure
intoOption<&SomeTrait>
for a variety of traits - for instance, seeas_attackable()
(#122) - Fix constant name
DROPPED_RESOURCES
(previously:DROPPED_RESOUCES
) (#126) - Remove
Attackable
implementation forStructure
(StructureController
andStructurePortal
are not attackable). Useas_attackable()
instead. (#129)
- Implement Serialize and Deserialize for constants under
constants-serde
feature flag (#69) - Fix Tombstone::get_position_at (#70)
- Remove duplicate Tombstone::id property (#70)
- Implement September 2018 update (#71)
- Replace old terrain APIs with game::map::get_room_terrain
- Add event API
- Add support for named construction sites on RoomPosition
- Add support for
findRoute
andfindExit
(#76) - Add full support for Creep::body (#78)
- Add support for
moveTo
options (#80) - Replace all usages of u8 for in-room positions with u32 (#80)
- Remove duplicate properties on StructureSpawn (#82)
- Use u32 for everything non-negative (#83)
- Add StructureSpawn::spawning property (#86)
- Replace use-once builder with more standard options struct in
StructureSpawn::spawn
(#86) - Add look, lookAt, lookAtArea support (#87)
- Add MemoryReference::get, get_path for retrieving arbitrary types from memory (#96)
- Fix unconditional error in
find_in_range
,find_closest_by_range
bindings (#99) - Unbreak
mem_get!
macro broken in last release (#102) - Rename
Density
enum variants to removeDensity
prefix (#101) - Make various API functions take
Copy
types by value rather than by reference (#101)
- Remove
Reservation
andSign
structures from prelude (breaking) - Add
Eq
,PartialEq
implementations to everything which has an ID, as well asRoom
- Implement
RawMemory
get
andset
support - Create CONTRIBUTING document
- Change all
TryFrom
implementations to perform type checks rather than making assumptions. - Implement
ReferenceType
for all reference wrapping structures - Add traits
ExpectedTypeInto
andExpectedTypeFrom
for convertingstdweb::Value
s to typed structures with or without type checks depending onscreeps-game-api
's feature flags- Add feature
check-all-casts
which is off by default and when enabled adds type checks toExpectedTypeFrom
conversions
- Add feature
- Create enum
Density
rather than havingDENSITY_LOW
,_MODERATE
,_HIGH
and_ULTRA
constants (breaking) - Implement support for APIs:
RawMemory.get
,set
Game.map.findExit
Game.market.*
Game.notify
Creep.drop
,owner.username
,moveByPath
,notifyWhenAttacked
,saying
Flag.remove
,setColor
,setPosition
Mineral.density
,mineralAmount
,mineralType
,ticksToRegeneration
Nuke.launchRoomName
,timeToLand
Room.serializePath
,deserializePath
,findExitTo
,getPositionAt
,findPath
,memory
,findPathTo
RoomPosition.isEqualTo
acceptingx
/y
parametersStructureController.activateSafeMode
,unclaim
StructureKeeperLair.ticksToSpawn
StructureLab.mineralAmount
,mineralCapacity
,mineralType
,boostCreep
,runReaction
StructureLink.transferEnergy
StructureNuker.ghodium
,ghodiumCapacity
,launchNuke
StructureObserver.observeRoom
StructurePortal.destination
StructurePowerBank.power
StructurePowerSpawn.processPower
StructureRampart.setPublic
StructureSpawn.memory
,recycleCreep
,renewCreep
StructureTerminal.send
StructureTower.attack
,heal
,repair
- Rename
get_object
toget_object_erased
and add support forget_object_typed
directly fetching a room object knowing its type (breaking) - Add support for fetching and setting memory keys by path using lodash
- Rename memory
num
method tof64
andint
toi32
- Add
mem_get!
andmem_set!
macros for compile-time memory path interpretation. - Rename
owner
methods toowner_name
- Fix
Creep.signController
type signature - Fix
Room.findClosestByRange
type signature - Add trait
HasId
representing things which have ids (allRoomObject
s exceptFlag
s)- Move
id
methods from individual structures to this structure (breaking)
- Move
- Add traits
CanStoreEnergy
,HasCooldown
,CanDecay
,Withdrawable
,Attackable
- Move
hits
andhitsMax
bindings fromStructureProperties
trait toAttackable
trait (breaking) - Re-export
stdweb::unstable::{TryFrom, TryInto}
intraits
module
Thanks to @ASalvail for planning and implementing the vast majority of this release!
- Add support for StructureController (thanks @ASalvail!)
- Work around Rust bug appearing in latest nightly (rust-lang/rust#53140)
- Bump to 0.1.0 so we can create bugfix releases such as this one which do not contain breaking changes.
- Add ReturnCode::as_result
- Add
MemoryReference::from_reference_unchecked
- Support ConstructionSite properties
- Support
Room::look_for_at_area
- Make 'Structure' type an enum rather than opaque reference
- Add
LocalRoomPosition::remote
shorthand
- Add string access API to Memory
- Implement PathFinder interface
- Implement Serialize/Deserialize for LocalRoomPosition
- Add LocalRoomName structure
- Change time to unsigned integers
- Add
StructureSpawn::is_spawning
- Add
RoomPosition::local
utility - Fix HeapStatistics field names
- Fix console.error hack (see cargo-screeps changes)
- Hotfix for code so it compiles
- Add tombstone support
- Add reaction_time constant calculation method
- Support
v8_getheapstatistics
- Replace some
get_from_js!()
calls with manual functions - Switch from using .0 to .as_ref() to refer to inner Reference of wrapping objects
- Add support for creating construction sites and flags
- Add Source support
- Add support for spawning creeps
- Make methods of traits have default impls, instead of using macros to implement them
- Fix crates.io distribution to include javascript files
- Fix crates.io distribution to include Web.toml
- No notable changes
- No notable changes
- Initial release