Stealing Control from Players - Legacy Devlog #22

Поделиться
HTML-код
  • Опубликовано: 10 июн 2024
  • In this week's indie game devlog™, I'd like to show you how I handle input in Astortion. More specifically - how I allow different external systems to influence and override the player's input.
    Support me on Patreon:
    / aarthificial
    0:00 Introduction
    0:30 InputProvider
    1:33 Chain-of-responsibility
    2:35 Summary
    Thanks for watching!
    made with Adobe Illustrator and After Effects

Комментарии • 172

  • @nichegames9590
    @nichegames9590 2 года назад +152

    First time seeing this. I was surprised by how human like this is seeing as your pixel density is so low. It's impressive.

    • @aarthificial
      @aarthificial  2 года назад +28

      Thanks! That's why I love pixel art

  • @hashimoto128
    @hashimoto128 2 года назад +206

    Hey, I don't know if you realized but once you've decoupled Inputs from Actions, this Input may come from ANYWHERE: a controller, an AI brain (as you said), but it may also come from the internet (leading to multiplayer/remote playing) or a file (leading to replays/TAS speedruns). Awesome work 'til now, by the way. :)

    • @aarthificial
      @aarthificial  2 года назад +48

      Thanks!

    • @thepro4805
      @thepro4805 Год назад +9

      @@aarthificial ohh i would LOVE to TAS it it sounds amazing

  • @capsey_
    @capsey_ 2 года назад +74

    I love how these videos are short and yet very dense with information and doesn't play with viewer like with a child that just opened Unity for the first time

  • @joshbishop
    @joshbishop 2 года назад +223

    It's always a good day when Aarthificial posts

    • @capsey_
      @capsey_ 2 года назад

      Great indeed

  • @Dastmema
    @Dastmema 2 года назад +26

    Everytime I saw this guy I'm wondering "why their animations are so clever?"
    And stay watching because they're entertaining

  • @RoffeDH
    @RoffeDH 2 года назад +49

    This video should have ended: "If you want to learn how to program something like this, become an 'apprentice' tier supporter on my Patreon before," bla bla date, "and watch it."
    That would have sold me in a heartbeat!

  • @AngusJMcGregor
    @AngusJMcGregor 2 года назад +93

    always feels so interesting seeing how you go about these kind of problems, I love seeing how different kinds of systems are set up in relation to each other

  • @codinginflow
    @codinginflow 2 года назад +40

    you've just earned a new fan man

  • @coyo_t
    @coyo_t 2 года назад +27

    Also don't forget that this kind of system can be used for demo recording/playback, DOOM style (along with a few other objects to save and load state variables like random seeds).

  • @goldenspirit3369
    @goldenspirit3369 2 года назад

    dude you are the best problem solver there is. u see a problem and you fix it. the most detailed problem solver there is! love your videos, you sir have earned a sub!

  • @0bmerlin
    @0bmerlin 2 года назад +6

    Coming from a functional programming background, this is really interesting. I'm not really used to OOP and game dev yet, so this shows me how to do things properly.
    Love the visualizations, keep it up!

  • @ikizlerlebirgun7119
    @ikizlerlebirgun7119 2 года назад +4

    Our little channel has grown up and is now able to keep this channel with the money coming from his fans. Keep working, we will always support you!

    • @aarthificial
      @aarthificial  2 года назад +2

      They grow up so fast :')
      Thanks so much!

    • @ikizlerlebirgun7119
      @ikizlerlebirgun7119 2 года назад +1

      @@aarthificial Thanks for reply. It is an honor for me. I am looking forward to see more astortion devlogs and other useful videos. :D

  • @MadamLava094
    @MadamLava094 2 года назад +1

    I love it when devs actually talk about decoupled object design like this. I myself am looking to get familiar because my own project would benefit heavily from being based on this approach

  • @tommyford1301
    @tommyford1301 2 года назад

    Always happy when I see your new vids in my recommended :)

  • @drac.96
    @drac.96 2 года назад

    Wow, the explanation of the strategy pattern using those beautiful illustrations is so awesome!
    Great job.

  • @greatot7429
    @greatot7429 2 года назад

    Recently just found this channel, I already watched all the devlogs.
    What I can say is I'm astonished!!!🔥. This is a lot of motivation to keep working on my own game too.

  • @ptinosq
    @ptinosq 2 года назад

    The quality of these videos is amazing. Such a pleasure to see you come up in my notifications!

  • @HaxorBird
    @HaxorBird 2 года назад

    Thinking like this while doing game development is my favorite. And you provide the perfect dose for new ideas. Keep it up!

  • @ilcanalechenonce
    @ilcanalechenonce 2 года назад

    It is so rare to find content about more abstract design concepts..
    and delivered so well! Great job!

  • @igrb
    @igrb 2 года назад

    loving the animations and the explanations, they get better every video

  • @noodle-eater
    @noodle-eater 2 года назад

    Awesome dude, I love ur code architecture. I love how you separate your code into different modules and used it

  • @DArK-xj8lr
    @DArK-xj8lr 2 года назад

    U know it's gonna be a good time on RUclips, when Aarthificial uploads

  • @dixalex02
    @dixalex02 2 года назад

    I know your an indie game dev but your videos are also very clean. Thanks.

  • @SuperGamersgames
    @SuperGamersgames 2 года назад +11

    Dang it! You’re making me want to make a devlog series now.

    • @aegeanviper73
      @aegeanviper73 2 года назад +2

      You should go for it!! Devlogs are a great way to track your own progress as well as teach others solutions you find for problems and others (including myself) would love to see it

  • @kimi59
    @kimi59 2 года назад

    Your color scheme and general design in your videos look professional and are really pleasant to look at. Nice.

  • @akifdur702
    @akifdur702 2 года назад

    I know this is an old video but I wanted to say thank you this really helped me out.

  • @aliceofclover
    @aliceofclover 2 года назад

    i absolutely love all of the work you put into making these videos, as well as your game, but one thing i haven't seen other people point out is the reference to the mushroom post on tumblr when Alice sits on the bench. massive props to that

  • @doommustard8818
    @doommustard8818 2 года назад +2

    Encapsulation is pretty neat!

  • @bilel114
    @bilel114 2 года назад

    A great and elegant solution as always.
    Thank you for sharing.

  • @ethanlynch3639
    @ethanlynch3639 2 года назад +3

    what a fantastic reference there

  • @r8teful
    @r8teful 2 года назад

    Just got recommended this video on my youtube. Just wanted to say that the quality is superb and I'm gonna be binge watching the rest of your videos. Cheers and keep it up!

  • @rhethoricalQ
    @rhethoricalQ 2 года назад

    Wow Aarthificial, your videos are top notch as always! Thank you for posting :D

  • @HAWXLEADER
    @HAWXLEADER 2 года назад +1

    I made something similar in my game just because it felt right.
    I had a SetInput command for my player controller that it'd forward to the player movement or the mounted vehicle accordingly.
    This input was used by both the player input provider and the ai input provider.

  • @rjendoubi
    @rjendoubi 2 года назад +1

    Always enjoy your videos, but this was particularly great - such a beautiful and *fun* demonstration of the patterns in question.
    I wouldn't want to distract you from making vids on exactly what you're working on and what is interesting for *you* currently... But, I'm sure a lot of people would enjoy and benefit from seeing more examples connecting a high-level and easily understandable game dev situation to a common software dev pattern which can be kind of abstract. It really makes the benefits of the pattern easier to grasp :)

  • @wintercoldfront
    @wintercoldfront 2 года назад

    I look forward to these videos.
    I always click on them whenever I see one posted.
    Thank you for your interesting problems and clear explanations.

  • @spkbreadroll
    @spkbreadroll 2 года назад

    the technical display here is amazing

  • @rampaging_teddy
    @rampaging_teddy 2 года назад +3

    You're insane! Keep up the good stuff and I'm looking forward to the game!

  • @krycerkris
    @krycerkris 2 года назад

    Great video! Clean visuals, concise and clear information!

  • @mufelo
    @mufelo 2 года назад

    As a C# dilletante, I had not realised you can define events in interfaces. This changes... EVERYTHING. Also thanks for the video, these are among my favourite GameDev vids on RUclips.

    • @aarthificial
      @aarthificial  2 года назад

      Thanks so much!
      You might have already discovered that but you can also define properties and indexers in interfaces

  • @krawieck
    @krawieck 2 года назад

    I love your videos, they are so aesthetically pleasing!

  • @alexanderosinubi5154
    @alexanderosinubi5154 2 года назад +2

    Another video, finally!

  • @n8dev
    @n8dev 2 года назад +2

    really interesting stuff!

  • @Skeffles
    @Skeffles 2 года назад

    Really well explained. This system looks fantastic for your game.

  • @ArkaniproMA
    @ArkaniproMA 2 года назад +1

    With every video he teaches us something new, while widening the scope of his project xD.
    Even though he might just make it easier for the many things he wants to have in his game. I am definitely curios for what is to come 🤗

  • @TotalPwnage777
    @TotalPwnage777 2 года назад

    Super informative video. Thanks! 😁

  • @JackAllpikeMusic
    @JackAllpikeMusic 2 года назад

    This was a fantastic video. I look forward to more from you!

  • @galbenshire3463
    @galbenshire3463 2 года назад +9

    This is something I feel isn't discuss often when it comes to game development. You can find many tutorials on player input, even on how to decouple it from your game objects, but they rarely go over when you might want to temporarily take control from the player, for things like cutscenes. So this is a great video to find.
    If you don't mind, I do have a question:
    You recommended the InputProvider to be a Scriptable Object. But would the Input Middlewares also be Scriptable Objects? Or would they be some form of global instance?

    • @aarthificial
      @aarthificial  2 года назад +5

      It depends on how you want to set up your middlewares. If you want to register them dynamically, from code, then you can just make an interface for your middleware and register whatever object you want.
      But if you want to have a serialized list of middleware then they need to be scriptable objects.
      In Astortion, for example, middlewares are monobehaviours registered during OnEnable.
      It makes sense in my context because most systems are not global and are represented by components in the scene.
      It also makes it easy to integrate with the new input system. You can create an object with the PlayerInput component and another component that will serve as the middleware.

    • @feliscape
      @feliscape Год назад

      ​@@aarthificial How exactly are the middlewares registered? In my implementation I have them registered in the scriptable object, but that means it wouldn't work with AI, because then I would need an extra ScriptableObject for every enemy instance (or at least I think)

  • @Duckamoly
    @Duckamoly 2 года назад

    Nice as always, your videos always are entertaining!

  • @monsieuralexandergulbu3678
    @monsieuralexandergulbu3678 2 года назад

    Really cool vids, lovin'it! Very nice visuals

  • @fibulawars
    @fibulawars 2 года назад

    very cool animations with the explanation

  • @kingjawdev8102
    @kingjawdev8102 2 года назад

    Really interesting stuff you talk about!

  • @nervymountain3109
    @nervymountain3109 2 года назад

    That's a great way to do it, and you explained it really well! Love your content man!

  • @semmu93
    @semmu93 2 года назад

    your presentation skills are mind blowing

  • @djdavidj
    @djdavidj 2 года назад

    Thank you for posting.

  • @TheCrazyLunatic8
    @TheCrazyLunatic8 2 года назад +1

    Your voice is pure ASMR.

  • @ULTRADARKSETH
    @ULTRADARKSETH 2 года назад

    After Starting and stopping maybe 80+ prototypes. You my friend has inspired me to start again. I do like the way from the first video you set out the plan. And sticking to it.

  • @icarusgaming6269
    @icarusgaming6269 2 года назад +1

    The term I prefer to use is "borrowing" because you should be prepared to give it back at a moment's notice. This is an important part of the design philosophy. Stealing control is called a cutscene. Conflating the two is a good way to make it hard to tell where the gameplay ends and begins, leading to unintentional pacing breaks where the player stands motionless when they're expected to play or try to play when a cutscene is active. COD campaigns have begins infamous for this

    • @aarthificial
      @aarthificial  2 года назад +1

      In Assassin's Creed, when you enter a walking crowd and let go of your joystick, the character will start walking alongside them.
      Enabling "auto-jump" in Minecraft will jump for you when walking into a block.
      Entering a safe zone in most third-person games will prevent you from drawing your weapon and/or sprinting.
      Aiming at an ally in some FPSs won't let you shoot.
      None of these are cutscenes

    • @icarusgaming6269
      @icarusgaming6269 2 года назад

      @@aarthificial Not at all, those are great examples of borrowing because you can either cancel out of them or still control a different part of the game like with auto jump. One of my favorites lately has been Miles Morales' soft camera work that's capable of both automating and following your inputs. What I was trying to differentiate is games that try to give the illusion of borrowing but actually just prevent you from playing entirely. I feel like it's easy to take it too far, so I think using two different terms is a good way to keep the concept in check

    • @aarthificial
      @aarthificial  2 года назад +2

      That's an arbitrary choice of words really. Cutscenes at some point also give back control to the player.
      I could argue, for example, that calling this "borrowing" implies that you first ask if you can borrow it. Whereas "stealing" can still affect only one aspect of control, like jumping.
      Still, I get that you're referring to a concept of interruptibility of a certain action/interaction. It's just that I'm not sure if using a different verb is explicit enough to convey that. But even if it is, the concept presented in this video can be used for both stealing and borrowing

  • @DolphinDev
    @DolphinDev 2 года назад

    An interesting concept! Keep it up dude!

  • @GRex0o0
    @GRex0o0 2 года назад +1

    Everything about your videos just leaves me in awe every time!
    I would like to know about your learning journey, how did you become the artist/developer/storyteller that you are?

    • @aarthificial
      @aarthificial  2 года назад +3

      Thanks so much!
      It would take too long to answer that but I am planning a video on this topic bc people often ask

  • @S41L0R
    @S41L0R 2 года назад

    Perfect video. I know this because it's aarthificial. I'm not even lying, the other day while I was walking I was thinking about how good of a youtuber & developer you are

  • @ikizlerlebirgun7119
    @ikizlerlebirgun7119 2 года назад

    Absolutely exciting

  • @exotium2765
    @exotium2765 2 года назад +1

    I love your videos, keep it up :)

  • @marcbentoy
    @marcbentoy 2 года назад

    Damn! Those graphics, man. Here's a sub!

  • @Soundy777
    @Soundy777 2 года назад

    Adore your work! Keep it up

  • @prodjectz1866
    @prodjectz1866 2 года назад +1

    feels good to be early

  • @PolycatGames
    @PolycatGames 2 года назад

    It looks very cool!

  • @didierdidier-mm3hh
    @didierdidier-mm3hh Год назад

    at this point i just want to play the game. can't wait !

  • @nightwintertooth9502
    @nightwintertooth9502 2 года назад

    This is very interesting. Ive done an assmembly line system siniliar to this for a custom network replication library that works in Unreal. The fundamental concept is the same. My contractor has no idea how it works. But our tester thanked me for making things so modularly. We needed custom replication with actor state to only upload some things to playfab tiledata thats been serialized, not entire actors. Playfab checks these with cloud script against the previous five frames of activity, it sends the object straight through our flask api running in a docker container alongside for physics based gpu accelerated bits. Theres literally no way to hack this system because the cloud provides physics correction every five frames to a modified client. But this also required quite an expensive nvidia grid conrainer to allow our playfab instance to run gpu sinulations and check them against client data. I really like this system. Having the grid conrainer was a very good investment. No matter how much a hacker tries, detatching the systems and coupling them together over the cloud ensured low network bandwidth over an active socket and zero chance that modified client data made it to the player controller thanks to the decoupling and the ability to interface out the physics portion of the equation to a network api call

  • @syneydesign
    @syneydesign 2 года назад

    You are way too underrated

  • @1ogic948
    @1ogic948 2 года назад

    Congrats on getting your channel to be self-sustaining!

  • @vatyunga
    @vatyunga 2 года назад

    I like how you care about passing dependencies and not just create singletones everywhere. I would recommend Zenject to resolve dependencies without needing scriptable objects or singletones. Zenject also supports contexts, like Project context, Scene context and even Game object context.

  • @tiagoalmeida2194
    @tiagoalmeida2194 2 года назад

    Is there a code example or a video where this is a bit more detailed? This is a great video for people who are familiarized with the concept of interfaces, event providers and subscribers. Plus, the chain of responsibility took me completed by surprise xD

  • @algs5483
    @algs5483 2 года назад

    As always, couldn't really understand anything but I like your voice.

  • @eboatwright_
    @eboatwright_ 2 года назад

    Amazing! :D

  • @JoeldaSilvaVicenteFilho
    @JoeldaSilvaVicenteFilho 2 года назад +1

    man, I would love to see an implementation of this, I'm trying to incorporate this I'm my game but I think that my existing code is not that compatible, so seeing an implementation would help a ton in figuring out how to approach this

  • @early2000skid
    @early2000skid 2 года назад

    this is so cool, how do you make your graphs and figures btw?

  • @davidegelhofer2257
    @davidegelhofer2257 2 года назад

    Great video! One question though: You said it is advisable to implement input providers as scriptable objects, so how do you manage the necessary references to the input/dialogue/navigation system etc? A class receiving playinput would need to derive from a monobehaviour and from my rather limited understanding of scriptable objects, they cannot hold references to monobehaviours.

  • @Jumpycnat
    @Jumpycnat 2 года назад

    Your visuals are outstanding! It really helps to illustrate your point in a very clear fashion. May I ask how you create them? I would love to try out something similar for my own videos, haha

    • @aarthificial
      @aarthificial  2 года назад +1

      Thanks!
      I design them using Illustrator and then animate them in After Effects

  • @natemyers1791
    @natemyers1791 2 года назад +2

    What do you use to create these graphics (representations of the code) for the video, and what special things do you do to make everything look so excellent?
    Superb video, by the way. Long time subscriber; love the look of your game.

    • @aarthificial
      @aarthificial  2 года назад

      Thanks so much!
      I use Illustrator and After Effects and loosely follow material design principles

    • @natemyers1791
      @natemyers1791 2 года назад

      @@aarthificial Ah, thank you! Never thought to use material design in a video. I’ll have to try it out myself. Cheers!

  • @Willendes
    @Willendes 2 года назад

    Fascinates me your ways to improve the unity's system. Do you have any plans to make tutorials in the future? I would love see it. Btw, greetings from Brazil

    • @aarthificial
      @aarthificial  2 года назад +1

      Thanks so much!
      It's difficult for me to make a tutorial bc I'm not a particularly articulate person. That's why I'm currently sticking with shorter videos with a script. But maybe in the future, once my skills improve a bit

  • @arthurgentz2
    @arthurgentz2 2 года назад

    This is some really interesting stuff. Though, i still can't wrap my head around each "middleware" has its own jump event, and how 'canJump' is written therefrom. Does each of these middleware have a jump event handler that sets 'canJump'?

  • @manuelreinfurt3497
    @manuelreinfurt3497 2 года назад

    I really like the way you explain and visualize stuff including the animations. Do you have a video or could make one where you explain how you create the videos?

    • @aarthificial
      @aarthificial  2 года назад +1

      Thanks! I've been willing to make one in a while

  • @fleity
    @fleity 2 года назад

    Can you elaborate a bit more on how and why you set up the provider as a scriptable object instead of as a regular instanced class?

  • @urdailycupoftea1475
    @urdailycupoftea1475 2 года назад

    What do you use to animate? It looks really good! Keep up the good work man (even if it takes forever)

    • @aarthificial
      @aarthificial  2 года назад

      Thanks!
      Nowadays I use Aseprite but - when it comes to pixel art - software doesn't really matter. In the past, I used to work with both Krita and Photoshop and the experience was the same

    • @urdailycupoftea1475
      @urdailycupoftea1475 2 года назад

      @@aarthificial I meant animate the videos! But thanks

    • @aarthificial
      @aarthificial  2 года назад

      Oh, in that case it's After Effects and Illustrator

  • @snesmocha
    @snesmocha 2 года назад

    i need to figure this out, i have been screaming for 30 minutes

  • @NoVIcE_Source
    @NoVIcE_Source Год назад

    woah

  • @vaflov
    @vaflov 2 года назад

    This is awesome! A concern I have is that the middleware approach is very reliant on the order of middlewares. Isn't this problematic if for example for a specific game event you want the dialogue system to override the inputs from the navigation system?

    • @aarthificial
      @aarthificial  2 года назад +1

      Thanks!
      In Astortion, systems naturally have this sort of hierarchy of importance - which is reflected by their order in the chain - so I haven't face an issue like that yet.
      I can think of a few ways to address this. You could for example make a middleware sandwich:
      [Navigation - only the overridable event]
      [Dialogue]
      [Navigation - the rest]
      Or have a separate "Process" method for this one event in which the order would be different.
      But I would probably just start with a bunch of "if"s in my provider, without any middlewares, and see if chain-of-responsibility is really applicable or maybe there's a better way to arrange everything.

  • @lazlobarragan7512
    @lazlobarragan7512 2 года назад

    your devlogs are rly interesting ! :) what do you use to make those diagrams ?

    • @aarthificial
      @aarthificial  2 года назад

      Thank you!
      Illustrator and After Effects

  • @plusmorale
    @plusmorale 2 года назад

    As always. One question, in which software you make this cool motion graphic?

    • @aarthificial
      @aarthificial  2 года назад

      I design them with Illustrator and then animate them in After Effects

  • @amitp6683
    @amitp6683 2 года назад

    Great videos, one question (not related to content, that was pretty concise): What do you use to compose these devlogs? It's super high quality and I'm interested in learning more

    • @aarthificial
      @aarthificial  2 года назад

      Thanks!
      I use illustrator and After Effects for the graphs and then put it all together in Premiere

    • @amitp6683
      @amitp6683 2 года назад

      @@aarthificial no, thank you :) Your content is of the highest quality here on RUclips

  • @MrHandsy
    @MrHandsy 2 года назад

    You're a pretty bright guy

  • @ygorperez
    @ygorperez 2 года назад

    The first thing that I thought after seeing the thumbnail was: "that's not right"

  • @ArielLothlorien
    @ArielLothlorien 2 года назад

    This was a great video nice and clear but I do have a question! What program did you use to make those code structure graphics?!

    • @aarthificial
      @aarthificial  2 года назад

      Thanks! It's illustrator and After Effects

    • @ArielLothlorien
      @ArielLothlorien 2 года назад

      @@aarthificial oh you just litterally made them wow very nice and smooth! Did you use a template or just make them from scratch?

    • @aarthificial
      @aarthificial  2 года назад

      I designed then myself loosely following the material design guidelines

  • @feliscape
    @feliscape Год назад

    How does the Input Provider get the Input Middlewares? It doesn't really make sense to serialize them in the Scriptable Object, since that wouldn't work with things like AI. Does the GetState function need a parameter for that?

  • @Snowdrama
    @Snowdrama 2 года назад

    Can you provide any example code for the interaction shown? I'm curious how it's specifically implemented, for example how does the system that moves the player to the bench know which direction the bench is in? Clearly the middleware needs to know where the player is, and where the target to move to is, so how do you provide that information to the middleware? I'd love to know! I've been trying to implement something like this over the last couple days so any examples would be helpful!

    • @aarthificial
      @aarthificial  2 года назад

      It's difficult to share any code because interactions are made up in the editor from small building blocks.
      My next devlog will go more in-depth on how they work. But the general idea is that the Interaction Manager (which is also a middleware) delegates the Process method to the current interaction. And since interactions are components in the scene, they can be configured from within the inspector and reference other scene objects.
      In this case, there's a navigation interaction that references some target transform and calculates the correct direction and speed. So the middleware doesn't really know where the target is etc.

  • @bucketofcereal3711
    @bucketofcereal3711 2 года назад

    Decay exist as an extant form of life

  • @creasu124
    @creasu124 2 года назад

    I was wondering, do those events for jumping for example also work for 2 players locally? or do you need to make 2 events 1 for each that are differently named?

    • @aarthificial
      @aarthificial  2 года назад +1

      With two players you should have two input providers, one for each player.
      This way the event is implemented once, but there are two instances of it. Each plugged to a different control scheme / input device.

    • @creasu124
      @creasu124 2 года назад

      @@aarthificial i don’t really understand events fully yet but i think i get it. I do find this method interesting, looks very useful for ai controlled characters and maybe even machine learning ones

  • @ZooHair
    @ZooHair 2 года назад

    What software do u use for the motion graphics?

  • @izerpizer
    @izerpizer 2 года назад

    What's the name of the song at the end of the video (3:20)? And also where do you source all the songs that you use in your videos?

    • @aarthificial
      @aarthificial  2 года назад +1

      Luella Gren - There Is Something about the World
      ruclips.net/video/E23TKjdDtow/видео.html
      I used to think that because I'm using Epidemic Sounds I don't need to credit these songs.
      But I just checked and they actually recommend to do that so I'll try to add them to my descriptions in my free time.
      Thanks!

  • @TripleA737
    @TripleA737 Год назад

    I have a question about Astortion, can it also work in top down games?