dt-rush / sameriver

game engine written in go
Other
1 stars 1 forks source link

Feature/numeric goap better modal #56

Closed dt-rush closed 1 year ago

dt-rush commented 1 year ago

holy moly this was a journey... the test cases show the basic pattern and what's possible.

took a detour into trying to optimize it, noticing in profiling traces that malloc was taking a lot of time; so i implemented an object pool for GOAPPath, GOAPGoalRemaining, GOAPGoalRemainingSurface, and GOAPWorldState. But that actually decreased performance by like 50x. SO........ this is it.

Future directions:

codecov[bot] commented 1 year ago

Codecov Report

Merging #56 (0a51842) into master (d90ad5a) will decrease coverage by 0.73%. The diff coverage is 64.76%.

:exclamation: Current head 0a51842 differs from pull request most recent head 3eea7d0. Consider uploading reports for the commit 3eea7d0 to get more accurate results

@@            Coverage Diff             @@
##           master      #56      +/-   ##
==========================================
- Coverage   70.40%   69.67%   -0.73%     
==========================================
  Files          63       68       +5     
  Lines        3193     3684     +491     
==========================================
+ Hits         2248     2567     +319     
- Misses        818      965     +147     
- Partials      127      152      +25     
Impacted Files Coverage Δ
v2/collision_rate_limiter_array.go 100.00% <ø> (ø)
v2/entity.go 52.23% <ø> (ø)
v2/floatmap.go 0.00% <0.00%> (ø)
v2/goap_pqueue.go 70.00% <0.00%> (+33.15%) :arrow_up:
v2/idiom.go 50.87% <0.00%> (-18.18%) :arrow_down:
v2/world_queries.go 19.17% <7.50%> (-14.16%) :arrow_down:
v2/item.go 65.00% <20.00%> (-9.79%) :arrow_down:
v2/goap_print.go 33.33% <33.33%> (ø)
v2/goap_planner.go 55.96% <55.14%> (-44.04%) :arrow_down:
v2/inventory.go 76.96% <66.21%> (-2.21%) :arrow_down:
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.