• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By ThunderTwonk
      Hello everyone, I am working on a game idea and since I am still in the process of learning C# and the features available in unity I was hoping some of you might be able to offer me a little insight on things in general for getting started.
      I guess the basic components of what I'm wanting to create would be a Multi-levels management/city builder/rpg.
      The goal is to provide a framework for players to interact with, build in and affect the world both from a 3rd person action RPG as well as a zoomed out 4x style view (This would be something unlocked through gameplay)
       
      As for my questions go I was wondering if anyone had resources that could help me learn.  I've been on youtube as well as enrolled in an online course for basic unity and C# and will continue those but if anyone has any words of advice, a place that has good information and tutorials etc.
       
      Thanks for your time.
    • By Cahit Karahan

       
      Hi, I'm new in this forum. It is honorable to see such communities exist. I would like to share my new game. I did for android with unity. I know the game is a little awkward , but you have to know that this game is from the time when Unity's name is Unity3D  I have made my first game when I was 12. Now I am 22.  I have taken a lot of experience in this process and I can make better games nowadays. I have published this game nowadays but actually this game is very old but also it is very special for me :))
      I have just wanted to retouch and share this game, because it has a very important place for me.
       
      DESCRIPTION FROM GOOGLE PLAY STORE

      It's a special free 3D horror adventure action game for the halloween. Fun with scary sound effects and musics, 3D realistic graphics, you will feel the horror in the deep of your heart. Use your reflex. Totally free adventure. Totally scary horror game. 

      Tamarra, she is a beast from our world. She needs to consume souls from innocent people to stay alive. Story begins, the old Elaris tribe had lost their everything because of this beast who lived in the well. Araknas was the most powerful warrior of the tribe. One day, Araknas's mother was killed by the servant beasts of Tamarra. That's how Araknas's journey to the well begins. Tamara's well is guarded by horrible beasts. Araknas has to pass all servant beasts until he reaches Tamarra.

      Even death at the end is worth the revenge. 
      Are you brave enough to jump into Tamarra's well?

      Survive from witch attacks, clown attacks and many scary creature.

      - Realistic 3D graphics.
      - Scary sounds.
      - Scary musics.
      - Best experience with headphones.
      - A demon cage where you can imprison all the demons one by one
      - The witches do not like help, but they love blood stone. Witch store where you can develop your abilities and get new abilities.
      - Countless beasts.
      - At the end of the well there is a hidden surprise for you.

      *We do not recommend this game to people with clown phobia, spider phobia, or panic attacks.*

      **!!!**Note : This game is an early-access game, we are upgrading new features every day, new beasts, new improvements, as an example online 1vs1 fall on the list, so stay on connect and follow Halloween : Horror Well on Google Play.**!!!**

    • By INFRA
      SCAN. DRILL. SURVIVE.   ISOLATED Release in May 1st 2018   https://store.steampowered.com/app/805950/Isolated/   A game by Jérémie Bertrand Music & Sound Design by Pierrick Querolle *** Our solar system has been invaded by strangers. For the purpose of a possible negotiation, a team of astronauts is sent to the moon. Alas, they are shot before even arriving on the scene. Only one astronaut survives the crash and his only goal will be to go home...   GAMEPLAY   Shoot enemy ships to avoid being invaded. Be precise in your movements, because it's better to lose a bit of life at the top than to lose it all at the bottom. Take out your drill to destroy the stones in your path. Validate your identity to cross the different laboratories. Reach the flag before losing your three lives.   And all that... at the same time! Will you be able to go home? If the answer is yes, how long will it take?
    • By BigJiggly
      Hello! So, I've been the leader of BJP for a while now. I'm a bit bored of taking the role I always take, leader. I was hoping someone out there is looking to forge a team maybe and needs a programmer. 
      I have experience mainly in the Unity engine(C# intermediate) and I have a very small amount of knowledge on Shaders, as well as experience on developing games(usually end up stuck in dev hell) and leading experience from my last team which at one point reached 11 people. I personally love the Unity engine and prefer to use it as it's the development environment I'm comfortable with. 
      I have used Unity for over a year and a few months, I'd consider myself an intermediate at the Engine, but to this day Unity still surprises me. 
      I live in the United Kingdom, I find it a bit strange to work with other programmers as the ones I've worked with tend to leave their code heavily unoptimised and I'm a on the go optimise kind of guy, I also like to get things done quickly.
       
      If you're a new team and need a programmer that has high levels of ambition and strives to maintain the motivation throughout the team, then I'm your guy. I don't care if you're just beginning because I'm all for helping people learn!
       
      To finish this off: I like to get things done and I like to get them done right the first time, if I fail I will do it again and again, etc, until I loose all motivation. So if you're a modeller or an artist, please don't leave me to do all the modelling/art as well as the programming and sound. I do have experience in all those areas but my main power is in programming and I'd prefer to keep it that way.
       
      [If this was posted in the wrong forum, sorry, I don't really know the layout of this website yet]
    • By Alexia
      Hi all,
      A small team are currently undertaking a fairly large game project involving multi-playing, taming and other complex game mechanisms.
      We are looking for someone who is experienced in programming a wide range of mechanisms, more information is on our discord server. It is also a learning experience and we wouldn't expect you to know how to do everything we wanted, but just ask that you would be willing to learn how to.
      If you are interested in joining the (rather long term project) just message me and i'll add you on discord.
      Thanks for your time,
      Alexia 
  • Advertisement
  • Advertisement
Sign in to follow this  

Unity Dialog and Event trees

This topic is 809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Game Engine: Godot Game Engine

Language: GDScript — Syntax very similar to Python

My questions are obviously within these bounds. I am very happy with Godot as an engine; and I do not think that my limitation to GDScript prevents me from any of what I aim to achieve: many have done so before me. It is almost entirely a matter of logic and the implementation of that logic within the bounds of resources available. With that said, let me propose my problem.

 

I am by no means an adept and fluent programmer, but my knowledge has been sufficient enough to make games in the past and I feel that I am capable of implementing whatever structures, systems and logic trees are suggested to me with some thought and exercise.

 

I have created a dialog system in Godot Game Engine which I am (somewhat) happy with, but does not achieve my core goal. Keep in mind this system was completely created by me and I was not following any examples, which could contribute to why it is so awful.

 

The first thing to note is that this system only allows any sign or enemy to have two states of text: An intro, and if specified, a continuation of that text. An exported variable lets me check a boolean to say "This character has two lines of dialog." — Upon speaking to the character they might say "Hello [player], my name is [entity], nice to meet you!" Then be flagged to say that the character has spoken to them.
Upon "activating" them the second time, the script will see that it HAS a second line of text, and then the NPC might say "It's a nice day today!"
 

The main core of this is done through three systems:
- Checking if the player is next to an interactive object.
- Passing the character details to a function which will query an external config file for appropriate dialog.
- Displaying the text on screen. (This part is fine, I'm totally happy with how it turned out)

 

Let's say that I have a Skeleton that the player can talk to. Its external parameters are this:
SECTION: GRAVEYARD (Its location)
KEY: SKELETON (Its identifier)
EXTENDED: True (Does this NPC have two lines of text?)

The script would then query a .cfg file which contains a dictionary of text; it would look like the following.

[GRAVEYARD]
SKELETON = {"INTRO": " Why don't skeletons fight each other?.","IDLE": "BECAUSE THEY DON'T HAVE THE GUTS!."}

 

The first time the player talks to him, the script would see that it has two lines of text. It would automatically search for "SKELETON" in "GRAVEYARD" in the config file. (See above.)

The script would then retrieve the dictionary value held in "INTRO" and flag the NPC such that the next time the script is called it searches for the "IDLE" dictionary value.
The player then activates it again, the script sees the flag, and then looks for "IDLE" instead of "INTRO".

This is the best that I could do. And it's god awful. It serves no purpose, other than to display two different mundane pieces of text. 

So why don't I use the system to enable more?

This is where my logic runs out. Bam. None.
The way that Godot (and MANY other engines, including Unity) handle objects are through nodes. These are the equivalent to Unity prefabs. I create an object and I have the luxury of attaching a script to it, which defines the way that ALL of those objects will behave, which saves me a lot of coding. Obviously there is a ridiculously easy solution to this, but my experience doesn't allow me to think of one, which is why I am here.

If the script searches for an invalid dictionary, the whole game crashes. If it searched for "IDEL" instead of "IDLE" — it's game over. (No pun intended.) So a solution would be to create a different script for each NPC in the entire game, but this doesn't work. What I need is a dialog tree which can be safely called by all NPC's in the game to get different text based on the situation. Is the player low on health? The NPC could say "You look sick!", is the player on a quest? The NPC could say "I hope you've killed those pesky Goblins!", has the player just saved someone's life? They could say "Wow, thanks for saving me!"

I will probably never use such complicated trees, and my current system could pass for this game as it's only a Castlevania-esque platformer. But it does me no favours, and while it has taught me a lot, is a huge bottleneck not only for creating dialog, but for my event system (flipping switches, opening doors with keys etc.) which works very similar to the above.

I have researched dialog trees, but they're all in the context of LUA/C++ which I obviously can't use. I'm pretty sure Godot supports XML but I don't think it can read XML files in the usual way — in that XML is specifically just a format for saving scripts or prefabs. I have a Config File system which can store any kind of variable or dictionary, and a surprisingly powerful scripting language that can do just about anything that Python can do.

I guess the best way to describe my limitation from my point of view is that I don't know how to create a system where entities or interactive objects behave differently while still using the same script. Obviously, there are other factors, and dozens of ways around it, but I really really really need a push in the right direction. Please give me some logic advice, or ways that you tackled similar issues. Thank you so much for taking the time to read this.

Share this post


Link to post
Share on other sites
Advertisement

if the engine you're using is limited to one behavior script per object type, you'll need a script and object type for each desired behavior. if you want 100 different npcs, you'll need 100 different scripts and 100 different types.

 

if the scripting language has the power to query an instance of a type for instance specific data such as an ID #, and can do branching logic on that value, you can use a single branching script for all instances of a type. the script would use the instance ID to figure out which NPC its was controlling. from there, hopefully the scripting langue is powerful enough for you to figure out where that npc is, whats going on, and thus what they should say.  this would basically fold your 100 scripts into one big branching monster script, but it would eliminate redundant lines of script code, IE having the same lines of code in 100 scripts. so it would be somewhat easier to maintain.

 

if you can't do a branching script, there's still the possibility of making a script generator. you would give it a list of high level behaviors, and it would generate the script code for them. a slightly faster way to generate and maintain 100 scripts.

 

a variation on that would be to have script code snippets for each behavior, and use batch files with the the copy+ command to concatenate them into whatever kinds of scripts you need. 

 

obviously, any script will somehow need to know which NPC its controlling, via some ID info its passed or looks up, or by the object type (for one type = one script).

Share this post


Link to post
Share on other sites

if the engine you're using is limited to one behavior script per object type, you'll need a script and object type for each desired behavior. if you want 100 different npcs, you'll need 100 different scripts and 100 different types.

 

if the scripting language has the power to query an instance of a type for instance specific data such as an ID #, and can do branching logic on that value, you can use a single branching script for all instances of a type. the script would use the instance ID to figure out which NPC its was controlling. from there, hopefully the scripting langue is powerful enough for you to figure out where that npc is, whats going on, and thus what they should say.  this would basically fold your 100 scripts into one big branching monster script, but it would eliminate redundant lines of script code, IE having the same lines of code in 100 scripts. so it would be somewhat easier to maintain.

 

if you can't do a branching script, there's still the possibility of making a script generator. you would give it a list of high level behaviors, and it would generate the script code for them. a slightly faster way to generate and maintain 100 scripts.

 

a variation on that would be to have script code snippets for each behavior, and use batch files with the the copy+ command to concatenate them into whatever kinds of scripts you need. 

 

obviously, any script will somehow need to know which NPC its controlling, via some ID info its passed or looks up, or by the object type (for one type = one script).

This reply was very constructive. This scripting language is more than powerful enough to test for an ID (or any variable) of a an NPC and can have virtually limitless scripts to reference from, or call functions from. Are you saying that I should create a separate script (such as a singleton) that will always be running, or listening, and for the NPC script to pass its parameters to a function on the external script signaling it the details it needs to make things happen?

I guess my question is, how could I use that external script to manage 100 different behaviours for 100 different NPC's when they all have very different conditions? Or am I missing the point?

Share this post


Link to post
Share on other sites
I guess the best way to describe my limitation from my point of view is that I don't know how to create a system where entities or interactive objects behave differently while still using the same script. Obviously, there are other factors, and dozens of ways around it, but I really really really need a push in the right direction. Please give me some logic advice, or ways that you tackled similar issues. Thank you so much for taking the time to read this.

 

 

Here's how I'd do it. In your NPC node, export a new variable called "conversation" (or whatever you like).

export(String) var conversation

Then when you add that node to your scenes, you'll see the Conversation variable in the object property panel. You can type in the name of your conversation config file in that variable for each NPC node in your scene. Importantly, you'll be able to type in a different file name for each node. Each NPC could have their own separate conversation file.

 

Then, in your NPC node, you just need to script it to load the config file assigned in the Conversation variable. That way, each NPC can use the same code, the same functions for parsing the conversations, but each NPC will have different conversations based on the config file. One NPC node, one NPC script, but many conversation files.

 

You can use the export keyword in a lot of different ways. For example, you can have an Enemy node with a single behavior script. But you can export variables for Speed and Turning Radius that allows you to have many different types of enemies all with different attributes from that one node.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement