A battle "engine"
I was trying to make an RPG...an i want to make a battle "engine"(basicly C++ header files) for battle... it calculates HP, weapon damage.. monster HP, monster weapon damage... armor... stuff like that.. how would i do this?
[Rant about people who can''t be bothered to learn coding and wants every thing handed to them]
Try somthing like this:
in ActorObject:
ActorObject.Strike( *ActorObject player )
{
die d20 = new die(20);
if ( this->Atack("Long Sword") + d20 >= player->getArmorClass("Slashing") )
{
die d8 = new die(8);
player->doDamage(this->getStrength() + d8);
}
}
or what ever....
/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
Try somthing like this:
in ActorObject:
ActorObject.Strike( *ActorObject player )
{
die d20 = new die(20);
if ( this->Atack("Long Sword") + d20 >= player->getArmorClass("Slashing") )
{
die d8 = new die(8);
player->doDamage(this->getStrength() + d8);
}
}
or what ever....
/Please excuse my bad spelling - My native language is binary not english
|Visit me
\Take my advice - I don''''t use it...
WEll you can see the VERY start of mine in a that post of mine. too bad it doesnt work HAHA burn, but mostly to me What i have is mostly just loading the ascii graphics and letting you move your cursor, i havent even really got to the battle part. Its about 4 lines of actual battle code.
__________________________________________________________________________________________
"yuo have it all wrong. admiralbiunary is me not the other way reorubnd poppet. just becuase hea was here first doesnt meean hes any mopre valid than me yuo rassit pigf." YodaTheCoda
__________________________________________________________________________________________
"yuo have it all wrong. admiralbiunary is me not the other way reorubnd poppet. just becuase hea was here first doesnt meean hes any mopre valid than me yuo rassit pigf." YodaTheCoda
There is a really good solution to this problem!
Look in "AI Game Programming Wisdom" or "Game Programming Gems" for an article by Steve Rabin. It''s called "A robust generic AI engine" or something in "Game Programming Gems".
I don''t think it''s avalible on the net. However, if you can''t find the book at a library or something, search for "finite state machines" or "FSM"..
----------------------------------------------
Petter Nordlander
"There are only 10 kinds of people in the world. The who understand binary and those who don''t"
Look in "AI Game Programming Wisdom" or "Game Programming Gems" for an article by Steve Rabin. It''s called "A robust generic AI engine" or something in "Game Programming Gems".
I don''t think it''s avalible on the net. However, if you can''t find the book at a library or something, search for "finite state machines" or "FSM"..
----------------------------------------------
Petter Nordlander
"There are only 10 kinds of people in the world. The who understand binary and those who don''t"
Well, I''m gonna be doing the same soon, and I can think of a few things it''ll need.
Either ATB or Turn-based combat system (calculates who''s turn it is etc)
Stat system to alter the player/enemy HP/MP etc, depending on things like attacks, spells, poison etc.
Something to manage animation of characters/enemies based on moves etc
Either ATB or Turn-based combat system (calculates who''s turn it is etc)
Stat system to alter the player/enemy HP/MP etc, depending on things like attacks, spells, poison etc.
Something to manage animation of characters/enemies based on moves etc
Discouraging comments:
I''d hold off on anything involding "RPG" or "engine" until you figure out what header files are
A battle system is a pretty complex task. It would involve almost every class related to your player, including his weapon object, armor object, stats. You''d need a timer, the enemy class, the enemy AI, the enemy''s weapon/armor objects, magic classes, death mechanics. And that''s all before you can concentrate on the battle system itself...how battles start and end, determining what enemies are in the battle (if it''s a final fantasy type encounter system), etc etc.
Start small!
I''d hold off on anything involding "RPG" or "engine" until you figure out what header files are
A battle system is a pretty complex task. It would involve almost every class related to your player, including his weapon object, armor object, stats. You''d need a timer, the enemy class, the enemy AI, the enemy''s weapon/armor objects, magic classes, death mechanics. And that''s all before you can concentrate on the battle system itself...how battles start and end, determining what enemies are in the battle (if it''s a final fantasy type encounter system), etc etc.
Start small!
quote:Original post by TheNerd Tk421
I was trying to make an RPG...an i want to make a battle "engine"(basicly C++ header files) for battle... it calculates HP, weapon damage.. monster HP, monster weapon damage... armor... stuff like that.. how would i do this?
You''re kidding, right? Look, I realise you''re new but... god you''re naive if you believe there''s a short answer to this question.
Something that i am also currently working on. All i can say is that it''s not something that is going to be done overnight.
I expect it to take atleast 50hrs of programming to reach a playable state. This is after i have done most of the basic game engine which supports static/animated meshes, and other things which need to be reused in the battle engine.
Some pointers though.
You would need some sort of menu to control the choices the user makes.
The menu should have access to the player Object which contains inventory info, spells info, hp, mp and other attributes of the player.
The menu alone should take a considerable amount of time since u would need to get all that info onto the menu space when it is accessed.
Then u would need atleast a monster object. The monster would have a number of attacks which it can perform at random.
You would need to get into math to find out how the character is going to move in the direction of the monster to reach the monster.
Handling animations.
Handling dmg done, char lvl, exp, items, etc..
Probably millions of other things which i cant think of right now. No easy task, and its going to take a considerable amount of planning.
I expect it to take atleast 50hrs of programming to reach a playable state. This is after i have done most of the basic game engine which supports static/animated meshes, and other things which need to be reused in the battle engine.
Some pointers though.
You would need some sort of menu to control the choices the user makes.
The menu should have access to the player Object which contains inventory info, spells info, hp, mp and other attributes of the player.
The menu alone should take a considerable amount of time since u would need to get all that info onto the menu space when it is accessed.
Then u would need atleast a monster object. The monster would have a number of attacks which it can perform at random.
You would need to get into math to find out how the character is going to move in the direction of the monster to reach the monster.
Handling animations.
Handling dmg done, char lvl, exp, items, etc..
Probably millions of other things which i cant think of right now. No easy task, and its going to take a considerable amount of planning.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement