Sign in to follow this  

RPG Battle Code

This topic is 4842 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

Looking for examples of RPG Battle code. Text base or graphic does not matter. But I am looking for examples that I can moderfy or mutate to use in a C# project. (Code base for examples does not matter either as I am just looking for examples)

Share this post


Link to post
Share on other sites
Quote:
Original post by Mykre
Looking for examples of RPG Battle code. Text base or graphic does not matter. But I am looking for examples that I can moderfy or mutate to use in a C# project. (Code base for examples does not matter either as I am just looking for examples)


Hi Mykre,

I think you might give some little information about what you want to achieve. Actually, battle code (as I see it) can be fairly simple ("throw a dice, hit test, do damages, move to next thing") but you can add everything you want (attack of opportunity, multiple action timing, different types of attack and so on).

It also depends on the game type: do you want to implement a turn-by-turn combat system (as in nearly all the japanese RPG) or do you want to implement realtime battles (a la diablo) ?

As for the code itself, it is rather simple, since the main algorithm itself is rather simple (basically, the 'throw a dice' stuff I said earlier).

Regards,

Share this post


Link to post
Share on other sites
yup what he said [wink]
you'll find lots of throw the dice rpg stuff in that second link. I'd advise starting with simple weapon based attacks and then you can add magic and maybe go as far as add character traits such as charisma etc.. to the general simulation and maybe even the battles...

Share this post


Link to post
Share on other sites
Sorry should have Added more information.

The program I am working on is tilebased, with network support. Hoping to be Large multiplayer. Most of the work should rely on playability and not focusing on the graphics side of things.

This project is to help me work on AI, and storage systems of the information. I am hoping to increase the AI Models so that the system can learn and react. I know that this is a big project, and shouldn't be taken lightly but with the storage systems, I am a DBA and Database Developer and will be using those skills to evolve the data used by the AI System.

What I was thinking of was recording the wins and losses of the NPC's and then running process on the recorded database at regular times (Indepentant of the Game Engine) and adjust the scripts for the NPC's as needed.

Looking at the links that where supplied to the GURPS system, this might be what I need.

Share this post


Link to post
Share on other sites
Hi again,

Since you want to have a multiplayer thingy, you'll probably want to avoid turn-based battle - what is the state of the universe during the battle ?

I suggest you to

a) think about the gameplay
b) create the offline algorithm (ie the game battle system)
c) implement the algorithm in a console program (more difficult but more configurable : implement it in a gui based program that will let you play with the battle system constants). This will allow you to easily balance the system
d) implement this in your game

A good design should allow you to integrate the code you created for the console program into your game :)

In addition to the gurps resource, you may have a look to WotC's "d20 system document reference" (SRD 3.5) which describes the gameplay of the Dungeon & Dragon game. It is located here. I didn't look at the recent gurps system but I remember the previous edition of GURPS was a lot harder to understand than the d20 system.

Regards,

Share this post


Link to post
Share on other sites

This topic is 4842 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this