Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Simple duel simulator

Author
Message
Sardine
19
Years of Service
User Offline
Joined: 5th Sep 2005
Location: U K
Posted: 8th Mar 2006 19:59
All I am looking for is some information on how to create a relatively simple text program to simulate a duel like a couple of gladiators or two knights slogging it out against one another using data input added to randomised numbers. I can't figure out how to write this program, to be honest.

I know there must data to work with like initiatives and strikes and damage added to which is a random number compared with the opponent. A < > = is neccesary for each round of course and then any modifiers comparing weapons.

Is there any help for text only anywhere? Sadly the book beginners guide introduces the concept but doesn't really reveal the whole process as far as I can see.

thanks for your time.
Gil Galvanti
19
Years of Service
User Offline
Joined: 22nd Dec 2004
Location: Texas, United States
Posted: 8th Mar 2006 21:00
what is it exactly that you don't get how to do?

Pirates of Port Royale:
http://www.popr.gwgaming.net (Temporarily Disabled, We Apologize for the Inconvenience)
Live the life.
Sardine
19
Years of Service
User Offline
Joined: 5th Sep 2005
Location: U K
Posted: 8th Mar 2006 21:13
Quote: "what is it exactly that you don't get how to do?"


I need the sort of format to process. For example how to determine who gets first strike based on stats, then a parry attempt and damage reducing hit points.

Way I see it I need to input data for first, parry etc with a random number and the program compute comparisons. IF A strikes first then B attempts to parry, again random number.

So the program looks like maybe:

Data entries (speed, parry, strength, weapon mod etc)

Function
Get A speed + ran
Get B speed + ran
If A > B or < B or + B etc

Then ... Etc.

But I am sure there needs to be functions and things. Basically Im looking for a format that will compute and print each round. So, Print "Knight A strikes Knight B" Knight B Parries etc. I really am at a loss how to organise the program etc. Where do I start?
Geo Kinkladze
18
Years of Service
User Offline
Joined: 8th Mar 2006
Location:
Posted: 8th Mar 2006 21:19
I'd suggest you get a piece of paper and a pencil and plan your overview, something like this:

PvP Combat simulator
Player chooses his class (Knight, Barbarian etc)
Player chooses armour
Player chooses weapons
Fight begins...
Loop
Player chooses move (Slash, stab, guard, feint)
Results computed
Check for death
Redo

With that summary, then go into detail on each line, for example what does the choice of class affect, type of armour and weapon etc. This should give you an idea of what variables you will need to set up at the start.

Hope this helps
Tinkergirl
21
Years of Service
User Offline
Joined: 1st Jul 2003
Location: United Kingdom
Posted: 8th Mar 2006 21:27
I think you're stuck on two different problems:

Firstly, you're trying to work out a combat system with the appropriate stats, skills, weapons and moves.
Secondly, you're looking to make a program that will run through this combat system and show you the results.

I'd advise that instead of going straight in for a complex combat system, you first try to set up a system where you have a PlayerA and PlayerB and they take turns. (Might want to put a 'wait key' between turns.)

Pseudocode:


As simple as that setup would be, it would show you two entities taking turns over many 'rounds'. It's only a short step from there to keep a variable for each player for their 'hitpoints' and subtract the damage from that.

Try something simple like this first, and see about expanding it.

Mind you, if you're more in to the combat theory and how the system might work, look in to pen and paper RPG's (like the D20 D&D system) to see how they handle turns, stats, first strike, parrying and other things. They eventually break it down to numbers, but pen and paper RPGs are a good source of combat system inspiration.
Sardine
19
Years of Service
User Offline
Joined: 5th Sep 2005
Location: U K
Posted: 8th Mar 2006 22:38
Hello Tinker girl

Thanks,

I'll mess with this then. I have worked out a combat system, and am familiar with the PnP style in RPG. I have spent the evening working the combat out on Excel 2003 so I know what I want the finish to be. I'll mess around with your little program and hopefully soon in the next few weeks might be able to post the whole thing.

Maybe I am thinking the prgram script is more complicated than it is.

Login to post a reply

Server time is: 2024-09-24 17:35:36
Your offset time is: 2024-09-24 17:35:36