Commit graph

114 commits

Author SHA1 Message Date
Eidolon
892a6b8620 Merge public master 2025-08-12 16:49:14 -05:00
Eidolon
255570cfca Dynamically allocate skins
This avoids an issue where the skins array takes up a fixed, but large
amount of memory at runtime. On x86_64 linux, that array is roughly 80
megabytes in memory, most of which is unused when the game is unmodded.
Instead, we treat `skins` as a dynamically resizing array, and it is an
array-of-pointers into separate allocated `skin_t`.

This is based on Lactozilla's skin limit MR for SRB2, but I've rewritten
it because RR has diverged quite a bit.

This was verified to check every access of `skins` by using clangd's
find-all-references function. However, I have only tested plain skins,
not Lua addons, so that could afford some extra checking.
2025-08-12 15:33:00 -05:00
toaster
5e7cce9047 CallFunc_SetThingProperty: Get next mobj in TID chain at start of loop
In cases where state/property set can cause instant deletion, definitely interrupts FindMobjFromTID iteration after one step and potentially uses after free

Also adds comment warnings to this effect near ways to find P_FindMobjFromTID, and updates P_ProcessSpecial even though we could probably stand to rip it out now
2025-05-26 15:22:30 +01:00
toaster
ecb4ffeeca Add bonus pickups in conditions you couldn't grab Spray Cans before
- If you've gotten every Spray Can, or you're on a custom course...
- Only one of these spawns per map
- Correctly save and load these
- Statistics menu counts base-game bonuses
- If there are gaps in the list, or new Spray Cans are added later, these base-game bonuses are converted into the new Spray Cans
- New graphics required so far:
    - SBONA0 to SBONP0 - 16-frame prerendered circling sprite animation
    - GOTBON - 8x8 representation of the SBON object
2025-05-20 20:27:06 +01:00
toaster
3f9c0685eb Move cache_spraycan on the mapheader_t struct to recorddata_t
Still in that struct, just in a more appropriate container
2025-05-20 20:18:11 +01:00
Eidolon
e7c096250e Merge public master 2025-04-08 09:29:49 -05:00
Eidolon
62e35c4f55 Set C++ feature level for ACSVM to 17 2025-04-08 09:22:33 -05:00
Eidolon
eca16f6858 Merge public master 2025-03-30 15:53:57 -05:00
Eidolon
138d27f1b4 Upgrade ACSVM cmake version to 3.14 to unbreak cmake 4.0 build 2025-03-30 15:52:04 -05:00
Eidolon
cb7f437e60 Merge public master 2025-02-13 15:48:11 -06:00
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
Eidolon
1a8467fdaf Merge public master 2025-02-12 19:02:38 -06:00
Sally Coolatta
3b898c528e Do not load invalid ACS modules
BEHAVIOR being optional is now handled from our side, because using getModule or loadModule on an invalid file is supposed to be an error condition for the VM.
2024-10-18 11:06:30 -04:00
Sally Coolatta
001ae4a05b Disable ACSVM save debug signatures
Adds a lot of extra time, and I meant to remove this when I confirmed ACS in netgames was working.
2024-10-18 11:06:30 -04:00
Sally Coolatta
287c711da4 Implement SetLineBlocking
This could be done with Get/SetLineProperty just fine, but added just for completion's sake -- the Hexen instruction set is now fully implemented, minus SoundSequence which is for a feature we straight up don't have.
2024-09-21 04:17:00 -04:00
Sal
653766010d FRIENDCODE (aka, Teamplay) 2024-09-17 01:41:26 +00:00
toaster
5ccdd4fd12 Environment::printKill: Use sizeu1 for system-independent pointer prints 2024-05-21 00:37:00 +01:00
Lactozilla
51ac2cf61a Add branch limit and implement printKill 2024-05-11 22:08:31 -03:00
bitten2up
cfacbd91be Fix implicit casts of int expecting 4-byte width
This fixes the issue with certain compilers that have int set to
different sizes by either explicitly casting or setting templates
manually
2024-05-03 17:53:53 +00:00
toaster
a9ac7e64c6 Permit entering the tutorial challenge multiple times per savedata 2024-04-26 14:59:48 +01:00
Sally Coolatta
7dfa597c7d SRB2 -> DRRR copyright in src, acs, android folder
Be consistent with toaster's recent changes to copyright
2024-04-05 02:08:23 -04:00
Gunla
75e4c63e04 Merge branch 'music-dim-acs' into 'master'
ACS: add Music_Dim function, API to g_musicfade

See merge request KartKrew/Kart!2229
2024-04-05 01:14:44 +00:00
James R
78da8bb816 ACS: add Music_Dim function, API to g_musicfade 2024-04-04 05:20:19 -07:00
James R
c9b57548e9 ACS: interpolate changes to sidedef offsets 2024-04-04 03:09:29 -07:00
toaster
bd82ca8ccf Add PlayerExiting() ACS callfunc 2024-03-30 16:38:53 +00:00
toaster
385988eeed Add PlayerLosing() to ACS
Exposes K_IsPlayerLosing. Necessary for Sealed Star script adjustment
2024-03-30 16:03:37 +00:00
toaster
a7079d6ea2 Add FINISH script calling type to ACS
Called at the end of a successful P_DoPlayerExit
2024-03-30 16:02:35 +00:00
Oni
973d5ba658 Merge branch 'objective-hud' into 'master'
Add persistent objective messages via K_AddMessage, expose to ACS

See merge request KartKrew/Kart!1843
2024-01-20 00:19:17 +00:00
James R
b903da899e Objective text ACS: return false
I think these are only supposed to return true if they
suspend thread execution, but I'm not sure.
2024-01-17 20:13:16 -08:00
AJ Martinez
7b2c5276c6 Add opcodes for HUD message system 2024-01-17 00:46:22 -07:00
Eidolon
bdc0795704 Fix several Clang compile warnings 2024-01-16 06:11:43 -05:00
AJ Martinez
9b224356fe Add persistent objective messages via K_AddMessage, expose to ACS 2024-01-15 17:49:10 -07:00
toaster
75205e3f79 New ACS functions (resolves #697)
- For Tutorials specifically
    - void Dialogue_AutoDismiss(void)
        - Dismisses the current dialogue (including from other threads).
    - str CheckTutorialChallenge(void)
        - Returns special values depending on state relevant to the Tutorial Challenge.
            - Returns a blank string in netgames, or if none of the following are true.
            - Returns "Active" if the skip is in progress.
            - Returns "Failed" if the skip was just failed.
            - Returns "Locked" if not available with this gamedata.
- Other tiny check functions
    - bool PositionStart(void)
        - Returns true if leveltime < starttime.
    - bool FreePlay(void)
        - Returns true if in Free Play.
2023-12-10 18:23:57 +00:00
toaster
cdb2b44aa6 ACS-Dialogue interface: New threads with dialogue auto-skip previous threads with dialogue
If some dialogue needs to be never-missable, that's the mapper's responsibility - but now they won't get randomly interleaved if multiple are activated just by regular free driving, which was the worst kind of default
2023-12-10 16:10:45 +00:00
toaster
f01e3bce9b CallFunc_DialogueSetCustomSpeaker: Support empty string 2023-11-30 17:54:51 +00:00
Sal
84543da38a Implement getModuleName for ACS environment 2023-11-22 14:37:07 +00:00
toaster
0c645810c6 ACS: Invalidate mapscope before PU_LEVEL purge occours
Fixes the MapWarp memory corruption conclusively.
2023-11-05 18:49:41 +00:00
toaster
dce2c73df1 thinker_era
A first pass in attempts to fix crashes when ACS causes map changes.
Frustratingly still got a crash, but I think this is definitely the right foundation to work with.
2023-11-04 17:11:59 +00:00
James R
adb3eb7463 ACS_Execute, ACS_ExecuteAlways: handle map stringargs 2023-10-07 20:40:39 -07:00
Oni
bcc8fc6438 Merge branch 'freeze' into 'master'
Mobj thinker freeze condition rework

Closes #690

See merge request KartKrew/Kart!1505
2023-10-02 05:42:19 +00:00
James R.
fa86512a4b ACS music functions: add optional bool to only affect player activator 2023-09-25 02:06:16 -07:00
Sally Coolatta
d3ee4d631a Add "Freeze" ACS function 2023-09-23 15:54:01 -04:00
toaster
63844b3839 ACS: Extra tidy
- Rename final BreakTheCapsules material to PrisonBreak
- Fix comment for PlayerScore (previously copypaste mistake)
2023-09-17 21:59:07 +01:00
toaster
3c1246412e ACS: Add PlayerBot
Returns bot status of activating player
ZDoom had a bot status function that could be mimiced... but it used a passed player number, when all we need to check for is the activator.
To this end, has a different name (the ZDoom version was "PlayerIsBot")
2023-09-17 21:58:56 +01:00
toaster
5926ee952a ACS: Add IsNetworkGame
- Mimics existing ZDoom(/Hexen?) ACS function for checking Netgame status
2023-09-17 21:47:19 +01:00
toaster
815e125188 Disable all g_dialogue-dependent ACS behaviour in netgame conditions
Actual solution to Test Run dialogue in servers
2023-09-17 13:50:32 +01:00
toaster
e854ce53f5 Add "GetGrabbedSprayCan" to ACS
- If netgame or no Spray Can has been grabbed on this map, return 0
- If all Spray Cans have been grabbed in other maps, return "_Completed"
- Otherwise, return the name for the Spray Can color attached to this map
2023-09-13 18:10:08 +01:00
toaster
ce86ebbd52 Add "GrandPrix" check function to ACS
Resolves #669
Done in this branch to keep ACS changes together
2023-09-13 18:06:15 +01:00
James R
baf7f82af3 HU_DoTitlecardCEcho: add splitscreen support and interrupt feature
- Takes player argument and only appears on the screen if
  they're a display player.
- Uses 4P font when in splitscreen.
- Uses 1P font if not in splitscreen, or player argument
  is NULL -- message to everyone.
- Interrupt argument controls whether the message should
  overwrite another message that's already playing.
  - Global and player specific messages are considered
    separately.
2023-08-26 21:39:18 +01:00
Sally Coolatta
3c14931764 Merge master 2023-08-25 18:39:01 -04:00