New answers tagged

1

In game development, there is never just one solution to any given problem. But one solution could be to create each active dialog as a separate, independent, invisible entity which references all participants of the conversation. That entity would then be responsible to check if the conditions for starting the scene are met (the player entered the trigger ...


1

There are much smarter people here than me, but I'll pitch in with my $.02. You asked about how others would approach this problem building a game in an engine like Unity. While I have not built a game with multiple NPCs talking to the player at once, I have built games where players can interact and converse with individual NPCs, and I think my approach to ...


2

For the type of problem you're describing, I'd recommend shifting your focus away from "identity" (is-a) toward "affordance" (has-a). This is part of the classic principle of composition over inheritance, with which Unity's component-based structure tends to work well (and it has a great write-up in the Game Programming Patterns book too)....


-1

https://github.com/jpgordon00/UnitySingleton All you have to do is add 'SceneSingletonListener' to your scene and you can create singletons like so: using UnityEngine; public class SingletonComp : Singleton { } // in any class during runtime... SingletonComp = SingletonComp.Instance;


2

I still use interfaces, inheritance and all the rest traditional OOP stuff but far less often. What I gradually began to value most is fast to create and modify while not being too "fragile". Without a big team all the rest is secondary. (honest translator: I gave up on being amazing so I can at least be effective) I came to an approach that works ...


Top 50 recent answers are included