Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

TheNerd Tk421

A battle "engine"

This topic is 5456 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
[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...

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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"

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!