RPG Core Combat - my modified version of the game

Hi,

I completed the course still in its earlier version (with Rick and Ben) and heavily modified/refactored the result. Then I shelved the project for a while. Recently I dusted it off a bit and created a write-up on my work process on my blog. If anyone would like to see the results of my work you can see the demo video here:

My blog articles about the game’s systems are available below:




I would greatly appreciate you leaving your feedback:)

1 Like

This looks really cool, it’s pretty obvious you put a lot of effort into it.

It’s hard to give feedback with just a video because my impressions might be innacurate, but here are things I noticed:

  • The second (Or first?) health bar doesn’t disappear completely.
  • Is it just me or it’s kinda hard to click the targets?
  • The interface obviously needs a lot of work.
  • I don’t think this kind of combat fits for a 3rd person view to be honest, that’s because the character blocks the view and you see in pretty close range how repetitive the combat is, it’s kinda boring, people will probably expect a more complex combat system than just click and hope for the best with that camera angle.

I think you have a very good looking game, something you can certainly sell, something I would certainly buy, you’ll just have to spend some more time with the controls and combat.

1 Like

Hi Yee,

Thanks for the feedback! Just to clarify one thing - I am actually not clicking the target. When I am attacking the targets I use Shift+Click - I do not actually need to click the enemy, my weapon or my fist just needs to collide with them. I changed the damage model to physical/collider based.

So this may not be apparent when watching the video, but what I’m actually doing there is just aiming at the target’s general direction with the mouse and clicking just to direct the weapon at the opponent.

1 Like

Hi, I like the changes you made. I was wanting to do the same for the combat. I was wondering if you can help with this problem I have I can’t tell want I’m doing wrong in the code. I keep getting a null reference but the print statement still comes through but I don’t know why the null comes up.

namespace RPG.Combat
{
    public class TPHitBox : MonoBehaviour
    {

        public Collider trigger;
        public Weapon weaponObject;
        TPFighting tpFighting;
        GameObject enemytarget;


        private void Awake()
        {
            tpFighting = GetComponent<TPFighting>();
            enemytarget = GameObject.FindWithTag("Enemy");
        }

        void Start()
        {
           
            trigger = GetComponent<Collider>();
            if (trigger)
            {
               trigger.isTrigger = true;
               // trigger.enabled = false;
            }
        }
        void OnTriggerEnter(Collider other)
        {
            if (weaponObject.friendly == true && other.gameObject.tag == "Enemy")
            {
               
                print("Hit Enemy");
                tpFighting.Attack(enemytarget);

            }
            if (weaponObject.friendly == false && other.gameObject.tag == "Player")
            {
                print("Hit Player");

            }
        }
    }

}

tpFighting.Attack(enemytarget); comes up null

  public void AttackBehaviour()
        {
                GetComponent<Animator>().SetTrigger("Attack");
                print("Attacking");
                GetComponent<Stamina>().AttackCost();
                tPControlUI.Lock(true, true, true, 0, .75f);
        }
        public void Attack(GameObject combatTarget)
        {
            target = combatTarget.GetComponent<Health>();
            Hit();
            print("Hello!!!!!");
        }

Hope there is something you may be able to tell what’s wrong, thanks.

Hi,

I do not currently have the possibility to analyse your code in detail, but I noticed 3 things that might help you:

  1. Does the variable enemytarget have the proper access modifier? I meancan the class AttackBehaviour access it?

  2. is the enemytarget variable initialized properly using GameObject.FindWithTag(“Enemy”)? Maybe you could try defining the variable as:

public GameObject enemytarget;

This way you will be able to put the reference to the target enemy in the inspector by dragging the object from the hierarchy to the script. This is of course not a permanent solution, but it can show you if your code works if the reference to enemytarget is correct.

  1. In my solution I actually do not get access to enemytarget this way. In my solution each weapon has its own collider and only on collision does any damaging happen. My character does not store any information about the enemy. Please see the article how I set this system up:
    https://gamedevstash.com/rpg-core-combat-creator-physical-combat/

Thanks, I’ll give that a try.

Privacy & Terms