Commit graph

1494 commits

Author SHA1 Message Date
Oni
9724144e99 Merge branch 'gamedata-extension' into 'master'
Gamedata Extensions

See merge request KartKrew/Kart!1262
2023-06-02 03:40:57 +00:00
toaster
1821b4f52d P_InitThinkers: Handle several important mobj cleaning tasks in one place, rather than scattered
- titlecam.mobj cannot have P_SetTarget applied when initially setting to NULL, as its previous occupant is some unknown region in memory, and modifying the reference count could in fact change some random number or address ANYWHERE IN THE ENTIRE PROGRAM.
- So we straight up wipe it rather than referenced-unset it in one place, always, for general tidiness.
- Also move skyboxcenterpnts, skyboxviewpnts, and iquetail/iquehead so it's all centralised.
2023-05-31 12:49:51 +01:00
toaster
4c34d04f8a recorddata_t handling adjustments
Preperatory work for the next feature on my agenda.
- No longer independently allocated.
    - This was a byproduct of the previous NUMMAPS-based implementation. It's just cleaner to have it live directly on the mapheader_t, no caveats about it.
- Now contains mapvisited bitflag array.
    - Now all to-gamedata properties on a mapheader's struct are grouped together.
        - I was of two minds about it, but decided that this would have cleaner guarantees for compartmentalisation, saving, and loading.
        - They can still be wiped independently (G_ClearRecords for time/lap and M_ClearSecrets for mapvisited).
2023-05-30 12:21:39 +01:00
Sally Coolatta
9d80323a3a Read-only mapthing_t
Map things are writeable in Lua, which I am pretty certain is a mistake because mapthings are not sent over the network at all. I considered making them net-synced (it would be relatively easy), but it also aligns with another, more "philosophical" issue: Doom generally copies over properties from mapthing_t into mobj_t, and then only refers to it again when needing to respawn an object -- mapthing_t is not really intended to be referred to very often at runtime. At best it's slightly annoying since some objects rely on a spawnpoint for behavior changes, at worst it may make ACS more confusing in the future since Thing and Mobj tags are mixed together or less useful since they wouldn't be able to modify behaviors of objects that are based on args.

So I decided to solve these two issues at the same time; just treat mapthing_t as something to copy values from, like OG Doom does it. This basically just means that special and args are also part of the mobj now instead of the mapthing, which should fill any desire to edit this stuff from Lua, and reduces the number of instances where objects need to check for their spawnpoint to function properly.
2023-05-25 14:40:55 -04:00
Sally Coolatta
d953049c78 ACS: User properties can tell bool from string 2023-05-02 18:44:30 -04:00
Sally Coolatta
d9382f2100 ACS: UDMF user properties
Lines, sides, sectors, and things now all support the "Custom" tab properly. Label a property as `user_[whatever you want]` in this tab, and it will be added to the structure. ACS will then be able to retrieve it using the `Get[x]UserProperty()` function.
2023-05-02 18:44:27 -04:00
Sally Coolatta
60e80d876d Improve quake effects
- Quake epicenter + radius now work.
- Since quake epicenter works, removed the display player check on all of the quakes, so other players can feel them.
- Multiple quake effects are stored in a linked list and dynamically created/freed, so they can stack together.
- Made in china
- Made the quake effects only work on the z axis.
- Quakes now alternate their intensity and dampen it over time, instead of randomly picking values.
- Added quake effects for offroad and stair-jank
- Disabled quakes in reducevfx
- Removed actionmovie and windowquake (sorry jartha)
2023-05-01 14:24:32 -04:00
toaster
581567dfae musiccountdown
A system for level completion jingles.
- G_Ticker
    - Call P_EndingMusic after a certain amount of time has elapsed to begin a jingle
    - Play O_RACENT after the jingle's completion instead of baking it or an equivalent into the music
- P_EndingMusic
    - Change the function signature to not take a player
    - Pick from a series of const char* jingles, instead of sprintfing into a buffer
        - _first
        - _win
        - _lose
        - RETIRE
    - Simplifying logic to handle intermission music
2023-04-30 21:47:07 +01:00
James R
c54f1a52bd G_LoadDemoInfo: don't read outside of the buffer if the file is too small 2023-04-25 18:49:31 -07:00
Sal
0fb691022b Merge branch 'fix-reset-interpolation' into 'master'
P_Ticker: update view interpolation at the start of a tic

See merge request KartKrew/Kart!1192
2023-04-25 01:50:51 +00:00
toaster
3d0abdd74a Merge branch 'follower-audience' into 'master'
Follower Audience

Closes #498 and #325

See merge request KartKrew/Kart!1185
2023-04-24 21:49:34 +00:00
James R
e8a8064da9 P_Ticker: update view interpolation at the start of a tic
This lets R_ResetViewInterpolation only need to be called
once from game logic.
2023-04-22 20:40:35 -07:00
toaster
2f8b8cf532 Follower lists: Fix typing
Should consistently be signed INT16, not unsigned UINT16
2023-04-21 20:52:13 +01:00
toaster
d7547edf05 P_SetDefaultHeaderFollowers: Add Motobuddy to the list as Eggman deserves his homies 2023-04-20 23:22:35 +01:00
toaster
a74b7995c9 Implement Follower Audience object
- Replaces Chao audience entirely
    - Convenient, because one of the two default follower types used in the audience is Chao
- Can provide one follower, or a list of followers, on the stringarg1 (seperated by spaces/commas) and it'll pick randomly between them
    - If not provided, uses the mapheader follower list
- Can provide one skincolor, or a list of skincolors, on the stringarg2 (seperated by spaces/commas) and it'll pick randomly between them
    - If not provided, uses the follower's default color
    - If the follower's default color is Match/Opposite or the user provides "Random" in stringarg2, pick a random skincolor
- If arg3 is set, floats in the air
    - MTF_OBJECTSPECIAL in binary format
- If arg4 is set, faces the closest player
    - MTF_AMBUSH in binary format
    - Uses some funny mathematical tricks to avoid checking on the same frame as every other audience member at once
2023-04-20 23:15:56 +01:00
toaster
5f15736626 Mapheader Followers system
Replaces Flicky List system from 2.2.
Specify a list of comma-seperated Followers.
Not used by any systems in this commit, but important to store the data for later.
2023-04-20 23:01:13 +01:00
toaster
ea8573a70a ParseTextmapThingParameter: Tidier, more explicit guarantees for null-terminated stringarg handling 2023-04-20 22:57:03 +01:00
Sally Coolatta
77a0e77bf6 Move level load scripting to P_PostLoadLevel
Means these scripts get to have an accurate count of the number of players.
2023-04-18 05:29:58 -04:00
Sally Coolatta
198672c845 Fix vote buffer for G_RandMap being broken 2023-04-11 01:19:30 -04:00
Sally Coolatta
9c4ace6fbc Map anger
- Maps build anger every time a map isn't selected by anyone.
- If a map is ignored for 4 votes in a row, then on the 5th vote it shows up it will be angry enough to vote for itself when everyone else finishes voting.
- Once it gives its funny vote, or it gets played, it will calm down again.
- 13P+ vote icons are implemented; it's just a basic circle though cuz lazy.
- Made the roulette finish even faster.
- Bots can vote again but now behind a debug cvar.
2023-04-10 02:10:06 -04:00
Oni
f615b1a2f0 Merge branch 'acs-trigger-improvement' into 'master'
Improve ACS triggers

See merge request KartKrew/Kart!1131
2023-04-09 03:08:34 +00:00
toaster
94e3803eb0 Merge branch 'blockmap-precip' into 'master'
Render precip through blockmap instead of during BSP

See merge request KartKrew/Kart!1147
2023-04-08 11:21:23 +00:00
Sally Coolatta
010fc344df Add equivalent of "Each Time" triggers for ACS 2023-04-06 18:05:05 +01:00
James R
bced5ecbc5 Render precip through blockmap instead of during BSP
There can be very many precipmobjs in a sector. During BSP
rendering, for each sector reached by BSP (the entire
visible level at least), all the precipmobjs would be
iterated and their distance from the camera calculated, to
determine whether they are within draw distance.

The issue with the old approach is that there really are
too many precipmobjs in each sector. By iterating the
blockmap within a certain range instead, precipmobjs
out of view are not iterated at all, saving some time.

Caveat: drawdist_precip is no longer respected as an
exact value, since it must round to the precision of the
blockmap.

List of potentially scary changes:

- Removes snext/sprev for precipmobj_t
- Removes preciplist for sector_t

- Adds bnext/bprev for precipmobj_t
  - mobj_t and precipmobj_t field offsets are symmetrical

- Modified P_SetPrecipitationThingPosition and P_SetThingPosition
  - The syntax in these functions is kind of wacky
2023-04-06 05:41:06 -07:00
toaster
e732f37258 levelheader_t: relevantskin property
- On level load for GT_TUTORIAL:
    - Forces to requested skin (or Eggman if not specified).
        - Named `relevantskin` and not `tutorialskin` in case it's useful to use the same apparatus later for Adventure.
    - Also sets default skincolor and disables follower.
2023-04-03 00:28:37 +01:00
James R
56694b2740 Merge branch 'udmf-riser' into 'master'
Add foflayer field to UDMF things, spawn offset from a specific FOF in the thing's sector

Closes #417

See merge request KartKrew/Kart!1120
2023-04-02 07:27:51 +00:00
Sal
3a109dbe78 Merge branch 'uncap-numlaps' into 'master'
Remove restrictions on numlaps, merge with gptest

See merge request KartKrew/Kart!1116
2023-04-01 20:12:47 +00:00
SteelT
5020e564e2 Fix empty position music header field pointing to garbage string 2023-03-31 15:41:58 -04:00
Oni
dec66ee9b1 Merge branch 'jam-project' into 'master'
Stereo Mode

See merge request KartKrew/Kart!1097
2023-03-31 01:07:38 +00:00
James R
881f8d8407 UDMF: add foflayer field to things TEXTMAP 2023-03-29 22:23:02 -07:00
SteelT
4e8bc36521 Reload palette even if rewinding a replay or reloading the gamestate 2023-03-29 14:29:00 -04:00
James R
e437656633 Remove restrictions on numlaps, merge with gptest
- numlaps 0 now sets the race to 0 laps.
  - Players will finish upon crossing the finishing line
    immediately after POSITION.

- gptest merged with numlaps.
  - numlaps works in GP.

- Warping to sprint maps with numlaps already set now lets
  numlaps exceed the map default. It was previous capped
  at map default ONLY when loading into the level (so you
  could still exceed it by setting numlaps during
  POSITION). Now it's consistent.

- numlaps can now be set at any time during the race.
2023-03-29 03:53:21 -07:00
Sal
fe34e04abe Merge branch 'encore-fixies' into 'master'
Fix random Encore vote, error if ENCORE/TWEAKMAP lump is invalid, add debugencorevote command

Closes #333

See merge request KartKrew/Kart!1101
2023-03-29 00:32:00 +00:00
Sal
83b5b26a12 Merge branch 'packet-hack' into 'master'
Experimental: Improve level load processing

See merge request KartKrew/Kart!1077
2023-03-28 23:41:33 +00:00
toaster
3e476568ea mapheader_t: AssociatedMusic property
Enables things like the Goin' Down!? segment in Speed Highway to be connected directly to access to that map.
2023-03-28 13:50:05 +01:00
toaster
90d5cb3752 S_PopulateSoundTestSequence: Sound Test sequence system
- Called on game start and file add
- Creates a seperate linked list sequence for map-related order
    - All tracks without associated map in level order
    - All tracks with maps in a cup in cup order
    - All tracks with maps in Lost and Found
2023-03-28 01:41:53 +01:00
James R
6bc785c099 I_Error if ENCORE/TWEAKMAP has an incorrect size
Prevent memory errors if the lump is too large.
2023-03-26 06:55:22 -07:00
Chromatian Keiske
77117bbc9f Merge branch 'fix-retry' into 'master'
Fix retry life/rank farming + fix buffered retry

Closes #475

See merge request KartKrew/Kart!1083
2023-03-25 05:50:06 +00:00
James R
b7d1996a15 Do not let retries be buffered on intermission to instantly retry the next round 2023-03-22 20:54:58 -07:00
James R
f5f85cc3e4 Refactor lives and rank increase to occur at level end transition, not when the player finishes
Fixes exploiting retries after finishing in good standing
to farm lives and rank. These are now applied when you can
no longer retry.

Extra life sound effect still plays as soon as you finish
the race.
2023-03-22 20:49:33 -07:00
Sally Coolatta
ffb65a3583 Experimental: Improve level load processing
- P_PreTicker ("defrosting") is dead. Levels now actually start on tic 0 instead of tic 2.
- Netxcmds are ran before G_Ticker, instead of after.
- All netxcmds are required to be processed before the level will finish loading (up to 5 gametics, to prevent any possible lock-up from malicious clients).
2023-03-22 10:59:29 -04:00
toaster
4c0077e07c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading 2023-03-19 13:01:06 +00:00
James R
60c1f5706a Set tripwire line alpha to FRACUNIT
blame f72379e557
2023-03-18 19:53:18 -07:00
James R
8de2910dcb Merge branch 'file-fixems' into 'master'
File Fixems

See merge request KartKrew/Kart!1055
2023-03-18 11:09:11 +00:00
Sally Coolatta
c7fa8fc2bc Spec 500 uses the same speeds as other scrollers 2023-03-18 02:35:26 -04:00
toaster
3e900d7f57 G_DirtyGameData: Dirty bit only applied in I_Error and signal handlers, nowhere else
- Unfortunately, the way this system previously worked, the unlock was given to you for free if you accidentially opened two copies of the game at once.
- Instead, open the file in r+ mode, shimmy along 5 bytes, and write a `true` to be read later.
- Far more memory safe than rewriting the entire gamedata out on crash.

ALSO:
- crashflags has been split into boolean evercrashed and UINT8 musicflags.
    - We don't need to track if the LAST session was a crash, at least not right now.
    - Opens the floor up to other music like Loser Club happening on the Challenges menu.
2023-03-17 14:42:06 +00:00
toaster
e0c9014547 P_AddWadFile: Do not I_Error if the file is not loaded due to invalid P_PartialAddGetStage 2023-03-15 17:31:34 +00:00
toaster
2e1efaff0c Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into conditions-cascading
# Conflicts:
#	src/k_battle.c
#	src/k_hud_track.cpp
#	src/k_kart.c
#	src/p_inter.c
2023-03-14 21:59:19 +00:00
Sally Coolatta
181501860f Make stringarg application consistent
stringarg[0] and stringarg[1] are now are used as doubles of arg[0] and arg[1]. Specials that use both string args and regular args need to shift their args up to accomedate. This makes the behavior align more closely with the other Doom ports and removes a dumb manual string arg amount thing in callSpecImpl.

I only adjusted the specials that can be called from ACS. I did not mess with level load specials or thing types, since it's not as important. It would be nice to clean them up before release for consistency, though.
2023-03-14 08:03:20 -04:00
toaster
241475155b Rename "Break the Capsules" to "Prison Break"
We had this collective consciousness bigbrain moment in VC together, and it can literally only happen in this branch because unlocks.pk3 is the only main-game asset that needs to change for it
Solves the big problem we had with mixing up Item Capsules and ~~Battle Capsules~~ PRISON EGGS
2023-03-12 20:17:46 +00:00