YouTube video feedback [Video Tutorials for MonoGame]

I watched the pixel shader one. It looks great. I still have qualms about the coding style (ie, use of globals), but I understand your perspective here. It’s kind of hard to set these up as quick bits of coding if you have to do a bunch of boiler plate. With the intent being to just demonstrate a concept in a short block of time, I can wrap my head around this.

One thing jumps out at me though… the transparency one (3/5) looks off. It might just be me but it seems to fall to fully opaque more quickly than I would expect. I think it might be because it’s just over a black background, so it’s much harder to see. If you do any future videos with transparency like this, you might want to consider using a background that demonstrates the transparency more effectively? I’m still not sure if that’s right though, or if it’s just an optical illusion haha. Stupid eyes.

Anyway, these have come a long way. Nice job :slight_smile:

Thanks for the feedback!

ad globals) you are right, it’s a crutch to speed things up

ad transparency) this is intentional, looking at the formula “input.TextureCoordinates.y * 2 - 0.4f” the Y goes at double speed, plus is shifted up a bit. But you are right about the background. Should have also used bigger textures.

image
LEFT - input.TextureCoordinates.y
RIGHT - input.TextureCoordinates.y * 2 - 0.4f

Thanks again!

Ah, I didn’t notice that you were using a non-linear mapping. That explains it :slight_smile:

Hello, programmers. New batch:

3 Likes

Hello :slight_smile:

A bunch of new videos. With a special one to celebrate 300 subs. Thanks!

2 Likes

Merry Christmas!
There is a new batch of videos. Started a devlog too.

4 Likes

I loved your videos.

They are really useful for people like me who does not have much time (I have a 1 year old daughter), know how to code and just want to see the implementation of a technique.

Keep it up, these videos have value to the community.

4 Likes

Hello, a few new videos + Discord server to discuss: GameDev Quickie

3 Likes
2 Likes

Awesome, nice videos :slight_smile:

A bit of feedback/questions…

Generic Event Delegate
For your observer pattern (ie, events), if you were so inclined, you could use the more standard sender/args pattern that Microsoft uses. EventHandler has a generic type you can use so you don’t have to make new delegates, just new event arg types. For example…

class MyEventArgs : EventArgs
{
  public string EventMessage { get; private set; }

  public MyEventArgs(string message)
  {
    this.EventMessage = message;
  }
}

...

class SomeObject
{
  public event EventHandler<MyEventArgs> SomeEvent;

  void TestEvent()
  {
    if (this.SomeEvent)
      this.SomeEvent(this, new MyEventArgs("This is a test!"));
  }
}

I don’t think you have to inherit from EventArgs either, but you can to stick with how the rest of .NET sets up its events. I have found that having the sender associated with the event is helpful though.

Dangling Event Handlers
I think there might be a bit of a lifetime management issue in your code here, though I’m not 100% sure so I’ll just bring it to your attention and you can look into it. For example, in your UI class, you pass Hero in through the constructor and have it subscribe to the OnCollect event. Now Hero is attached to the UI class, but the UI class doesn’t keep a reference to Hero or unsubscribe from that event.

I think this can be an issue in cases where you want to destroy your UI object, but the Hero object sticks around. Maybe your Hero collects something and your UI changes, so you would destroy the old one and instantiate a new UI. If you were to do this, the UI object wouldn’t actually destroy as the Hero object would be holding a reference to it, keeping it alive. Every time the OnCollect event fires, you’ll actually get two events fired, one to the new UI object and one to the old.

To fix this, you can have your UI class keep a reference to the Hero object it was given then, in the UI object’s destructor, unsubscribe from OnCollect.

What you have here is probably fine since the UI object is likely to live as long as the Hero object in your particular example, but I figured I would point it out since this was not obvious to me when I first learned this stuff. To be fair though, I learned this back in like .NET 2.0 so maybe some work has been done there? Either way, I figured I would mention it.

ICloneable
For your prototype example, there is an interface built into .NET called ICloneable that you could use instead of defining your own, if you wanted to. I don’t think there’s anything wrong with using your own, per se, but using the .NET one might make interacting with other built-in things that expect ICloneable a smoother experience.


Anyway, I just wanted to mention those. I love these videos, keep them up! :slight_smile:

1 Like

Keep going! it will be very useful for future Monogame developers and I hope more people start using Monogame. I will start some kind of tutorials in a couple of weeks, trying to finish my game first.

1 Like
2 Likes
2 Likes

Nice and well done with the channel, you have a new sub so i can find you later :grinning:

2 Likes
1 Like
2 Likes

image

For future reference

For all of those, who don’t like the AI voice :slight_smile:
(My very first try, there are problems, I will work on it/myself. Have mercy.)

2 Likes

Should have started with this… :100:
Success100GIF

1 Like

Thanks!
There are steps in the evolution, that can’t be skipped.

1 Like