What's a good way to implement npcs and fights in an RPG game?
-
Hi, i am working on an rpg game and don't have clear ideas about implementing npcs, dialogs, fights, mobs and stuff like that since i have never done this tuff before, so which is a good and efficient way of doing that?
My game is a text mode graphics top down rpg game, i have implemented features reguarding the map, like warping to other maps and map draing based on some hardocded assets.
For the fights i want something like in the style of undertale, with options to either fight or end the thing pacefully, but i don't know how to represent or implement them in a good way in the code, i'd really like something which requires minim code and with a modular strucure that can adapt to the characteristics of each mob.
For the npcs, just having dialogs and dialog options which can trigger map changes (like going to another map or map coordinate) or cutscenes is what i need.
This is enought to make the game and bring it to completition, or at least to have a complete demo for you to enjoy.
-
Isnt it possible to use this assets.As you may no i am not a game developer.But if you say not graphical.look for ascii art
-
@petermeisenstein I mean just making the code, not the estics, since for those i just need to hardcode some strings, my problem is representing the mobs and npcs in memory and having a good implementation for the fights and the dialogs
EDIT:
To be clear i am not using any assets packs, i am just using strings and text drawing features of fuze -
Oh sorry.Can you make them in a list ?
-
@petermeisenstein I am just looking for a generic way of implementing them since i don't know which npcs, mobs and fights i will end up using in the game
-
I think you may find what you need in the 2 vid tutorials on structures
-
@ITzTravelInTime You will need a structure to store the mobs and npcs in memory with the properties you'll need. You could define a structure type and use it for everything, even if you don't end up using some of those properties, so something like:
struct actors_type int state int type float xpos float ypos string name array stats array inventory array moves endstruct
You could even declare things like the
moves
array to be a struct in itself, for example:struct moves_type string name float physDmg float magDmg float mpCost float accuracy endstruct
Then, the "moves" property in your actors structure would be this predefined structure:
struct actors_type int state int type float xpos float ypos string name array stats array inventory moves_type moves // <----- declaring the array struct using the moves_type keyword now means this property itself has the properties of our moves_type struct endstruct
You could then do:
actors_type enemies[10]
And you could set the moves for them with something like:
enemies[0].moves[0].name = "Slash" enemies[0].moves[0].physDmg = 80.00
Let me know if there's anything I've said here which needs further explanation!