9 Commits
Author SHA1 Message Date
code-explorer786andArkanic a5de131711 Trapezoidal jumps
I haven't checked this yet, but it seems like it also reduces the
complexity (runtime) from ≈O(n^2) to ≈O(k^2 + n)
(n = number of jump curves)
(k = number of unique destinations)

The worst case, that is k = n, is still O(n^2) but generally it's much
more (scalably) performant.

Thanks Arkanic for suggesting this!
https://discord.com/channels/391020510269669376/663854113418641429/1256161815503704104

Co-authored-by: Arkanic <50847107+Arkanic@users.noreply.github.com>
2024-09-23 22:31:21 +07:00
code-explorer786andIlya246 939f6939d0 Jump curve coloring
See #general-programming in the Mindustry Discord server:
https://discord.com/channels/391020510269669376/663854113418641429/1256146387834372106

Co-authored-by: Ilya246 <ilyukarno@gmail.com>
2024-09-23 22:26:06 +07:00
code-explorer786 89b67fc4b4 Transition jump heights
It looks good.
2024-09-23 22:26:03 +07:00
code-explorer786 282d21db05 Update jump heights only when necessary.
This method uses signaling (through a boolean) and I feel like it's
extremely hacky, but I tested this and it (kind of?) works.
Unfortunately I found this to potentially lag when resizing.

I am not sure if this is guaranteed to work (as in, produce correct
behaviour) or not, but to my understanding only LogicDialog uses LCanvas
(grep out "LCanvas\|canvas" and see) so it will most likely work?

I tested this and accidentally found an unrelated issue related to
LCanvas.maxJumpsDrawn, but I hope this will be fixed in the near future.
2024-09-23 21:04:45 +07:00
code-explorer786 26105a64f1 Use pools
It feels hacky, but it works regardless. The GC should be working as
hard as it was beforehand.
2024-09-23 21:04:42 +07:00
code-explorer786 b58a6bb8d6 wip: different heights for jump arrows
Note that this is very incomplete, for two different reasons:
- it's O(n^2) or potentially worse
- it makes the GC work hard (it invokes `new` in
  `LCanvas.DragLayout.layout()`)

For the second reason this does not clearly fit the criteria of
CONTRIBUTING.md, but I have yet to figure out ways to work around this
(or make the algorithm more efficient).
2024-09-23 21:01:54 +07:00
code-explorer786 b8c9a05963 LCanvas: jumps -> statements.jumps
Original canvas.jumps is now a reference to canvas.statements.jumps.
Please remove canvas.jumps in favour of canvas.statements.jumps in a
future release. Thanks!
2024-09-23 18:14:38 +07:00
cdb9fa0d7d Add PlayerChatEvent on clients (#8432)
* Add PlayerChatEvent on clients

https://github.com/mindustry-antigrief/mindustry-client/commit/d32dd01097ef62fb0a1bd5aade2a738c04652854

Co-authored-by: buthed010203 <naguiar010203@gmail.com>

* Only fire when valid. (Currently deciding on whether or not to add ChatEvent without the player.)

---------

Co-authored-by: buthed010203 <naguiar010203@gmail.com>
2023-04-06 18:16:04 -04:00
code-explorer786andGitHub 29085b95b7 Fix setblock block not accepting @air (#7160) 2022-07-09 21:21:29 -04:00