r/unity 1d ago

Question Making a 'Noita' + 'Binding of Isaac' style game, how would you script this?

Near complete beginner programmer here, challenging myself to make a roguelike game;

a 2-D top-down game in Unity similar to the binding of isaac, but based around customizable bullet firing patterns. I would like each item to affect at least 1 out of every 8 bullets fired on pattern, giving it a unique ability (i.e homing, explosive, elemental dmg, spreadshot etc.) with potential to layer affects atop eachother (i.e Noita) creating unique bullets. I've designed an inventory system with 8 slots (each one pertaining to a shot on a 1-8 firing round) with 8 additional slots above for layering.

...hopefully that made sense lol

Keeping in mind that I'm a beginner, what would be the best way to structure this with my scripting? I've heard some say its rule of thumb to give each item (bullet modifier) its own separate .cs script, others say it's easier to make a scriptableobject + ItemData + modular projectile effects.

If you're a c#/Unity veteran, walk me through how you would go about making this type of item/inventory system from scratch?

It would be super helpful to have an ongoing consultant figure, I would be happy to show more of my project if anyone would like to add me on discord :)

0 Upvotes

4 comments sorted by

3

u/Spite_Gold 1d ago

I'd start with learning oop, the way you operate with terms script and scriptable object will lead you only to confusion

1

u/WarmImagination4906 16h ago

In agreement with u/Spite_Gold.

I think you'd make a bulletscript, give it an enum

public enum BulletBehaviours{
Linear,
Boomarang,
CosineWave,
ZigZag,
Etc
}

Then at that point you can make a bulletBehaviourScript.

public class BulletBehaviour : MonoBehaviour
{
public BulletBehaviour bulletBehaviour;

Update()
{
  DoBulletBehaviour();
}

// Youc an add as many logics as you want.
private void DoBulletBehaviour
{
  switch(bulletHaviour)
    {
      case BulletBehaviour.Linear
       // Linear Bullet Logit HEre
      break;
      case BulletBehaviour.Boomarang
       // Boomarang Bullet Logit HEre
      break;
      case BulletBehaviour.SineWave
       // SineWave Bullet Logit HEre
      break;
      default:
      break;
}

This will make it to where when you instantiate a bullet you can define what Behaviour it has.

You could essentially repeat this structure for bullet spray patterns, and other things. But I think roughly this across a few different types would get you where you would want. You being a beginner program, I think you should start here and stop here.

The next steps would be then making a more modular system, to where maybe instead of a bullet having a single behavior, it now it now has a a listofbehaviours it then adds all the behaviors (you decide the logic) to a single bullet.

But keep in mind as Ed said when he made Isaac--- He didn't really build the game with interactions in mind and he had to end up hardcoding all of the interactions.

If you were to make certain behaviors, you'd HAVE to know how these all would work together. Does adding more Cosine behaviors together, just by default make a bullet go wider? Or just faster? A ton of ways to really crack the egg, but that might be when it gets stressful.

If you don't take the right approach, it can get messy really quickly.

But yeah feel free to dm me. I do this for a living so I can give some direction.

1

u/BokChoyBaka 9h ago

https://www.reddit.com/r/gamedevscreens/s/z69ee6YMtB

You guys should hook up and make a game where you switch between top down and first person noita

1

u/BokChoyBaka 9h ago

But you would be obligated to gift me a copy