-
Notifications
You must be signed in to change notification settings - Fork 10
New api #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
milanjrodd
wants to merge
225
commits into
main
Choose a base branch
from
new-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
New api #15
Changes from 15 commits
Commits
Show all changes
225 commits
Select commit
Hold shift + click to select a range
80f9922
init new-api
milanjrodd 58118d5
fmt new-api
milanjrodd 126c085
fix types
milanjrodd fe7fcc1
refactors
milanjrodd 90aaba4
feat scenes
milanjrodd 97fed6d
refactor playerSystem
milanjrodd abd6532
init velocity system in desktop-game.go
milanjrodd b4ed6e1
refactor scenes and implement dynamic auto imports for components in …
milanjrodd 234100b
remove pointers to component managers in component list
milanjrodd a81ce79
update go version and deps
milanjrodd 36292ac
update github master_workflow.yml
milanjrodd 4e22a6b
fix memory issues
milanjrodd 6034af3
refactor huge renaming breaking changes
milanjrodd 962e6e2
feat new api
milanjrodd ef9f8e0
small changes
milanjrodd 547d9f0
new engine runner
milanjrodd e845554
refactor render lerp with exp decay function
milanjrodd 997493d
optimize some issues
milanjrodd e346698
fix pointers
milanjrodd 219d814
fix issues
milanjrodd 35a958f
feat dist build tasks
milanjrodd 05bad1d
feat mem pprof
milanjrodd e138759
fix huge amount of memory allocation
milanjrodd 9e8e8e4
sandbox sdl and c
milanjrodd 0d4cc5d
feat internal sdl3 cgo test
milanjrodd c8bacb0
refactor render -> rl-render.go
milanjrodd debd54a
sdl rulit
milanjrodd e38f5c9
add HromRu@twitch to the history B)
milanjrodd e3b4898
feat component-manager-shared.go
milanjrodd 90ac2cd
feat new render.go with sprite sorting
milanjrodd acd7633
feat ysort system and component
milanjrodd a58d91f
feat simple collision system
milanjrodd 891a7e5
feat collision events
milanjrodd 640b2c5
feat spatial collision and grid
milanjrodd 6015d46
feat collision-detection.go
milanjrodd 08dfdf0
implement multithreading in collision-detection.go
milanjrodd fc605fc
hot fix entity array out of bounds collision-detection.go
milanjrodd 92850e3
fix collision-detection, set proper amount of workers, and check enti…
rkuzovlev ae4a1dc
collision-detection do not process same entity in different workers
rkuzovlev bd93006
feat assterodd game
milanjrodd 0d58cb8
change batch size + move wg.Add
rkuzovlev 0219b26
Merge pull request #16 from rkuzovlev/new-api
milanjrodd 60fe87d
include donations 10.03.2025
milanjrodd d0098e8
yolo
milanjrodd f0ac2b8
feat bvh system collision-detection-bvh.go
milanjrodd fc7d3d3
refactor collision-detection-bvh.go to use stack instead of function …
milanjrodd d746766
small optimizations
milanjrodd b833dab
refactor collision-detection-bvh.go - implement layers for trees
milanjrodd c233834
optimize bvh tree
milanjrodd 9bb6f60
fix window render
milanjrodd 4a27e59
better collision mask and layer system
milanjrodd 7be447d
add steamworks api
milanjrodd 49d79dd
collision-detection-bvh.go implement GJK
milanjrodd 9c57aa4
collision-detection-bvh.go implement epa - collision depth and normal
milanjrodd 7301dd7
collision-detection-bvh.go fix bvh and epa for 2d space
milanjrodd 0f3af9e
collision-detection-bvh.go fix tp issue
milanjrodd 967a546
collision-detection-bvh.go 4 hours of aabb size fixing, please help
milanjrodd 614dbd8
collision-detection-bvh.go small fixes
milanjrodd f3564a6
fix naming collisions
milanjrodd 46ff981
fix taskfile dev cmd
milanjrodd 3f5683e
feat gjk package amd refactor collision detection system
milanjrodd 86730e6
update vscode settings
milanjrodd 3f266a9
upd epa
milanjrodd 1bfcac6
refactor epa
milanjrodd 096b09b
add gjk+epa doc links
milanjrodd 7b81b41
fix epa teleportation and panic
milanjrodd 32d8273
implement circle colliders
milanjrodd 93b4499
update mac build task
milanjrodd 03746fb
refactor - small changes
milanjrodd ab5c159
gjk - fix circle collider support function
milanjrodd 0bed522
feat(audio): added some self-made SFX for asterodds
thearturca 96aae0b
rigid body mass fun
bitver e91a0b2
Merge remote-tracking branch 'rodd-oss/new-api' into new-api
bitver f204b34
upd chatting
milanjrodd 28bb6e6
Merge pull request #17 from thearturca/feat/new-api-audio-system
milanjrodd 835fc8e
Merge remote-tracking branch 'origin/new-api' into new-api
bitver 5832860
rigid body mass fun
bitver 3bd3d51
Merge pull request #19 from bitver/new-api
milanjrodd dcea177
optimize collision detection system
milanjrodd 95a7805
implement circle to circle collision strategy
milanjrodd 66bb6a5
upd tree
milanjrodd 6d816f2
update bvhtree
milanjrodd be1cb24
upd bvhtree
milanjrodd 53918e3
remove deprecated
milanjrodd af70d93
rename bvh tree
milanjrodd d27aad4
small updates
milanjrodd 0a03a29
refactor bvh tree build function - x9 performance
milanjrodd abe69dd
refactor bvh tree - use pagedArray for nodes
milanjrodd 383adee
refactor bvh tree - from slices to pagedArrays
milanjrodd 03cbe5c
feat collision sleep system
milanjrodd 0b257f5
refactor(audio): implements audio in ecs-way
thearturca 7e0a145
update sdl3 purego and cgo internals
milanjrodd e53a3e9
fix: minor rename
thearturca 26c4984
Merge pull request #20 from thearturca/feat/ecs-implement-of-audio-sy…
milanjrodd 7e2fa06
fix(sound-effects-manager): rename component id
thearturca 3cd53f0
Merge pull request #21 from thearturca/feat/ecs-implement-of-audio-sy…
milanjrodd 6a6ec9e
update sdl3 purego and cgo internals
milanjrodd 2fd7689
feat sdl purego zukko internal test
milanjrodd 9835d08
feat ebiten internal test
milanjrodd f63de3f
feat sdl2 internal test
milanjrodd 4dd954d
+perf
bitver 2436b07
Merge pull request #22 from bitver/new-api-test
milanjrodd 76d17e6
upd bvh tree
milanjrodd f309722
upd collision detection massive reallocations
milanjrodd b9205b1
pre bvh tree fix
milanjrodd 3ed7154
bvh tree fix
milanjrodd 792a64b
fix bvh collision checks
milanjrodd 66e4bad
add leaf aabb check to bvh tree
milanjrodd ac4214c
upd
milanjrodd 4b00a45
fix collider.go cgo issue
milanjrodd 33c80f3
feat velocity system asserts
milanjrodd eebf4fe
feat debugTree const for collision-detection-bvh.go
milanjrodd 2288801
feat bvh tree asserts
milanjrodd 0326177
update asterodd.go inits
milanjrodd b6228f2
init game refactor
milanjrodd 77cc919
refactor world to render injection
milanjrodd 7b1edde
ftm game.go
milanjrodd 3aafeb4
fix fixUpdate rapid effect after fps drop
milanjrodd 80d576a
init grid and bvh component
milanjrodd d33f37f
upd collision-detection.go implement grid and tree setup sub system
milanjrodd 2268368
init slice.go
milanjrodd 3632e01
upd ecs slice
milanjrodd 1a52849
feat slice.go
milanjrodd 6837164
upd collision-detection.go
milanjrodd 044bdf8
+cameras
bitver a347763
Merge branch 'new-api' into local-new-api
bitver c2a1653
merge fix
bitver 9221749
fix bvh-tree.go stack limit
milanjrodd 1a18f56
lil optimization
bitver fd6b4c6
pre-merge
bitver f4bf154
Merge branch 'new-api' into local-new-api
bitver 3587716
pre-merge
bitver 054973b
random crash fix
bitver b8a760c
return non-perfomant systems
bitver 62cb525
clean
bitver 7a02935
wip
bitver 5d74d64
center
bitver 8613555
mini fix
bitver 88de518
mini fix
bitver d1706cd
update lvl
milanjrodd ed432cb
Merge pull request #26 from bitver/local-new-api
milanjrodd fee320e
Merge pull request #27 from rodd-oss/local-new-api
milanjrodd 90cacc7
refactor render-2d-cameras.go for better performance
milanjrodd 3442d49
breaking changes - component-manager.go rename Get() to GetUnsafe()
milanjrodd 747ff47
component-manager.go add safe Get() method
milanjrodd bc754c4
breaking changes component-manager.go rename Remove() to Delete()
milanjrodd f8be29b
breaking changes component-manager.go each parallel batchsize -> numW…
milanjrodd 248bfb8
breaking changes paged-array.go rename iters
milanjrodd b3a6479
breaking changes - refactor iterators
milanjrodd 43e6fbb
massive optimizations
milanjrodd 29dd608
small memaloc fixes
milanjrodd 77d3926
+perf?
bitver 4d383a0
Merge pull request #23 from bitver/new-api
milanjrodd bedf07e
init pkg/worker - pool, task & worker
milanjrodd dea9544
feat workers
milanjrodd 1c34304
fix numworkers
milanjrodd 9123a49
update worker pool performance
milanjrodd a869059
add donations
milanjrodd e61194c
fmt
milanjrodd 7d654b5
update workers and pool
milanjrodd ff9bd06
breaking changes - iter EachParallel is now Process method
milanjrodd a0e7a74
fix pool nil pointer
milanjrodd 233d4f3
feat worker pool GroupAdd() method
milanjrodd 21141e3
optimize memory allocation
milanjrodd 4a31572
implement map.go - which is LESS PERFORMANT than paged-map.go
milanjrodd 752cf05
implement flat multithreaded collision setup in collision-detection.go
milanjrodd 0852389
rename collision-detection.go to collision-setup.go
milanjrodd 7edccb6
feat collision-detection.go
milanjrodd 3804dd0
fix allocation issues
milanjrodd 1e60961
fix: value direct memory call
milanjrodd 21f6bd0
docs - add comments
milanjrodd a08654f
fix multithreading
milanjrodd 75fb158
fewer allocations
bitver 80af469
Merge branch 'new-api' into new-api-local
bitver 17ae43a
feat: chunked bit table
bitver 643fe0d
feat i <3 my twitch chat babies
milanjrodd 25dbcc5
update race_test.go
milanjrodd 275b015
update race_test.go
milanjrodd 4bd1159
add: component-byte-table.go
bitver 8b25a13
tests
bitver 9ee0fdb
tests
bitver e688d4f
Merge pull request #28 from bitver/new-api-local
milanjrodd a729294
scroll
bitver 6dd64e8
Merge pull request #29 from bitver/new-api-local
milanjrodd f7902cf
fix culling
bitver 7c5422b
Merge pull request #30 from bitver/new-api-local
milanjrodd db10d9a
fix scroll
milanjrodd 4198977
faster and more reliable bitset
bitver 8bbb574
rocket science
bitver d291a00
bench test the goasm and cgo calls
milanjrodd ec96dab
wanna perf?
bitver a18d097
Merge pull request #32 from bitver/bittable
milanjrodd 067abb9
Merge remote-tracking branch 'origin/new-api' into new-api
milanjrodd cf84f1b
micro optimizations
bitver 3a43bf9
fps
bitver b22473f
Merge remote-tracking branch 'origin/new-api' into new-api
bitver b66ec1f
Merge pull request #33 from bitver/fps
milanjrodd 4bade53
Merge remote-tracking branch 'origin/new-api' into new-api
milanjrodd a491066
feat collision-setup.go
milanjrodd 88eff30
Merge remote-tracking branch 'origin/new-api' into new-api
bitver 0a4c967
refactor(spatial-audio): adds volume calculation and fix volume control
thearturca 4de6c17
chore(dev): adds asserts on GetUnsafe components
thearturca 5744efe
docs(sound-effect): adds more description on component fields
thearturca 46aa58f
refactor(spatial-audio): rewrite SpatialAudioSystem to parallel proce…
thearturca 697ed2a
feat(sound-effects): adds sound for satellite to demo SpatialAudioSystem
thearturca 1b6234b
refactor(audio-system): rewrite AudioSystem to use parallel processing
thearturca 0b80f39
lowest
bitver 7b92d84
Merge pull request #34 from bitver/bittable
milanjrodd c75a82e
fastest log2 on wild west
bitver b7e2a51
minor changes
milanjrodd 096131f
Merge remote-tracking branch 'origin/new-api' into new-api
bitver ca8bdc8
fastest log2 on wild west
bitver 8f3526d
Merge pull request #35 from bitver/bittable
milanjrodd cf54441
feat collision-detection.go
milanjrodd 5404d06
optimizations for collision detection
milanjrodd e63b1a4
Merge pull request #31 from thearturca/refactor/audio-system
milanjrodd 430d201
optimizations for collision detection
milanjrodd 2b7ca75
resize
bitver e55bb98
Merge pull request #36 from bitver/bittable
milanjrodd f5d9ed9
minor chores
milanjrodd fe01bd8
init internal wasyan
milanjrodd f22852b
revert to old iterators
bitver 2b6cdb6
add test wasyan
milanjrodd c5b5650
update wasyan
milanjrodd 10ccef8
Merge pull request #37 from bitver/new-api
milanjrodd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
This Source Code Form is subject to the terms of the Mozilla | ||
Public License, v. 2.0. If a copy of the MPL was not distributed | ||
with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
===-===-===-===-===-===-===-===-===-=== | ||
Donations during this file development: | ||
-===-===-===-===-===-===-===-===-===-=== | ||
|
||
none :) | ||
|
||
Thank you for your support! | ||
*/ | ||
|
||
package gomp | ||
|
||
import ( | ||
"gomp/stdcomponents" | ||
) | ||
|
||
func NewDesktopComponents() DesktopComponents { | ||
return DesktopComponents{ | ||
Position: stdcomponents.NewPositionComponentManager(), | ||
Rotation: stdcomponents.NewRotationComponentManager(), | ||
Scale: stdcomponents.NewScaleComponentManager(), | ||
Velocity: stdcomponents.NewVelocityComponentManager(), | ||
Flip: stdcomponents.NewFlipComponentManager(), | ||
Sprite: stdcomponents.NewSpriteComponentManager(), | ||
SpriteSheet: stdcomponents.NewSpriteSheetComponentManager(), | ||
SpriteMatrix: stdcomponents.NewSpriteMatrixComponentManager(), | ||
Tint: stdcomponents.NewTintComponentManager(), | ||
AnimationPlayer: stdcomponents.NewAnimationPlayerComponentManager(), | ||
AnimationState: stdcomponents.NewAnimationStateComponentManager(), | ||
TextureRender: stdcomponents.NewTextureRenderComponentManager(), | ||
Network: stdcomponents.NewNetworkComponentManager(), | ||
} | ||
} | ||
|
||
type DesktopComponents struct { | ||
Position stdcomponents.PositionComponentManager | ||
Rotation stdcomponents.RotationComponentManager | ||
Scale stdcomponents.ScaleComponentManager | ||
Velocity stdcomponents.VelocityComponentManager | ||
Flip stdcomponents.FlipComponentManager | ||
Sprite stdcomponents.SpriteComponentManager | ||
SpriteSheet stdcomponents.SpriteSheetComponentManager | ||
SpriteMatrix stdcomponents.SpriteMatrixComponentManager | ||
Tint stdcomponents.TintComponentManager | ||
AnimationPlayer stdcomponents.AnimationPlayerComponentManager | ||
AnimationState stdcomponents.AnimationStateComponentManager | ||
TextureRender stdcomponents.TextureRenderComponentManager | ||
Network stdcomponents.NetworkComponentManager | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
This Source Code Form is subject to the terms of the Mozilla | ||
Public License, v. 2.0. If a copy of the MPL was not distributed | ||
with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
===-===-===-===-===-===-===-===-===-=== | ||
Donations during this file development: | ||
-===-===-===-===-===-===-===-===-===-=== | ||
|
||
none :) | ||
|
||
Thank you for your support! | ||
*/ | ||
|
||
package gomp | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
type AnyGame interface { | ||
Init() | ||
Update(dt time.Duration) | ||
FixedUpdate(dt time.Duration) | ||
Render(dt time.Duration) | ||
Destroy() | ||
ShouldDestroy() bool | ||
} | ||
|
||
func NewEngine(game AnyGame) Engine { | ||
engine := Engine{ | ||
Game: game, | ||
} | ||
|
||
return engine | ||
} | ||
|
||
type Engine struct { | ||
Game AnyGame | ||
|
||
lastUpdateAt time.Time | ||
lastFixedUpdateAt time.Time | ||
lastRenderAt time.Time | ||
} | ||
|
||
func (e *Engine) Run(tickrate uint, framerate uint) { | ||
fixedUpdDuration := time.Second / time.Duration(tickrate) | ||
|
||
framerateDuration := time.Second / time.Duration(framerate) | ||
|
||
|
||
fixedUpdTicker := time.NewTicker(fixedUpdDuration) | ||
defer fixedUpdTicker.Stop() | ||
|
||
renderTicker := time.NewTicker(framerateDuration) | ||
defer renderTicker.Stop() | ||
|
||
e.Game.Init() | ||
defer e.Game.Destroy() | ||
|
||
e.lastUpdateAt = time.Now() | ||
e.lastFixedUpdateAt = time.Now() | ||
e.lastRenderAt = time.Now() | ||
|
||
for !e.Game.ShouldDestroy() { | ||
// Update | ||
e.Game.Update(time.Since(e.lastUpdateAt)) | ||
e.lastUpdateAt = time.Now() | ||
|
||
// Fixed Update | ||
select { | ||
case <-fixedUpdTicker.C: | ||
e.Game.FixedUpdate(time.Since(e.lastFixedUpdateAt)) | ||
e.lastFixedUpdateAt = time.Now() | ||
default: | ||
break | ||
} | ||
|
||
// Render | ||
select { | ||
case <-renderTicker.C: | ||
e.Game.Render(time.Since(e.lastRenderAt)) | ||
e.lastRenderAt = time.Now() | ||
default: | ||
break | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.