100% found this document useful (1 vote)
21 views

Beginning NET Game Programming in VB NET 1st Edition David Weller - The ebook is ready for instant download and access

The document provides information about various eBooks available for download at ebookname.com, including titles on game programming, ASP.NET, and other subjects. It features links to specific eBooks and mentions the availability of formats like PDF, ePub, and MOBI. Additionally, it includes details about the authors and technical reviewers of the featured book, 'Beginning .NET Game Programming in VB.NET'.

Uploaded by

diyakosaleme
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
21 views

Beginning NET Game Programming in VB NET 1st Edition David Weller - The ebook is ready for instant download and access

The document provides information about various eBooks available for download at ebookname.com, including titles on game programming, ASP.NET, and other subjects. It features links to specific eBooks and mentions the availability of formats like PDF, ePub, and MOBI. Additionally, it includes details about the authors and technical reviewers of the featured book, 'Beginning .NET Game Programming in VB.NET'.

Uploaded by

diyakosaleme
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

Beginning NET Game Programming in VB NET 1st


Edition David Weller

https://ebookname.com/product/beginning-net-game-
programming-in-vb-net-1st-edition-david-weller/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookname.com


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

VB to VB net Craig Utley

https://ebookname.com/product/vb-to-vb-net-craig-utley/

Fast Track VB Net 1st Edition Rocky Lhotka

https://ebookname.com/product/fast-track-vb-net-1st-edition-
rocky-lhotka/

Professional ASP NET 4 in C and VB 1st Edition Bill


Evjen

https://ebookname.com/product/professional-asp-net-4-in-c-and-
vb-1st-edition-bill-evjen/

Global Unions Theory and Strategies of Organized Labour


in the Global Political Economy Routledge Ripe Studies
I Global Political Economy 1st Edition Jeffrey Harrod

https://ebookname.com/product/global-unions-theory-and-
strategies-of-organized-labour-in-the-global-political-economy-
routledge-ripe-studies-i-global-political-economy-1st-edition-
Pulmonary Vascular Disease 1st Edition Jess Mandel Md

https://ebookname.com/product/pulmonary-vascular-disease-1st-
edition-jess-mandel-md/

Terrestrial Global Productivity Physiological Ecology


1st Edition Jacques Roy

https://ebookname.com/product/terrestrial-global-productivity-
physiological-ecology-1st-edition-jacques-roy/

Dermatoscopy in Clinical Practice Beyond Pigmented


Lesions Series in Dermatological Treatment 1st Edition
Giuseppe Micali

https://ebookname.com/product/dermatoscopy-in-clinical-practice-
beyond-pigmented-lesions-series-in-dermatological-treatment-1st-
edition-giuseppe-micali/

Communication Yearbook 31 1st Edition Christina S. Beck


(Ed.)

https://ebookname.com/product/communication-yearbook-31-1st-
edition-christina-s-beck-ed/

100 Questions Answers About Depression Ava Albrecht

https://ebookname.com/product/100-questions-answers-about-
depression-ava-albrecht/
Gender Issues in African Literature 1st Edition Chin Ce

https://ebookname.com/product/gender-issues-in-african-
literature-1st-edition-chin-ce/
4010fm.qxd 8/20/04 2:33 PM Page i

Beginning .NET
Game Programming
in VB.NET
DAVID WELLER, ALEXANDRE SANTOS LOBÃO,
AND ELLEN HATTON
4010fm.qxd 8/20/04 2:33 PM Page ii

Beginning .NET Game Programming in VB.NET


Copyright © 2004 by David Weller, Alexandre Santos Lobão, and Ellen Hatton
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying, recording, or by any information storage
or retrieval system, without the prior written permission of the copyright owner and the publisher.

ISBN (pbk): 1-59059-401-1

Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1

Trademarked names may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, we use the names only in an editorial fashion and to the
benefit of the trademark owner, with no intention of infringement of the trademark.

Technical Reviewer: Andrew Jenks

Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis,
Jason Gilmore, Chris Mills, Dominic Shakeshaft, Jim Sumser

Assistant Publisher: Grace Wong

Project Manager: Sofia Marchant

Copy Editor: Ami Knox

Production Manager: Kari Brooks

Proofreader: Linda Seifert

Compositor: Dina Quan

Indexer: Rebecca Plunkett

Cover Designer: Kurt Krames

Manufacturing Manager: Tom Debolski

Distributed to the book trade in the United States by Springer-Verlag New York, Inc., 233 Spring
Street, 6th Floor, New York, New York 10013 and outside the United States by Springer-Verlag
GmbH & Co. KG, Tiergartenstr. 17, 69112 Heidelberg, Germany.

In the United States: phone 1-800-SPRINGER, email orders@springer-ny.com, or visit


http://www.springer-ny.com. Outside the United States: fax +49 6221 345229, email
orders@springer.de, or visit http://www.springer.de.

For information on translations, please contact Apress directly at 2560 Ninth Street, Suite 219,
Berkeley, CA 94710. Phone 510-549-5930, fax 510-549-5939, email info@apress.com, or visit
http://www.apress.com.

The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall
have any liability to any person or entity with respect to any loss or damage caused or alleged to
be caused directly or indirectly by the information contained in this work.

The source code for this book is available to readers at http://www.apress.com in the
Downloads section.
4010fm.qxd 8/20/04 2:33 PM Page v

Contents at a Glance
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xv
Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi

Chapter 1 .Nettrix: GDI+ and Collision Detection . . . . . . .1


Chapter 2 .Netterpillars: Artificial Intelligence
and Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .65
Chapter 3 Managed DirectX First Steps: Direct3D
Basics and DirectX vs. GDI+ . . . . . . . . . . . . . . . . .141
Chapter 4 Space Donuts: Sprites Revisited . . . . . . . . . . . .207
Chapter 5 Spacewar! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .245
Chapter 6 Spacewar3D: Meshes and Buffers and
Textures, Oh My! . . . . . . . . . . . . . . . . . . . . . . . . . . . . .271
Chapter 7 Adding Visual Effects to Spacewar3D . . . . . . . .327
Epilogue Taking Your Next Steps . . . . . . . . . . . . . . . . . . . . . .343
Bonus Chapter Porting .Nettrix to Pocket PC . . . . . . . . . . . . . .351
Appendix A Suggested Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . .371
Appendix B Motivations in Games . . . . . . . . . . . . . . . . . . . . . . . . .375
Appendix C How Do I Make Games? . . . . . . . . . . . . . . . . . . . . . . . . .381
Appendix D Guidelines for Developing
Successful Games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .391
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .399

v
4010fm.qxd 8/20/04 2:33 PM Page vii

Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xi
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii
About the Technical Reviewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xv
Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvi
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xvii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xxi

Chapter 1 .Nettrix: GDI+ and Collision Detection . . . . 1


Basic GDI+ Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2
Performing Graphic Operations with a Graphics Object . . . . . . . . . .4
Creating Gradients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7
Collision Detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8
Optimizing the Number of Calculations . . . . . . . . . . . . . . . . . . . . . . . . . .18
Extending the Algorithms to Add a Third Dimension . . . . . . . . . . . .22
The Game Proposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23
The Game Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
The Coding Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Final Version: Coding the GameField Class and
the Game Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .51
Adding the Final Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64
Book Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64

Chapter 2 .Netterpillars: Artificial


Intelligence and Sprites . . . . . . . . . . . . . . . . . . . . . 65
Object-Oriented Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66
Artificial Intelligence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .69
Sprites and Performance Boosting Tricks . . . . . . . . . . . . . . . . . . . . . . . .76
The Game Proposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84
The Game Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86
The Coding Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99
Adding the Final Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .135
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139
vii
4010fm.qxd 8/20/04 2:33 PM Page viii

Contents

Chapter 3 Managed DirectX First Steps: Direct3D


Basics and DirectX vs. GDI+ . . . . . . . . . . . . . . . . 141
DirectX Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .142
3-D Coordinate Systems and Projections . . . . . . . . . . . . . . . . . . . . . . . .153
Drawing Primitives and Texture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .160
The Application Proposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .168
The Application Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .169
The Coding Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .170
Adding the Final Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203
More About DirectX and GDI+ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .205
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .206

Chapter 4 Space Donuts: Sprites Revisited . . . . . . . . . . . 207

Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Space Donuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243

Chapter 5 Spacewar! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245


About Spacewar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .246
Methodology: Challenges of Working with
Someone Else’s Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248
Using the Application Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .248
Direct Play . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .261
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .269

Chapter 6 Spacewar3D: Meshes and Buffers


and Textures, Oh My! . . . . . . . . . . . . . . . . . . . . . . . . . . 271
DirectX Basics: The Application Wizard Revisited . . . . . . . . . . . . .272
Spacewar3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .284
The Game Proposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
The Game Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .285
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .326
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .326

viii
4010fm.qxd 8/20/04 2:33 PM Page ix

Contents

Chapter 7 Adding Visual Effects to Spacewar3D . . . . . 327

Point Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .327


Step 10: Adding Thrust Effects to Spacewar3D . . . . . . . . . . . . . . . . .329
Step 11: Adding Explosion Effects to Spacewar3D . . . . . . . . . . . . . .337
Step 12: Adding a Shockwave Effect to Spacewar3D . . . . . . . . . . . .339
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .341

Epilogue Taking Your Next Steps . . . . . . . . . . . . . . . . . . . . . . . . 343

Moving On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .343
Habits to Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .344
Things We Neglected to Tell You . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .348
Happy Trails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .350

Bonus Chapter Porting .Nettrix to Pocket PC . . . . . . . . 351

Programming for Mobile Devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .352


The Game Proposal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .356
The Game Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .357
The Coding Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .358
Adding the Final Touches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .368
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .369

Appendix A Suggested Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

Appendix B Motivations in Games . . . . . . . . . . . . . . . . . . . . . . . . . 375

Appendix C How Do I Make Games? . . . . . . . . . . . . . . . . . . . . . . . . 381

Appendix D Guidelines for Developing


Successful Games . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399

ix
4010fm.qxd 8/20/04 2:33 PM Page xi

Foreword
BACK A FEW YEARS AGO I HAD AN IDEA. What if I could make the power of the
DirectX API available to the developers who were going to be using the new set
of languages and common language runtime that Microsoft was developing?
The idea was intriguing, and opening up a larger portion of the world to DirectX
was a goal I was only happy to endorse. Besides, what developer doesn’t want to
write games?
It seems that at least once a week I am answering questions directly regard-
ing the performance of managed code, and Managed DirectX in particular. One
of the more common questions I hear is some paraphrase of “Is it as fast as
unmanaged code?”
Obviously in a general sense it isn’t. Regardless of the quality of the Managed
DirectX API, the fact remains that it still has to run through the same DirectX API
that the unmanaged code does. There is naturally going to be a slight overhead
for this, but does it have a large negative impact on the majority of applications?
Of course it doesn’t. No one is suggesting that one of the top-of-the-line polygon
pushing games coming out today (say, Half Life 2 or Doom 3) should be written
in Managed DirectX, but that doesn’t mean that there isn’t a whole slew of games
that could be. I’ll get more to that in just a few moments.
The reality is that many of the developers out there today simply don’t know
how to write well-performing managed code. This isn’t through any shortcoming
of these developers, but rather the newness of the API, combined with not enough
documentation on performance, and how to get the best out of the CLR. For the
most part, we’re all new developers in this area, and things will only get better as
people come to understand the process.
It’s not at all dissimilar to the change from assembler to C code for games.
It all comes down to a simple question: Do the benefits outweigh the negatives?
Are you willing to sacrifice a small bit of performance for the easier development
of managed code? The quicker time to market? The greater security? The easier
debugging? Are you even sure that you would see a difference in performance?
Like I mentioned earlier, there are certain games today that aren’t good fits
for having the main engine written in managed code, but there are plenty of
titles that are. The top ten selling PC games just a few months ago included two
versions of the Sims, Zoo Tycoon (+ expansion), Backyard Basketball 2004, and
Uru: Ages Beyond Myst, any of which could have been written in managed code.
Anyone who has taken the time to write some code in one of the managed
languages normally realizes the benefits the platform offers pretty quickly. Using

xi
4010fm.qxd 8/20/04 2:33 PM Page xii

Foreword

this book, you should be able to pick up the beginning concepts of game devel-
opment pretty easily. It takes you through the simple sprite-based games, all the
way through a basic 3-D game implementation.
It’s an exciting time to be a developer.
Tom Miller
Lead Developer for the Managed DirectX Library,
Microsoft Corporation

xii
4010fm.qxd 8/20/04 2:33 PM Page xiii

About the Authors


Somewhere around 1974, David Weller discovered a coin-operated Pong game
in a pizza parlor in Sacramento, California, and was instantly hooked on com-
puter games. A few years later, he was introduced to the world of programming
by his godfather, who let him use his Radio Shack TRS-80 computer to learn
about programming in BASIC. David’s first program was a simple dice game that
graphically displayed the die face (he still has the first version he originally wrote
on paper). He quickly outgrew BASIC though, and soon discovered the amazing
speed you could get by writing video games in assembly language. He spent the
remainder of his high school years getting bad grades, but writing cool software,
none of which made him any money. He spent the next 10 years in the military,
learning details about computer systems and software development. Shortly
after he left the military, David was offered a job to help build the Space Station
Training Facility at NASA. From that point on, he merrily spent time working on
visual simulation and virtual reality applications. He made the odd shift into
multitier IT application development during the Internet boom, ultimately land-
ing inside of Microsoft as a technical evangelist, where he spends time playing
with all sorts of new technology and merrily saying under his breath, “I can’t
believe people pay me to have this much fun!”

Alexandre Santos Lobão got his first computer in 1981, when he was 12, and
immediately started to create simple games in BASIC. Since then, computers
have evolved massively, and so has he. Graduating with a bachelor’s degree in
computer science in 1991, Alexandre, together with six friends, founded that
same year a company that came to be known as a synonym for high-quality
services in Brasilia, Brazil: Hepta Informática.
Besides his excellent work in many software development areas, from
financial to telecommunication, he never forgot his first passion, and has always
worked as a nonprofessional game programmer. From 1997 to 1999 he also
worked at Virtually Real (http://www.vrealware.com), a virtual Australian amateur
game programming company founded by Craig Jardine.
At the end of 2000, Alexandre started searching for new horizons and,
leaving the company he helped to create, entered Microsoft as a consultant.
Looking at the new and extremely interesting possibilities offered by the .NET
Framework, he decided to take everything he’s learned over the last decade
and apply it to this new development platform.

xiii
4010fm.qxd 8/20/04 2:33 PM Page xiv

About the Authors

Ellen Hatton is a computer science undergraduate at Edinburgh University. She


was exposed to computers at a very early age and has been fascinated with them
ever since. Her first experience with computer games was playing Dread Dragon
Doom, at which she quickly excelled at the age of 5. She’s been hooked on games
ever since.
Ellen is not only interested in computers. She skis frequently, amongst other
sports, and enjoys general student life in the bustling Scottish capital,
Edinburgh.
As her choice of degree suggests, Ellen still finds computers very interesting
and is constantly looking for new challenges. This book is the latest.

xiv
4010fm.qxd 8/20/04 2:33 PM Page xv

About the Technical


Reviewer
Andrew Jenks began writing code when his parents bought him a TI 99-4A for a
Christmas present. As tape drives were hard to use, and the media resulting was
often overwritten by singing siblings, his father brought home their first family
computer in 1985. Andrew learned to write BASIC and assembly programs
through old Sanyo manuals and whatever he could find in the library. This
proved handy when he found himself broke at the Georgia Institute of
Technology and discovered that people would pay him to teach computing
classes. He went on to act as a developer for an artificial intelligence company,
manager for a communication company at the 1996 Olympics, and a technical
advisor for several political campaigns. Andrew joined Microsoft as a program
manager in 2000 and can currently be found working on MSJVM migration
issues when he’s not off skiing or diving.
During Andrew’s illustrious career as a professional geek, he has written
code that caused several graphics cards to make pretty blue sparks, lost one
monitor due to a long fall, and set one machine on fire. He is most proud of the
fire. That was good code.

xv
4010fm.qxd 8/20/04 2:33 PM Page xvi

Credits
Figure 6-13: Serious Sam® ©2001 is a trademark of Croteam Ltd.
All rights reserved.

Figure C-1: Quake® is a trademark of Id Software, Inc. All rights reserved.

Figure C-4: PAC-MAN® ©1980 Namco Ltd. All rights reserved. Courtesy
of Namco Holding Corp.

Figure C-5: Super Mario Bros. 2® © 1988 by Nintendo of America Inc.

Figure C-6: GALAGA® ©1980 Namco Ltd. All rights reserved. Courtesy of
Namco Holding Corp.

Figure C-7: GAUNTLET® DARK LEGACY™ © 1998–2000 Midway Games


West Inc. GAUNTLET DARK LEGACY is a trademark of Midway Games
West Inc.

xvi
4010fm.qxd 8/20/04 2:33 PM Page xvii

Acknowledgments

Tools and Tunes

To begin with, no development effort can be done without tools. There tools
were invaluable to me, and I heartily recommend them as “must have” tools:

• IDE: Visual Studio .NET Professional 2003 (http://www.microsoft.com/


catalog/display.asp?subid=22&site=11513&x=30&y=4)

• Source control: SourceGear’s Vault (http://www.sourcegear.com/vault)

• DirectX 9 SDK (http://www.microsoft.com/directx)

I also want to thank those that kept me rocking while typing: Prodigy,
Ghetto Boys, Radiohead, Everclear, AC/DC, Christopher Parkening, Elliot Fisk,
Jimmy Buffett, Fleetwood Mac, the cast of the movie Chicago, Shakira, Norah
Jones, Alejandro Sanz, Juanes, and many, many more.

People Who Really Made This Happen


Few authors can write a book completely by themselves, and I’m no exception
to this rule. First and foremost, this book could not have been done without the
coding wisdom of Scott Haynie. He converted the Spacewar game and wrote the
bulk of the code for the Spacewar3D game. In addition, he gladly contributed the
3-D models for the Spacewar3D game. This book would have been very different
without his help and ideas, and he has my undying gratitude.
In addition, other people helped by contributing code or offering sugges-
tions. Tristian Cartony (.Nettrix), Stephen Toub (.Netterpillars), Carole Snyder,
and Franklin Munoz. For anybody else who contributed that I forgot to call out
by name, please accept my apologies in advance.
There are two other people I’d especially like to thank: Tom Miller, the prin-
cipal developer of the Managed DirectX libraries, graciously whacked me over
the head several times saying, “What were you thinking?!” Without his (if you’ll
pardon the pun) direct input, we might have taught some beginners some very
bad Managed DirectX habits. And, of course, Sofia Marchant, the project man-
ager for this book, who did a great job of being my “velvet-gloved taskmaster” as
well, making sure I was staying on schedule to get this book done on time.

xvii
4010fm.qxd 8/20/04 2:33 PM Page xviii

Acknowledgments

Lastly on the list are the people who have quietly (or not-so-quietly) influ-
enced this book:

• My godfather, Charles Plott, who opened up my eyes to the world of com-


puters and computer games.

• My high school math teacher, Duane Peterson, who let me take a com-
puter programming class in spite of not knowing enough math—the result
of which inspired me to get a degree in computer science with a math
minor.

• My mom and dad, who put up with my intense passion for computers
during my adolescence, in spite of not having enough money to buy me
the mainframe system I wanted to put in our garage.

• My kids, Erich and Gretchen, and their mother, Nancy, who patiently
tolerated my passion for computer games for many years.

Lastly, I want to thank my girlfriend Ana, who has made some very gloomy
days for me much brighter, and who gave me all the support she could, even
though she was 2000 miles away most of the time.
—David Weller

xviii
4010fm.qxd 8/20/04 2:33 PM Page xix

Preface
I APPROACHED ALEXANDRE ABOUT A YEAR AGO to offer him comments on his first
book, .NET Game Programming with DirectX 9.0. After presenting him with a
rather long list of what I would have done differently, Alex graciously suggested
collaborating on a new book. We decided early in the process to reuse some
of the game examples from his book (specifically .Nettrix and .Netterpillars),
although some parts have been heavily modified. We did this for two reasons:

• The games are good, simple examples that can stand the test of time when
it comes to learning game programming. There was no sense creating a
different game just to convey the same concept.

• Writing different games from scratch would take time away from adding
newer games at the end of the book that challenged the beginner.

Of course, my youthful memories of the early computer games influenced


me to choose a space theme for the later games, leaning on the well-known
games of Asteroids and Spacewar. But I wanted to take things a step further, to
show how 2-D gaming knowledge can quickly scale into 3-D games. I had never
seen a book take such a step, and was frankly worried that it couldn’t be done
effectively. However, the book you’re holding is the best attempt I can put for-
ward, and hopefully you’ll find the progression simple as well as instructional.
Due to my distaste for gaming books that double as gymnasium free
weights, I wanted to create a book that avoided the long, pointless chapters that
explained Visual Basic .NET (henceforth referred to as “VB”), object-oriented
programming, how to use Visual Studio, etc. This book gets right to the games,
and assumes you have a rudimentary knowledge of VB. If you need to get up to
speed on VB, we recommend Matthew Tagliaferri’s Learn VB .NET Through
Game Programming (Apress, ISBN 1-59059-114-3), which makes an excellent
companion book to this one.
For developers who are already familiar with programming and basic gaming
concepts, this book will serve well as a high-speed introduction to Visual Basic
.NET and, in later chapters, Managed DirectX. If you’re already intimately familiar
with DirectX game development and are looking for a book focused directly on
Managed DirectX, I recommend Managed DirectX Kick Start (SAMS, 2003) written
by Tom Miller. Of course, I would love for you to buy this book as well, but I’m
more interested in getting you to write games in Managed DirectX than I am in
making a buck or two by convincing you to buy this book.

xix
Another Random Document on
Scribd Without Any Related Topics
of money for rendering less malodorous the streets of this pestiferous town.
The money was drawn, and then its recipient discovered that the people were
partial to noxious vapours, and had conscientious objections to any
interfering and misguided foreigner meddling with their pet manure heap. So
nothing was done, but the money disappeared. Such is morality as practised
in this corner of the Shah's dominions!

The Telegraph Compound which, during our occupation of Mianeh,


served as Wagstaff's headquarters, stood on the brink of a knoll overlooking
the main street leading to the Bazaar Quarter. On the face of a corresponding
eminence opposite, and divided by a bend of the road, was the local Potter's
Field, where friendless peasants and penniless wanderers from afar who had
paid the great debt of Nature within the inhospitable walls of Mianeh were
interred (when the lazy townsfolk found time to give them sepulture) in a
hastily dug and shallow grave. In the meantime the defunct ones were wont
to be dumped down on a rude bier and left there, sometimes for a whole day,
under the fierce rays of a mid-June sun. Mianeh was as uncomfortable for
the dead as it was unhealthy for the living. Truly, few Persians seem to
possess any olfactory sensitiveness. They would pass the Potter's Field
hourly, showing no concern at the repulsiveness that must have assailed their
eyes and noses.

News filtered down the road from Tabriz that the Turks there were
displaying great activity. They were daily being reinforced, and made no
secret of their intention to attempt, when sufficiently strong, the task of
chasing the British from Azerbaijan. They established posts on the Tabriz
road southwards as far as Haji Agha, about sixty miles from Mianeh.

The answer to all these Turkish preparations for breaking our slender hold
upon Azerbaijan was for Wagstaff urgently to ask for reinforcements and
especially mountain guns. In the meantime he sent Osborne back up the
Tabriz road, with all the fighting men that could be spared, to watch the
enemy and to attempt to prevent his breaking farther south. Osborne's chief
reliance was placed on the few British N.C.O.'s who accompanied him.
Beyond these, all he had to stem any Turkish advance was about half a
squadron of newly enrolled irregular horse and a couple of platoons of native
levies who had been taught the rudiments of musketry and elementary drill.
Their appearance, at all events, was very warlike, not to say terror-
inspiring, and, like some of the wild tribes of Polynesia, they relied chiefly
on the effectiveness of their make-up when on the "war-path" to bring about
the discomfiture of their enemies. The Sowars were unusually awe-inspiring,
hung about as each was with two or three bandoliers studded with cartridges.
Each carried a rifle, a sword of antique design, and a short stabbing blade.

The Naib, or Lieutenant, who commanded them, was equally formidable


from the point of view of arms and equipment. He had a Tulwar shaped like
a reaping-hook, and a Mauser pistol, the butt of which was inlaid with silver.

The tactics of the Sowar levies were something in the nature of a


compromise between a "Wild West" show and opéra bouffe. They would
gallop at full speed up a steep hill, brandishing their rifles over their heads
and yelling fiercely the while. It was always a fine spectacular display with a
dash of Earl's Court realism thrown in. The rifles of the Sowars had a habit
of going off indiscriminately during these moments of tense excitement
when they were riding down an imaginary and fleeing enemy, and the
British officers who watched their antics found it expedient in the interests
of a whole skin to remain at a respectful distance from the manoeuvring, or
—should one say, performing?—Sowars.

Swagger and braggadocio were the principal fighting stock-in-trade of the


levies and their Persian officers. They were always clamouring to be led
without delay against the Turks in order that we might have an opportunity
of witnessing what deeds of valour they would perform under enemy fire.
The time did come, and our brave auxiliaries found themselves in the front
line with a Turkish battalion about to pay them a morning call—and we
realized more fully than ever that the hundred-years-old dictum of that
incomparable humorist, Hadji Baba, still held good, "O Allah, Allah, if there
were no dying in the case, how the Persians would fight!"

The Turks having outstripped us in the race to Tabriz, a belated attempt


was made early in July to get in touch with the sorely pressed Jelus in
Urumia and stretch out to them a succouring hand. They had sent us a
despairing appeal for help. Their ammunition was running out; their
available supplies were nearly exhausted; and they were on the verge of a
military collapse. The Turks threatening Urumia had offered terms if the
Jelus laid down their arms, but, fearing treachery if they accepted, the War
Council of the Jelus refused the enemy offer, advising unabated resistance,
and urging that an attempt should be made by the whole army to break out
towards the south and march in the direction of Bijar and Hamadan, in order
that they might find safety behind the British lines.

Lieutenant Pennington, a youthful Afrikander airman who was noted for


his coolness and daring, was despatched from Kasvin on July 7th. He was to
fly to Urumia carrying a written assurance of speedy British aid for the
beleaguered garrison there. Pennington made a rapid non-stop flight to
Mianeh, covering the distance from Kasvin in a little over two hours. He
spent a day at Mianeh, where he carried out a series of useful demonstrations
intended to impress the local Democrats. They had never seen an aeroplane
before, and were rather vague as to its offensive potentialities. Moreover,
they had been inclined to be scornful of our want of military strength so
glaringly revealed at Mianeh. But now, at all events, the Democrats were
duly impressed by Pennington and his machine. They argued that, if one
aeroplane could come from Kasvin in a couple of hours, so could a whole
flotilla, and armed with death-dealing bombs. Not altogether ignorant of the
doctrine of consequences, the Democrats realized the value of oratorical
discretion; so for a while they put a curb on their poisonously anti-British
tongues.

Meanwhile Pennington continued his aerial journey to Turkish-menaced


Urumia, the city by the lake shore, where a Christian army was sheltering
and wondering anxiously whether it was succour or the sword that awaited
it. Within two hours of leaving Mianeh, the intrepid airman was crossing
over Lake Urumia heading for the western shore. He dropped low on
approaching the city itself, and his unexpected appearance brought
consternation to the inhabitants. Aeroplanes were unknown in those parts.
They felt that this visitor from the clouds could hardly be a friend; therefore
he was presumably a foe. Reasoning thus, the Jelus lost no time in blazing
away a portion of their already slender stock of ammunition in the hope of
bringing him down. The aviator had many narrow escapes, and so had his
machine. He landed with a few bullet holes through his clothing, but his
aeroplane, happily, had not been "hulled," or he would have been
immobilized at Urumia.
As he alighted, the Jelus rushed up to finish him off, for they were not
noted for being over-merciful to Turks falling into their hands. But seeing
that he was English, they embraced him as a preliminary, and then carried
him shoulder-high into the city. He was the hero of the hour. The people
were delirious with joy, and women crowded round and insisted on kissing
the much-embarrassed aviator. As the weather was very hot, Pennington was
wearing the regulation khaki shorts. One Nestorian woman, after gazing
compassionately at the airman's bare, sunburnt legs, and noting the brevity
of his nether garment, shook her head sadly and said she had not realized till
then that the British, too, were feeling the effects of the War and were
suffering from a shortage of clothing material. There was a whispered
consultation with some sister-Nestorians, and a committee was formed to
remedy the shortcomings of Pennington's kit. The women ripped loose their
own skirts and, arming themselves with needles and cotton, pleaded to be
allowed to fashion complete trousers for the aviator, or at least to be
permitted to elongate by a yard or so the pair of unmentionables he was
wearing. The youth blushed furiously, and was at great pains to explain that
there was still khaki in England, and that it was convenience, and not any
scarcity of material, that had caused the ends of his trousers to shrink well
above his knees.

Pennington flew back from Urumia, and it was arranged that the Jelus
with their women and children were to march south by way of Ushnu and
Sain Kaleh to meet a British relieving force moving up from Hamadan and
Bijar.

Early in August Osborne had several brushes with the Turks on the Tabriz
road. The enemy flooded our lines with spies, chiefly Persians from Tabriz,
and pushed reconnoitring patrols as far south as Haji Agha, forty miles from
Tabriz. In these road skirmishes our Persian levies behaved with their
characteristic unsteadiness. Once they were fired upon by hidden infantry at
seven hundred yards, they forgot their promised display of valour, their
courage oozed out at their boots, and they promptly bolted. An aerial
reconnaissance revealed detachments of cavalry, artillery, and infantry
marching south along the Tabriz road, but Headquarters in Bagdad refused to
attach any importance to this concentration, and for the moment were deaf to
Wagstaff's reiterated demand for reinforcements, and especially for a
mountain gun or two.
Captain Osborne and his party now dug themselves in at Tikmadash,
about fifty miles from Mianeh and a corresponding distance from Tabriz,
and fixed his headquarters in a serai close to the village which commanded
the Tabriz road. There was a supporting British post at Karachaman not far
from the main Tabriz road and fourteen miles to the south-east.

Wagstaff's repeated pleadings with "high authority" at last began to bear


fruit. It was a generally accepted military axiom out in Mesopotamia and
Persia that, if you were insistent enough in your demands for an extra
platoon or two, with a gun or an aeroplane thrown in, you were either given
the goods, or dubbed a "flannel-footed fool" and relegated to the cold shades
of official oblivion. It was generally the latter. When Wagstaff, therefore,
heard that he had been given a whole squadron of 14th Hussars, a platoon of
the 14th Hants, and a platoon of Ghurkas, as well as a section of a howitzer
battery and a couple of mountain guns, his habitual soldierly calm deserted
him, and he almost wept for joy on the neck of his adjutant, debonair
"Bobby" Roberts of the 4th Devons.

"C" squadron of the 14th Hussars had made a forced march from Kasvin.
Its ranks had been thinned by fever, and it barely mustered eighty sabres
when it rode over the Kuflan Kuh Pass to Mianeh. It had but two officers,
Lieutenants Jones and Sweeney, fit for service. But there was no respite.
Fever-racked troopers and leg-weary horses, after a night's halt at Mianeh,
started on a fifty-mile march to Tikmadash, where a handful of British were
holding up a Turkish force already numbering nearly a thousand and
growing daily. The tired infantry who had "legged it" all the way from
Kasvin were also pushed north in the wake of the cavalry.

CHAPTER XVI

THE FIGHT AT TIKMADASH


Treachery of our irregulars—Turkish machine-gun in the village—Headquarters under fire
—Native levies break and bolt—British force withdrawn—Turks proclaim a Holy War
—Cochrane's demonstration—In search of the missing force—Natives mutiny—A
quick cure for "cholera"—A Turkish patrol captured—Meeting with Cochrane—A
forced retreat—Our natives desert—A difficult night march—Arrival at Turkmanchai—
Turks encircling us—A fresh retirement.

The Turks came against Osborne at Tikmadash on September 5th. For


days previously they had been carefully preparing for the attack.

Overnight they sent into the village, unperceived by the British, an


infantry detachment which fraternized with the inhabitants and also with a
small party of our irregulars who were on observation duty there. The
treacherous irregulars said nothing of the presence of the Turks in their
midst, and made common cause with them at once. Towards midnight the
Turks smuggled in a machine-gun, which they subsequently mounted on the
flat roof of the dwelling of a Persian official. At daylight the Turks, from
cover of the village itself, opened a violent machine-gun fire on the
headquarters of Osborne, which were in a serai a short distance on the
Mianeh side of Tikmadash village. All the officers, some eight or ten in
number, lived here. There were two doors to the serai on two different sides
of the building. Both these exits were sprayed with machine-gun fire. There
was nothing for it but to open the door and run the gauntlet. It was like
coming within the vortex of a hail-storm, yet, surprising to relate, few were
hit.

Beyond the weak units of the 14th Hussars, the Hants, and the Ghurkas,
Osborne had nothing to depend upon in this critical hour save levies
recruited in Mianeh and elsewhere who, in spite of their boastings, were
always fire-shy. They took up a position this morning at Tikmadash, but it
was clear from the beginning that their hearts were not in the business.

After firing some shrapnel into the position, the Turks stormed it with two
thousand infantry. The shell fire had already stampeded the Persians, but
their British officers, Captains Heathcote, Amory, and Trott of the Devons,
and Hooper of the Royal West Kents, by dint of persuasion and threats,
temporarily stopped the disorderly flight, and induced the wavering men to
follow them back into the line. But a few more shells from the Turkish gun,
which burst with telling accuracy, finished the resistance of the levies.
Osborne had no artillery, the mountain battery section from Mianeh not
having yet arrived.

This time the portion of the line held by the levies doubled up like a piece
of paper. Panic seized them, and they fled with all the swiftness of hunted
animals, throwing away their rifles as they ran. The Hants, Ghurkas, and
Hussars were now all that was left to cover the retirement. The Turks were
working round both flanks and, had the British hung on, the whole force
would have been surrounded and killed or captured. Some of the British
soldiers were so incensed at the cowardice of the Persians that they turned
their rifles against the fugitives and shot them in their tracks.

When a retirement was seen to be inevitable, the charvadars were ordered


to load up the stores and medical supplies at the serai. In the midst of their
preparations the levies broke and fled. This decided the charvadars, who
showed themselves to be as arrant cowards as the rest of their race. Cutting
away the lashings securing the loads on the transport mules, they jumped on
the animals' backs and galloped panic-stricken to the rear.

Captain John, of the Indian Medical Service, who had worked like a
Trojan attending to the wounded under fire, now collected three or four
British N.C.O's. and sought to rally the runaway charvadars, or at least to
recapture some of the transport mules. As well might Dame Partington have
tried to mop back the waves of the Atlantic. John, however, did succeed in
moving the British wounded, but all the officers' kits, medical supplies, and
ammunition fell into the hands of the enemy.

The sadly diminished and battered British force withdrew to


Karachaman, preceded by the fleeing native levies, who magnified the extent
of our reverse, and as they ran spread panic amongst the villages on our line
of retreat.

Eight days before the Turks hit us at Tikmadash, news had filtered
through to Mianeh that the enemy was becoming active in Eastern
Azerbaijan. Raiding parties of Turkish cavalry had penetrated to Sarab,
eighty miles east of Tabriz, and stray bands of tribal levies who had taken
service under the Turkish flag were reported farther east towards Ardabil and
the Caspian littoral. They distributed proclamations broadcast announcing a
Jehad or Holy War against the British, and calling upon the people to rally to
the banner of the Ittahad-i-Islam, or Pan-Islamic movement, and so make an
end of the Infidel occupation of Persia. The hapless villagers themselves had
little choice in the matter; compulsion was drastically applied, and a village
that showed hesitation, or evinced any apathy in embracing the tenets of the
political-cum-religious and Turkish-controlled Ittahad-i-Islam, was laid
waste, its inhabitants maltreated, or sometimes put to the sword.

The Turks further showed their contempt for Persian authority by seizing
the telegraph office at Sarab and kicking out the detachment of Persian
Cossacks who held the place in the name of the Shah and did police duty in
the district. These Cossacks, in common with the rest of their brigade, were
under the command of a Russian officer. He evidently harboured some
extraordinary view as to his duty towards the Shah's Government, for he
accepted with meek submissiveness the imperative orders of the Turks to
take himself and his command out of Eastern Azerbaijan without any
unnecessary delay. The Persian Cossacks, the "paid protectors of the poor,"
to give them one of their official designations, rarely "protected" anybody
unless as a financial investment, and their brutality and greed for illicit gain
caused them to be as much dreaded by the Persian peasant and bazaar
shopkeeper as were those brutal, plundering ruffians, the Turkish Bashi-
bazouks whom the senior partner in the Pan-Islamic firm had let loose in
upper Azerbaijan.

To counteract enemy activity round Sarab and Ardabil a small mounted


force was despatched from our post at Karachaman under Captain Basil
Cochrane of the 13th Hussars. Cochrane had with him about forty British
enlisted Sowars of Khalkhal Shahsavans. Moving across the mountains, he
boldly rode into Sarab. The Turks, assuming his to be but the advance guard
of a large British force, scattered at his approach. The Governor and the
townsfolk welcomed him effusively, and promised him military support. But
Persian promises are not always redeemable, as we had already found to our
cost. Turkish cavalry were advancing afresh and threatening his rear, so
Cochrane, who was fifty miles as the crow flies from the nearest British
post, had to let go his hold on Sarab, and retire towards the south. Then a
veil of silence enshrouded his movements; and at Mianeh headquarters it
was feared that he had been cut off and killed with his whole party.

I had just come back from a long trek, and had stretched my weary self
out on a camp bed and gone fast to sleep, booted and spurred, when someone
shook me vigorously. I awoke and found it was Wagstaff, chief of the
Mission, with orders for me to take out a mounted party and go in search of
Cochrane. I mustered the available Sowars of the station, about fifty in all.
They were recruited from the Shahsavan tribesmen, and we had had hitherto
no reason to suspect their fidelity. But immediately they divined that trouble
was brewing and that they might get a "dusting" from the Turk, they decided
that Mianeh was a healthier place than Sarab, and mutinied to a man. Neither
threats nor persuasion could move them. Having, so to speak, thrown in their
hands, they dismounted from their shaggy, fleet-footed hill ponies, and stood
sullenly with folded arms, refusing obedience to all orders.

Leaving Wagstaff to deal with the mutinous Sowars, I collected about a


dozen of my own Persian police, and with these and two British N.C.O's.,
Sergeants Calthorpe, R.F.A., and Saunders of the 13th Hussars, set off on my
mission.

We marched the greater part of the night, and early next day reached
Turkmanchai on the Tabriz road, twenty-five miles north-west of Mianeh.
Here I impressed ten Sowars of ours who, feigning illness and suffering
from "fire-shyness," had stolen out of the trenches at Tikmadash. Our route
from Turkmanchai lay nearly due north towards the foothills of the lofty
Bazgush Range and the country of the Khalkhal sub-tribe of Shahsavans. We
bivouacked for the night in the prosperous village called Benik Suma, which
stands in the middle of an arboreal-cloistered dale watered by a shallow but
swift-running mountain stream. Supplies were plentiful, and the hand of
famine had not touched this secluded Persian hamlet, which nestled so cosily
beneath the glorious foliage of oak and chestnut.

When the march was resumed in the morning, it was found that four of
the "malingerers" from Turkmanchai had deserted overnight. My little
command did not seem at all easy in its mind at the prospect of having a
brush with the enemy, and every hour that brought us nearer to the hill
country an increasing number of Sowars reported sick and begged to be
allowed to fall out.

At first I was puzzled by the spread of this sudden malady, for the
symptoms were identical in each case—severe abdominal pains; but
presently the mystery was explained. I encountered on the road a Persian
Cossack who had ridden in from the Sarab district, and had come across the
mountains that lay ahead of us. He volunteered the information that in a
village about twenty miles distant he had seen a Turkish cavalry patrol. Our
Sowars on hearing this looked very glum, and four of them at once
complained of violent illness. They rolled on the ground in pretended agony,
artfully simulating an acute cholera seizure. This time, and without much
difficulty, I diagnosed the disease as being that of pure funk, or what is
commonly known in military parlance as "cold feet." While sympathizing
with the sufferers, I gravely told them that I had instructions to shoot off-
hand any of my command who became cholera-stricken, and to burn their
bodies in order to prevent the disease spreading. The result was little short of
magical. The "severe pains" disappeared, and the patients made such a
wonderful recovery that within half an hour they were able to mount their
horses and turn their faces towards Sarab once more. And the "epidemic" did
not reappear.

We entered the mouth of the gloomy Chachagli Pass in the Bazgush


Range. Horsemen afar off had hovered on our flanks and reconnoitred us
carefully, but the distance was too great to tell whether they were enemy
irregulars or simply roving Shahsavans in search of plunder, who would
impartially despoil, provided the chances were equal, Briton, Turk, or
Persian.

The Chachagli Pass, a trifle over 8,000 feet, must surely be the most
difficult to negotiate in the whole of the Middle East. The road or track from
the southern entrance of the Pass follows a narrow valley shut in by a high
gorge. A huge mass of limestone rock, parting company with some parent
outcrop several thousand feet above our heads, has fallen bodily into the
shallow stream which rushes down the Pass, damming up its waters
momentarily. The stream is angry, but not baffled, at this clumsy effort to bar
its path. Gathering volume and strength, and mounting on the back of the
impeding boulder, it dives off its smooth surface with all the energy and vim
of a miniature Niagara, and goes on its way humming a merry note of
rejoicing.

After traversing the stream repeatedly, the road tilts its nose in the air and
mounts sharply. With just enough room for sober-going mules to pass in
single file, it skirts the brink of a precipice until the top is reached. The rocks
radiated a torrid heat that September morning, and the sun struck across our
upward path. It was difficult climbing, for there is not in all the Chachagli
Pass enough tree shade to screen a mountain goat.

On the north side of the summit the road descends just as abruptly; the
track is narrow and rugged, and it requires careful going to avoid toppling
over the unramped side and down into the rock-studded bed of the stream.

It was nearing sunset on the evening of September 2nd, and my small


force was preparing to bivouac for the night, when two Sowars who had
been foraging in a village to the west came galloping with news of the
enemy. They had learned that a party of Turkish irregulars had halted in a
hamlet three miles away.

We moved in the direction indicated and found the information was


correct. The enemy horsemen, believing themselves secure, had neglected to
mount a guard. They had off-saddled and were sleeping peacefully in the
shade of a mud-walled compound when we burst into the place and surprised
them. They were ten in all. Rudely disturbed in their siesta, they surrendered
without firing a shot. The prisoners comprised two Turkish N.C.O's., six
Sowars, and two agents of the Ittahad-i-Islam. They had evidently been
"billposting" and recruiting, for their saddlebags contained letters addressed
to Turkish sympathizers in the district and also the red armlets worn as a
distinguishing badge by the newly enrolled fedais who undertook to fight
under the crescent-flag of the Osmanli.

My own Sowars were greatly elated over this minor success. Their spirits
rose accordingly, and they now professed to regard the fighting Turk with
disdain, and to be prepared to match themselves single-handed against a
whole troop of the enemy.
But it was all mere bombast. The prisoners were sent down to Mianeh
with an escort of six of these "valorous" levies. On the way they, though, of
course, unarmed, overpowered the guard, took the arms and horses, and
escaped.

At daylight next morning, September 3rd, the march northwards was


resumed. Our advanced guard was fired upon by some armed horsemen,
who retired. Following them up, we found that they were some of
Cochrane's scouts who had mistaken us for Turks. Cochrane himself I came
across two hours later. With his little force he had retreated without loss from
Sarab, and had taken up a snug defensive position on the brow of a wooded
eminence, where he placidly awaited whatever fate might send him first—
the attacking Turk, or the succouring British.

The tribesmen were friendly towards us, and, attracted by the prospect of
good pay, were offering themselves freely as recruits. Making due allowance
for the fighting instability of our levies, we felt we were strong enough to
hold on, and if the worst came to the worst, and we were outnumbered,
capable of putting up a running fight with the enemy.

But the end bordered on the dramatic, and came with an abruptness that
neither of us had foreseen. As related in a previous chapter, Osborne was
heavily attacked at Tikmadash on the morning of September 5th, and the
news of his retreat and the advance of the Turks along the Tabriz road did
not reach Cochrane and myself until 2 a.m. on the morning of the 6th. It was
a ticklish situation. Go forward we could not, and our only way back was
over the gloomy fastness of the Chachagli Pass. The Turks, we knew, were
advancing rapidly, and we mentally saw them already astride our one line of
retreat and ourselves trapped at the south exit of the Pass.

There was no time to be lost. So, destroying our surplus stores, and with
grim faces, we set off in the darkness of the night. Our levies surmised that
something had gone wrong with the British, and fear gripped their hearts.
They deserted wholesale and without waiting to bid us adieu. There was a
picket of fifteen Persians and a British sergeant in a village a mile to our
front. The sergeant alone reported back. His command had "hopped it" when
they realized that danger threatened. Five miles behind us on the crest of the
ridge there was an observation post of thirty irregulars with a Naib or native
lieutenant and two British N.C.O's. The Naib had the previous evening
vaunted his personal prowess, and assured Cochrane and myself that no
Turks would pass that way except over his lifeless body. But when we
reached his post in the blackness of the night, we discovered that the gallant
Naib had fled none knew whither, and taken all his men with him. We never
saw him again. The two N.C.O's. had mounted guard alternately, and we
found them cursing Persian irregulars and Persian perfidy with a degree of
vigour and a candour that did adequate justice to their own private view of
the situation.

Cochrane is an Afrikander born, and as resourceful and plucky a soldier


as ever donned khaki. Used to night marching on the veldt, he led the
advanced guard of our party through the intricate, labyrinthian windings of
the Chachagli Pass where a single false step meant death. It was nerve-
straining work, this night march in the darkness, with men, horses, and
transport mules following each other in blind procession and groping for a
foothold on the narrow causeway. That mysterious dread of the unseen and
the unknown, ever present on such occasions as these, clutched with a
tenfold force the timorous hearts of the native levies who had survived the
earlier stampede at the beginning of the retreat. Their teeth chattered, and
their trembling fingers were always inadvertently pressing triggers of loaded
rifles, which kept popping off and heightening the nerve tension.

We got clear of the Pass shortly after daylight. Fortunately the Turks were
not there to intercept our march. With the passing of the long night vigil, and
the coming of the dawn, gloom was dispelled; life assumed a rosier tint, and
the levies recovered some of their lost spirits and waning courage. Once free
of the imprisoning hills, and out on the broad plateau that dipped southwards
to intersect the Tabriz road, we headed straight for Turkmanchai. Once we
rode into a village as fifty well-mounted horsemen, disturbed like a covey of
frightened birds, bolted out at the other end. We found that they were
Shahsavan robbers, who looked upon our party as potential enemies. Turkish
cavalry in extended order were visible on the skyline as we gained the
shelter of Turkmanchai.

We reached this spot in the nick of time. Osborne's force had been
compelled to evacuate Karachaman, the position occupied after Tikmadash,
and his sorely pressed command was now trickling into Turkmanchai with
the Turks at their heels. Turkmanchai village is at the base of a steep hill. At
its summit the road from Tabriz squeezes through a narrow-necked pass.
Here the Hants and the Ghurkas took up a position in order to arrest the
Turkish advance. A section of a mountain battery had arrived overnight. The
Turkish cavalry appeared in column of route, out of rifle fire as yet, and
blissfully ignorant of our possession of artillery. The cavalry made an
admirable target. Two well-directed shells burst in the midst of the
astonished horsemen. Their surprise was complete, and wheeling they
opened out and galloped wildly for cover. The impromptu salvo of artillery
set them thinking, and they did not trouble us again that day.

To hold Turkmanchai was impossible. We had stopped the Turks in front,


but they were working round our flanks, and it was only a question of hours
when we should be isolated and cut off from Mianeh. We were outnumbered
by fully ten to one, and the flanking parties of cavalry which the enemy
threw out were alone larger than the British combined force of regulars and
irregulars.

A fresh retirement was decided upon, and on the morning of September


7th we evacuated Turkmanchai. The wounded and the sick were removed in
transport carts, and two hours after midnight the head of the column moved
slowly off in the darkness. I was in charge of the advanced guard, and found
myself in command of a varied assortment of Persian irregulars, some of
whom had "distinguished" themselves at Tikmadash and Karachaman and
had been "rounded up" by British troops during the retreat. They were a
motley crew, and what infinitesimal amount of pluck they ever possessed
had long ago evaporated. In the advanced guard it was difficult to restrain
their impetuosity. They dashed off at top speed as if they were riding a fifty-
mile Derby race to Mianeh. But their one impelling motive was to place as
many miles as possible of dusty road between themselves and the oncoming
Turks before daylight.

By dint of threats of summary punishment they were brought to heel and


ultimately held in leash. Silence it was impossible to impose, short of some
form of gagging, and they chattered like a cageful of monkeys, utterly
heedless of the danger of betraying our presence to the enemy. Then, too,
their superheated imagination saw Turks growing on every bush. "Osmani
anja!" "Osmani anja!" (The Turks are there!) they would cry, indicating
some village donkey or goat taking a hillside stroll. Fortunately for us, the
Turks showed themselves to be singularly lacking in energy, and were not
keen on risking a night attack in unknown country, or they might have
ambushed the advanced guard half a dozen times before it got clear of the
danger zone. With our Persian "braves" to rely upon, there would surely
have been a "regrettable incident" to record officially.

The Turks waited for daylight, and then they attacked the main body and
the rearguard, but were beaten off, and the column extricating itself reached
Mianeh in safety.

CHAPTER XVII

EVACUATION OF MIANEH
We have a chilly reception—Our popularity wanes—Preparation for further retirement—
Back to the Kuflan Kuh Pass—Our defensive position—Turks make a frontal attack—
Our line overrun—Gallantry of Hants and Worcesters—Pursuit by Turks—Armoured
cars save the situation—Prisoners escape from Turks—Persians as fighters.

Mianeh, pampered, spoon-fed Mianeh, which had grown fat on British


bread and comparatively wealthy on British money, gave the retreating
column a chilly reception.

The bazaar looked at us askance, and the Democrats spat meaningly in


our direction and muttered a malediction upon our heads. There was joy in
the eyes of the people which they took no pains to conceal.

The news of the Turkish success, much magnified in passing from mouth
to mouth and village to village, had preceded our arrival, and the barometer
of bazaar sentiment, always a sure gauge of Persian public opinion, had
veered round to "stormy."
And "stormy" it was to be. It was felt that the sands of the British glass
had run out. The attitude of the people underwent a sudden change from
cringing supplication to one of thinly veiled hostility. Fawning officials, who
had battened upon our liberality and profited by our largesse, now fell over
themselves in their efforts to sponge the slate clean and write upon it a
Persian improvised version of the "Hymn of Hate." They threw the full
weight of their mean souls into the job. In the bazaar they buzzed about like
so many poisonous gadflies, and in order to curry favour with their new
masters-to-be they incited the people to anti-British demonstrations, and beat
and imprisoned humble folk whose friendship for our nation was
disinterested and had not been offered on the local commercial basis of so
many krans per pound. With one exception, all the district notables—who
had always been reiterating their professions of friendship, and to whom we
had paid large sums as subsidies for faithless, turn-tail levies, or as purchase
price for grain—went over to the enemy. Our Mianeh police, my own
command, or those of them who were Persians, followed the general
example and ran off to join the Turks.

There was one notable exception. Four Kurds who belonged to the police
and who could not be intimidated or cajoled, stood firm and refused to be
carried off by the wave of desertion, and they remained to guard the Mission
premises.

After Turkmanchai we did not tarry long in Mianeh. Preparations were at


once made for a further retirement. The Turks were coming on slowly and
methodically, and apparently in no immediate hurry to hustle us out of
Mianeh. The long and, in a sense, rapid marches of the previous five days
during hot weather had told upon the Turkish infantry, and now the
advancing enemy had cried a halt in order that his tired troops might enjoy a
brief repose.

Our next defensive position was the Kuflan Kuh or Qaplan Kuh (the
panthers' hill) Pass, which lies five miles south-east of Mianeh. The main
range of the Kuflan Kuh runs roughly from east to west, and the Tabriz-
Zinjan road passes over its crest at a height of about five thousand feet. At
the end of the Mianeh plain, and some two miles from the village itself, there
is a solid brick bridge over the Karangu River. Once the river is crossed,
coming from Mianeh, the rise begins gradually, and the foothills of the Pass
are met with a mile or so from the river bank. The ascent from the northern
or Mianeh end is very difficult, and the road mounts between two
perpendicular walls of rock. The gradient is steep, and the outer edge of the
roadway was wholly unprotected until a British labour corps took the job on
hand and interposed a coping-stone barrier between the exposed side of the
road and the abyss below. The same workers also plugged up some of the
gaping holes in the roadway which had existed from time immemorial.

On Sunday, September 8th, the whole of Major Wagstaff's force bade


farewell without regret to Mianeh, marched across the Karangu, and placed
the formidable barrier of the Kuflan Kuh between itself and the advancing
enemy. Wagstaff established his headquarters in a ruined caravanserai near
the stone bridge which spans the Kizil Uzun River at the southern entrance
to the Pass. All the stores of wheat and barley which had been accumulating
in Mianeh were destroyed before evacuation, and the rearguard crossed the
Karangu without molestation either from the Turks or from their new allies,
the Mianehites, who were hourly showing themselves more hostile to the
retiring British.
NORTH GATE, KASVIN.

Headquarters at Kasvin now began to be alarmed at the uninterrupted


southward advance of the Turks, for, if Zinjan fell, Kasvin might be expected
to follow, and our line of communications from Hamadan towards the
Caspian would be cut. General Dunsterville himself was away in Baku,
fighting Bolsheviks and Turks. Some weeks earlier, with the help of
Bicherakoff and his Russians, he had rooted out Kuchik Khan from his
jungle fastness, and opened the road from Manjil to Resht and the Caspian
Sea.

Wagstaff was accordingly ordered to hold the Kuflan Kuh at all costs, but
what he was to hold it with was not quite clear, inasmuch as his total
dependable fighting strength of Hants, Ghurkas, and 14th Hussars did not
exceed 250 bayonets and 50 sabres, the few remaining levies being a
negligible quantity. He had been given a machine-gun detachment, a
mountain battery section, two field guns, and a howitzer. His main position
was on a line of low hills extending for about three miles below the northern
face of the Pass, and commanding the approaches from the Mianeh plain and
the brick bridge across the Karangu. The guns were on the reverse or
southern slope of the Pass, whence by indirect fire they could make it
unpleasant for an enemy crossing the Karangu bridge or fording the shallow
river itself.

A platoon of the Worcesters arrived to reinforce our attenuated line, and


Colonel Matthews of the 14th Hants took over command on the 9th. The
Turks had now occupied Mianeh in force, and during the ensuing two days
were busy preparing for an offensive movement. They pushed a considerable
body of infantry down to the cultivated fields bordering the north bank of the
Karangu. Here, amongst the boundary ditches, topped with low bushes, they
found a certain amount of ready-made cover, and they subjected our
advanced posts on the right to a harassing fire. These were held by levies
with a stiffening of British officers and British N.C.O's. The Persians, as
usual, became "jumpy" whenever Turkish bullets hummed in their
immediate vicinity, and as they were utterly lacking in elementary fire-
control they were a source of vexatious perplexity to their British officers
and sergeants. One officer, in despair at their utter unreliability under fire,
pleadingly suggested that they might be withdrawn altogether, and himself
left with two British sergeants to hold the post.

Even after making due allowance for the complete worthlessness of our
Persian auxiliaries, we hesitated to believe that the Turks would commit
themselves to a frontal attack on the Kuflan Kuh. Given a sufficiency of
reliable troops, it would have been an admirably strong defensive position,
and any enemy who came "butting" against it with lowered head would have
found the experiment a costly one.

But the Turks had seemingly gauged the measure of our strength and our
weakness more accurately than we had ourselves, for, eschewing anything in
the nature of new-fangled turning movements, they came at us in the good
old-fashioned way, and by the most direct route.

The attack was delivered after breakfast on September 12th, and on the
part of the enemy there was no sign of hurry or confusion. Two thousand
infantry, highly trained and admirably handled, belonging to one of their
crack Caucasian divisions, crossed the river in extended order and flung
themselves against our line. The shock of contact was first felt on the right,
where the Persians were in position. These latter promptly broke and fled in
utter disorder, all attempts to rally them proving futile. Our line was now in
the air, so to speak, with the Persians scuttling like rabbits up towards the
entrance to the Pass. It was short and bloody work.

The Hants and the Ghurkas had now to bear the brunt of the attack. The
Turks, reinforced, came on in surging waves and flowed over their trenches.
Both units made a gallant but ineffectual fight, and were forced back up the
Pass, suffering considerable losses. The enemy followed up his advantage
and stormed the Pass itself. A last stand was made at the summit to cover the
retreat of the guns. Here Hants and Turks fought hand to hand with bayonet
and clubbed rifle, until the sadly diminished remnant of this brave battalion,
after losing their gallant sergeant-major, were literally pushed over the crest
and down the reverse slope. But they had stood their ground long enough to
save the guns from capture.

The Worcesters, who had been in reserve on the southern slope, now
came doubling into action to the assistance of the hard-pressed Hants.
Taking shelter behind the boulders which are plentiful on both sides of the
roadway, they covered the retirement, driving the Turkish snipers off the
summit of the Pass and arresting any immediate pursuit on the part of the
enemy.

The caravanserai at the Kizil Uzun Bridge, where Colonel Matthews had
his headquarters, being now untenable, he withdrew with his remaining force
across the Baleshkent Pass to Jamalabad on the road to Zinjan. As for the
runaway levies, some of them did not halt until they had placed a good
twenty miles between themselves and the scene of the Kuflan Kuh fighting.

The Turks pursued us to Jamalabad, but it was the last kick. Their
offensive spent itself here, thanks to a new factor which had entered into the
game. This was the armoured car sections, light and heavy, under Colonel
Crawford and Lieutenant-Colonel Smiles, which, when our position was
indeed precarious, had been rushed up from Kasvin and Zinjan in support of
our retiring column. The Turks got a bad peppering at Jamalabad, and a few
miles farther south at Sarcham where the cars were in action. The enemy had
no liking for this sort of fighting, and troubled us no more. They withdrew
from Jamalabad and, in anticipation of a counter-offensive on our part,
proceeded to fortify themselves on the Kuflan Kuh.

A week after the fight at the Kuflan Kuh two men of the Hants who had
been captured by the Turks arrived in our lines, clothed in nothing save a
handkerchief apiece. While their captors were squabbling amongst
themselves as to the distribution of the worldly possessions of the prisoners,
the latter had slipped away unperceived and gained Jamalabad. There they
were waylaid by Persian thieves, badly beaten, stripped of their clothing, and
left for dead on the roadside. Still, they were a plucky pair, for, recovering,
they set out afresh, and, completing a fifty-mile tramp in the blazing sun
without food or raiment, rejoined their unit.

The Crawford armoured cars and the Matthews column slowly fell back
on Zinjan, and there ended the military activities of the Tabriz expedition.

My strictures on the fighting value of the Persian may appear unduly


severe. I fully realize that one had no right to expect very much from a mass
of raw, undisciplined material. The men were hastily recruited, and their
training, necessarily circumscribed by the exigencies of time, could not have
been anything but perfunctory and imperfect in the circumstances. But I am
tilting rather at the theory prevalent in certain quarters at the inception of the
Tabriz Expedition that one had only to send British officers into the
highways and byways of Azerbaijan and that they would find there "ready-
made" soldiers endowed with a fine fighting spirit, hardly inferior in quality
to our own superb infantry, men who would stand up to trained and efficient
soldiers like the Turks. Having once got the half-trained levies into the
trenches, their British officers were expected to hold them by sheer force of
will-power, and to hypnotize them into taking aim at an enemy without
shutting both eyes. Now the bubble of Persian fighting efficiency has been
pricked, and we have a more just appreciation of the virtues and
shortcomings of the Persians as a unit in a modern army.
CHAPTER XVIII

CRUSHING A PLOT
Anti-British activities—Headquarters at Hamadan—Plans to seize ringleaders—Midnight
arrests—How the Governor was entrapped.

Back in Hamadan, the fierce political enmity of the Democrats, which


had been quiet for some time, broke into fresh activity after the removal of
Dunsterville headquarters to Kasvin at the end of May.

General Byron, who was in charge at Hamadan, speedily discovered


through his Intelligence Officers that the local Democrats were bent on
making things merry for the British, if they possibly could. Previous rebuffs
had taught the Democrats the value of silence and a more complete method
of organization. Their defects in these directions were now to some extent
remedied. Turkish gold, too, was forthcoming, and the Democrats of
Hamadan became a secret political organization—a sort of Persian Mafia or
Camorra—which was hatching a political conspiracy against the British. It
was the Ittahad-i-Islam again at work. This organization, while outwardly
making common cause with the Islamic malcontents of Hamadan and
elsewhere, was in secret working strenuously for Turkey and the Turkish
cause, and the Democrats who were caught in its net were but a means to
that end.

One thing, however, soon became clear—that a vast network of Turkish


espionage, with ramifications through Persia, had its headquarters in
Hamadan. For many weeks the organization was allowed to have free rein in
the carrying out of its "holy work."

Its propaganda mills worked long and late; its agents came and went;
Turkish emissaries slipped into Hamadan and out again without any
difficulty, and the leaders of the Hamadan movement, which aimed at our
overthrow by a tour de force, must have often chuckled to themselves at our
apparent simplicity and at the ease with which we had been outmatched by
Oriental cunning.

While feigning blindness, the British were very watchful indeed. It was
like the story of the faithful retainer of the Samurai noble in feudal Japan
who set out to avenge his lord's death. His enemies were powerful and
vigilant, but in the end his carefully simulated indifference threw them
completely off their guard, and he triumphed. So it was in Hamadan, where
sharp wits were pitted against sharp wits. In time the chiefs of the inner ring
of the Hamadan combination grew careless. Little by little, their secret signs
and passwords, their working programme, their membership roll, and even
full details of the Turkish system of espionage in Persia generally, passed
into our hands. There was little more to wait for. It was time to strike.

But a fresh difficulty immediately presented itself. The plotters, in co-


operation with Kuchik Khan, had fixed the date for an armed revolt against
British occupation; and what afterwards happened in Egypt, was, in June of
1918, deliberately and carefully planned to take place in Hamadan. There
were practically no troops in the town at the time, and the torch of revolt
once lighted and the work of our extermination begun, ten or twelve officers
with a couple of dozen of N.C.O's. of Dunsterforce could not for long have
resisted the determined onslaught of a fanatical and arrack-incited
population of 70,000.

To arrest the leaders openly in daylight would assuredly have precipitated


a disaster, and led to bloodshed, and probably to our own undoing. The inner
council of the conspiracy consisted of fifteen members, and included the
Persian Governor and a number of local notables.

Secrecy and surprise were essential; so the plan hit upon was a night
descent simultaneously on the whole band, an officer and two N.C.O's. being
detailed for each arrest.

The procedure in the following case may be taken as typical of the others:
In the early hours of the morning a Persian batman in the employ of a British
officer was directed to deliver a sealed envelope marked "From O.C.
Hamadan" at the house of one of the plotters. The messenger, hammering at
the door, aroused the sleepy watchman within, and told him that he had an
important letter to deliver from the British General. "Come back in the
morning," would reply the watchman, "my master is in bed and asleep." The
messenger, duly coached, would reply, "That is impossible. Open the door.
The letter, I know, is important, for I have been given ten krans to deliver it
safely." The watchman, while wary and inclined to be suspicious of belated
callers, was also avaricious, and was not going to let slip any chance of
netting a few krans. As had been anticipated, his greed overcame his caution.
He opened the door in order to claim his share of the late letter delivery fee.
As soon as he did so, a couple of stalwart British sergeants, springing out of
the darkness, seized, bound, and gagged him. Once within the high-walled
courtyard of the house, the rest was easy. It was but a few steps to the
sleeping apartments, and the proscribed conspirator as a rule woke up to find
the chilly muzzle of a British service revolver pressing against his temple.
He was gagged to prevent his raising an alarm; his hands were bound; and,
thus helpless, he was carried off and dumped into a covered motor lorry,
where an armed guard saw that he came to no harm.

But the Persian Governor himself was the most difficult of the whole
band to surprise and arrest. His residence was in a big walled serai at the
extreme end of Hamadan, and, in accordance with Persian custom, and by
reason of his official position, he lived surrounded by a guard of about fifty
men. To deal with him tact and finesse were necessarily called into play.

The task of securing the Governor quietly and without unnecessary fuss
fell to the lot of a Colonel who had learned something of native ways in
Rhodesia and East Africa. He was an Irishman possessing a glib tongue, a
knowledge of Persian, and all the suavity of his race. He also had the
advantage of being known to the Governor and his entourage. So, when he
knocked at the door of the Governor's residence at an hour long after
midnight, the watchman admitted him without hesitation. The guard turned
out and eyed the intruder suspiciously, but, finding it was the sartip sahib
(Colonel) from the British Mission who was making inquiries about the state
of the Governor's health, they yawned sleepily and betook themselves to the
shelter of their blankets, vowing inwardly that the eccentricities of this
strange race called English who paid ceremonious visits in the middle of the
night were beyond the comprehension of any Oriental mind.
"There has come wonderful news from Teheran, and the Governor must
be told at once," said the visitor, flourishing a big envelope with many red
seals attached thereto.

"Good," replied the janitor deferentially, "the Governor is enjoying sweet


repose, but if it is the wish of the Colonel Sahib, I will take him the paper."

"Alas, that it should be so!" interposed the caller gravely, "but into his
own hands alone am I permitted to deliver this precious letter. Go, faithful
one! Summon your illustrious master, the protector of the poor, and the
friend of the oppressed! I will remain on guard by the open door, and none
shall enter in your absence."

The ruse succeeded. The servitor departed on his errand, and in a few
minutes returned with the Governor clad in a dressing-gown and slippers. He
greeted the Colonel, who handed him the envelope which contained a blank
sheet of paper. It was dark on the threshold where the Governor stood tearing
open the missive, so the Colonel proffered the aid of his electric torch.
Presently the Governor, divining that something was amiss, looked up with a
start, and found himself covered with a revolver. "Come with me," said the
officer tersely, "and, above all, do not resist or attempt to summon help!"
The trapped official obeyed with docility, and followed his captor to a
waiting automobile, into which he was bundled and placed in charge of a
British guard. Two sentries at the guardroom door kept the Persian guard
within in subjection while the Governor's papers were being seized. These
latter proved to the hilt his complicity in the plot that was being hatched to
destroy British lives in Hamadan. The deposed official—accompanied by
copies of the incriminating documents—was sent as a present to the Teheran
Cabinet, with a polite request for an explanation of the gross treachery of
their unfaithful servant.

The coup had succeeded without the firing of a shot, and the back of the
conspiracy was broken, for it was left impotent and leaderless. Before
sunrise all the captives, with the exception of the Governor, were on their
way to Bagdad and an internment camp.

An amusing sidelight on the affair was the attitude of the Persian police
in Hamadan. Hearing of the arrests, they assumed the worst. They bolted,
taking refuge in the neighbouring cornfields, where they remained a whole
day under the impression that they were the sole survivors of a "general
massacre" of inhabitants carried out by the British.

CHAPTER XIX

THE FIRST EXPEDITION TO BAKU


Kuchik Khan bars the road—Turk and Russian movements—Kuchik Khan's force broken
up—Bicherakoff reaches Baku—British armoured car crews in Russian uniforms—
Fighting around Baku—Baku abandoned—Captain Crossing charges six-inch guns.

In a previous chapter I pointed out that Kuchik Khan was in military


possession of the Manjil-Resht road, and that the Russians under
Bicherakoff were concentrating at Kasvin preparatory to trying conclusions
with this amiable bandit—the cat's-paw of Turkish-German intrigue—who
was barring Bicherakoff's route to the Caspian and to Russia.

At the end of May, in order to bring about a more effectual co-operation


between his own force and that of the Russian commander, General
Dunsterville transferred his headquarters from Hamadan to Kasvin.

The original purpose of the Dunsterville Mission, it will be recollected,


was to fight Bolshevism by the organizing of Armenians and Georgians and,
if possible, Tartars, in the Southern Caucasus. This had now become difficult
of realization, owing to the series of bewildering and kaleidoscopic changes
in Transcaucasia which had profoundly affected the entire political and
military situation. For example, the virus of Bolshevism had infected the
Russian troops in Baku; the Germans had landed at Batum and, by making
peace with the Georgians, were placed in possession of Tiflis. The Turks had
arranged a peace pact with the Armenians which left their armies free to
invade north-west Persia, prosecute a vigorous campaign against the
Nestorians of Urumia, and, finally, overrun the Caucasus as a preliminary to
co-operating with the Germans in their contemplated advance on Baku. Now
the Bolshevik leaders in Baku refused to recognize the right of either of the
rival belligerent groups—the Central Powers or the Entente—to spoil the
flavour of their military hotch-potch in any way. It suited the blasé Russian
palate, and that should be sufficient. The Bolsheviks, at all events, were
consistent to the extent that, while they opposed the advance of the Germans
and Turks towards Baku, they more than once resolutely refused to accept
the proposed aid of British troops to help them in overcoming the forces of
the Central Powers.

DRILLING ARMENIANS AT BAKU.

Negotiations with Kuchik Khan had ended abortively. The leader of the
Jungalis was quite prepared to permit Russian troops to withdraw from
Persia if they wished, and to pass through his "occupied territory" to their
port of embarkation on the Caspian. But British, "No!" They had no business
in Persia at all, he argued, and if they were desirous of going to Russia, they
would have to find some other road.

The haughty tone of this communication angered the Russian General,


and he sent Kuchik Khan an ultimatum, calling upon him to evacuate the
Manjil position with all his followers, or be prepared to take the
consequences. As Kuchik ignored this, a combined Russian-British force
was sent against him on June 12th. Two of the British armoured cars which
the year previously had formed part of the Locker-Lampson unit in Russia
proper, were present at the attack. After a brief bombardment, a white flag
was hoisted on the Manjil bridge position, and two German officers issued
from the trenches to parley. They offered, on behalf of Kuchik Khan, to
come to terms with the Russians and allow them to pass, provided a similar
concession was not demanded by the British. Bicherakoff's reply was to
dismiss the impudent parliamentaires, and to intimate that Kuchik Khan and
his whole force could have fifteen minutes in which to lay down their arms
and surrender. Nothing happened, so at the end of the stipulated period the
advance was ordered, and the Russians and British stormed the enemy
trenches and speedily disposed of the Jungalis holding them. Kuchik and a
portion of his army, with his two German military advisers, escaped for the
time; but, after another drubbing had been administered to him, the
crestfallen Jungali leader was glad to make peace, dismiss his German staff
officers and drill instructors and release McLaren and Oakshott, two
Englishmen, who had spent months in captivity.

The road to Resht and Enzeli was open at last, and Bicherakoff moved to
the Caspian without delay and set about embarking his command for Baku.
As a leader, Bicherakoff was popular amongst his men; and in the Caucasus
he enjoyed deserved prestige as a soldier. He was pro-Russian—that is to
say, anti-Bolshevik; and it was felt that his own personal influence, no less
than the presence of his troops at Baku, would serve as a powerful antidote
to Bolshevik activity in Southern Caucasia.

Bicherakoff's contingent embarked at Enzeli on July 3rd. A British


armoured car battery accompanied the Russians, and, in order not to ruffle
unduly the susceptibilities of the Bolsheviks, British officers and men wore
Russian uniforms. But these they discarded on landing at Baku. Bicherakoff,
who made a favourable impression locally and was well received by the
inhabitants of the great oil centre, lost no time in seeking out and engaging
the Turks, who were menacing Baku from two sides. A good deal of heavy
fighting went on during the middle of July, and the British armoured cars
rendered signal services, being engaged almost daily in close-quarter
fighting with the Turks, enfilading their infantry and breaking up their
threatened attacks, and, on another occasion, repulsing a cavalry charge with
heavy loss to the enemy.

Bicherakoff, however, soon found that the local troops were not to be
relied on, even when they professed their readiness to fight under his flag
and against the Turks. On July 29th the Turks, who seemed bent on getting
possession of Baku at any cost, succeeded in capturing Adji-Kabul station, a
short distance south-west of Baku. Using this as a pivot, they swung
northwards in order to complete the envelopment of Baku.

The Russian commander now became anxious for his own safety.
Realizing his powerlessness to carry on an effective offensive, and fearing
lest he should be shut up in Baku when the Turkish encircling movement
became complete, he hurriedly abandoned the town, and with his British
armoured car auxiliaries went off north by rail towards Derbend and
Petrovsk, to operate against the Bolsheviks and Dageshani Tartars who were
terrorizing the country bordering on the Caspian.

In the attack on Petrovsk, the armoured car unit led under the command
of Captain Crossing. Their fire threw the Bolshevik troops into confusion,
and, when the latter broke, the cars pursued them through the town,
capturing several hundred of their number. A battery of six-inch guns which
had subjected the attacking force to an annoying fire was with extraordinary
temerity engaged by the armoured cars and put out of action by the simple,
but dare-devil expedient of dashing up within range and shooting all the
gunners. This splendid and heroic deed won for Captain Crossing—"the
super-brave Crossing," as Bicherakoff designated him—the Cross of St.
George, and the Order of St. Vladimir for Lieutenant Wallace; nor in the
distribution of awards for gallantry were the men who accompanied the two
officers in the armoured car charge against the guns forgotten by the grateful
Russian commander.
CHAPTER XX

THE NEW DASH TO BAKU


Treachery in the town—Jungalis attack Resht—Armoured cars in street-fighting—Baku
tires of Bolshevism—British summoned to the rescue—Dunsterville sets out—Position
at Baku on arrival—British officers' advice ignored—Turkish attacks—Pressing
through the defences—Baku again evacuated.

We were soon to discover that we had not cut the claws of the Jungali
tiger, and that he was yet capable of giving us serious trouble.

There had been a good deal of unrest amongst the disbanded followers of
Kuchik Khan. Men had gone back to their villages to brood over their
reverse of fortune. The hotheads amongst them were not at all satisfied at the
easy way in which they had been beaten out of their entrenchments on the
Manjil road. Various pretexts were put forward with a view of explaining
away the sharp reverse they suffered on that occasion. Further, there was a
recrudescence of propaganda activity amongst them, carried on by Turkish
agents and sympathizers who came and went in the jungle country on the
shores of the Caspian.

Bicherakoff and his Russians had gone off to Baku, and a small force of
British alone was holding Resht. Admirable for the Jungalis' plan, thought
their leaders! This time they would be able to settle their account with the
British without any intervening Russian mixing himself up in the business.

Early on July 20th a large force of Jungalis made a surprise attack on


Resht. Aided by armed partisans within who, once the attack developed,
brought hitherto concealed rifles into play from window and roof-top, the
enemy achieved a distinct measure of success. The street fighting was
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like