2 Replies - 1517 Views - Last Post: 06 November 2012 - 01:55 PM Rate Topic: -----

#1 BornAfterTV  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 05-June 12

Dialog with XML and XNA - How To? (High Level)

Posted 28 October 2012 - 03:46 PM

Hi All,

I've been making a Final Fantasy 2 clone. I use XML for the tiles in the game, in that I graphically build the maps in a Windows Application and save that work in XML, the game then reads in the XML and draws the maps.

What I need to do next is get NPC Conversations/Dialogs (and maybe quests) built. After reading on the net XML seems to be a solid way to approach this and as I use it already that's what I want to do. The issue is at a conceptual level how Dialog, Dialog Conditions, Responses and XML work.

My current Tile XML implementation is basically a Template/Class(that has nothing in it but a list of variables really) to Serialise the data, I use the same Template/Class to De-serialise the XML and then store each iteration of the data into a list of X Class. (Where X is the actual Class the game uses). I'd then reference the actual game Class(or list of) when I wanted to apply logic in the game.
EG: MapData.cs - would be the Template Class for XML and Map.cs would be the full Map class the game uses, I would have a list<> of Map if the XML contained many Maps.

For Dialog/Conversations I can see how a 1 way conversation from NPC to Player would work as that is just a list of strings. But I don't get how conditional conversations would work. I've seen what looks like logic IN the XML, maybe I need to know more about that. But I've also seen posts of people that store values(strings) in the XML that are used to build logic on, in the game.

Any help appreciated~!

Is This A Good Question/Topic? 0
  • +

Replies To: Dialog with XML and XNA - How To? (High Level)

#2 Kilorn  Icon User is offline

  • XNArchitect
  • member icon



Reputation: 1356
  • View blog
  • Posts: 3,528
  • Joined: 03-May 10

Re: Dialog with XML and XNA - How To? (High Level)

Posted 29 October 2012 - 05:56 AM

I found this tutorial after doing a quick search. It would explain things a lot easier than I could try to explain them to you and appears, although I have not done this tutorial, to fit your needs quite well and does a great job at explaining things from what little I have read of it.
Was This Post Helpful? 0
  • +
  • -

#3 BornAfterTV  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 05-June 12

Re: Dialog with XML and XNA - How To? (High Level)

Posted 06 November 2012 - 01:55 PM

Thanks Kilorn,

This person actually has a version 2 of this project and that was exactly what I was after. I've now created my own version of this and implemented it into my game. I wasn't after the code but the design concepts.

It turns out the XML part is quite simple, basically a series of strings and indexes that the conversation manager will use to determine what string to display. The conversation manager does a number of other cool things like typing effects and use of avatars plus constraining the text into the text box etc but the XML part is straight forward.

I have a really solid base to roll out XML to all the other game elements (and have started by making an NPC editor and now my game reads XML for NPCs too). I'll do this for everything from Enemies, Characters to Items.

Now off to a part of the forum that could help me with Windows Form Controls. There must be a control that is perfect for holding a list of vectors2's (or a multi-array of int) :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1