Commit Graph

230 Commits

Author SHA1 Message Date
3d6ef03b37 attempt to optimize collision
it's actually worse
2025-06-24 22:36:58 -07:00
d7e029edb6 profile-guided optimization 2025-06-23 01:37:57 -07:00
5e6b98523b delete linked lists and use optimized array impls.
Also removes "suppress" table from collider, use candidate.dead instead
because the set of dead ships and the set of non-colliding ships is
identical.
2025-06-23 00:47:02 -07:00
67970a5164 add draw/update stat readout
surprisingly, update is most of my problem
2025-06-21 17:50:03 -07:00
eaea42f993 fix shot axis 2025-06-21 17:38:05 -07:00
929f47fc78 bullet microoptimization and velocity fix 2025-06-21 17:36:27 -07:00
430a0a4b14 ship_m:move micro-optimizations 2025-06-21 17:17:44 -07:00
e4062d3ccd back out of fast bullet changes, keep optimizations
in the "nothing but turrets" worst-case scenario, fast bullet logic costs 133% of slow bullet logic even when almost all shots on screen are slow. when I back out of this, that scenario is _still_ over 300% CPU but at least it's not 400%. note that this is with a screen mostly full of enemies, so processing all of them and their potential collisions also has cost, so the actual bullet-specific change is closer to 150%, maybe 200%. this is genuinely not as bad as I had thought but it doesn't feel like it will be workable; while my worst-case scenario is implausibly bad it's not actually 3x-likely-peak bad. so I'm going to need to find more optimizations, and probably give up on fast bullets. But I can keep the fast bullet branch around in case I find the headroom to reintroduce it later.
2025-06-21 17:05:36 -07:00
c9d7437ffe trim up draw costs a bit 2025-06-21 16:40:23 -07:00
d0de757b0e test the worst case scenario for shots
way too slow
2025-06-21 16:36:36 -07:00
a8b5b9dbe6 fast shot rendering prototype
it's slow *and* it sucks, and making it not suck will make it much slower. this is bad
2025-06-21 16:07:23 -07:00
2596f8aa6c I can't spell 2025-06-21 15:13:07 -07:00
ef40c245f8 multi-step shot prototype
nothing reaches this new logic yet, and multiple steps aren't drawn
2025-06-21 15:12:40 -07:00
6d6e13cf3b special case strip(call_move) to stripmove()
this gets called so much the extra function overhead actually seems bad
2025-06-21 14:55:20 -07:00
99323be298 despawn shots aggressively when offscreen
avoids hitting enemies before they spawn in.

may need to revisit this for the X coordinate if I want to implement a "Wild Ball" kind of weapon, but I think I won't have the tokens for that anyway
2025-06-20 19:13:28 -07:00
85c5091804 pbullets also move just before the collision check.
This also sets up for the "fast shots" refactor.
2025-06-20 19:08:58 -07:00
a77180d89a bullet_base:die doesn't actually make sense 2025-06-20 18:55:48 -07:00
c01c3400b7 fix eternal horizontal bullets 2025-06-20 18:51:58 -07:00
0f791b193c more efficient collision iteration, fix eternal shots 2025-06-20 18:50:04 -07:00
d3351d9a05 Use eship_collider for ship collisions, too. 2025-06-20 17:56:57 -07:00
ecddb56d72 loops work better when you increment them 2025-06-20 17:50:03 -07:00
723c0f791c Refactor collider to collaborate with linked_list.
The only use of a collider is intertwined with the ship list, so I can combine the "prepare to yoink" and "populate collider" and "iterate list" steps, and I can combine the "hide" and "yoink" steps. This doesn't save tokens now but it's about to, when I use the eship collider to test pship collision.
2025-06-20 17:48:02 -07:00
e018578754 keep animating bullets while dead 2025-06-20 16:36:18 -07:00
bf8297eb72 prevify eships when setting up collider
I will refactor this next: collider.new will take the linked list to ingest, perform the `insert` and "prevify" loops itself, then replace `hide` with `yoink`, which yoinks the item out of the original list. This pairs the `yoink` operation with the context that makes it possible to do (that is, the context when prevification was implemented); eships therefore cannot be edited in complex ways while the collider is still valid, but we can append to it as long as we don't expect those items to be procesesd correctly this frame. a new_eships+vore plan might be better if we turn out to need it, but presently we don't; flotilla spawning and raider spawning happen at a different point.
2025-06-20 16:31:18 -07:00
1c8bcae44c put ebullet moves inside the collision check loop 2025-06-20 16:01:59 -07:00
325d7444e7 invert eship/pbullet collision
Also mildly trims up linked_list impl.
2025-06-20 15:09:18 -07:00
789cdf6a7a profile the drawing options 2025-06-08 17:36:50 -07:00
372133c15e sqrt is actually faster 2025-06-08 16:55:15 -07:00
b38ebcc603 magnitest: cover image, png file 2025-06-08 16:16:16 -07:00
d9a10a7d07 fastest sqrt version, fix percentage 2025-06-08 16:14:18 -07:00
3ec786f416 fix deceleration 2025-06-08 15:11:36 -07:00
9955df6844 fix scaling alg 2025-06-08 15:11:07 -07:00
9e52e65ad1 fix font color 2025-06-08 15:10:12 -07:00
a9765bee1a fix missed cls 2025-06-08 15:09:27 -07:00
b919eb824d testing vector magnitude calculation 2025-06-08 15:08:58 -07:00
2c37784ad7 try this linefill func and start optimizing it 2025-06-08 14:35:49 -07:00
37d9e3d30e more experiments with drawing these collision boxes. still sucks 2025-06-08 14:10:23 -07:00
1ef5b56c58 wait this version of zot actually looks good 2025-06-01 23:46:59 -07:00
44fb8482a5 a version of zot that does not look awful
performance impact is probably not acceptable though
2025-06-01 23:29:03 -07:00
62f8f27829 a zot prototype that looks awful
I need to draw all the hot parts last
2025-06-01 23:06:44 -07:00
542acc5308 nano-optimizations 2025-06-01 21:03:04 -07:00
4e66c875ad improve legibility 2025-06-01 20:58:21 -07:00
812d32e70c micro-optimizations 2025-06-01 20:58:12 -07:00
d2ec1b39df Show approximation of contact zone 2025-06-01 20:38:56 -07:00
a3ac8074ae line-box collision implemented by Pyrex&Nyeo 2025-06-01 20:29:02 -07:00
85d28ae28b get rid of pships
lots of things rely on exactly one primary ship now, so this was just
overhead and wasted tokens / cspace.
2025-06-01 17:55:46 -07:00
c514c61b3a look at me. *look at me.* I'm the gun_base now 2025-06-01 17:41:07 -07:00
9be828dd5c blast gun is a trig gun
now there are no more base guns
2025-06-01 17:38:45 -07:00
2b51a3472b protron trig gun 2025-06-01 17:36:15 -07:00
95ea70baae vulcan_gun as trig gun
causes x offset to reverse for negative aim; may need to be careful
with how I make aiming guns actually work, but this should work for
deriving player guns from enemy guns (by using negative aim)!
2025-06-01 17:26:29 -07:00