Commit graph

78 commits

Author SHA1 Message Date
MysterD
59eef70183 Prevent player-to-player interactions from messing up other ones 2021-06-26 21:51:00 -07:00
MysterD
0b3a97d405 Improvements to late-join synchronization
Removed (slightly) old coin and static ent removal system
Resynchronized respawners
Added packet for macro deletions
    better than previous system since the entities don't need a sync id and we can synchronize deletion station across areas
    allows the synchronization of odd entities like lines of coins
Added packet for spawn info deletions
Split packet_location_request into multiple files
2021-06-09 22:35:34 -07:00
MysterD
6e7c542068 Synchronized race timers 2021-06-08 22:05:12 -07:00
MysterD
5db1a9e827 Synchronize late-join coin collection 2021-06-08 02:26:35 -07:00
MysterD
bbdc942501 Ripped out level synchronization/warp code
Began writing new system that synchronizes course/act/level/area per
player and 'ownership' of that location.
2021-06-07 12:19:59 -07:00
MysterD
1564ac7c0f Translated Luigi sounds through new Character system 2020-10-16 23:33:41 -07:00
anzz1
d1739648e1
Added Luigi sounds (#77)
* added a new audio bank 10 for luigi sounds
* made some audio memory buffers larger to fix sound cuts
* added option to enable/disable luigi sounds in the sound options menu
* added Andrat's "90's Classic Luigi Voice Pack" as default luigi sounds

Co-authored-by: anzz1 <>
2020-10-16 11:54:59 -07:00
MysterD
2b0f892251 Misc adjustments to recent PRs
Switched from manual checking of Luigi to using new Character structs
Synchronized cap spawning for mario_blow_off_cap()
Added declarations for network_send_death() and network_receive_death()
2020-10-16 03:59:24 -07:00
anzz1
bc7ec31c02
Enemy hat fixes (#83)
* Ukiki now steals Mario/Luigi hat correctly
* Klepto now steals Mario/Luigi hat correctly
* Mr. Blizzard now knocks off Mario/Luigi hat correctly
* Fwoosh now knocks off Mario/Luigi hat correctly

Co-authored-by: anzz1 <>
2020-10-16 03:03:25 -07:00
MysterD
8750198750 Prevented vanish cap players from interacting with other players 2020-10-14 20:58:03 -07:00
MysterD
cfd559bc74 Sync riddenObj, prevent remote interaction with shell 2020-10-14 20:50:55 -07:00
MysterD
8fc8ca6ca7 Prevent players from interacting with a shell that someone else is riding 2020-10-14 20:42:04 -07:00
MysterD
cb902c519d Properly synchronize koopa shells spawned from boxes 2020-10-14 20:34:38 -07:00
MysterD
c8a45235ca Removed two-player hacks from cannon and object packets
Increased error checking of get_behavior_from_id
Made failure logging for packet_object a lot better
Changed debug logging to show global index instead of "Server/Client"
Changed debug keyboard binds to support more keyboard types
Made SyncObject's rxEventId de-duplication per-player instead of one-player
Removed sizeof(enum) from packet_read/packet_write
2020-10-13 21:44:27 -07:00
MysterD
41295fb814 Synchronized Ukiki 2020-10-08 20:56:49 -07:00
MysterD
ea1553c18d Koopa shell can only be ridden by one person, and doesn't get accidentally removed 2020-10-06 23:38:56 -07:00
MysterD
53f7a36819 Prevent multiple star/key unlock animations on the same door 2020-10-04 23:23:17 -07:00
MysterD
e9761cd3e6 Prevent rare bug where a remote player will grab a non-grabbable object momentarily 2020-10-04 23:06:52 -07:00
MysterD
104e824a13 Make sure 70 star door is always openable 2020-10-04 22:16:20 -07:00
MysterD
d229a69b83 Made picking up / dropping objects immediately sync those objects 2020-10-04 13:54:12 -07:00
MysterD
931ee9ca13 Prevented bubbled players from interacting with objects 2020-10-02 23:37:15 -07:00
MysterD
b673457a48 Synchronized mips/toad star spawning 2020-10-02 21:05:02 -07:00
MysterD
e7ffd52d45 Made COTMC, TOTWC, VCUTM, WMOTR use the normal death barrier warp 2020-10-01 21:34:46 -07:00
MysterD
f5df807a0c Additional synchronization fixes for end cutscene. 2020-09-26 12:07:43 -07:00
MysterD
4ab4a109da Prevented lava from taking extra lives from bubbled players 2020-09-24 18:32:18 -07:00
MysterD
95b9167287 Synchronized Klepto 2020-09-23 23:18:45 -07:00
MysterD
4217306a44 Ignore jump and double jump when looking at attacks 2020-09-23 20:15:29 -07:00
MysterD
e67665ca3f Made player-to-player attacks more consistent
The direction that someone is pushed is based purely on the direction
the attacker is facing.
2020-09-23 20:07:07 -07:00
MysterD
5f3895463f Prevent remote player damage from shaking local screen 2020-09-21 18:22:58 -07:00
MysterD
54cd42608d Allow players to enter the 70 star door early 2020-09-20 17:54:25 -07:00
MysterD
bbdc3180cd Made celebration star appear above correct player
Celebration sparkles appear around all players
2020-09-19 17:28:11 -07:00
MysterD
2c46eec6ba Prevented rare unlocking door crash 2020-09-19 16:19:47 -07:00
MysterD
6d438ba760 Fix first-person camera lock bug
Getting kicked in vanilla-cam's first person messed up the camera, this
fixes it.
Fixes #55
2020-09-11 22:32:32 -07:00
MysterD
718974c111 Fix PSS's secret star collection
Fixes #56
2020-09-11 22:25:49 -07:00
MysterD
cf732c7beb Eject a player if more than one is in the cannon
Two players in the same cannon was causing softlocks and general
insanity. Now this should be fixed. Also prevented players from being
able to push or attack a player inside of a cannon.
2020-09-08 16:12:11 -07:00
MysterD
ef6ec31075 Prevent ground pound from attacking until they're moving downward 2020-09-08 15:01:31 -07:00
MysterD
a2fe4f80a7 Lower knockback for anything stronger than a kick 2020-09-08 14:57:50 -07:00
MysterD
26726121a5 Players sliding in the same direction will no longer attack each other
We check to see what the difference in velocities is, if it's small then
no attack is made. Otherwise, only the player going faster will attack.
2020-09-08 14:43:07 -07:00
MysterD
3b946eb5e1 Added stay-in-level-after-star server-side setting.
Configurable in the server's config file under:
coop_stay_in_level_after_star

Defaults to off

Based on GateGuy's patch
2020-09-08 00:04:06 -07:00
MysterD
88b935e9dd Force marioObj player indices to be well behaved
Fixes a crash when spawning the secret star in The Princess's Secret
Slide.

Fixes #32
2020-09-07 20:30:20 -07:00
MysterD
ef48ec249a Allow other player to pass through door when it's being opened
Also disable the 'walking through door' cutscene when newcam is on
2020-09-07 16:35:42 -07:00
MysterD
bc2480da87 Added aggressive null checking to various types of objects 2020-09-07 00:29:18 -07:00
MysterD
e0903003f4 Rewrote how players are initialized, stored, and displayed
Since the second-player code was the first code I wrote, it was implemented
poorly. At that point, I didn't know the code base at all and the way it was
written would prevent anyone from ever adding to those parts.

The rewrite allows me to use the default geo.inc.c file for Mario, and removes
all of the geo2.inc.c files. I no longer do a bunch of bit shifting to figure
out which player is being drawn in the rendering code.

I'm also now able to remove tons of duplicate code that exists just for the
remote player. The main player code is generic enough to support both indices.
A side-effect of the rewrite is I was able to remove many assumptions in the
code where two-players is assumed, but many other parts of the code still
assume two players.

This is a fairly major change that, if all goes well, will be completely
unnoticed by the player. However, I do expect new bugs to pop up in strange
places. Time will tell.
2020-09-06 18:52:52 -07:00
MysterD
7dafd081e1 Made player attack knockback configurable 2020-09-06 12:18:33 -07:00
MysterD
bed036bcfb Added coop settings to saved config file
Saves and loads last join IP/port attempt
Made host's port configurable in config file
Made host's save slot configurable in config file
Made host's player interaction setting configurable in config file

Indicated when the client was trying to connect on the join menu.
Fixed join menu display error where the port would disappear
2020-09-06 03:32:34 -07:00
MysterD
51940d6a82 Player interaction enhancements
Made water punch do an attack
Increased knockback significantly
Different types of attacks will have different knockback severity and damage (Stomp > kick > the rest)
Fixed rapid attack spam
Adjust radius for bouncing on players and popping bubbles

Made player interactions a synchronized server flag:
  None - Players are not solid
  Solid (Default) - Player can run into each other and stun each other
  PVP - Same as solid except friendly fire is on
Note: Not currently configurable due to a lack of a UI.
2020-09-06 10:05:58 -07:00
MysterD
906ea3345e Players turn into bubbles when they die
Player life counters are separate.
When one player dies they lose a life and are turned into a bubble.
If the other player pops it, they are alive again.
If all players are bubbled, they get kicked out of the level.
If the bubbled player ran out of lives, they can not come back to life
until the level is over.
Whenever a level change happens, everyone's life count is set to a
minimum of two.
No game overs.

Took heavy inspiration from Kaze Emanuar
2020-09-05 18:10:55 -07:00
MysterD
d5005c9f37 Served time for crimes against C
Due to my compile & launch scripts, I was silently ignoring warnings
this whole time. I've fixed my process, and gone back to fixed all of
the warnings I could (even outside of my code).
2020-09-04 01:58:54 -07:00
MysterD
ab9e7c7bca Added player-to-player interactions
Players are now solid to each other and can push each other
Players can now attack each other (but they do not deal damage)
Players can bounce on top of each other, and they get squished
temporarily
Players are given slightly offset positions when they transition between
areas and levels, so they're no longer on top of one another.
2020-09-02 23:50:27 -07:00
MysterD
b9e84ad3b9 Shell music only starts and stops for local player 2020-09-01 23:41:56 -07:00