Home

2024

Worklog

LETSGO Game

Interface Signature Rework

Interface Signature Rework

Date
November 20, 2024
Hours
1
Tags
UnrealCodeC++LETSGO

Knowing what kind of errors to expect from yesterdays Start Testing CreateMotif, I was able to jump in today with the machete:

One thing I didn’t like about my MusicalStrategy pattern is that the Generate method was only producing a single bar.

This is OK, but it makes things simpler for it create the entire FInstrumentSchedule- A set of musical bars and when to play them.

So I just went and reworked the whole thing, fixing some minor bugs along the way.

However, an idea I literally just had might simplify things a bit more.

As mentioned, FInstrumentSchedule is pretty much an array of bars to play, and when to start playing them.

I think there is a case to push when to start playing them into each bar.

See, the Instrument actor contains a set of InstrumentSchedules, and plays them if the current bar == InstrumentSchedule.StartAtBar

One of the reasons for this was to account for a “rest”- bars where no music would play.

But this means Instrument holds a set of InstrumentSchedules, which in turn holds a set of BarsToPlay.

If BarsToPlay had the StartAtBar value, Instrument could have a single InstrumentSchedule, and just read from the one set.

That seems pretty interesting to me. Might consider reworking that tomorrow.

Does any of this actually test my new function?

Well, no.

But, it should make it a bit easier to figure out what the hell is going on in my code.