25.12.2012 Views

Ultimate Game Design : Building game worlds

Ultimate Game Design : Building game worlds

Ultimate Game Design : Building game worlds

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Hitting<br />

Again, you might use a GUI tool here to tweak values, or you might make edits<br />

directly into a script like this one:<br />

// JavaScript sample for "fielding" edits<br />

function processOutfielder(outFielder) {<br />

if(outFielder.neareastBall()) {<br />

outFielder.seekBall(20); // 20 is a "tweakable" range<br />

}<br />

if(outFielder.ballRadius(5)) { // Is outfielder within 5 units?<br />

outFielder.doCatch();<br />

}<br />

if(outFielder.hasBall()) { // caught ball<br />

// specify max range of this player as "60"<br />

outFielder.throwToNextPlayer(60);<br />

}<br />

}<br />

Hitting in baseball <strong>game</strong>s is a matter of determining a thin balance between several<br />

forces. You can’t make hitting too easy, but you can’t make it too hard. If you feel like<br />

you must err due to unavoidable circumstances, do it toward the player’s favor. It’s<br />

better to create a slugger than a frustrated player who throws your <strong>game</strong> away in disgust.<br />

This isn’t just true of dialing in hitting behavior, either, as this kind of mental approach<br />

applies just as well to many other <strong>game</strong> genres. Believe me, I’ve known many who get<br />

some sort of thrill out of stupefying a player. I have never understood this kind of<br />

thinking. Here are some play factors to consider for building up hitting behavior:<br />

� Ball scale The size the ball should increase as it gets closer to you.<br />

� Swing speed How fast a hitter can swing, by body type. Larger players<br />

tend to swing slower, but with more force if contact is made.<br />

� Swing arc Hitter swings are not perfectly parallel with the ground.<br />

The swing arc can help set the frequency of ground balls versus flies.<br />

� Bunt speed How fast a player sets up for bunt contact.<br />

� Ball angle How much influence the angle of the ball leaving the bat<br />

has on hit outcomes.<br />

� Foul tip percentages How often foul tips into the catcher’s mitt occur.<br />

� Foul factor Adjust to increase or decrease foul numbers.<br />

C H A P T E R 6<br />

157<br />

Scripting Action Events

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!