(subject changed) How to model gun aiming?
"If you are not willing to try, you will never succeed! If you never succeed, are you really trying?"
Grellin
No game using an existing P&P rule system ever had appeal to me, the rules killing gameplay being greatly responsible of that fact.
-* So many things to do, so little time to spend. *-
I''m going to put off using a P&P system for the moment. One of the core items in my game is how to model gunfire. Please read and comment.
How to aim guns?
------------------------------
My gameplay is inspired by a game called xcom. The issue I am facing is how to model aiming. My aim is to let bullets which don''t hit the intended target to continue traveling and cause chaos
The system I currently have is as follows. I''ll begin by discussing aiming along the horizontal plane.
Point blank range
------------------------------
The shooter is modeled as a single point and the target is a 1 metre cubed box five metres away.
When a shooter aims at a target at this distance, the shooter has a very high chance of hitting. The shooter may aim a little to the left or right. The extreme left is given the number -10, dead centre the number 0 and the extreme right the number 10.
Using random numbers, the shooter will hit if a number between -9 and 9 comes up, so there is an 18 in 20 chance of hitting.
The effect is that there is an arc in front of the shooter that the shooter aims within.
Just above point blank range
------------------------------
Now picture the target being moved so that it is 10 metres away from the target.
The shooter has the same arc as when at point blank range to aim within but because the target is further away the arctual arc required to hit is smaller.
The extreme left is still -10, dead centre the number 0 and the extreme right the number 10.
This time however, the shooter requires a number between -5 and 5 to hit.
Conclusion
------------------------------
The result of all this is that bullets are given a direction. For example if the shooter has the random number -5, this indicates a position on the arc and the bullet will travel that way.
In addition, there can be modifiers that help make the targeting arc smaller increasing the chance to hit. Modifiers may be from attributes, skills and environmental conditions.
I''ve implemented this in my game already but I have found that units are too in accurate. I have a hunch that different arcs at different ranges are required to make the game more realistic and fun.
Any comments are most appreciated.
I think you''ve just discovered why the dice system works (The skewing towards the centre actually helps). What you need is to randomise your aim in such a way that you get the average value (0) much more often than either of the extremes (10 or -10). You will probably find that this issue will reoccur in many different calculations in your game.
For instance, should a bullet that makes an impact have an equal chance of doing 5% of damage as it does of doing 50%? So a player never knows if it''s going to take two shots to kill a particular enemy or 20! It''s more reassuring to the player to know that it usually takes 5 shots to kill this enemy but if I''m really lucky it could take two (and if really unlucky it could take as much as twenty). Many CRPGs do something similar.
---------------------------------------------------
There are two things he who seeks wisdom must understand...
Love... and Wudan!
If you need a really easy system idea, just go with the boolean type, where you either have the skill or you don''t, and you figure that into the gameplay.
if ( PlayerHasSkill( Lockpicking ) ) { OpenDoor(); }
else if (random(1,6)<= Dexterity) { OpenDoor(); }
else { Fail(); }
Ouch that was a hit.
quote:
2.7% 5.5% 8.3% 11.1% 13.8% 16.6% 13.8% 11.1% 8.3% 5.5% 2.7%
When you see something with % postfix that wouldn''t be mod, hit yourself to the face then again. Then revrite it to the number/number syntax. This is a rule that, if you have more serious project should be fulified where is at least a little possible. (it might sound harsh, but it''s my experience)
First at all. GURPS used 3 dice roll ADDED together for a reason. To increase common cases. When you have roll 1-20000 where are all outcomes equally possible, you have rather the instant kill system than a reasonable system. This system would be pretty hard to scale after few years, so you''d have problem with addition of new features. (Don''t even say it could be solved by rewriting few classes. Zandgbad, Moria, or other programs are prime example that it could be difficult task.)
3 dice 18-3 is 15 divided by 2 is 7.5 round up you''d have 8 add 3 is 11 so most common case is 10 to 11 becose you can''t roll 10.5 on three 6 sided dices.
Linear pseudorandom generators don''t scale well unmodified. You should remmember it if you''d do some table. What for? You could notice that the fourth number 7 is more common than rest of entries. When you are designing something with pseudorandom, or quasirandom generators on the computer, you should be REALLY careful to test it well.
To BinhNguyen
Firing at a "point blank" range could end by alien tentackle cuting soldier arm, and second cuting is... you know what. Sometimes souldier could just close eyes and start to shoot with hope he will hit something, then Alien would evade his fire, sidestem and turn him around towards his comrades.
You simply has target that is supposed to be hit and roll if it would be hit, if not result is most likely (you wont believe it if you seen some women shoot) near the target. +-165 degree. If he botched it he have it in his leg. Shaky hands you know. *_*
line of fire ------------| line of difference of shot. simple near object detection could estimate what object should check if it dodged.
BTW I think there is some remake of that old game. It has even something like 3D map. You should google for it, and/or try to help them/learn from code. (mean that unofficial remake not that commercial silliness that appeared not long ago)
"When you see something with % postfix that wouldn''t be mod, hit yourself to the face then again. Then revrite it to the number/number syntax. This is a rule that, if you have more serious project should be fulified where is at least a little possible."
I don''t quite understand those three sentences.
"When you have roll 1-20000 where are all outcomes equally possible, you have rather the instant kill system than a reasonable system."
What do you mean by an instant kill system and a reasonable system?
The comment about the soldier and the alien is pretty cool
"simple near object detection could estimate what object should check if it dodged."
I''ve got a bounding box around the target and the target is deemed hit if the bullet goes inside the bounding box. Is this what you mean?
Thank you to everyone who has replied.
PS. I''ve uploaded alpha002.zip where aiming is randomised.
---
Today, is a good day to code.