Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trainer Mode #194

Closed
wants to merge 17 commits into from
Closed

Trainer Mode #194

wants to merge 17 commits into from

Conversation

StarWitch
Copy link
Member

For #193 .

Right now, the following is implemented:

  • Extra Lives (when needed) - you can still die, but only lives that you lose when you go below 0 total lives will count as "extras". If you end up collecting extra lives, those get used first.
  • Extra Spellcards (when needed) - same as above. Stored used first, extras given/tracked.
  • Invulnerability (with Hit Tracking) - lets you turn on God Mode (like iddqd) but will track whenever you get hit by a bullet.
  • No Powerdown When Hit - if you die, you don't lose any of your Power gauge.
  • HUD Stats & Tracking - toggle whether or not you want to see stats in the HUD while playing the game. Some people can find them distracting. There is also a "per stage" and "per play-through" tracking extra lives/extra bombs/misses while invulnerable. That way you can see which stages trip you up the most, and how, and also overall stats for your entire run.

I broke it out into its own module so that additional functionality can be added easily enough down the line. This is a minimum viable implementation right now.

The HUD display isn't the most polished but it can be changed easily. I put it in there just to see what it'd look like. I'm also hoping to eventually implement the ability to log when/where you end up dying, getting hit, or needing an extra bomb (which Spellcard, etc) and track stats on a menu entry somewhere.

I don't think adding a "Slowdown" feature is worth it at the moment, mostly because of how much work is being done on Coroutines and how screwy global timers are. We'd also have to slow down audio clips that play, which as far as I know isn't a thing that's implemented right now. And at the end of the day, either someone's using it to get better at the game (or STGs in general), or they're using it so they can see the whole game at their leisure, and in either case Slowdown doesn't really help them do that.

Copy link
Member

@Akaricchi Akaricchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this yet, so a very superficial review for now.

src/player.c Outdated Show resolved Hide resolved
src/player.c Outdated Show resolved Hide resolved
src/player.c Outdated Show resolved Hide resolved
src/stagedraw.c Outdated Show resolved Hide resolved
src/stagedraw.c Outdated Show resolved Hide resolved
src/trainer.c Outdated Show resolved Hide resolved
src/trainer.c Outdated Show resolved Hide resolved
src/trainer.h Outdated Show resolved Hide resolved
src/global.h Outdated Show resolved Hide resolved
src/trainer.c Outdated Show resolved Hide resolved
Copy link
Member

@Akaricchi Akaricchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A general problem with this design is that it doesn't work with replays, because it uses config settings to directly affect the game state. So if a replay is recorded with trainer settings A and played back with trainer settings B, it will desync eventually. This can be fixed fairly easily by storing the settings in the replay. That can be done by extending the ReplayStageFlags enum in replay.h and manipulating ReplayStage::flags. There are a lot of free bits right now, so no format extension is required.

There is another problem though: the settings can be changed mid-game via the pause menu. To work around that you need to either cache them when the stage starts (so any adjustments will not take effect until the next stage), or do something more complicated and introduce special replay events for when a change is detected (will still need a cache; setting config options from a replay input isn't a good idea). I'm not sure the ability to change them in-game is very valuable, so I'd personally go with the first approach.

Lastly, I don't think it should be possible to use this in the story mode. Or at the very least, it shouldn't be possible to unlock things and achieve a good ending with it. We already have a stage practice mode, perhaps it makes sense to make the trainer an extension of that? The trainer settings could pop up when starting up stage practice, instead of being buried in the options menu. This way they won't be accessible in-game, either. That's just my idea though, let me know what you think.

src/trainer.c Outdated Show resolved Hide resolved
src/player.c Outdated Show resolved Hide resolved
@StarWitch
Copy link
Member Author

Yeah, replays were going to be the next thing I worked on with respect to this. As I said, this isn't a "complete" implementation, it's a basic one to see how it looks and fits in with the game.

I think the idea of having to set which options you want before you start playing is a decent one, as it's also something I thought of, not only for replays but just with the spirit of the mode itself in general.


As for being able to see the good endings and all that... I think Trainer Mode should still allow it. But let me explain first.

As I said in the original Issue ticket, a lot of "hardcore" games are letting players do that these days. Celeste is my big inspiration for this in Taisei: it's an incredibly intense and competitive masocore platformer, where you're expected to die hundreds if not thousands of times in a casual playthrough, but you can still get to the end of the game and unlock everything with their Assist Mode turned on.

It encourages and incentivizes players to beat the game with Assist Mode turned off, though. It adds a badge to your completion screens saying that Assist Mode was used, which goes away when you beat each Chapter/Stage with it turned off. There's also messages throughout the game telling players that it's supposed to be challenging, and that the challenge is part of the genre (masocore). We could do the same thing with "Trainer Mode" enabled on the HUD as a mandatory feature (with only stats being toggleable), as well as having it marked as "Cheats Used" in replays, which is already a thing due to iddqd.

Also, from a personal perspective, doing stage/spell practice is a different feel from playing through the game from start to finish. I play differently due to the flow of the stages and the feeling of momentum in a good run. It's hard to achieve that "zen" state when the start and stops are so sudden.

Anyways, that's just my opinion.

@Akaricchi
Copy link
Member

Alright, I see where you're coming from. I do agree that it should cheat-mark the replays and display the HUD message. We can also track stage & game clears with trainer mode/cheats separately in the progress module, perhaps for a future stats screen. In that case I'd be ok with it.

@Akaricchi
Copy link
Member

This system could be further extended later with options that not just make the game easier, but also harder, sillier, or just different somehow (various challenge modes, deadly pickups, permanent Mystia blindness, UFOs from th12, you name it). I actually thought of something like that before.

@StarWitch
Copy link
Member Author

A challenge mode would be a lot of fun. A few of my friends actually complain that Touhou-themed STGs are "too easy" even on Lunatic so adding additional challenge options would be a cool idea just to show off.

@Akaricchi Akaricchi force-pushed the coroutines branch 2 times, most recently from 8a7f512 to a9604b1 Compare March 5, 2020 19:18
@StarWitch StarWitch changed the base branch from coroutines to master March 6, 2020 18:16
@StarWitch StarWitch force-pushed the trainer_mode branch 2 times, most recently from 5118e3c to ff77ac8 Compare March 6, 2020 18:48
@StarWitch
Copy link
Member Author

I redid a bit of this to make it fit in better with the overall structure of the code. It also now works with replays, displays what replays had Trainer Mode enabled in the replay select menu, as well as displaying it in the character select. You also can't select it from in-game to prevent people flipping the settings during a run and potentially messing with replay stats - either you start a run with it, or you don't. It's not a particularly long game so I don't think this is too big of a deal.

@Akaricchi Akaricchi added this to the v1.4.x milestone Mar 9, 2020
@Akaricchi Akaricchi self-requested a review March 9, 2020 01:44
@Akaricchi Akaricchi self-assigned this Mar 9, 2020
@StarWitch StarWitch changed the title Trainer Mode implementation Trainer Mode Mar 14, 2020
@StarWitch StarWitch force-pushed the trainer_mode branch 2 times, most recently from 58745ea to 39d27a6 Compare March 26, 2020 16:31
@StarWitch
Copy link
Member Author

I rebased this branch to get rid of the merge conflicts. Hopefully everything looks as it should now.

@StarWitch StarWitch mentioned this pull request Apr 26, 2020
@StarWitch
Copy link
Member Author

Closing this PR for now since we're going to have to think about rethinking the way game sessions are handled before v1.4, to make things easier to maintain.

@StarWitch StarWitch closed this Apr 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants