Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Proper way to implement vast amounts of character dialogue?  (Read 3183 times)
0 Members and 1 Guest are viewing this topic.
Offline StonePickaxes

JGO Coder

Medals: 5
Projects: 2

Nathan Kramber

« Posted 2013-03-04 19:04:18 »

I've been working on a pretty standard role-playing game for quite a while now. It's coming along nicely, but I still don't have a good solution for a major part of the game: handling large amounts of character dialogue and scripted cutscenes.

The simplest (and least-ideal) solution would be to simply make a new class for each cutscene that contains info on where the camera needs to be looking, who needs to say what, etc etc. This doesn't seem like a very good approach to me.

Another idea would be to have a bunch of XML (or something like XML) files that contain the data.

So, my question to anyone who has tackled this issue in the past: how did you do it? If you haven't done this before, what would you do in this situation?

Thanks a bunch for your time.

Check out my website!
Offline 65K
« Reply #1 - Posted 2013-03-04 20:13:16 »

Take a pencil and paper and write down all kinds of elements a cutscene could be made of, like text block, camera movement, sound, sprites, etc.
Create classes for each type and a common super type or interface.
Identify attributes of each element like text, screen positions, start time, end time, duration, sound name, event listeners for starting and stopping, etc.

Put a cutscene class together, give it a list of elements (of the element base class), a play method, timer. The cutscene does not know individual element classes.
Think of the environment that cutscene elements need to know to be properly run. Pass it as parameter into the play methods.
Add a timer or event listeners to step from element to element.

Then, after it works, you could think of how to compose, load and save cutscenes. But that is a different task, do not mix it up.

If that is what you meant...

Lethal Running - a RPG about a deadly game show held in a futuristic dystopian society.
Offline tyeeeee1
« Reply #2 - Posted 2013-03-04 22:06:16 »

You could save it in text files and load them when needed.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline LaughingSeraphim

Junior Newbie

« Reply #3 - Posted 2013-03-04 22:13:57 »

Again I end up agreeing with 65k.

Games like TA:Kingdoms, if i recall correctly, used something like a custom INI file for scripted scenes and events. Xml is the rage now I suppose, but dude(?) is right. I would handle breaking up the elements and methods first, then worry about storage.

Please keep us posted as well, I am honestly a little curious myself, as I will eventually need to do something similar.
Offline ctomni231

JGO Wizard

Medals: 99
Projects: 1
Exp: 7 years

Not a glitch. Just have a lil' pixelexia...

« Reply #4 - Posted 2013-03-04 22:21:17 »

If the cut scene needs to be exact, like a movie, I'd just look into YUNPM and try to make a full movie cut scene using the normal video tools.

If it is one of those interactive cut scenes, then I'd handle it the way movie scripts are handled in code. I'd write all the dialogue for the cut scene in one XML file stating the characters as the tags. Then, I'd add the cues and camera positions to the specific points in the file where characters need to move, and the camera angle needs to change. Kind of like this code snippet...

<Barbera> "You can't let that kind of thing get to you!" </Barbera>
<Cathy movex=17 movey=18></Cathy>
<Barbera movex=13 movey=14> "He doesn't know anything..." </Barbera>
<Camera movex=18 movey=19 movez=9 rotate=0.15></Camera>
<Cathy rotateHead=0.15> "I know he seems inconsiderate sometimes, but I can sense a change in him." </Cathy>

Disclaimer: This is a mock up example. It hasn't really been tested so don't ask what the numbers mean Tongue

Offline Jimmt
« League of Dukes »

JGO Kernel

Medals: 167
Projects: 5
Exp: 6 years

« Reply #5 - Posted 2013-03-04 22:43:44 »

You could save it in text files and load them when needed.
Literally everything is a text file. And he's asking for specifically how to store things inside the text file.
Offline theagentd
« Reply #6 - Posted 2013-03-04 23:38:07 »

For a visual novel engine I wrote a complete script language based on Java Reflection. It turned out pretty nicely, although I'm not sure it was worth it when it comes to productivity.

Pages: [1]
  ignore  |  Print  

EgonOlsen (74 views)
2018-06-10 19:43:48

EgonOlsen (55 views)
2018-06-10 19:43:44

EgonOlsen (74 views)
2018-06-10 19:43:20

DesertCoockie (254 views)
2018-05-13 18:23:11

nelsongames (154 views)
2018-04-24 18:15:36

nelsongames (154 views)
2018-04-24 18:14:32

ivj94 (895 views)
2018-03-24 14:47:39

ivj94 (156 views)
2018-03-24 14:46:31

ivj94 (808 views)
2018-03-24 14:43:53

Solater (172 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!