Dragon Creek Weekly Update #3


I managed to get the feeding animation working this week, as well as food preferences by breed and personality. For example, Lung enjoy coffee, but dislike cheese. A serious dragon will like foods like salad, but dislike childish foods like candy. 


The way this works is when I feed an item, the dragon checks the name of the food, and then takes that food and enters it into a massive switch statement. Are you feeding me "Ham"? Then go to case "Ham". Nested inside that switch statement are two smaller switch statements that check personality and breed. That way I don't have to write what EVERY personality and breed thinks of EVERY food. I have 10 breeds planned, 10 personalities, and 21 foods (medicine is considered food). If I coded every behavior, I would be coding 420 preferences. Not ideal. Instead with the nested switches I can just code the preferences and ignore the neutral behaviors. Generally a breed has 1 hated food and 1 loved food, and a personality has 2 or 3 liked foods and 2 or 3 disliked foods. This reduces coding preferences to at max 80 which is much nicer. 


I found a bug where when reading a dragon's seed(all of its birth data) the seed would cut off the personality. This was because I miscalculated the seed length to 85, when it should be 86. Easy fix. Just changed the seed reader to cut-off at 86 characters and now I don't have an army of "Weird" dragons (personality of 0 indexes to "Weird").


Admittedly I'm not a huge fan off the wyvern and lun feeding animations. The wyv feels too static, and the lung feels too short. I took some animation shortcuts with the feeding animations to reduce the time spent drawing the sub-components and I think it shows. Perhaps when I have time I will redesign the animations, but for now I need to rush into making a stat checking menu, a personality cheecking menu, and sleeping. 

Leave a comment

Log in with itch.io to leave a comment.