IF Platform Design - C# - Iteration 4

I just got to a point in my 3rd iteration where I felt the need to think through some of the structures and designs. I could just repair or change some of the current code, but I also realized this is another way ChatGPT-4 can be extremely helpful. You can refactor whole application architectures and code in a fraction of the time it would normally take.

Now that I mostly know where I want this design to land, I’ve had a conversation with ChatGPT-4 about alternate data structures (yes @jbg I was paying attention) and a few other things. Then I created a brand new empty Visual Studio solution using the newer thoughts.

Solution - refly (older name I came up with the platform identity)

  • Console app (refly)
  • Graph Data Structure with non-IF interfaces and queries - (class library) (izyuk)
  • Conversation Service (class library)
  • Event Service using Observer pattern (class library)
  • Game Service manages turn loop (class library)
  • Grammar Service manages acceptable verb-based sentence structures (class library)
  • Parser Service tokenizes user input, implements Grammar and WorldModel services to validate input and returns a delegate to execute the action (class library)
  • World Model Service implements izyuk and provides the IF interfaces to the graph (class library)
  • Text Service is implemented by the Standard Library and game code to accept all input with context and compiles it based on author-based rules (class library)

All of this will be seamlessly tied together with a DI container so the author can write code and not worry about calling services.

I may add an Inventory Service and a Puzzle Service but those are still in R&D mode.

Just curious but…

What do you mean by services here? Is that just a chunk of code that can be considered more-or-less in isolation (is that why you flagged them as “class library”), or is there more to it?

What would the puzzle service actually do?

Yeah “service” in this context is just a way to separate concerns and leverage dependency injection to manage everything. I assume every service is a singleton. It’ll also help build robust unit tests.

I’m still pondering the puzzle service, but I think it’s likely a way to track goals and elements of goals.

When an author thinks, “I want the PC to visit these 3 locations, locate these 4 objects, use the objects in these 5 ways,” the puzzle service could make that easier.

This architecture also provides a pattern for future extensions.

1 Like

Im interested in whether your GPT4 code is good.

so far on the free GPT (3.5 i think), it makes novice mistakes . some simple string maniulation went wrong.

And it forgets things.

Perhaps v4 is better.

V4 produces solid code 95% of the time. It has inspired my urge to write code after many years of letting those skills lay dormant.

It’s significantly better than v3.5, at least for C# and .NET Core.

1 Like

Hi, I’m really interested in any project that takes a fresh look at IF engine design.
But in case I missed some context from your previous posts, is ChatGPT an integral part of your methodology for some reason?

Interesting question.

Had you asked it two weeks ago I’d have just said it’s accelerating the design and coding process.

But because ChatGPT-4 is a very polite and “words of affirmation,” interface, I’m now starting to believe its helping me stay focused and has removed the doldrums of writing a lot of boilerplate code.

Yup we all need those :slightly_smiling_face:
On the other hand, a critical friend in the early stages can help avoid the pitfalls which may be so common that no one notices them before it’s all too late.

Not trying to criticise your approach. But if you prod me I can give some examples of how I’ve been bitten that way myself.

Just like any relationship, you have to level it and set boundaries.

1 Like