Commit Graph

402 Commits (20ab5ec9f6b11658bde98db6dcad3b55bd010ef6)

Author SHA1 Message Date
MysterD daa05d98a0 Hacky workaround for BBH camera bug
One specific door didn't reset the vanilla camera when rushing through
an open door.

Fixes #48
2020-09-11 23:48:27 -07:00
MysterD c0a31ab06c Prevented bubbled players from triggering level warps
Fixes #41
2020-09-11 22:58:34 -07:00
MysterD 5abe3577ae Added Luigi's face in place of 'Mario Cam'
Fixes #42
2020-09-11 22:36:29 -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 3070d2bfdb Prevent two players from holding the same object
Fixes #40
2020-09-11 22:14:42 -07:00
MysterD c86c7f7280 Fix new level transition synchronization softlock 2020-09-11 18:30:34 -07:00
MysterD a6b3ddcc69 Revert "Revert "More level transition synchronization rewrites""
This reverts commit 0667908b86.
2020-09-11 18:08:24 -07:00
MysterD 0667908b86 Revert "More level transition synchronization rewrites"
New synchronization caused a softlock on new-level-dialogs

This reverts commit 163527401e.
2020-09-11 18:02:21 -07:00
MysterD 163527401e More level transition synchronization rewrites
I believe this fixes #51
2020-09-11 15:32:30 -07:00
MysterD 791423ff98 Properly offset player spawns 2020-09-10 22:18:10 -07:00
MysterD cb6836f818 Fixed infinite hold by King Bobomb softlock
fixes #38
2020-09-10 21:55:03 -07:00
MysterD 71589938df Fix King Bobomb dialog softlock
Fixes #45
2020-09-10 21:26:17 -07:00
MysterD 9cf3932435 Fix coffin crushing softlock
Fixes #47
2020-09-10 20:26:02 -07:00
MysterD 114665f6bb Keep player control of camera for chain-chomp cutscene
Fixes #54
2020-09-10 20:02:16 -07:00
MysterD 3e5b08b487 Fixed small crimes against C 2020-09-10 09:43:32 -07:00
MysterD 1e6c734ced Completely rewrote level transition synchronization code
Should be snappier and less prone to crashes. I tested as many scenarios
as I could think of and it has been rock solid. But time will tell.

Also created a new debug log system, just so I could understand what the
hell was going on with this code.
2020-09-10 00:17:30 -07:00
MysterD e48a9c25ab Added 'no lives remaining' text 2020-09-08 18:21:09 -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 58a3156180 Lowered cannon sensitivity 2020-09-08 15:13:49 -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 d1873328a4 Prevent underwater bubble-popping from teleporting the player to the top 2020-09-08 14:03:12 -07:00
MysterD 1e46ed136a Prevent extra death for bubbled player on area change 2020-09-08 13:53:46 -07:00
MysterD a7434c9513 Completely disable text saves until they're synchronized 2020-09-08 13:34:35 -07:00
MysterD a4288fe150 Allow exiting from course at any time 2020-09-08 09:52:48 -07:00
MysterD 29cb0935fb Fixed glitchy animations on remote when in dialog 2020-09-08 09:33:55 -07:00
MysterD cc550e1de5 Unagi: prevent sending a pointer, hopefully doesn't cause desync 2020-09-08 09:16:44 -07:00
MysterD b9924253bb Racing Penguin: remove airborn check, fix end of race desync 2020-09-08 09:15:43 -07:00
MysterD a804981b2a Fix koopa the quick sound spam and cheat detection 2020-09-08 09:06:25 -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 2f8d119301 Prevent exclamation box from spawning the wrong star on remote 2020-09-07 23:56:29 -07:00
MysterD 2d0871e061 Prevent exclamation box from double spawning stars 2020-09-07 23:10:28 -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 95e9c1dc4c Synchronized room checking better + fixed bookswitches
Determining if the player is in the room was bugged, and bookswitches
caused Luigi to crash. Now things should be a bit more stable in BBH.
Fixes #30
2020-09-07 19:51:39 -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 214697fc8e Fixed infinite loop with King Bobomb 2020-09-07 10:50:32 -07:00
MysterD 3145dfabdc Misc camera fixes
Made analog camera stop rotating or triggering TOTWC when paused
Fix broken vanilla camera on TOWTC w/BETTERCAMERA enabled
Fixes #15
2020-09-07 10:48:54 -07:00
MysterD bc2480da87 Added aggressive null checking to various types of objects 2020-09-07 00:29:18 -07:00
MysterD 36e035984f Pausing the game no longer pauses, just brings up the menu
Fixes #19
2020-09-06 22:27:09 -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 df7904e288 Geo2 removal wip 2020-09-06 13:54:01 -07:00
MysterD 7dafd081e1 Made player attack knockback configurable 2020-09-06 12:18:33 -07:00
MysterD b9750057d5 General network code clean up
Marked globals, rearranged functions, added comments
2020-09-06 11:02:41 -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 91981d679d Hide life counter when lives is -1 2020-09-05 21:17:33 -07:00
MysterD 13d9ae0313 Synchronized 1-up collection
Collecting a 1-up gives a life to both. This can bring back a bubbled
player who had no lives remaining.
2020-09-05 19:55:38 -07:00
MysterD 8c3014b120 Created Luigi's life icon 2020-09-05 19:44: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 478f77e6bf Fix EXTERNAL_DATA for Luigi
Fixes #25
2020-09-05 00:11:15 -07:00
MysterD 670a554b37 Remove any lingering dialog boxes on level transition
Fixes #22
2020-09-04 21:27:06 -07:00
MysterD 00b0b7cd8f Remote reading sign no longer causes sound spam
fixes #20
2020-09-04 21:14:14 -07:00
MysterD 4cb13edf84 Fix animation desync when pressing Z+B
Fixes #18
Found by el pinguino max
2020-09-04 21:08:04 -07:00
MysterD 1bb0c90741 Add docker-build workarounds and container script 2020-09-04 17:03:35 -07:00
MysterD 4a2c218f11 Synchronized save files
Now when a client joins, it will request the entire 512 byte EEPROM from
the server and refuse to continue until the server replies with the
contents. Then the client will override all reads and writes to the
EEPROM/save file. Thus, a client will never overwrite their local save.

Fixes #21
2020-09-04 15:07:32 -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 3c48e1df1a Prevent infinite loop for remote sliding players 2020-09-03 18:32:07 -07:00
MysterD 68ad6bc15c Added host/join in-game GUI
Now people aren't forced to launch with command-line parameters,
instead they can host or join a server by selecting buttons in
the main menu.
2020-09-03 18:30:15 -07:00
MysterD f367ed2167 Prevented softlock and entity duplication when both grab at the same time
As reported by somario360:
After grabbing the small box at the same time, one of two results can happen.
There will be a fake cloned box that will only be visually in the other
player's hands, or one player will be stuck in the punching animation until
the other player lets go of the box, in which the box goes into the stuck
player's hands.

Now escapes from action if the grab fails, preventing a softlock.
And now if both players report having the same object, the client
will drop their copy.

Fixes #14
2020-09-03 18:11:42 -07:00
MysterD 920c0674d9 More tuxie fixes
Tuxie will regain its hitbox if dropped through crouching or any other means
Fixed detection of if any mario is far away
Immediately sends an object packet whenever any object is dropped or thrown

Fixes #9
2020-09-03 08:58:21 -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
MysterD 933ee68477 Null checked heldObj in all mario actions
Bobomb clip no longer segfaults the game
2020-09-01 23:40:53 -07:00
MysterD 72c4379d8a Fix first sound and size of first punch
The code was skipping playing the sound of the first punch, and changing
the size of the first for the first punch. Added hacky stuff to the
player packet code to ensure those events are hit.

Fixes #10 reported by somario360
2020-09-01 23:35:57 -07:00
MysterD f62f80a228 Synchronize sleeping animations
Sleeping animations were desynchronized previously. Now remote goes to
sitting, and to laying down, at the right times. A snoring remote player
will no longer lower your music, and will no longer get stuck snoring
when they wake up.

Fixes #11 reported by somario360
2020-09-01 23:00:12 -07:00
MysterD c88ff19190 Prevent infinite looping of Mario action transitions
There have been several times where the unpredictable behavior of
a remote player where execute_mario_action() would get caught in
an infinite loop. Now we attempt to detect an infinite hang and
escape from it. The sequence of actions will be recorded into an
errorlog.txt file. In debug mode this infinite hang will cause an
assertion to fail, crashing the game. In normal mode the game will
break out of it and hopefully carry on normally after new packets
come in.

I believe this addresses github issue #12 but I can't be sure.
2020-09-01 22:06:36 -07:00
MysterD af117f4647 Various tuxie synchronization fixes 2020-09-01 20:13:46 -07:00
MysterD c54063fadd Fixed messed up animation when remote is talking to an NPC
fixes #8 found by somario360
2020-09-01 18:10:00 -07:00
MysterD 8711829664 Merge branch 'nightly' into coop 2020-09-01 18:08:46 -07:00
MysterD 443fc1a73f Synchronize cannons as soon as they are unlocked 2020-08-31 23:49:51 -07:00
MysterD 3495a9e4a4 Re-added King Bobomb dialog 2020-08-31 21:38:08 -07:00
MysterD efa1600ad0 Truly deal with the NPC dialog softlock problem
Reported by somario360:
After I (Luigi) gave the baby penguin to the mother, the start spawned,
but I was stuck in the looking up animation.
My friend (Mario) talked to Bowser after defeating him, Bowser turned into
a key, but he was stuck in the looking up animation after (I was able to
grab the key though, but Bowser was slightly visible) (Also don't mind 0
stars, he loves doing the lobby BLJ)

The issue is the state machine moved on without removing the reading
dialog action. There was no straight forward way to deal with this.
Custom functions were written for each call to dialog to ensure that we
should stay reading the dialog.
2020-08-31 21:10:34 -07:00
MysterD 5d7499bd2a Fixed crash when changing areas within a level
Bug reported by somario360:
After I (Luigi) exited the slide in CCM, an error message appeared and ignoring would make it pop up again.

This was due to the sync ID reservation system not being flushed and
reset on area change.
2020-08-30 23:13:05 -07:00
MysterD 7b073aedb8 Fix NPC softlock (cannon and hoot)
Bug reported by somario360:
When trying to open the cannon in a level (so far tested in BOB & WF) the cannon dialogue will repeat infinitely. Sometimes the cannon will open, but the game will crash after.

The code I had written previously to prevent softlocks ended up causing
them due to a incorrect check of activeFlags.
2020-08-30 23:12:28 -07:00
fgsfds 6d1f2afd8b Merge pull request #350 from pouar/fix-snufit
Bugfix for NODRAWDISTANCE
2020-08-30 15:34:24 +03:00
MysterD 483694d6b3 Synchronized Bowser 1 2020-08-29 12:59:07 -07:00
MysterD 10bdd1e1fe Synchronized bowser bombs 2020-08-29 12:58:54 -07:00
MysterD 81d23b3cc9 Made castle floor trap multiple-player-aware 2020-08-29 12:58:04 -07:00
MysterD 13d4a0bfe8 Fixed stomache slide hang, made grabs only happen on local 2020-08-29 12:57:20 -07:00
MysterD cb5dcaa4f4 Synchronized sliding platform 2 2020-08-28 20:26:17 -07:00
MysterD 398f5e8345 Synchronized ferris wheel 2020-08-28 20:26:04 -07:00
MysterD ec89f3fccc Synchronized amps 2020-08-28 20:25:46 -07:00
MysterD ab9d7db29f Synchronized square platforms as groups of two 2020-08-28 20:25:34 -07:00
fgsfds 655427f10f add --poolsize arg for modifying main pool size 2020-08-29 02:13:30 +03:00
MysterD a778bf497d Resynchronized checkerboard platforms 2020-08-27 21:39:13 -07:00
MysterD d2a2a80d56 Synchronized Big Boo's Haunt + major changes
Synchronized currentRoom per-player
Synchronized haunted bookshelf, and the bookshelf manager
Synchronized haunted chairs
Synchronized mad piano
Synchronized BBH's tilting trap, and made the physics multiple-player-aware
Synchronized scuttlebugs
Synchronized every variety of Boo
Synchronized elevators
Synchronized flamethrowers
Synchronized the various types of enemy books
Synchronized the book switches
Synchronized jumping box
Made coffins multiple-player-aware

Fixed everything that used gMarioState as an array instead of gMarioStates
Prevented some NPC-dialog softlocks
Prevented the remote player from messing up the local's camera settings
Possibly fixed the relatively rare chain chomp softlock
Possibly fixed the relatively rare chain hoot softlock
Fixed the first-person-camera softlock
Forced camera code to use the correct mario struct
2020-08-26 23:29:40 -07:00
MysterD 13b216ea5d Synchronized Boo 2020-08-24 21:38:49 -07:00
MysterD 8c650a5b7d Created system to reserve sections of SyncIDs per client
This allows clients to spawn a new sync object after the level loads and synchronize it.
Changed how un-initialized sync objects are detected
Koopa shells are the first thing to use this new system

Removed network_object_settings() command, instead explicitly setting the sync object parameters
2020-08-24 18:33:53 -07:00
MysterD 4b12d0e513 Fixed exclamation box synchronization bug 2020-08-18 18:47:21 -07:00
MysterD 53576aa51e Synchronized unagi 2020-08-18 18:47:06 -07:00
MysterD 57a4e746cf Synchronized underwater koopa shell 2020-08-18 18:46:54 -07:00
MysterD f08e6f0806 Made floating platform multiple-player aware 2020-08-18 18:46:13 -07:00
MysterD b8bdac2666 Made falling pillar multiple-player aware 2020-08-18 18:45:50 -07:00
MysterD 5b7e1c28d8 Synchronized clam 2020-08-18 18:45:34 -07:00
MysterD 79a2d95f00 Synchronized jrb ship and box 2020-08-18 18:45:19 -07:00
MysterD c589f2a620 Synchronized treasure chests 2020-08-18 18:43:42 -07:00
fgsfds 8b23c544d1 Merge pull request #399 from ineedhelpbad/nightly
BUGFIX: Camera bugs when using flying cap with BETTERCAMERA=1 #370
2020-08-15 15:59:59 +03:00
MysterD 88bcd2a143 Sound fixes for remote player 2020-08-13 18:53:01 -07:00