1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-03 06:20:43 +00:00
Commit Graph

68 Commits

Author SHA1 Message Date
gravestench
48cefd5aef Merge branch 'master' of http://github.com/OpenDiablo2/OpenDiablo2 into ecs 2021-01-10 20:24:23 -08:00
Ian Ling
c019476d08 Merge master into ecs 2021-01-08 22:56:41 -08:00
Intyre
add41494be Replaced kingping with flag package 2020-12-17 21:26:05 +01:00
Hajime Hoshi
366df65c92 Update Ebiten to v2.0.2 2020-12-15 23:50:33 +09:00
gravestench
deb63a95c8 changes to d2components, d2systems, d2ui, d2enum
go.mod, go.sum:
* updating akara, bugfix in akara.EntityManager.RemoveEntity

d2core
* adding d2core/d2label
* adding d2core/d2bitmapfont

d2ui
* exporting some constants for use elsewhere

d2components
* added bitmap font component (for ui labels)
* added FileLoaded tag component to simplify asset loading filters
* added locale component
* FilePath component renamed to File
* sprite component now contains the sprite and palette path as strings
* adding ui label component

d2enum
* added locale as file type for file "/data/local/use"

d2systems
* changed most info prints to debug prints
* removed unused scene graph testing file (oops!)
* terminal is now rendered above mouse cursor scene
* adding ui widget system for use by the game object factory
* adding test scene for ui labels created with the ui widget system

d2systems/AppBootstrap
* added command line args for profiler
* `--testscene labels` launches the label test
* now adds the local file for processing
* game loop init logic now inside of Init method (the call to
world.Update does this)

d2systems/AssetLoader
* loads the locale file and adds a locale component that other systems
can use
* adds a FileLoaded component after finished loading a file which other
systems can use (like the loading scene)

d2systems/FileSourceResolver
* Now looks for and uses the locale for language/charset filepath
substitution

d2systems/GameClientBootstrap
* game loop init moved to end of AppBootstrap.Init

d2systems/GameObjectFactory
* embedding UI widget factory system

d2systems/BaseScene
* made base scene a little more clear by breaking the process into more
methods

d2systems/LoadingScene
* simplified the entity subscriptions by using the new FileLoaded
component

d2systems/SceneObjectFactory
* adding method for adding labels, buttons to scenes (buttons still WIP)

d2systems/SceneSpriteSystem
* the sprite system now maintains a cache of rendered sprites
2020-12-08 11:24:10 -08:00
gravestench
2e814f29b0 transform component, scene testing
* removed position,scale,rotation components
* added Transform component that contains position, rotation, and scale
* scene graph update now regenerates the local mat4 using the transform
component
* akara bugfix: adding new subscriptions will process existing entities
* added `--testscene` arg for testing individual scenes in isolation
* added rotation support to d2interface.Surface
2020-12-07 12:44:11 -08:00
gravestench
13ae64af8c adding terminal, ebiten splash scene 2020-12-07 12:44:11 -08:00
gravestench
7c02b7051f updating to use new BaseSystem.InjectComponent method 2020-12-07 12:44:11 -08:00
gravestench
e6d418fdb2 Adding input system, mouse cursor scene, interactive component
* added `d2common/d2input`, copied input vector logic from hellspawner
* added an `InteractiveComponent` which contains input vector, enable
flag, and callback function
* Added an InputSystem which handles input logic and iterates over
entities with interactive components
* added a mouse cursor scene for rendering the mouse cursor
* made the trademark sprite disappear when left mouse is clicked
* various other small bugfixes in scene systems
2020-12-07 12:44:11 -08:00
gravestench
3f5d2c0938 major refactor of akara ecs
* component ID's are dynamically allocated now
* removed `akara.BaseComponent` member from components
* component declarations drastically reduced
2020-12-07 12:44:11 -08:00
gravestench
b86ac4df84 akara update: BaseComponent and BaseComponentMap
* common component methods have been put into BaseComponent and
BaseComponentMap
* boilerplate code for components has been significantly reduced
* all lint errors fixed in d2components
2020-12-07 12:44:11 -08:00
gravestench
069201a980 update akara, fix race condition in render system init
* reduced boilerplate init code for systems with an update to akara
* fixed a race condition in the render system, added a 1-frame delay
* updated all subscriber systems (due to akara update)
* adding render system test (temporary)
2020-12-07 12:44:11 -08:00
gravestench
8b1b6b9adc more work on ecs implementation
* removed d2common/d2scene, was not the right way to go.
* added components for animation, scale, main viewport, viewport filter
* added interface for scenes, which are extensions of akara.System
* BootStrap is now AppBootstrap, common to game clients and headless
server
* added generic BasicScene struct for common scene functionality
* added game object factory as a system, with single sprite factory
* added update counter system, shows how many times the world updates
per second
* integration test is now the game client test
2020-12-07 12:44:11 -08:00
gravestench
bdf3a2e75d adding d2util.Loggers instances to existing systems 2020-12-07 12:44:11 -08:00
gravestench
474a03e5dc more work on ecs impl 2020-12-07 12:44:11 -08:00
Julien Ganichot
1f2771e8bc
Resolves #874 and #892 (#894)
* Move engine initialization to d2app
* adding debug print of error returned from `App.Run`
* adding ClampInt utility function to d2math
* cleaned up argument parsing in app.go, dedicated server no longer starts a renderer

Co-authored-by: gravestench <dknuth0101@gmail.com>
2020-11-01 16:05:50 -08:00
gravestench
33cf06732e
Revert "Misc(CodeCleanup): Moves engine initialization to d2app #874 (#890)" (#891)
This reverts commit 40879db32f.
2020-11-01 12:12:45 -08:00
Julien Ganichot
40879db32f
Misc(CodeCleanup): Moves engine initialization to d2app #874 (#890)
Move engine initialization out of main and into d2app
2020-11-01 11:16:15 -08:00
Tim Sarbin
1a6c6b8e9f
Add panic screen (#878)
* Add panic screen

* Fixed lint error. Updated all module references
2020-10-28 21:02:12 -04:00
gravestench
6e31cfb52a
migrate to ebiten v2.0 API (#860)
* migrate to ebiten v2.0 API

* fixed lint errors
2020-10-28 14:17:42 -04:00
gravestench
4a62101b96
adding the rest of the data dictionary loaders (#869) 2020-10-28 13:52:15 -04:00
gravestench
a5f9067248
replace satori/go.uuid with google/uuid (#747) 2020-09-23 13:30:15 -04:00
Tim Sarbin
8c8ab94f8c
Remove star, update refs. (#625)
* Added patreon supports to credits

* Remove astar path finding code.
2020-07-26 12:55:10 -04:00
David Carrell
cc893e4dd4
504 - removes input singleton in favor of d2interface.InputManager constructor injection (#584)
Co-authored-by: carrelda <carrelda@git>
2020-07-13 20:29:17 -04:00
thetogi
7b60882ba3
Replace ebitenUtil with d2DebugUtil and new charmap for debugger. (#577)
* lint updates for /d2astar

* png issue

* debug package

* load bmp properly

* debug draft

* Vector float64 (#565)

* Fixed nil pointer in Copy()

* Position added

Added Floor() and String() methods to Vector.

Also added Position which declares an embedded Vector2 and returns various forms of it.

* d2vector.Vector2 renamed to d2vector.BigFloat

* vector.go renamed to big_float.go

* Float64 stub and more renaming

* Vector value getters

* Separate vector types with initial methods.

* Divide and lint warnings.

* Distance and Length.

* Scale, Abs and Negate.

* CompareFloat64Fuzzy delta direction reversed.

* Refactor vector_test.go.

* Renamed Approx methods.

* Distance and Length.

* Distance and Length.

* Removed BigFloat and Vector, renamed Float64 to Vector, simplified tests.

* Angle, SignedAngle and other small functions.

* Receiver rename.

* SingedAngle and test fixed

* Rotate.

* SetLength.

* Cross.

* NinetyAnti and NinetyClock.

* Lerp and Clamp.

* Reflect and ReflectSurface.

* Cardinal convenience functions.

* Comments.

* Panic on NaN and Inf in Position.

* Lint warnings and comments.

* D2map lint warnings (#566)

* Comments and newlines in engine.go

* Comments and newlines in object.go

* Comments and newlines in animated_entity.go

* Comments and newlines in missile.go

* Comments and newlines in npc.go

* Comments and newlines in player.go

* Removed object.go (incorrectly merged it in during rebase).

* Comments and newlines in renderer.go.

* Comments and newlines in map_entity.go.

* Comments and newlines in walk_mesh.go.

* Comments and newlines in viewport.go and tile_cache.go.

* Comments and newlines in stamp.go and wilderness_tile_types.go.

* Comments and newlines in everything else.

* removing inventory grid test for now because it causes builds to fail on github (#570)

* Refactored d2enum (#567)

* Refactored animation mode enum

* More d2enum changes

* Refactored tile enum

* Refactored weapon class enum

* Refactored more enums

* Refactored item event enum

* Fixed init_functions animation mode

* Removed string2enum from MonsterAnimationMode

* Refactored ItemStatCost description

* Last enum lint errors

* Regenerated monster stringer file

* compressed image

* Replaced restruct with StreamReader (#574)

* Fixed bug in palette.go (#575)

* Javascript console commands (#572)

* Allow the execution of JS from the terminal when hosting a local game or playing a single game

Signed-off-by: William Claude <w.claude@thebeat.co>

* Reorganise imports on edited files

Signed-off-by: William Claude <w.claude@thebeat.co>

* Remove Reset

Signed-off-by: William Claude <w.claude@thebeat.co>

* Add inventory.txt loader, use the records (#573)

* adding resource entry for inventory.txt

* adding loader for inventory.txt

* adding call to inventory.txt loader in d2app

* d2game now uses the inventory.txt records for making the inventory panel

* removed comments

* remove unused files

* update go.mod

* lint updates for /d2astar

* png issue

* update go.mod

Co-authored-by: danhale-git <36298392+danhale-git@users.noreply.github.com>
Co-authored-by: dk <dknuth0101@gmail.com>
Co-authored-by: Intyre <Intyre@gmail.com>
Co-authored-by: William <1004323+aziule@users.noreply.github.com>
2020-07-11 18:12:20 -04:00
Tim Sarbin
5bfec3ccb0 Removed render singleton. Updated refs. 2020-07-03 14:00:56 -04:00
Tim Sarbin
b29e7c8fdd
Updated ebiten. Fixed hash entry map data leak. (#489) 2020-06-29 10:53:25 -04:00
Tim Sarbin
9e0df88fc4
Updated ebiten reference (#474) 2020-06-27 14:41:59 -04:00
nicholas-eden
dd21809288
Pull go-astar code into the repo, improve perf (#411)
Copied go-astar into d2common/d2astar, made a few optimizations.  Runs
roughly 30% faster according to my benchmarking.

Added a `maxCost` param to prevent searching the entire map for a path.
This probably needs tweaked a bit, but follows the original game more
closely.

Co-authored-by: Nicholas Eden <neden@zigzagame.com>
2020-06-23 02:04:17 -04:00
Tim Sarbin
8dcec1f209
Added profiler options (#398) 2020-06-22 12:43:26 -04:00
Tim Sarbin
7b38a9d818
Updates (#340) 2020-06-19 02:19:27 -04:00
Tim Sarbin
2da08884c4
Added multiplayer support (#336) 2020-06-18 14:11:04 -04:00
Tim Sarbin
52f8cd6d0c
Initial work to separate client and server logic (#330)
* Switched to json formatted characters

* Added infrastructure for networking

* Minor updates.

* more updates for map engine/rendering

* More map engine changes and fixes
2020-06-13 18:32:09 -04:00
Tim Sarbin
3412c4338c
Added pathfinding and (buggy) collision data. (#285) 2020-02-02 12:46:19 -05:00
Alex Yatskov
8a547ebf0e
Moving files around to make more sense (#279)
* Prevent input fighting between terminal and other input listeners.

* Moving files around, removing exports

* Add missing line
2020-02-01 18:55:56 -05:00
Tim Sarbin
6832a5a0db
merged d2shared into the core package (#275) 2020-01-26 00:39:13 -05:00
Ziemas
6cea2bded0 Update ebiten (#272) 2020-01-02 09:17:55 -05:00
Alex Yatskov
1b03e691b9 High level resource caching; resource cleanup (#264)
* Work on resource loading

* Use new material flag name. (#261)

Update ebiten ref while at it

* Hopefully fix CI (#262)

* Don't try to copy config.json on travis (#263)

I doesn't exist anymore

* Update D2Shared references

* Fix character selection rect

Co-authored-by: Ziemas <ziemas@ziemas.se>
2019-12-21 20:53:18 -05:00
Ziemas
006dcddfb7 Use new material flag name. (#261)
Update ebiten ref while at it
2019-12-19 20:01:00 -05:00
Alex Yatskov
cc678ba747 Add asset manager (#253)
* Add asset manager

* Fix rebase

* Update asset manager to support mpq hash caching

* Update vendoring
2019-12-16 22:23:01 -05:00
Alex Yatskov
61d63bc902 Remove ebiten reference in d2shared (#252)
* Remove ebiten reference in d2shared
* update d2shared reference to latest
2019-12-15 14:07:57 -05:00
Tim Sarbin
88b9fb6207
Updated D2Shared reference. (#242) 2019-12-02 19:16:57 -05:00
Ziemas
51d78bfcbf Draw object layers in order and generally untangle the direction mess. (#239)
* Implement drawing COF Layers by priority

Hack it up by using always draw order for direction 0 until we get a
better handle on directions in the engine.

* Take directions in "cof directions"

Transform into dcc directions for loading frames.

* Set characters to dir 0 in char select.

Direction 0 is now facing down universally
2019-11-26 21:04:36 -05:00
nicholas-eden
19257abddb Extract sprite from dc6 from D2Shared (#234)
Remove processing of dc6 file type from sprite creation.  Use dc6 loader from D2Shared.
2019-11-24 17:58:23 -05:00
Ziemas
c0e931eb4f Animate floor tiles (#232)
* Caching functions decide if we get random tile

We might not always want to.

* The caching functions don't need to return images

* Cache all frames of animated tiles

Also some error checking

* Update animations before drawing floors

* Fix missing frame

Animate from index 0 to 9

* Update refs
2019-11-24 01:11:32 -05:00
Ziemas
48f81c82cd Update d2shared reference (#229) 2019-11-22 23:40:45 -05:00
Ziemas
5ba9470c3a Switch to using the TileType type for tiles. (#228) 2019-11-22 23:30:02 -05:00
Tim Sarbin
93a421c5ed
More CI fixes. (#225)
* Fix CI builds. Removed old go.sum stuff.
2019-11-21 22:31:58 -05:00
Tim Sarbin
3e55453450
Fix CI builds. Removed old go.sum stuff. (#224) 2019-11-21 22:26:08 -05:00
Tim Sarbin
e3e52fd36d
Updated ebiten ref. Removed tag generation. (#223) 2019-11-21 22:00:37 -05:00