I am in the process of converting my game to Slick and taking the opportunity to improve some of the more painful parts.
One thing that was really tough was interactive dialogue. Basically where an NPC says something and the player has 3 phrases to choose from and then the NPC will reply based on which phrase the player chose.
How I do it currently is basically a List of HashMaps of HashMaps. In other words there is a list of all possible conversations:
Player and Bob
Player and Joe,
Player and Sally
… and so on.
The conversations are HashMaps where the player’s phrase is a key to pull out the response from the npc. And then the npc’s phrase is the key to pull out the possible phrases for the player to choose from and so on and so on.
I was able to build several interactions but it is really tough adding new conversations and keeping track of which response is the key for which options and such.
Does anyone have suggestions on improving this?
Thanks.