Designing a dialog system?

Discuss game development design and post your game ideas

Post » Mon Nov 02, 2015 3:25 am

I'm trying to design a dialog system and I am thinking about the structure for the data. I want to make sure I can cover a wide array of possibilities, but I'm unsure if I'm on the right track.
This is what I have currently in xml:
Code: Select all
<game>

<layout id='layout 104'>
   <interaction id='0' with='1'>
      <condition prerequisites='none' disqualifiers='boughtFarm'>   
         <speaker id='npc' pos='right'>Hello, welcome to the farm.\nThe place is a bit old.</speaker>
         <go to='menu' value='0' />
      </condition>
      <condition prerequisites='boughtFarm' items='farmDeed'>
         <speaker id='npc' pos='right'>Congratulations on your new- I mean, old farm.</speaker>
         <event action='createcondition' value='welcomeFarm' />
      </condition>
   </interaction>
   
   <menu id='0'>
      <item disqualifiers='dontMind' goto='1'>I don't mind.</item>
      <item disqualifiers='howOld' goto='2'>How old is it?</item>
      <item prerequisites='howOld' goto='3'>This place is too old.</item>
      <item prerequisites='howOld' goto='4'>A place with some history can be interesting.</item>
   </menu>   
   <menu id='1'>
      <item prerequisites='(money>=5000)' goto='5'>I would like to buy it.</item>
      <item goto='6'>I'll think about it.</item>
   </menu>
   
   <interaction id='1' with='1'>
      <speaker id='player' pos='left'>I don't mind.</speaker>
      <speaker id='npc' pos='right'>Great!\nWould you like to buy it?\nIt costs 5000 dollars.</speaker>
      <event action='createcondition' value='dontMind' />
      <go to='menu' value='1' />
   </interaction>
   
   <interaction id='2' with='1'>
      <speaker id='player' pos='left'>How old is it?</speaker>
      <speaker id='npc' pos='right'>It's about 100 years old.</speaker>
      <event action='createcondition' value='howOld' />
      <go to='menu' value='0' />
   </interaction>

   <interaction id='3' with='1'>
      <speaker id='player' pos='left'>This place is too old.</speaker>
      <speaker id='npc' pos='right'>Yeah, it requires a lot of work.</speaker>
   </interaction>
   
   <interaction id='4' with='1'>
      <speaker id='player' pos='left'>A place with some history can be interesting.</speaker>
      <speaker id='npc' pos='right'>Not much happened here.</speaker>
   </interaction>
   
   <interaction id='5' with='1'>
      <speaker id='player' pos='left'>I would like to buy it.</speaker>
      <speaker id='npc' pos='right'>Okay, that will be 5000 dollars.</speaker>
      <event action='giveMoney' value='5000' />
      <speaker id='npc' pos='right'>Thanks! Here's the deed to the farm.</speaker>
      <event action='getItem' value='farmDeed' />
   </interaction>
</layout>

Perhaps someone who has more insight into this sort of thing can lend me some tips/advice. I'm not sure if I like what I have.
B
43
S
19
G
65
Posts: 1,105
Reputation: 37,949

Return to Game Development, Design & Ideas

Who is online

Users browsing this forum: No registered users and 0 guests