Jump to content
  • Advertisement
Sign in to follow this  
Nicholas Kong

How to handle Dialogue Text for NPC and Quest [Java]

This topic is 2105 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

Code is in Java. The project is a small scale single player role playing game for PC.

 

How to handle Dialogue Text for NPC and Quest? Are dialogue for NPC and Quest handled differently?

 

At the moment, this is how it is currently handled. Text is passed through as a parameter during the creation of NPC and Soldier object.

 

For map screen 0 of the game (0 being the first map of the game)

public Screen0(double x, double y) {
super(x, y);
// TODO Auto-generated constructor stub
anim = new Animation(animations); 
String text = "My cat is in danger! Please I need your help!";
soldier = new NPC(new Soldier(getWidth() - (getWidth() * .66)  , (getHeight() - (getHeight() * 1.2))  ),text);
}

Screen 1(1 is the second map of the game)

public Screen1(double x, double y) {
super(x, y);
// TODO Auto-generated constructor stub
anim = new Animation(animations); 
String text = "I'm in need of limber. ";
soldier = new NPC(new Soldier(getWidth() - (getWidth() * 1.5)  , (getHeight() - (getHeight() * 1.2))  ), text);
}
Edited by warnexus

Share this post


Link to post
Share on other sites
Advertisement

Dialogues and quests are not the same. Although quests are often given in the course of a conversation, but they may also come from reading bulletins in a town, or materialize as sub-quest when executing a main quest, or … whatever. As such, a quest is a job to be done, has a current state, has conditions which denotes its success (goal of the quest), perhaps also conditions denoting its final fail, defines a reward, and perhaps other things that doesn't came to my mind at the moment. On the other hand a dialogue is a piece of conversation, may transport just facts which must be known by the player, or is simply garnishment for the game, perhaps some needless gossip. Conversation needs to be tracked, too, and hence also has a kind of state.

 

Thinking that dialog and/or quests are just text is wrong. Text is an auxiliary form of expression for both, nothing less but also nothing more.

 

BTW: Maps should be data, perhaps each one owned by an instance of Map, but not own derived classes! The same is true for dialogue and quests and anything else that counts to the assets of the game.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!