Commit Graph

566 Commits

Author SHA1 Message Date
Collin Smith
3bd3e5f64e Added debug logging for number of box2d bodies generated 2019-11-19 23:55:50 -08:00
Collin Smith
4e5fbc03d6 Made Box2DPhysicsSystem disposable 2019-11-19 23:32:32 -08:00
Collin Smith
35df3a6b96 Added support for retrieving vector2 view of MapGaphPath iterator
Added support for retrieving vector2 view of MapGaphPath iterator
Changed representation of PathfindComponent to Vector2 from MapGraph.Point2
Deleted old MapGraph racaster
2019-11-19 21:55:56 -08:00
Collin Smith
4d1ecab3f5 Added support for sized path smoothing (see #63)
Added support for sized path smoothing
Removed extra data structures and put references directly into Point2
Added back direction-8 children successors
2019-11-19 20:46:55 -08:00
Collin Smith
40d9b56c33 Increased position lerp tolerance to 0.1 yards -- should help prevent entities getting stuck at waypoints 2019-11-19 16:48:42 -08:00
Collin Smith
b6bf8773a1 Implemented variation of A* that includes support for clearance (see #63)
Added SizeComponent and implemented auto sizing within engine entity creation
2019-11-19 02:07:42 -08:00
Collin Smith
09c4a01b3e Implemented map to store existing paths to prevent object creation 2019-11-19 00:58:50 -08:00
Collin Smith
2298d80cab Reduced static memory usage of MapGraph
Changed rounding method of Map#flags(float,float) to use Map#round(float) instead of casting down to int
Removed indexing and connection links from Point2
Point2 are now indexed using MapGraph#getOrCreate and mapped using an ObjectSet -- using int hash did not seem sufficient
Connections to a given Point2 are lazily generated using a static Array -- it did not make sense to cache this for every node
Cleaned up API and method references (all pathing methods now use MapGraph#searchNodePath as their base method)
Most of these changed are geared to hopefully use the underlying map collision flags array as the graph instead of building a new one
2019-11-18 16:36:24 -08:00
Collin Smith
222fe7077a Added Box2D dependency
Created Box2DComponent to store Box2D body
Created Box2DPhysicsSystem to generate world objects and iterate physics
Created Box2DBodySystem to propagate VelocityComponent to Box2D bodies
2019-11-17 03:08:42 -08:00
Collin Smith
5d077652ea Added getter method for RenderSystem isometric camera 2019-11-15 16:14:49 -08:00
Collin Smith
bdfb83da30 Added pathfinding that includes collision detection with world -- PhysicsSystem still ignores collision 2019-11-15 16:04:08 -08:00
Collin Smith
11fe2682f6 Fixed issue with displaying unloaded texture briefly before new one is loaded 2019-11-15 05:28:02 -08:00
Collin Smith
22d7701647 Fixed changing cof components of an existing animation
Introduced CofComponent.setComponent(int,int) to auto set dirty flags for changed components
AnimationLoaderSystem will now unset load flag for null layers and remove transform and alpha update flags
CofLoaderSystem will now trigger a layer load when a nil component is encountered
2019-11-15 03:53:52 -08:00
Collin Smith
d34964c4ba Increased Warp interaction range to 3 yards 2019-11-15 02:29:17 -08:00
Collin Smith
3c1a8e4933 Added InteractableComponent 2019-11-15 01:24:51 -08:00
Collin Smith
d0e323e320 Added AutoInteractSystem which will automatically hover and sort nearby entities for selection on mobile 2019-11-15 01:22:51 -08:00
Collin Smith
00947ba87d Added ZoneEntrySystem to display zone entry texture when RenderSystem source entity changes zones 2019-11-12 20:13:44 -08:00
Collin Smith
8c7a340582 Fixed issue where DARKEN wasn't multiplying alpha value 2019-11-12 20:08:10 -08:00
Collin Smith
3317794cb5 Added PlayerSystem and Map.Zone tracking
Created ZoneAwareComponent and ZoneUpdate tags
Added factory method to create players within Engine
2019-11-12 19:40:22 -08:00
Collin Smith
7c1c64823b Added MovementModeComponent and System to manage walk/run/neutral mode based on velocity 2019-11-12 17:18:05 -08:00
Collin Smith
5754ba9b57 Added conditional coloring of selectable bbox to represent hovered state 2019-11-12 04:11:31 -08:00
Collin Smith
318382ee34 Refactored SELECTABLE and SELECTED states to components 2019-11-12 04:08:34 -08:00
Collin Smith
93be087793 Added static factory method to get or create a specified component for an entity 2019-11-12 01:55:54 -08:00
Collin Smith
58a011ab07 Refactored alpha and transform updates to components and systems
Removed generic update flags from CofComponent
Created AlphaUpdate and TransformUpdate components to store flags of layers that need updating
AnimationLoaderSystem no longer sets alpha and transform values and sets flags instead
Created AlphaUpdateSystem and TransformUpdateSystem to update animation layers
2019-11-12 01:31:50 -08:00
Collin Smith
5beafce761 Removed tile alignment from entity debug status text 2019-11-10 17:32:19 -08:00
Collin Smith
364775954c Added support for setting animation speeds 2019-11-10 15:21:19 -08:00
Collin Smith
29f619fe1b Added support for animation transformations / alphas
Added support for animation transformations / alphas
Changed CofComponent transformation field back to byte
Introduced update dirty flags in CofComponent to track transformation changes
2019-11-10 15:02:34 -08:00
Collin Smith
32b20d284e Added run and walk speeds to VelocityComponent
Added run and walk speeds to VelocityComponent
Added RUNNING flag to tell if entity should use run or walk speed
2019-11-10 02:25:04 -08:00
Collin Smith
4ed6792996 Added physics system placeholder which manages velocity application on position 2019-11-10 01:56:23 -08:00
Collin Smith
caec8d7032 Small optimizations 2019-11-09 22:09:39 -08:00
Collin Smith
c270dbb7a3 Added PlayerComponent
Added PlayerComponent containing D2S reference
Added alpha array to CofComponent
2019-11-09 22:02:40 -08:00
Collin Smith
851cdc2aa5 Moved default angle to its own field 2019-11-09 21:52:11 -08:00
Collin Smith
41ff1997a4 Added support for angular velocity
Added target field to AngleComponent
Set default AngleComponent angles to PI/2
Changed AngleComponent angle fields to Vector2
Added support for angular velocity -- entities will no longer instantly update to target vector
2019-11-09 21:48:03 -08:00
Collin Smith
bac1c3c59c Added AngleComponent to debug status text 2019-11-09 15:36:07 -08:00
Collin Smith
33ce6bf2c7 Added DirectionTool used to test com.riiablo.engine.Direction 2019-11-09 15:09:59 -08:00
Collin Smith
9201f63914 Added AngleSystem and refactored com.riiablo.entity.Direction as com.riiablo.engine.Direction
New direction class assumes angles are given using isometric coordinates (no longer uses pixel-aligned cartesian coordinates)
2019-11-09 14:53:26 -08:00
Collin Smith
8b2f671834 Added assertion that RenderSystem source entity has a position component 2019-11-08 16:03:56 -08:00
Collin Smith
f6b806bd59 Removed path debug fields (debugging now within PathDebugSystem) 2019-11-08 00:56:05 -08:00
Collin Smith
88a02f2306 Refactored Animation#setLooping and Animation#setClamp with Animation#setMode 2019-11-07 14:20:28 -08:00
Collin Smith
56e18a0b41 Refactored Animation#reset(COF) with Animation#setCOF(COF) 2019-11-07 14:06:07 -08:00
Collin Smith
ba03f5c269 Defined a custom BBox for waypoint pads to be more squared with tiles and slightly larger 2019-11-07 13:58:15 -08:00
Collin Smith
8c18e072dd Moved boxComponent assignment from AnimationLoaderSystem to Engine entitity creation 2019-11-07 13:57:20 -08:00
Collin Smith
9c414c1065 Resetting AnimationComponent will reset underlying Animation 2019-11-07 13:44:08 -08:00
Collin Smith
581a1b4715 Replaced Animation with improved version
Added support for pooling Animation, Animation.Builder, Animation.Layer
Animation will now use only its managed BBox -- no more returning BBox of layers
Redefined animation states into Mode enum -- they were discrete
Replaced act methods with update
Animation builder now copies layers instead of setting the animation object layers reference to builder layers reference
2019-11-07 13:41:38 -08:00
Collin Smith
5361d80864 Closes #34 2019-11-06 13:13:04 -08:00
Collin Smith
223efec103 Exposed render bounds 2019-11-06 00:37:29 -08:00
Collin Smith
f3f91d5a85 Fixes issue where non-default zoomed client would display labels in incorrect location 2019-11-06 00:35:40 -08:00
Collin Smith
19ab19d4e0 Added support for invisible object entities
Objects tagged with no draw will no longer have CofComponent and AnimationComponent added and will have the INVISIBLE flag set
2019-11-05 15:42:44 -08:00
Collin Smith
0321d769bf Refactored TextureRegion frames into DC
Refactored TextureRegion frames into DC
Implementation will be improved later
2019-11-05 13:47:33 -08:00
Collin Smith
df4a4d144e Duplicated DC6 TextureRegion workaround into DCC 2019-11-05 13:05:56 -08:00