Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (480)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (546)
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 1209 times)
0 Members and 1 Guest are viewing this topic.
Offline StonePickaxes

JGO Coder


Medals: 4
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...

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...

1  
2  
3  
4  
5  
<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: 128
Projects: 4
Exp: 3 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.
Online 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.

Myomyomyo.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

atombrot (20 views)
2014-08-19 09:29:53

Tekkerue (21 views)
2014-08-16 06:45:27

Tekkerue (21 views)
2014-08-16 06:22:17

Tekkerue (12 views)
2014-08-16 06:20:21

Tekkerue (19 views)
2014-08-16 06:12:11

Rayexar (55 views)
2014-08-11 02:49:23

BurntPizza (37 views)
2014-08-09 21:09:32

BurntPizza (28 views)
2014-08-08 02:01:56

Norakomi (35 views)
2014-08-06 19:49:38

BurntPizza (64 views)
2014-08-03 02:57:17
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!