Beginning NET Game Programming in VB NET 1st Edition David Weller - The ebook is ready for instant download and access
Beginning NET Game Programming in VB NET 1st Edition David Weller - The ebook is ready for instant download and access
com
https://ebookname.com/product/beginning-net-game-
programming-in-vb-net-1st-edition-david-weller/
OR CLICK HERE
DOWLOAD EBOOK
https://ebookname.com/product/vb-to-vb-net-craig-utley/
https://ebookname.com/product/fast-track-vb-net-1st-edition-
rocky-lhotka/
https://ebookname.com/product/professional-asp-net-4-in-c-and-
vb-1st-edition-bill-evjen/
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/
https://ebookname.com/product/terrestrial-global-productivity-
physiological-ecology-1st-edition-jacques-roy/
https://ebookname.com/product/dermatoscopy-in-clinical-practice-
beyond-pigmented-lesions-series-in-dermatological-treatment-1st-
edition-giuseppe-micali/
https://ebookname.com/product/communication-yearbook-31-1st-
edition-christina-s-beck-ed/
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
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.
Editorial Board: Steve Anglin, Dan Appleman, Ewan Buckingham, Gary Cornell, Tony Davis,
Jason Gilmore, Chris Mills, Dominic Shakeshaft, Jim Sumser
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.
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
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
Contents
Sprites . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .208
Space Donuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .223
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .243
viii
4010fm.qxd 8/20/04 2:33 PM Page ix
Contents
Moving On . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .343
Habits to Build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .344
Things We Neglected to Tell You . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .348
Happy Trails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .350
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
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
xiv
4010fm.qxd 8/20/04 2:33 PM Page xv
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-4: PAC-MAN® ©1980 Namco Ltd. All rights reserved. Courtesy
of Namco Holding Corp.
Figure C-6: GALAGA® ©1980 Namco Ltd. All rights reserved. Courtesy of
Namco Holding Corp.
xvi
4010fm.qxd 8/20/04 2:33 PM Page xvii
Acknowledgments
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:
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.
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 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.
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!
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.
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.
"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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
CRUSHING A PLOT
Anti-British activities—Headquarters at Hamadan—Plans to seize ringleaders—Midnight
arrests—How the Governor was entrapped.
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.
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.
"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
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 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, 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
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.
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.
ebookname.com