Announcement

Collapse
No announcement yet.

Resident Evil clone made in Unity Javascript teaser

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resident Evil clone made in Unity Javascript teaser

    For the past few days I've been learning the ropes around Unity Javascript and managed to whip up a clone of Resident Evil. It's still far from finished, but the core gameplay controls and animations have been ported over to Unity from Resident Evil 2 with near perfect accuracy. I can't promise to complete anything beyond what you'd find in the Biohazard 10/4/95 build, as anything otherwise would be a bit too ambitious, but the main goal is to provide a working template to serve as a starting point for the RE community so people can download the source and create their own Resident Evil style games with ease without having to mod and mess around in the original games. So once the core engine is finished, users will be able to add on to the features if they so desire provided they know Javascript and/or C#. In addition to releasing the source code, I will be making in depth step by step tutorials on how to translate camera placements and orientation from Max to Unity as well as properly setting up backgrounds in your scenes and triggering camera switch zones.

    Latest update video as of 9-10-2015:


    List of features (so far):
    - 2.5D pre-rendered static backgrounds.
    - Instant camera switch zone controls.
    - Hidden 3D geometry used for collisions.
    - Official idle, walk, run animations ported over from RE2 Hunk model.
    - Core RE emulated movement controls such as rotating left and right while playing the walk animation, left-shift to run, run limited to just initiating while moving forward, moving along collisions, etc.
    - Debug player coordinates system /w official RE2 debug font. ;)
    - Background music.

    List of features soon to come:
    - Aiming and shooting.
    - On the fly weapon change system based on variables.
    - Enemy zombie AI who can walk towards, grab and bite the player, etc and be shot at by the player.
    - Real time condition status HUD display.
    - Footstep audio arrays (plays a different footstep sound depending on the room).
    Last edited by VirusPunk; 09-10-2015, 09:28 AM. Reason: New video update!

  • #2
    Not bad at all. Looks like a solid start to me, especially after a ton Unity clones that just don't cut it.

    Resident Evil: Behind the Mask twitter
    , also in Facebookian flavor for great justice.

    Comment


    • #3
      Originally posted by Gemini View Post
      Not bad at all. Looks like a solid start to me, especially after a ton Unity clones that just don't cut it.
      Thanks, I appreciate it! Yep. I think the official animations play a key role in getting that official RE feeling, which pretty much all of those other Unity projects are lacking.

      Comment


      • #4
        wow cool well done ! looking forward to seeing the aiming and shooting

        Comment


        • #5
          Originally posted by VirusPunk View Post
          I think the official animations play a key role in getting that official RE feeling, which pretty much all of those other Unity projects are lacking.
          There is a bit more to that. Most of the authentic feeling comes from speed values and interpolation (bezier is usually the best, but the original used linear). You need to interpolate the key frames when an entity is moving to a new state and you also interpolate rapid placement shifting, which RE games do a lot. As for other speed values, turning is the most variable, since it depends both on the character and the weapon you've got equipped. Most of these values are, however, hardcoded and not found inside entity file data.

          Resident Evil: Behind the Mask twitter
          , also in Facebookian flavor for great justice.

          Comment


          • #6
            Dude freaking awesome! Looks so close to RE1

            Comment


            • #7
              Originally posted by VirusPunk View Post
              I think the official animations play a key role in getting that official RE feeling, which pretty much all of those other Unity projects are lacking.
              I have to agree! Without them, you'd have nothing more than a fancy background viewer.

              Best of luck to you, Virus Punk!
              I'm a blackstar.

              Comment


              • #8
                Originally posted by Gemini View Post
                There is a bit more to that. Most of the authentic feeling comes from speed values and interpolation (bezier is usually the best, but the original used linear). You need to interpolate the key frames when an entity is moving to a new state and you also interpolate rapid placement shifting, which RE games do a lot. As for other speed values, turning is the most variable, since it depends both on the character and the weapon you've got equipped. Most of these values are, however, hardcoded and not found inside entity file data.
                In the case of my script, I have a variable setup for turn-speed, so whatever action block in my script that requires a different turn speed value can simply be defined by adding a different value for that variable in the block (as an example, if the player is holding a shotgun, the variable will be lowered), same with the overall forward/backward movement speed. Thanks for the reminder about that stuff, though. The current video demonstrates the game running with anti-aliasing and anisotropic texture filtering, this will of course be disabled to preserve a more PS1 quality.

                Originally posted by Deathlygasm View Post
                Dude freaking awesome! Looks so close to RE1
                Greatly appreciated!

                Originally posted by MarkGrass View Post
                I have to agree! Without them, you'd have nothing more than a fancy background viewer.

                Best of luck to you, Virus Punk!
                Exactly. Much obliged.

                Comment


                • #9
                  Looking good man, I'm looking forward to seeing more!

                  Comment


                  • #10
                    Implemented RE style aiming, attacking, and weapon on the fly switching for the knife only for now. Although, any other weapon is just as simple as copy/pasting the block and adjusting the variables as I see fit. Once I implement on collision hit detection with an enemy, I'll post a video showing the new implementations. For now here are some screenshots demonstrating aiming down, up, forward, and holding the position. The animation transitions between between the aiming actions are a bit jumpy as well, so I'll have to fine tune it before I post another teaser video. ;)

                    In case you guys are wondering why it's not Hunk anymore and looks a bit different, I started the project over with the old code saved of course. Mainly due to the fact I had the scaling off, and I wanted to switch to 1.5 animations.









                    The weapon system works just like the leaked Biohazard 1 beta where you press a key to change the weapon on the fly. Example: 0 = unarmed, 1 = knife. When you change to the respective weapon the model part changes to that respective model piece just like in RE.

                    The code was also fine tuned to act as a universal controller, in other words; if you imported say Elza's model with her model piece names the same as Leon's and her animation names the same, she would work with the player script perfectly without having to change a thing. This will definitely come in handy when I decide to implement a character select feature.
                    Last edited by VirusPunk; 08-25-2015, 09:01 PM.

                    Comment


                    • #11
                      One step closer to running a fully customizable re engine on OpenGL ES :-)
                      Last edited by Mikhail; 08-26-2015, 12:59 AM.

                      Comment


                      • #12
                        So far so awesome, looking forward to seeing where this goes

                        Comment


                        • #13
                          Originally posted by VirusPunk View Post
                          The animation transitions between between the aiming actions are a bit jumpy as well, so I'll have to fine tune it before I post another teaser video. ;)
                          You mean the interpolation or the player having weird placement? The former is easy to fix if Unity is smart enough to perform interpolation, the latter not much. CAPCOM's code does a lot of screwy stuff when it comes to setting the model position: it actually calculates foot magnitude and moves the root to simulate a "stable" position. Add to that the fact that feet can be different depending on the current character or weapon and you have the recipe for messy goo code.
                          Last edited by Gemini; 08-26-2015, 09:50 PM.

                          Resident Evil: Behind the Mask twitter
                          , also in Facebookian flavor for great justice.

                          Comment


                          • #14
                            Originally posted by Gemini View Post
                            You mean the interpolation or the player having weird placement? The former is easy to fix if Unity is smart enough to perform interpolation, the latter not much. CAPCOM's code does a lot of screwy stuff when it comes to setting the model position: it actually calculates foot magnitude and moves the root to simulate a "stable" position. Add to that the fact that feet can be different depending on the current character or weapon and you have the recipe for messy goo code.
                            The interpolation. For the most part the models are exported as they should be from Capcom's engines. We're going to have a direct PLD/EMD complete with animations importer in the near future (by we, I mean mortician and I) once we get the RDT importer out of the way. As opposed to releasing the source code with Capcom assets, we want to give people the ability to just direct import data from RE without much hassle on their own accord.

                            For now I figured out how to port rooms myself from BIO1 with the cameras and boundaries aligned to Unity's jumbled up 3D axis. As well as implemented an on the fly weapons changing system, aiming and attacking with hit detection, etc. At this current stage it is still crude, but making swift progress.

                            Update: Teaser #2:
                            Last edited by VirusPunk; 08-27-2015, 08:29 AM.

                            Comment


                            • #15
                              Originally posted by VirusPunk View Post
                              The interpolation.
                              The interpolation seems mighty fine now. Now you need to look into the way Leon slides on the floor, which is completely computed by the engine and mostly hardcoded with joint IDs. The trick is to build a transformed matrix with the hierarchy for a foot, so start from the hip and go all the way down to the foot, then subtract the previous transformed xz values and the temp ones, finally add the result to the current position of your Leon object (i.e. Leon_pos_x += previous_x - temp_x). If you did everything correctly, you should have around 5 matrix multiplications.

                              For now I figured out how to port rooms myself from BIO1 with the cameras and boundaries aligned to Unity's jumbled up 3D axis.
                              It's more like a coordinate system with left handed projection and the up vector pointing to Y=1.0. The PlayStation is right handed and up points to Y=-1.0. Chances are Max uses yet another coordinate system, something like up Z=1.0. As for RE1 rooms, you're gonna need a lot of patience; they're are a hilarious collection of messy standards that aren't even consistent with each other. If I were you, I'd check RE2 and 3 - both have way less crazy bat shit.
                              Last edited by Gemini; 08-27-2015, 12:35 PM.

                              Resident Evil: Behind the Mask twitter
                              , also in Facebookian flavor for great justice.

                              Comment

                              Working...
                              X