Best way to have Dialog in your game?

Player_EPlayer_E Member, PRO Posts: 604
edited November -1 in Working with GS (Mac)
Okay, so I was wondering what was the best way to have character speak in your game. What will be the lightest on the usage and keep project size down.

This is how I have it done now, but I have very minimal dialog and when I add more I'm sure this will make the project size blow up.

I have a text box image in my game.
I keep an attribute that tracks where the player is in the conversation.

When player advances in conversation attribute adds 1

The text box has a rule that
When convo progress is 1 "Change to image1"
When convo progress is 2 "Change to image2"
When convo progress is 3 "Change to image3"
and so on

Each image is a new image with new dialog for the conversation.

This keeps one actor for the conversation on the screen, but it uses multiple images that I make for the conversation. For now this is good because I don't have much dialog, but as I build my game further and add more it means more images for dialog. These images range in size from 4kb to 10kb depending on how much text is there.

Anyone have any suggestions on a better way to do this?

*****************************************************
Image Hosted by ImageShack.us

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    4-10kb doesn't seem like that much. But I've never done dialog in a game. So I'm not an expert...
  • Player_EPlayer_E Member, PRO Posts: 604
    thats 4-10kb for each image
    one or two images is not much, but when I plan on having quite a bit of dialog that could add up. Yeah it might not be much more than 1mb total, but I would like to know if there is a better method if one is out there :)

    *****************************************************
    Image Hosted by ImageShack.us
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    You can resume everything in less rules.

    If the attribute that regulate the dialog box is "convo progress" you should have an actor with a rule that change it right?

    In that case create a boolean actor called somethingHappened and set it to false and in that actor along with the rule that change the "convo progress" attribute add a change attribute for somethingHappened to true.

    Then in the dialog box actor make a rule that says:

    When attribute "somethingHappened" is true
    - Change attribute self.Image to "image"..convo progress..".png"
    -Timer after 0.1 seconds Change attribute somethingHappened to false

    That way it change every time the convo progress attribute is changed without the need to constrain any attribute. Also you will have less rules on the dialog box actor.

    Hope that helped, I use this technique a lot also for scores to keep fps up.

    ________________________________
    Icon Pack
  • InLikeFlynnInLikeFlynn Member Posts: 171
    If you're trying to save space you could try setting the color index of your PNG to 8 colors or less. Image>Mode>Indexed in Gimp.

    Also, since there's a minimum file size due to the file allocation table (I think 4kb?) You could try saving a bunch of dialogue on one texture, then move the texture behind a mask to block out the unwanted dialogue.
  • Player_EPlayer_E Member, PRO Posts: 604
    Thanks for the input, I think ill stick with how I do it and go with what your suggesting Mrmeatface and see if I can drop the size of the images.

    *****************************************************
    Image Hosted by ImageShack.us
Sign In or Register to comment.