dev.mag - 14
TRANSCRIPT
-
8/14/2019 Dev.Mag - 14
1/28
JUNE 2007
-
8/14/2019 Dev.Mag - 14
2/28
REGULARS
EdsNote.........................................................................................P03
News...............................................................................................P04
FEATURE
TheMakingof.S.C.A.G...................................................................P05
OPINION
TheSandtrap...................................................................................P09
CanGameDevelopersLearnfromGenetics?................................P10
DESIGN
BlenderIntermediateTutorial:CreatingExplosions.........................P12
TakingtheBluePillfor:GameMaker...............................................P15
ABeginnersGuidetoMakingGames:Part1..................................P16
PROJECTS
RoachToaster2:BigCity................................................................P21
TECH
GameCodingwithTrigonometry:Part1.........................................P22
HISTORY
TheHistoryofI-ImaginePart5:TheFirst9Months.......................P24
TAIL PIECE
JohannesburgdevLAN....................................................................P27
CONTENTS WHATS INSIDE
05
15
24
27
-
8/14/2019 Dev.Mag - 14
3/28
EDS NOTE THE BIG CHIEF
AninterestinglittlethingiepoppedupontheGame.Devforumstheotherday.Amidstallthehype,hubbuband
competitionentriesforComp15(hey,R10000,remember?)thathavebeenclutteringthecommunityasof
late,oneofourmembersburstinonthelatestDev.Magthreadanddrewourattentiontothefactthathesaw
someGame.Devadsonthetelly.Prettyawesome,Imustsay!Werestokedthatthegrouphascomesofar
inthisrelativelyshortspaceoftime,andkudosmustbegiventothecommunitysfounderandleader,DannyIve-worked-
my-ass-offDay,knowntomostasdislekcia.
ThiskindagotmethinkingthatmaybethismagdoesntadvertiseitslinktotheGame.Devgroupenough.Itsalwaysbeen
greatthatthemembershaveworkedautonomouslyonthispublicationformorethanayearnow,andweveneverbeen
restrictedbythehigh-upsregardingcontentdecisionsandhowmuchextraicecreamwegetonFridays(itsaperkforloyal
staffmembers,Ilienot).But,asflatteringasitistohavesomepeopleforgetthatDev.MagisjustacoginthebigGame.
Devmachine,maybeitstimetopayhomagedirectlytoouralmamateroverthesenextfewissues.Thankyou,Mommy.
Youvegivenbirthtoabeautifulbabyzine.
Onasimilarnote,someofourwritershavebroughtuptheconcernthatperhapswerelosingtouchwithouroriginalethos.
Nomatterwhatelseweputinourpages,thiszinewasultimatelycreatedtoserveasaguidethosewhoweretakingtheir
firsttentativestepsonthatscarygamedevelopmentroadsobygolly,weregonnastickwiththatgoal! Tothisend,weve
donethreethingsforyou,ourreaders:
1.WeveintroducedaBluePillarticleseriesintheDesignsection.Everymonth,wellbetakingalookatonegame
developmentproduct.Welltellpeoplewhatitis,howitworks,whereallthebesttutorialscanbefoundandwhyitsa
goodideatogetstartedwithit.
2.WeveestablishedourownseriesofGameMakertutorialstohelpanybodywhostillisntconvincedbywhattheyhear
abouttheproductseaseofuse.Itsablast,seriously!
3.Werenowtakingcaretorefertobackissuesforthebeginningsofarticleseriesoronce-offtutorials,sothatanybody
confusedbythestufftheyreadinherecaneasilyflipbacktoapreviouseditionandbeenlightened.
Weredoingourbesttomakethisworkoutaswellaspossible,sobesuretosendusyourfeedbackandtelluswhatyou
thinkofthechanges!
Editor
Rodain Nandrew Joubert
EDITOR
Rodain Nandrew Joubert
DEPUTY EDITOR
Claudio Chippit de Sa
SUB EDITOR
Tarryn Azimuth van der Byl
DESIGNERS
Brandon Cyberninja Rajkumar
Geoff GeometriX Burrows
MARKETING
Bernard Mushi Mushi Boshoff
Andre Fengol Odendaal
WRITERS
Simon Tr00jg de la Rouviere
Ricky Insomniac Abell
William Cairnswm Cairns
Danny Dislekcia Day
Andre Fengol Odendaal
Heinrich Himmler RallMatt Flint Benic
Luke Coolhand Lamothe
Stefan ?rman van der Vyver
Gareth Gazza_N Wilcock
WEBSITE DESIGNER
Robbie Squid Fraser
WEBSITE
www.devmag.org.za
EMAIL
This magazine is a project of the
South African Game.Dev commu-
nity. Visit us at:
www.gamedotdev.co.za .
All images used in the mag are
copyright and belong to their re-spective owners. If you try and
claim otherwise, you dont get to
play .S.C.A.G....
... ever!
WHOOPS!
Well,arentwejustsillysillies?Lastedition,we
failedtomentionthatthisDBmodel(and,well,all
oftheotherDBmodelsyousee)aredonecourtesy
ofoneGeoffGeometriXBurrows.Hedidapretty
swelljobonem,too.Thanks,Geoff!
DEV.MAG ISSUE 143
This months opinion columnists:
Rodain Nandrew JoubertSimon Tr00jg de la Rouviere
This months PGD contributors:
Michiel NecroDOME Gijbels
Frank Mad Woody van Gent
www.pascalgamedevelopment.com
-
8/14/2019 Dev.Mag - 14
4/28
Reminder for Comp 15
http://www.gamedotdev.co.za/
Thatsright,acheekylittlereminderthatthecompetitionisstillonandstillacceptingnew
entrants!Gamemakersextraordinairehaveonemonthlefttogetcrackingontheirown
masterpieces based around an educational theme and get their piece of
R10000! CheckouttheGame.Devwebsiteandforums formoredetailsonentering.
Game Addiction Discussed
http://www.gamedev.net/community/forums/topic.asp?topic_id=453210
TheAmericanMedicalAssociationrecentlyheldadiscus-
sionabouttheseverityofgameaddictionandwhetheror
notitcanbeconsideredaformalpsychologicaldisorder.
Thefinaldecisionwasagainstlabellingitassuch,butonly
becauseitwasfeltthatmoreresearchneededtobedone
inthearea.Gamedev.nethasalinktothedocumentout-
liningtheissue,anditlookslikethemedicalworldisgoing
tobepayingmuchcloserattentiontogamingfromnowon.
NEWS HEADLINES
Doritos game design
http://www.unlockxbox.com/
Thelatestgame-makinginitiativeonthe
Xboxisbeingspearheadedby...tortilla
chips?Well,thatseemstobethecase,
anditsaninterestingchallenge,tosay
theleast.Thepremiseissimple:submit
adesignideaforaDoritos-basedgame
which has the chance of being devel-
opedintoaXboxLiveArcadegame.If
you happen to have a US citizenship
lyingaround,takeastabatityourself,
orwatchfromtheshadowstoseewhat
happens with whats proclaimed to
be the first user-generated Xbox 360
game.
Nintendo says yes to indie developers
http://gizmodo.com/gadgets/wiiiiiiiii!/nintendo-opens-wii-to-indy-developers-272717.php
Traditionally,Nintendohaskeptitsdoorsclosedtothirdpartyand
indiedevelopers.However,arecentannouncementbythecom-
panyhas turned that ideaonitsheadandbroughthopetoWii
enthusiastsandaviddevelopers.WiiWare,agamedistribution
servicecomparabletotheoneofferedbyXboxLive,issettoal-
lowsmallercompaniesachancetogettheirgamestothepublic
withauser-friendlysalessystem.Althoughitseemsunlikelythat
thiswillopenupWiidevelopmenttothemanonthestreet,were
holdingthumbsforit.
DEV.MAG ISSUE 144
-
8/14/2019 Dev.Mag - 14
5/28
programThe_Making_of_.S.C.A.G.;
implementation
constructorCreate();
begin
Thisarticlewilldescribein-depthhowwemade
thegame.S.C.A.G..Whenwestartedwiththe
engineayearandahalfago,theoriginalideawastomakeafirstpersonshooter.Whenwe
finallyhadauserfriendlyeditor,thePGDcom-
petition(BigBoss)crossedourpathandwede-
cidedtocreateagamethatlookedliketheold
arcadegameRaptor:CalloftheShadows.
end;
procedureInit();
begin
Thefirstthingwedidwastocreateanewproj-
ect,andincludeourNecro3Dgameengineinit.
Thiswasagoodtestforustoseeifweactually
THE MAKING OF SCAGby NecroSOFT
FEATURE SHOOT. FLY. SHOOT SOME MORE.
Wejustcantseemtogetenoughofthose
Pascal guys right now. This month, we
sport a postmortemofone ofthe games
built by the Pascal Game Development
teamknown asNecroSOFT. Theycallit
.S.C.A.G.. Its slick, its fancyanditwon
2nd place in the 2006 PGD Big Boss
competition, so we thought it would be
worthwhileto nagthem fora juicyarticle.
Ofcourse,theseguysdontthinklikemost
people,sowhatweendedupwithwasa
cryptic list of Pascal code instead of the
usualEnglish. Fortunately for you, dearreader,wemadeafaireffortattranslation...
DEV.MAG ISSUE 145
-
8/14/2019 Dev.Mag - 14
6/28
couldmakeagamewiththeengine.Wewere
alsoabletoseeiftheeditorwasasuserfriendly
aswewantedit tobe.When our enginewas
successfully implemented, itwastime to load
alow-polyshipandafewcubestogetproperhandlingfortheplayersship.Inthisphasewe
alsogotthegreatideatodosomethingmore
then a 2DRaptor game ina 3Dengine.We
decidedtomakeagamethathadaside-view,
andatop-downview.Withthisinourminds,we
startedcreatinglevelsandenemies.
end;
functionLevel_Design()
begin
Forthecompetitionwehadtomakethreelev-
els.Wellwemadefour just for fun!Afterthe
competitionweexpandedittofourteen,divided
intofourdifferentzonesplusonebonuslevel.
Thefirstlevelwasacity.Becausewehadno
terrainengineyet,weusedplanestomakethe
cityroad.Inafewplacesinthelevelweadded
somebigsmokeparticlesforsomereallynice
effects.Thiswill givethe player theidea that
itsverywindyinthetownandthatthecityis
deserted.Itseasytocreate,andgivesagreat
environmenttothegame.
Thetop-down,andside-viewcannotbechosen
bytheplayer,butaremarkedinthemap.This
isbecausewehadtoaligntheenemiesontwo
differentaxesforthetwoviewmodes.Allthe
enemieswereplacedwithoureditor.Wecan
tellyouthis-itwasonehellofajobtogetit
done.Itdidnttakeverylongbeforewecreated
acopyandpastefunctionforthisintheeditor.
FEATURE SHOOT. FLY. SHOOT SOME MORE.
DEV.MAG ISSUE 146
-
8/14/2019 Dev.Mag - 14
7/28
Whentheterrainenginewasdone,itwasreally
easytoimportheight-mapsandspeedupthe
leveldesign.A very importantthing to create
therightenvironmentislight.Insteadofusing
onegloballight,weusedalotofsmalllights.Themostimportantthingisthatallthoselights
weplaced had different colors. For example,
inthelavalevelsweusedalotofyellowand
redlightstomaketheuglygreylevelsmoreat-
tractive.Wehadasmallproblemwiththislevel
becausewehadalotofaliasinggoingonatthe
edgesofthelavaandtheterrain.Tosaveyou
guysalotoftimewhenyouhavethisproblem,
its caused bythe Z buffer and theminimum
cameradistance.
Anotherfunthingaboutthelavalevelthatwe
createdafterthecompetitionwastherocksthat
arefallingdown.Thisistheonlyplacewhere
weusedtheNewton Physics Engine thatwe
implementedintoourengine.
Inmostof thelevelsweusedmulti-texturing.
Thismeansyoucanplacetwoormoredifferent
texturesoneachotherwithablendingeffecton
it.Inoureditorwemadeafeatureinthetexture
browsertoeasilydothis.Justcreateanempty
texturewith a sizeand load the texturesyou
wanttouse.Youcanseethiseffectintheice
level,aswellasthemirroringonthebuildings
ofthecitylevel.
end;
functionWeapons();
begin
The most fun part of creating a game is of
course adding awesomeweapons.The inter-
estingthingofourgameisthatsomeweapons
havetwodifferentbehaviors.Forexamplethe
rockets will fall down a little bit in side-view,
andthenintop-downview,theywillgotooutto
thesidesabitonthescreen.Wealsomadea
weaponcalledtheDrunkenpod.Itfiresabunch
ofsmall rockets thatwillfly allover theplace
--becausetheyredrunk,ofcourse.Eachrocket
FEATURE SHOOT. FLY. SHOOT SOME MORE.
leavesasmalltrailwhichcreatesareallycool
effect.We made thisby simply stickingsome
particlestogether.
end;
functionShip_Modeling();
begin
First, I haveto saythat wearenotgreat de-
signers.Ourinspirationcamespecificallyfrom
Raptor.Wealsolookedforsomeshipsonthe
internetforideasandworked themoutin 3D
max,butwithourowntwist,ofcourse.Theidea
oftheSharkfighter(yellow,redenemy)wascre-
atedfromanoldGameBoyClassicgame(dont
rememberthe name).Butduringthe creation
wechangeditsomuchitwasacompletelynew
fighter.Afterwecreatedthemodelswehadto
doourfavoritejob-texturing.Wellwemadeit,
andlooksgood,butitsnotthemostfunpartto
doandverytimeconsuming.
end;
functionSoundtrack;
begin
We made four different soundtracks for
DEV.MAG ISSUE 147
-
8/14/2019 Dev.Mag - 14
8/28
.S.C.A.G..Thefirstideawastoletafriendof
oursmakeitwiththehelpofhisband.Unfor-
tunatelyhedidnthavethetimetodoit,sowe
decidedtomakeitourselves.Weusedavery
oldprogramfrom1996calledNewBeat.Itoffers
alotofdifferentsamplesdividedintosamples
from 2, 4 and 8 seconds. With thisyou can
makegreatsongsifyouuseitright.Itcreated
justwhatwewanted,aretrostylesoundtrack.
Onlykeep inmind thatthesamplesshouldnt
conflictwitheachother.
Toplaythesoundtrackandsoundeffects,we
hadfirstusedtheOmegaDirectXSDKforDel-
phi,butsincethereleaseofVistawenoticedit
wasntVistacompatible.Sowethendecidedto
useanotherSDKandasresult,wecannowsay
that.S.C.A.G.isVistacompatible.Itnowalso
supports the Doppler effect, but is not used.
Yet...:)
end;
functionMenu();
begin
Forthemenuwecreatedanewmenuengine
that supports drag-able panels and custom
fonts.Fontsin.S.C.A.G.arecreatedatruntime
tosavediskspace.Themenuitselfwascreated
usingbuttons.Eventhebigcaptionlogoontop
ofthemenuwascreatedusingabuttonwithno
clickeventandtwoofthesameimagessoyou
wontnoticeitwhenyouhoveryourmouseover
it.Thescrollingtextinthecreditswindowwas
madewitharendertargetthatwasplacedon
abutton,whichinturnwasplacedonthemain
creditspanel.Itgivesanicelooktoseecredits
scrollinginsideawindow.
end;
functionThe_New_Way();
begin
OurNecro3Dgameengineisgreat,butthereis
alwaysroomforimprovement.Thatswhyafter
twogamesintheNecro3Dgameengine,weare
nowbusywiththeNecro3Dgameenginever-
sion2.Themainimprovementofthisnewen-gineisthatitwillbefullydynamic.Wearegoing
touseseparatemodulesthatareloadedinthe
enginelikeapluginsystem.Examplesofsome
ofthemodulesare;theRendermodule,Sound
module,Physicsmodule,andsoon.Withthis
structurewecaneasily change, forexample,
therenderingwithDirectX10orOpenGL,with-
outrewritingthewholegameengine.Thisalso
meansthatwecaneasilyupgradeagamewith
anewphysicsengine.Itsalittlemorecomplex
tomake,butwhenitsdonewellhaveagreatly
improved,fullydynamicengine.
The workofthisnewengine progresseswell
andwearealreadyabletoload3Dworldsand
compile shaders --something the old engine
couldntdo.Alsotheeditorisgoingtobevery
different.Insteadofthefourviewsections--top,
left,frontand3D--wearenowgoingtouseone
FEATURE SHOOT. FLY. SHOOT SOME MORE.
single3Dview.Weareveryexcitedaboutour
newengineandhopetobeabletoshowyou
thefirstgamesmadewithitsoon.
end;
procedureCleanup();
begin
With.S.C.A.G.,wemadeagreatgameandfin-
ishedsecondinthePascalGameDevelopment
AnnualCompetition.Wecansaythatwehada
lotoffunmaking.S.C.A.G.andareplanningto
tryandsellthiswonderfulgame.Keepinmind
thatthisisnottheend,butonlythebeginning.Wewillcontinuemaking gamesandwith the
newengine,wehopetobeabletocreatemore
qualitygamesthenever.Andwhoknows,may-
beyoullseea.S.C.A.G.2?;)
Print(Endofline.);
end;
//Giveusavisitat
//http://necrodome.homeftp.net/
end.
DEV.MAG ISSUE 148
-
8/14/2019 Dev.Mag - 14
9/28
THE SANDTRAP
Yeah,okay,soweallstandinaweofcreativityandfreedominvideogames,
right? I mean, games are evolving
from the droll, go-here-do-this linear hum-
drumof yesteryearinto theflexible,free-form
sandboxesthatweremetwithtoday.Theyre
morelikethetoysthattheyshouldbe,right?
Riiiiiiight.
Popular opinion seemsto bethatgames like
TheSims,BlackandWhiteand,toalesserex-
tent,Fable are usheringin the golden age of
gaminganeraofvirtualworldswhichhaveac-
tivitiesandobjectivesthatgobeyondthebasic
goalsofthegameitself.Inmoreextremecases,
user-definedgoalsserveastheonlyobjectives
inthegame.So,woohoo!Youhaveultimate
poweroveryourdestiny!Aintthatjustdandy?
Well, while this sounds great and all, I think
Imgoingtostepforwardhereandrisksound-
inglikethatproverbialoldmanontheporch.I
dontthinkthatthisnewwaveofgamesareall
theyrecutouttobe.Theymayappealmore
toanewmassmarket,butasfarasImcon-
cerned,games aredefinedby rulesand goals
setbythedevelopermuchinthesameway
thatmovieplotsarewrittenbythoseblokesin
Hollywoodandnotthepeoplesittinginthecine-
ma.Heck,evenajokehasadefinedpunchline.
Imagine how dreadfully boring it would be if
yourfriendwalkedovertoyouandsaid,Knock
knock,yougettheideanow.Finishityourself.
IveplayedTheSimsmyself.Gotratherboredafterawhile,soIwentontobuyanexpansion
packortwo(especiallysinceoneofthemhad
thoseadorablelittlepetsinit).Thosedidntlast
muchlonger.IeventuallycluedupastowhyI
wasntenjoyingthegametherewasnodefined
challengesforme.IfIgotrich,Igotrich.IfIbe-
camefitterorgotnewemployment,goodonme.
Theresimplydidnotseemtobeenoughofthe
gamesaying,Heygreat!Youdidasweetjob!
Heck,IalsoplayedFablewentandboughta
housein-game,evengotmarried.Theresultwas
thatInowhadawifewithalittleheartaboveher
headwheneverIdecidedtostepbackintothat
oneparticularpartofthegame.Andforwhat
OPINION WHAT YOURE THINKING
purpose?Shedidnthelpmekillmonsters,she
didntunlockanybonuses,shehardlyevenap-
pearedunlessIwentoutofmywaytofindher.
Itallseemedmerelyforthekudosofhavinga
wife.Aremoderngamersreallydrawntothat?
Dontget mewrong. I thinksandboxgames
areimportant,and mostgamescontainsome
concepts of user-defined goals. Still, I think
itsimportantforustopayheedtotheadvan-
tages presented by a well-scripted and well-
ordered games that provide rewards which
are ... well, truly rewarding. Just a thought.
NANDREW
DEV.MAG ISSUE 149
The Dev.Mag staff does not expressly support or agree with the views of guest columnists in this section.
In fact, the Dev.Mag staff does not expressly support or agree with the views of Dev.Mag staff writers in this section.
Its a crazy world, isnt it?
-
8/14/2019 Dev.Mag - 14
10/28
Can Game
Developers learn
from Genetics?
Inmyquestto discoverwhycertainoriginalgamesgetthe limelightwhileotheroriginal
gamesgetlost inthe recessesofthe web, I
stumbledupontheanswer.
It happenedwhile I was watchingmy favourite
show,Heroes. If you dont know, Heroes is all
about seemingly normal people trying to cope
withtheirspecialpowersin their everyday lives.
Thenarrator of theshowspeaksabout thecon-
ceptof evolutiona lot.So being thepersonthat
Iam,IwikiedHeroesandEvolution.Idiscovered
aninterestingandtruephenomenoninevolution.
When there is a huge number of a species
(like humans), any new mutation will be liter-
allydrownedoutbysheernumberofpeoplewho
simply donot have that mutation. The chances
that this new mutation will be carried to new
generations are incredibly remote. A new mu-
tation will have a higher chance to get carried
on tonew generations insmall closedsocieties.
Iimmediatelydrewacomparisontogames-whatare
thechancesthatanoriginalgamegetsnoticedand
acceptedassomethinggreat?Verysmall,simply
becauseitisdifferenttoeverythingelseoutthere.
Icanhearyouasking,Butifagameisoriginal,
doesnt it then stand out among the masses?
Yesit does,butagainwedrawa comparison to
genetics.Ifsomeonewithanewmutationoccurs,
wewould be instinctively wary.An extreme ex-
ample is thecase that someonemutates a third
arm.Lookat allthepossibilitiesandadvantages
of a third arm! But lets be serious here - who
wouldgooutwithsomeonewhohasathirdarm?
SoIcomebacktomyoriginalquestion.Whydo
some original games fare better than others?
Ill explain it by another example. If Super-
man (who has awesome powers) gets tired
of Lois Lane, he will have plenty of girls will-
ing to have his babies. It is instinctively viable.
Now how do we distinguish between third-arm
games and Superman games? Is your original
game third-arm or Superman? If its a Super-
mangame,you wouldntbe reading this - youd
be takingaSundaydrive inyourFerrari. I dont
knowthe answer,but I have the solutionto get
OPINION WHAT YOURE THINKING
yourthird-armgameorSupermangamenoticed.
Thegreatdifferencebetweengeneticsandgame
developingisthatwecanchoosethesenewmuta-
tionsinourgames.Ifmoreandmorepeoplemutate
thirdarms,thephenomenonwillbecomeaccepted
insocietyandbecarriedovertofuturegenerations.
So,whatisthesolutionhere?Ifyouhaveanorigi-
nalgamethatdoesnotseemtogetnoticed,you
shouldkeep floggingit everywhereandproduce
sequels with the same gameplay. If more and
morepeopleseeyouroriginalgameanditsvari-
ants,itWILLbecomerecognisedandtalkedabout.
TakeTeam17sWormsasabrilliantexample.All
they have done is developWormsafterWorms.
Who remembers the first worms when it came
out?Back then, no-one reallyknew about it,but
nowitsgrossinghugesaleswithitslatestincarna-
tiononX-boxLiveArcade.Theyjustkeptgoing.
Itsassimpleasthat.Justkeepgoing.
TROOJG
DEV.MAG ISSUE 1410
The Dev.Mag staff does not expressly support or agree with the views of guest columnists in this section.
In fact, the Dev.Mag staff does not expressly support or agree with the views of Dev.Mag staff writers in this section.
Its a crazy world, isnt it?
-
8/14/2019 Dev.Mag - 14
11/28
MAKE A GAMEAND GETYOUR
PIECE OF
R10 000Here at Game.Dev, we believe that games are more than just entertainment or a silly fad
games can (and will) change the world and make a difference. Mindset Learn are keen on doingjust that, making a difference. So theyre challenging us and you to produce the next gen-
eration of entertaining and meaningful games. That challenge takes the form of:
R5000 for first place,R2500 for second place,R1500 for third place and
R1000 for the best new entrant.
So all you have to do now to get a shot at that prize money is put together a game thats fun
and focuses on a concept you enjoyed or found challenging at school. You dont need to pro-
duce a fully fledged educational experience, in fact were looking for quite the opposite: fun
games that are enjoyable because theyre well-designed and entertaining, you just happen to
be playing within rules or a setting that match something youve learned. Think guerrilla learn-
ing and youre on the right track!
The competition begins on 1 June 2007, and the deadline for entries is 31 July 2007. Thats two
months that you have to make the ultimate game and win some big money!
For more details, head on over to the Game.Dev website at http://www.gamedotdev.co.za
-
8/14/2019 Dev.Mag - 14
12/28
12
BLENDER INTERMEDIATE TUTORIAL:
Creating explosions with Blender 3D
DESIGN ENTER THE 3D WORLD
swithprevioustutorials,Ineedtostress
the factthat thebasicBlender interface
has already been discussed within
previous releases of Dev.Mag. I wil l not
thereforeexplaineverysinglestepoftheway.
Thereareplentyofinterface-relatedresources
on-line.
Blender3D hasan integrated particlesystemthat can render production quality special
effects. One possible use for this particle
system is to render a particle system that
simulates an explosion through animated
colourandtransparencyparameters.
Therenderedsequencecanthenbecompiled/
compositedasamovieclip,animatedGIF,orin
anywaythatyourspecificsoftwarepackagewill
handle images with sequential numbers.
Hence,ananimatedexplosion.
Thefieldofspecialeffectsisbiggerthanashort
tutorial,soexpecttofind:
Thebasicsforsettingupaparticlesystem
Basicanimationofcolourparameters
Basicintroductiontotransparencyfor
Blenderparticles
Particle systems can produce spectacular
effects,dependingonthetimeyouarewillingto
spendtweakingit.
So,firstthingsfirst.Wehavetoplanthisthing,
sinceithastofitintoagamesomehow.
Isuggestdoinganexplosion:
That will be an explosion for a scrolling
top-downshootinggame
That starts and completes the animation
withintwoseconds(Iwillworkwith25frames
persecond)
Two seconds of animation amounts to 50
frames at 25fps, and I will plan the colour
changesofmyparticlestofitintothattimeframe.
Iwillsetmycolouranimationtogofrominitial
BLACKsmoke, tobright hot RED, toflaming
ORANGE,andendingoffwithGREYsmoke.Timing will be set as indicated in the image
below.
Wewillcreate:
Anobjectthatwillshootoutparticles
Createatexturefortheparticles(mainlya
smoky,see-throughtypeofeffect)
Keyframethecolourchanges
Positionacameratodocumentthe
explosion
Render50frames
Particleswillbegenerated(inthiscase)froma
meshobject.Wewillshapetheobjectsothat
theparticlesdonotsimplyflyoutinastraight
line.Speedoftheparticlesisdeterminedbythe
menusettings.
Of course we also have to tell the particles
when toappear,how long theywill last,and
howlongtheywillbeemittedfor.
Forexample,wemightsaythattheparticleswill
bethrownoutoftheobject(emitter)withinthe
first ten frames, which will create the actual
explosion,afterwhichsomeflamesandsmokewillbillowoutwardsfortheremaining40frames.
StartupBlender,ifyou'reupforthechallenge!
DEV.MAG ISSUE 14
(IfyourenewtoBlender,checkoutDev.MagIssue5forthebeginningofourBlendertutorialseries!)(IfyourenewtoBlender,checkoutDev.MagIssue5forthebeginningofourBlendertutorialseries!)(IfyourenewtoBlender,checkoutDev.MagIssue5forthebeginningofourBlendertutorialseries!)(IfyourenewtoBlender,checkoutDev.MagIssue5forthebeginningofourBlendertutorialseries!)
-
8/14/2019 Dev.Mag - 14
13/28
13
DESIGN ENTER THE 3D WORLD
Createamesh'plane'.
Subdividethemeshplane(WKEY)
Selectthefourcornersandscaletheminwards
Go to Edge mode (Ctrl-TABKey) and select
(RMB) the outer edges. I also switched to
wireframeview(ZKEY)foreasierviewing.
Extrudetheedges(EKEY),butpressLMB(left
mousebutton)immediately.Afterpressingthe
LMB,pressSKEY.Thiswillputyouintoscaling
mode.Scaletheedgesoutwards.
Now you haveto change yourviewto aside
view,whichwillallowustoaddtheshapethat
willmaketheparticlesflyoutinawiderarea.
Movetheselectedaxisaccordingtothisimage:
Select the center vertex of the initial mesh
object, and move the vertex so that you an
imageresemblingthis:
TABKEYleaveseditmode.Thisobjectwillbe
theemitterfortheparticles.
It'stimetoaddtheparticlesystem.Ensurethat
ou have enough screen space around the
emitter,sothatyoumayseetheeffectofanyof
thechangesyoumaymake.
ClickontheObjectbutton.
ThenlocatethePhysicsbuttonandactivateit.
Next,createaNEWparticlesystem.
A new menu becomes available. Note that
thereisatabforParticles,aswellasatabfor
ParticleMotion.
Under ParticlesParticlesParticlesParticles, you will find settings that
define the creation and lifespan of particles,
while the Particle MotionParticle MotionParticle MotionParticle Motion tab controls
movementoftheparticles.
Mysuggestionwouldbetosettheparameters
asfollows,afterwhichyoucanstarttweaking:
YouwillnoticethatIonlychangedaboutsixor
sevenparameters.Ifyouwanttheparticlesto
flymorerandomly,tryaddingsomeRandom
undertheVelocityheading.Thesevaluescan
also beadjusted negatively tochange tothe
oppositedirection.
Playyouranimation(mouseoverviewportand
ALT+AKEY),orusethearrowkeystolookat
theanimationoftheparticles.
Nowforthetextureoftheparticles.Thispartisquitechallengingifyouarenewtothis,soallow
sometimetofigurethisout.
TexturingTexturingTexturingTexturing
WewillusethesolidcolorRGBareaforprimary
coloradjustment,and load a texture thatwill
affect the smoky, transparent look ofthe fire
andsmoke.
DEV.MAG ISSUE 14
-
8/14/2019 Dev.Mag - 14
14/28
14
DESIGN ENTER THE 3D WORLD
ClickontheMaterialbutton.
Assignanewmaterialtoyourobject.ClickonAddNew.
Firstly,wewillsetthematerialtocreateaHalo
material. This is used along with particle
systems and can create starry, or smoky
effects.Clickonthehalobutton.Anewsetof
buttons will appear. Set those according to
thesesettings:
Next, we wil l add a texture, and use the
mappingoptionstogetthattexturetoinfluence
thealphachanneloftheparticles.Clickonthe
Texturebutton(that'sthe leopardskinone).Addanewtexture,makeitaCloudstype,and
thensetthesettingsasshownbelow.
Thesizeofourparticles,alongwiththesizeof
thescene,willinfluencewhattheparticleslook
like.Tweaktheparticlesizesettings,aswellas
the noise sett ings (after we've done the
mapping),togetthedesiredeffect.
Transparency(alphachannel)willbebasedon
100%transparent forblack, andfully opaqueforwhite,withshadesofgrayofferingvarious
levelsoftransparency.
ClickbacktotheMaterialsbutton.Youshould
seethemappingoptionstowardstheright-hand
sideofyourscreenifyouhaveadefaultscreen
layout.ActivatetheMapTotab,andactivate
theAlphabutton.ThistellsBlendertousethe
coloursfromthetexturetocalculateanalpha
channel. Don't worry about the pink color
swatch.Weareoverridingthatwiththetexture.
One thing remains to animate the color
parametersontheparticles.Don'tgetconfused
here:
Weaddedatexturetocontroltransparency,not
changetheactualcolouroftheparticles!
(You can see that the Col button is not
activatedintheMapTotab)
We will keyframe the RGB colors using the
IKEY.
EnsurethatyouareonFRAME1.
Again.
Ensure that you are on FRAME 1. You are
goingtostruggleifyouleaveoutthisstep!
Setthecolortoblack,hoverthemouseoverthe
blackswatch, and press the IKEY. Amenu
popsup.ChooseRGB.
Nowadvanceyourframestoframe4.Change
thecolourswatchtoabrightred,andinserta
RGBkeyframe.
Advancetoframe12.Keyframethatsamered
coloragain.
Moveontoframe25,keyframeabrightorange
RGBvalue.
Atframe40,keyframealightgreyRGBvalue.
Last, but not least, use the samemethod to
keyframetwovaluesoftheA(shortfor'Alpha'):
Valueof'1'atframe44;
Valueof'0'atframe70.
You can now set upyourcamera and lights,
and start rendering your sequence. My
suggestionwouldbetorenderPNGfileswith
thealphachannelswitchedon.Youcan then
composite your explosion on top of other
images.?RMAN?RMAN?RMAN?RMAN
DEV.MAG ISSUE 14
-
8/14/2019 Dev.Mag - 14
15/28
15
GAME MAKER
DESIGN TOOLS OF THE TRADE
fyouaskatriple-Agamedeveloper
what isrequired tocreatea quality
game, hell almost certainly include
atalentedprogrammingteaminhislistof
prerequisites, leaving many a budding
game developer to wallow in sorrow.
Thankfully, a Dutch computer scientist
named Mark Overmars decided that
complexprogrammingneedntbeahurdle
forproducingqualitygames.Hecreated
Game Maker, a true boon to the game
developmentcommunity.
Anyone who ever had even the most
fleeting thoughts about a potentially
interestinggameideawill findhimselfathome with Game Makers simple, yet
powerful, tools. These very tools also
happentobefree.Well,mostofthemat
least.Theprogramcomesoftwoversions:
Theunregistered(Lite)version,whichis
freeof charge,andthe registered (Pro)
version.ThePro version, atthemeager
price of 15 (roughly R150), includes
supportforadvanceddrawingeffectsand
functions,aneffectssystem,andsupport
for.dllimports,amongotherthings.
Game Makers strength lies in its
innovative drag-drop interface, which
allows multiple game creation
opportunitieswithlittleornoprogramming
required. As such, the world of game
developmentisnowopentothosewithout
intimateknowledgeofcomputersystems
andprogramminglanguages.
But before any of you hardcore game
programmers write off this measly
program,knowthat,forthoseinclinedto
delve deeper, Game Maker includes arobust scripting language that will allow
eventhemostcomplexinteractionstobe
created.Thescriptinglanguage,knownas
Game Maker Language or GML,
increases the appeal of Game Maker
beyond the non-programmer crowd.
Togetherwiththescriptinglanguage,high
qualitygamescanbecreated.Remember
TheCleaner,agamewereviewedawhile
back?Youguessedit!Thatwasmadein
GM. As was Ninja loves Pirate. (http://
www.ninjalovespirate.com/)
Game Maker also boasts a huge
community base, providing assistance
and tutorials for anyone eager to learn.
The official Game Maker Community is
likelythelargestofthese,butmanymore
are abound. A previous Dev.Mag issue
(Issue9)includesamoreexhaustivelist.
Sowallownomore.GograbGameMaker
andstartmakinggames.Andonceyoure
done, well be more than eager to seewhatyouvemade.
CHIPPITCHIPPITCHIPPITCHIPPIT
I
DEV.MAG ISSUE 14
GetGameMaker:
www.yoyogames.com/gamemaker
Tutorialsandexamples:
www.gamedotdev.co.za
www.yoyogames.com/make/tutorials
64digits.com/games/index.php?example=1
GameMakerCommunity:
gmc.yoyogames.com
TAKING THE BLUE PILL FOR ...
-
8/14/2019 Dev.Mag - 14
16/28
Todaysarticlewillcontainthefollowingsections:
1.AbriefGameMakertutorialshowingthebasicsofgettinganobject
tomove,bothwiththekeyboardandwiththemouse.
2.Thisisfollowedbyadiscussion,indetail,ofthevariousGameMak-
eractionsavailabletoyou.
3.GameMakerLanguage(GML)isapowerfulwayforthedeveloper
togetclosertotheaction,andcontainsnumerousfunctionsformov-
ingobjects.
Game Maker Tutorial
Thistutorialisgoingtocreatearoom
thatcontainstwo balls. Thefirstball
willbecontrolledbythearrowkeyson
thekeyboardandthesecondballby
clickingthemouse.
Thistutorialisnotagameassuch,butisdesignedinsteadtoshowvari-
ousmethodsofmakingobjectsmove.Afewsmallchangescouldmakethisintoafungame.Somepossibilitiesmightincludespreadingvarious
objectsaroundthescreenandscoringastheygeteatenbytheballs,
creatingatwoplayerPacMangamewheretheballsmustrushthrough
amaze,ofevenachasinggamewhereoneplayermusttryandcatch
theother.
Step 1 Create sprites
InGameMaker,addanewsprite.Selectanimageforit,suchasoneof
theballsinthedefaultgraphics.Thespritescreenshouldlooklikethe
imageoverthepage:
WelcometothefirstintheBeginnersGuidetoMakingGames.
Eachmonthasingleimportantconceptrequiredformaking
gameswillbediscussedindetail.Thismonthwerestarting
withmovingobjects,andnextmonthwelllookatcollisions.Thesehave
beenchosenasthefirsttwoconceptsbecauseagoodunderstandingof
themwillallowyoutostartbuildingyourownuniquegames.
ThemaingoaloftheBeginnersGuideseriesistotryandensureade-
tailedunderstandingofthevariousconceptssothattheycanbeapplied
toothernewandexcitinggames.Whilemosttraditionaltutorialswillshow
whatcodeisneeded,theseguideswillensurethatyouwalkawayactu-
allyunderstandingeachoftheseconcepts.
Thisarticleisaimedatsomeonewhohasjuststartedlearningtomake
games.Whileitisassumedthatthereaderofthearticlehascomplet-
edthefirstofficialGameMakertutorialandisable,therefore,tocreate
spritesandobjects,itisquitepossibletofollowthearticlewithouthaving
doneso.Thearticleis structurednotonlytointroduceanewprogram-
mertotheconcept,butshouldbeofsomevaluetotheintermediatelevelprogrammeraswell.
Moving an object GM tutorial
Thevastmajorityofgamesrequiremovementwithinthegame.Some
gamessuchaswordpuzzlesgetawaywithoutusingmovingobjectsbut
thesearetheexceptionratherthantherule.Tokeepthingssimple,well
onlylookatmovinganobjectin2Dspace,whilealaterarticlemaylook
ataddingthethirddimension.
DESIGN HELPING YOU ALONG
A BEGINNERS GUIDE TO
MAKING GAMES
DEV.MAG ISSUE 1416
1PART
HINT: When using Game Maker
always set the Advanced option
on. This makes it easier to see and
access all the functions.
-
8/14/2019 Dev.Mag - 14
17/28
TomovetheobjectonthescreenwenowneedtoclickanddragtheStartmovinginadirectionactionintotheactionslist.Thisisthefirst
actionontheMoveactionscreen.FormoredetailsonhowtheStart
movinginadirectionactionworks,consultthenextsection.
WheneveranactionisaddedtotheActionslist,adialogueboxwillbe
displayedwhereyoucansettheparametersfortheaction.Inthiscase
weclickthearrowpointingleftandsetthespeedto5.(Notethatthis
speedisgoodfortestingthings,butcansometimesbetoofastforactual
in-gameevents).
Step 3 Adding our object to the room
RoomsarewhereeverythinghappensinaGameMakergame.Without
aroom,objectscantdoanything.Roomscanalsobesetuptocontain
prettybackgroundsandcantransitioninfancyways.
Create a new room inGameMaker. On the left tab ensure that the
oBallKeyboardobjectisselectedtobeaddedtotheroom.Ifitisnt,click
ontheselectionboxunderObjecttoaddwithleftmouseandselectit
fromthelist.Clickwiththeleftmousebuttonanywhereintheroom.
Step 4 It works
RunyourgamebypressingthegreenRun
Gamebutton.ThebeautyofGameMakeris
howyourgamerunseverytimewithoutfail.
PresstheLeftarrowkeyandyourballwillgoflyingofftotheleft.Unfor-
tunatelythereisnowayofchangingitsdirectionorstoppingitatthemo-
ment.Tobeablechangethedirectionoftheballrepeatwhatwasdone
abovebutfortheotherthreedirectionsoftheKeyPressevent.
Whilenotimportantforthistutorial,itisoftenagoodideatosettheorigin
ofaspritetothecentreofthespritetoassistwithcollisiondetection.To
dosopresstheCentrebuttonontheSpritescreen.
Transparentspritesusuallylookalotbetterthanasolidspriteunlessfor
somereasonthespriteisasingleblockofcolour.Thecolourusedto
makethespritetransparentisthecolourinthetoprighthandcornerof
thesprite.
Step 2 Making an object
GameMakerusesaspritetostorethegraphicsforthegame,andthe
objectsinthegamearerepresentedbyaGameMakerObject.Createa
newobjectusingthepreviouslycreatedsprite.
Name this object oBallKey-
boardtoshowthatthisballwill
becontrolledbythekeyboard.
To move an object in Game
Maker we need to create
eventsandallocateactionsto
theevents.For thekeyboard
weneedtocreatefourevents
(one for each arrow key di-
rection)and allocatea Start
moving in a direction action
toeach.
OntheobjectscreenselecttheAddEventbutton,andinthefollowing
dialogueboxselectKeyPressandthenchoosetheLeftoptionfromthe
menu.Thiscreatesaneventthatwilloccurwhenevertheplayerofthe
gamepressestheleftarrowkey.
DESIGN HELPING YOU ALONG
DEV.MAG ISSUE 1417
HINT: Always rename the items you create in
Game Maker. It is always easier to remember
that something called sBall is a sprite contain-
ing the image of a ball than to try and remem-
ber that sprite125 is a 16 frame animated
image of a vampire firing a bazooka!
HINT: A good habit to get
into is saving your game
every time before you run it!
-
8/14/2019 Dev.Mag - 14
18/28
theydo,andwhatalternateoptionsareavailableforeachthingyouwanttodo.
OfteninGameMakertherearealternateoptionstoachievethesame
thing.Howeverbyunderstandingwhatthevariousoptionsdo,theycan
bebetterusedtoachievetheeffectsthatyourgamerequires.
Movement inactions consists of two ele-
ments, direction and speed. Speed indi-
cateshowfartheobjectwillmoveineach
step, so the higher the speed value, the
fastertheobjectwillmove.Directionshows,
indegrees,thedirectiontheobjectshould
bemovingstartingatzerobeingrightand
movinganti-clockwise.Adirectionof90in-
dicatesadirectiondirectlyup,whileavalue
of180wouldmeandirectlyleft.
Anicetrick tounderstandinGameMakeris the use oftheRelative
checkbox.Whentherelativecheckboxischeckedthevaluesentered
intotheparametersboxesareaddedtothecurrentvalues.Soforex-
ampleifanobjectismovingataspeedof5,andarelativevalueof1is
selectedtheobjectwillstartmovingat6thereafter.
Start moving in a direction
The most basic of the movement
actionsallowsyoutochoosethedi-
rectionyouwanttheobjecttomove
withoutneedingtounderstandwhat
degrees and direction mean. This
action is best used when you are
designinga gamethatusesclearly
definedhorizontalandverticallines,
forexampleamazegame.
Set direction and speed of movement
This option allows you tomove an
object in any direction and at any
speed.Touseitproperlyyouneedto
understandhow thevariousdegree
pointswork.Beingabletosetanydi-
rectionformovementgivesthedevel-
operaverylargerangeofmovement
options.Being able tomovein any
direction is typicallyusedin games
Step 5 Mouse movementMovingobjectsusingthekeyboardisjustonemethodofmovingtheob-
jectonthescreen.Anotherfrequentlyusedmethodofcontrollingobject
movementistousethemouse.Makinganobjectmovetowardthemouse
isinfactveryeasy.
Followthepreviousinstructionstocreateanewsprite(usingadifferent
ballpicture),andanewobjectcalledoBallMouse.
Createaneweventforthenextobject,selecttheMouse,GlobalMouse
EventthentheGlobalLeftPressed.MouseeventsinGameMakercan
applytotheobjectindividuallyoronagloballevel.MouseEventssuchas
Mouse,LeftButtonwillonlyapplyiftheplayerleftclicksontheactual
object.TheGlobalMouseEventswilltriggerfortheobjectirrespective
ofwheretheplayerclicksonthegamescreen.
WhenusingtheGameMakeractions,itispossibletousetheinternal
GameMakerfunctionsasparameters.Inthiscasewewanttomakethe
objectmoveinadirectiontowardthemouse.FortunatelythereisaGame
MakeractioncalledMoveinthedirectionofapoint.Usingtheinternal
GameMakermouseinformation,wecanjustsetthexandycoordinates
tomouse_x andmouse_ywhichrepresent thecurrent positionof themouse.
Addthenewobjectintotheroom.Runthegameagainandclickrandomly
onthescreenandwatchhowyournewballfollowstheclicksaroundthe
screen.
Moving objects with actions
GameMakeriscoolbecauseitseasy,andActionsaresomeofthemost
importantthingsthatmakeGameMakersuchaseasytooltouse.Toget
themostoutoftheGameMakeractions,youneedtounderstandwhat
DESIGN HELPING YOU ALONG
DEV.MAG ISSUE 1418
-
8/14/2019 Dev.Mag - 14
19/28
theYtomouse_y.
b.Setthedirectiontopoint_direction(x,y,mouse_x,mouse_y)and
thespeed
Therearealmostalwaysvariousdifferentwaystomakeanobjectmove
thewayyouwantitto.
Moving objects with GML
GameMakeractionsareshortcutstoGameMakerLanguageconstructs.
Whilethatsoundscomplicated,itbasicallymeansthatactionsare the
easierwayofdoingthingsthatcanbedoneinGameMakerLanguage.
Beforewestartdiscussingthevariousoptionsformakingobjectsmove,
hereisaquickbreakdownofhowmovementinGameMakerworks.
Allmovementisbasedonadirectionandaspeed.Eachstep(frame)
makestheobjectmoveanumberofpixelsonthescreenasspecifiedby
thespeedinaspecificdirection.Anotherwayoflookingatthisisthatthe
objectsmoveasetspeedinaverticalandhorizontaldistance.Allthese
valuesarepropertiesoftheobjectandcanbemanipulateddirectly.
PropertyDescriptionhspeed Horizontalcomponentofthespeed.
vspeed Verticalcomponentofthespeed.
directionCurrentdirection(0-360,counter-clockwise,0=totheright).
speed Currentspeed(pixelsperstep).
Nowitsimportanttounderstandthatthesepropertiesadjustbasedon
thevaluesetintheotherproperties.Sosettingthedirectionandspeedof
anobjectalsochangesthehspeedandvspeedoftheobject.
Calling a script
Tocallascriptforanobject,addaneventtotheobjectandaddtheEx-
ecuteapieceofcodeactiontotheactionlist.Inthepopuptexteditor,
addthecommandsyouwanttobeexecuted.
ScriptscancontainanyoftheGameMakerLanguagefunctionsaswell
asvariouscontrolstructuressuchasforloopsandifstatements.GML
allowsstatementstobegroupedtogetherthroughtheuseofbracesto
identifystartandendsections{}.
Rememberalsothatitispossibletoaccesspropertiesofotherobjects.
Soitsquitepossible,forexample.todothingslikemovingtowardother
objectsorusingthepositionofotherobjectstodefinethemovementsof
theobject.
thatuseanopengameenvironment,whereanobjectneedstomovein
anydirectionbetweenpoints,suchasenemyfighterplanesinashooter
game.
Move in a direction to a point
Rather than forcing the game de-
velopertoworkoutthedirectionan
objectwouldneedtomoveintoget
to a point, Game Maker has sup-
plied an action to just define the
point to which an object needs to
move. Internally, this action uses
theobjectscurrentposition andthe
destinationpointtocalculatethedi-
rectiontheobjectneedstomovein.
Moving directlyto a pointis very useful in gameswhere one object
movestowardanothertoattackit,suchasenemybulletsbeingshotat
theplayer.
Set the horizontal speed, set the vertical speed
Theseverysimpleoptionsallowyou
tomoveanobjectinahorizontalorverticalmanneratasetspeed.Note,
however, that these options do not
cancel the other directional speed
that has beenset. Thismeansthat
ifanobjectismovingupthescreen
andaHorizontalSpeedissettheob-
jectwill beginmoving inadiagonal
direction and not just horizontally.
Theseactionsareusefulingamesthatneedsomesortofaccelerationor
decelerationinadirectionoptionratherthanspecificspeedsettings.
Some examples
Here are some examples of doing the same thing inmany different
ways.
1.MovinganObjectLeft
a.Use Start moving in a direction, choose Left and define a
speed
b.UseSetdirectionandspeedofmovement,withadirectionof
180andaspeed.
c.UseMoveinadirectiontoapoint,setthenewpointsXvalue
tox-100andsettherequiredspeed.
2.Movetowardthemouse
a.UseMoveinadirectiontoapoint,settheXtomouse_xand
DESIGN HELPING YOU ALONG
DEV.MAG ISSUE 1419
-
8/14/2019 Dev.Mag - 14
20/28
Special moves
GMLcontainssomespecialmovementfunctions.Thevariousjumpfunc-
tionsarebeingexcludedastheywillbecoveredinafuturearticle.This
articlelooksonlyatthefunctionsthataffectthemovementoftheobject.
move_towards_point(x,y,speed)
DoesthesameastheMoveinthedirectionofapointaction.Soina
globalmouseleftpressedeventapieceofscript
move_towards_point(mouse_x,mouse_y,5);
willmovetheobjecttowardsthepositionofthemouse.
The power of scripts
Whileitiscertainlypossibletocreateafunplayablegamewithoutusing
scripts,thepersonusingscriptswillprobablybeabletocreateamore
immersivegameastheywillbeabletoincludeproperAIandmorebe-
lievablebehaviours.TakingthetimetolearntouseGMLwilldefinitely
improveyourgames.
CAIRNSWM
Moving the object
InGMLmovinganobjectinaspecificdirectionisaseasyassettingthe
directionandspeedpropertiesoftheobject.SobycreatingaKeyPress,
Lefteventandexecutingthefollowingcode:
TheobjectwillmovetowardtheleftjustasiftheStartmovinginaDirec-
tionactionwasusedtomoveleftataspeedof5.
Theothermovementactionscansimilarlybedefinedincode.Toswap
thehorizontalorverticalmovementthefollowingstatementcanbeused:
vspeed = -vspeed;
Andtomaketheobjectmoveinexactlytheoppositedirectiontowhichitiscurrentlymoving,try:
Direction = 360 direction;
DESIGN HELPING YOU ALONG
DEV.MAG ISSUE 1420
-
8/14/2019 Dev.Mag - 14
21/28
So.RoachToaster2has,asofJune
2007,beenayearintodevelopment
frominitialdesigntobeta.Iamvery
very proud of what I have been able to ac-
complish.Therehavebeenlotsofthingsthat
nabbed myattention fromRoachToaster2 -
school,games,gamedevcompetitionsandjust
lifeingeneral.
AsIamsittinghere,RoachToaster2isready
forpublictesting.Thistestingphaseisbasically
fortestingthefullgameplay.Doesitwork?Is
it fun?The nextphasewill bethemeticulous
balancing/polishingphase.Iwanttohaveafull-
blownfirstbetathrownouteverywhere.Ieven
wanttoflauntittopossiblepublishers.Thebig
thing, however, is that I am stuck without a
properinternetconnection!
Yes,thebanethatisSouthAfricastelecommu-
nicationsdidnotplanwellenough.Theregion
Iliveincurrentlyhasashortageoftelephone
points.Theyareintheprocessofupgradingit.
ThewayIcurrentlyconnecttotheInternetisnot
socosteffective.ItisaboutR2permegabyte!
Withoutmyproperinternetconnection,Iwont
be able to post, read feedback, and uploadupdates without chalking up a considerable
amountintelephonebills.So,duringthishia-
tus, I amdoingfivethingsconcerningRoach
Toasterasawhole.
1)Imgettingtheart/spritesforRoachToaster2
done.Ivealreadygotanawesomemainmenu
pagefromalocalartist.
2)IvealwayswantedtoremakeRoachToaster
1.Thisisbecausepeoplemightwanttoplay
RoachToaster1asanextendeddemoforRT2,
and because ofRoachToaster1s poor pro-
ductionquality,Iamworkingonaremake.This
remakewillbemadeinXNAforacompetition.
DuetoXNAsbadsharingcapabilities,Imight
justportthegraphicstotheGameMakerfilein
theend.
3)Ialreadyhavethegameplayandstoryde-
velopmentinminduptoRoachToaster4,and
Ineedthistimetodevelopacharacterthatwill
appear in the upcoming games. This might
seemodd,butwhenRoachToaster2getsre-
leased youwill knowexactlywhatI meanby
this.
4)Ifyoudontknow,theofficialRoachToaster
website is up! http://www.roachtoaster.com.I
plantorevampthesiteabit,i.e.addpictures/
screenshotseverywhere,andjustprettyitup.
ROACH TOASTER 2: PICKING OUT THE BUGS
PART 5
PROJECTS LEARNING HOW ITS DONE
5)Ialsoplantosortouttheonlinepaymentop-
tions.Ihavenocluehowthisworks,andIhave
signed up for several e-commerce providers
justtogetabetterideaaboutitall.
Myoriginalintentionwastoreleasethebetain
December2006Oh,howwrongIwas!Asyou
cansee,IhavenoideawhenRoachToaster
2willbereadyforrelease.Withthewayithas
developedthus far,Id say(with nocertainty)
it will be finished round aboutOctober 2007
(yes,rathersettoofarintothefuture,thantoo
soon).
For more info onRoach Toaster 2:Big City,
head on to http://www.shotbeakgames.za.net
orthenewsitehttp://www.roachtoaster.com
TROOJG
DEV.MAG ISSUE 1421
( Wondering what were talking about over here? check out Dev.Mag Issue 10 for the beginning of this Project series! )
-
8/14/2019 Dev.Mag - 14
22/28
(a triangle that contains a single 90 degree
corner). Heres one I found lying around:
Firstly,itsimportantthatwenamethesidesof
thetrianglesothatwecanidentifythemwhen
webuildourequationslater.Intrig,wename
sidesbasedontheirrelationshipstothecorners
ofthetriangle.Takethistriangleasanexample:
Inthis triangle,wevedefinedoneof thenon-
right-angles with the variable theta (). For
now, this issimply a variableto identify the
Trigonometry. The mere mention of it
strikesterror into the minds ofbewil-
deredhighschoolstudents.Confusing
ratios,bizarrediagrams,tryingtofindthesineof
thecosineofthetangentoftheta-manypeople
struggletowraptheirmindsarounditandeventu-
allygiveupindesperationtodosomethingeas-
ier,suchasendingwarorachievingcoldfusion.
Well,despitewhatyour high school teachers
may have said, trigonometry can actually be
useful! Yes, in the vast sea of unintelligible
termsisavaluableandpowerfulmathematical
toolthatcanaidyouimmenselyinthehumble
task of game design. The aim of this series
istoexplaintoyoujusthowsimpletrigonom-
etryreallyis,andhowyoucanuseittosolve
some very common programming problems.
Hopefully itwill make the job of coding your
nextblockbustergamejustthatlittlebiteasier.
First Principles - The Triangle
Before we start writing any trig in our code,
its necessary to understand all the nasty
mathematical stuff behind it (just joking, its
notthatbad!).First,weshould takea lookat
how trigonometry works at the most basic
level. Todo that,well need a triangle. Morespecifically, well needa right-angled triangle
corner dont worry about about how the
numbers fit in just yet! Now that weve de-
fined , we can use it to identify our sides.
Nowwevedesignatedoursides.Intrig,sides
arealwaysdesignatedrelativetotheanglethat
wereworkingwith,inthiscase.oistheside
oppositetothespecifiedangle.a istheangle
adjacent(nextto)thespecifiedangle.h isthe
hypotenuse,whichisalwaysthesideoppositeto
the90degreeangle.Clear?Well,ifnot,letsgo
throughthesameexercisewiththeotherangle
inthetriangle.LetsdesignatethatoneAlpha
(),andtakealookathowthisaffectsoursides.
GAME CODING WITH TRIGONOMETRY
PART 1
TECH WHEN MATH GETS USEFUL
DEV.MAG ISSUE 1422
Figure 1: A boring right-angled triangle
Figure 2: Boring right-angled triangle with
angle theta
Figure 3: RA triangle with angles and sides
defined
-
8/14/2019 Dev.Mag - 14
23/28
This isall good and fine, but the real magic
comesinwhenweslotnumbersintothosevari-
ables.Timeforsomegoodold-fashionedmaths!
Basic Calculations
Lets take the trianglethatwevebeenwork-
ing on and plug some numbers into it:
Now we have numbers to work with! How-
ever, youll notice that side o and a havent
been givennumbers.We have noideawhat
the lengths of those sides are. That means,
of course, that well have to calculate them!
Calculating anything using trigonometry re-
quiresthreesteps:
1.Determinewhatnumbersyouhave,andwhat
numbersyouwant.
2.Determinewhichratiotouse,andbuildyour
equation.
3.Substitutetheknownvaluesintotheequation
andsolvefortheunknown.
Thatmayseemlikequiteabrainful,butonceyou
seeit inactionyoull appreciateits simplicity!
First, we take a look at what we have:
we have values for (45) and h (6). We
want to calculate o and a. Next, we deter-
Notethatthistriangleisstillthesametriangle.
Wevejustrenamedthesidesaccordingtowhich
cornerwereviewingthemrelativeto,inexactly
thesamewaythatwedidwithangle.Youll
notethathisstillassignedtothesameside.As
Imentioned,thisisbecausethehypotenuseis
alwaysthesideoppositetothe90degreean-
gle,andsowontchangeifweswitchcorners.
Ifthisstillseemsalittleconfusing,dontworry
nextwellbeseeinghowallofthistiestogether!
Trigonometric Ratios
Trigonometry is not a new thing. We owe a
lot of our geometrical knowledge to ancient
Greek mathematicians, such as Pythagoras,
whodedicatedalotoftimetofiguringoutthe
relationships between the sides and angles
of shapes. One of the many things that the
Greeks managed to determine was that the
lengths of the sides of right-angled triangles
weresubjecttocertainratios,extrapolatedrela-
tive totriangles corners intheway thatwas
discussed inthe previoussection.From this,
theyderived commonmathematical functions
touse these ratios for their calculations. For
easeofuse,theygavenamestothesixfunc-
tionsthat theydiscovered.Weknowthemas
sine (sin), cosine (cos), tangent (tan), cotan-
gent(cot),secant(sec),andcosecant(cosec).
Theratiosthatthenamesdescribeareasfollows.
Notethattheaftertherationamesdenotes
whichanglewearetakingthesesidesrelativeto.
mine which ratios we need to use. Gener-ally, we decide that based on the formula
Letscalculateofirst.Wellusehasourknown
value.Asaresult,theabovewilllooklikethis:
Looking familiar? Look back to the table
where I outlinedthe ratios. If you read care-
fully, youll see that the ratio corresponding
too/hissin.Ourequationnowlookslikethis:
Andwhenweplugournumbersinandsolveforo:
Note: You can easily use the Windows cal-
culator in Scientific mode to work with trig
ratios. Simply ensure that the calculator is
set todegrees, thenpunchintheangle (45
inthiscase)and click the sin button toget
theresultabove(0.707).Iveroundedthean-
swer off to three decimals for convenience.
And there you have it! Weve calculated
o to be 4.424 units long! Now try calculat-
ing a (hint: youll be using cos as your ra-
tio - check the list again to see why). You
should get an answer of about 4.243.
What? Out of space already?
Thats all for this month, but despair not!
Next month, well be looking at how to cal-
culate unknown angles, and youll also
get a taste of how you can start using trig
methods in your games. Until then, prac-
tice calculating unknown sides using differ-
entratiosandvalues.Illseeyounextmonth!
GAZZA_N
TECH ELECTRONIC PLAYGROUND
DEV.MAG ISSUE 1423
Figure 4: Right triangle with angle alpha,
and sides
-
8/14/2019 Dev.Mag - 14
24/28
Impretty sure thatnot many ofyou have
had the pleasure of experiencing the 18
hour non-stop flight between New York
and Johannesburg. For those of you who
havent, re-read the previous sentence and
replacepleasurewithmisfortune,andadd
from hell directly after flight if you would
likehaveanideaastowhatitreallyfeelslike.
Actually, I couldfill anentire separatearticle
justdescribinghowthose18hours feelmore
like3years,andhowInolongerfearwhat
may awaitme inthe afterlife. But I digress...
Looking back on what is nearly eight years
now,thefirstfewmonthsthatI-Imaginespent
ondevelopingwhatwouldeventuallyturninto
Chase:HollywoodStuntDriverwerefilledwith
onegrowingpainafteranother.Therelatively
easypartofthejobhadbeendone,sincewe
had decideduponaconcept togo aboutde-
velopingourfirstgamearound.Nowwewere
atthestagewherewehadtodiginandactu-
ally produce the goods, whichwas not going
tobeaneasytaskgiventhatwehadsucha
small team consisting of only four program-
mers, two artists and a single designer.
Theprogrammingtasksendedupbeingbroken
downquiteeasilywithDavesmaintaskbeingtohandlealloftherigidbodyphysics(forve-
hiclesaswellasdynamicobjects),Mattsmain
taskbeingtocreateplug-intoolsfor3DSMAX
aswellasthevehicleAI,andDansmaintask
beingtherenderingengineaswellasassuming
themantleofLeadProgrammer.Seeingashow
Iwastheleastexperiencedprogrammerinthe
team,Iwasprettymuchlefttohelpoutwher-
everIwasneeded,aswellastotackleallofthe
littlefillertaskssuchastheGUI(whichisntre-
allyafillertaskatall...)andvarioussmalltools.
The art tasks were pretty much divvied up
evenlybetweenHoangandFelixwith bothof
them being equally responsible for level and
objectbuilding,althoughHoangtookonallof
theconceptualartworkcreationaswell.Lastly,
althoughthegamewas very much a design-
by-committee production, it was left up to
Kennytofillinalotoftheblanks,aswellas
to create andmaintainourdesign document.
The rest of1999wasfilledwitha lot ofhard
workfortheteam,butitwasalsoalotoffun.
Ithinkthatweallquiteenjoyedthechallenge
and responsibility of having gone out onour
THE HISTORY OF I-IMAGINE
Part 5: The First 9 Months
HISTORY WHERE IT ALL BEGAN
own tocreatewhatwe hopedwould turnout
tobe a hit game.But before wewould have
the chance to possibly reach that lofty goal,
wewouldhavetonavigatesomeroughseas...
thefirstofwhichwasnotveryfarawayatall.
ThetaleofwhatwouldultimatelybeFelixand
Kennysshort timeat I-Imaginebeganalmost
as soon as they had arrived inSouth Africa.
Unbeknownsttotherestoftheteam,Felixand
Kennyhadabitofaproblem...actuallyitwas
morelikeaddiction,anditwasntlongbeforeit
cametotheforefrontandstartedtocausean
issuebetweenthemandtherestoftheteam.
DEV.MAG ISSUE 1424
( Who? What? Where? If youre lost concerning I-Imagine, check out Dev.Mag Issue 10 for the start of this article series! )
-
8/14/2019 Dev.Mag - 14
25/28
Theoffendingsubstancewasntalcohol,drugs,
sex,orevenoiledmidgetwrestling.No...itwas
something far more sinister, devious and life
threateningthananyothersubstanceknownto
mankind.AlthoughIamsurethatitwasoriginal-
lychristenedwithadifferentname(whichwasunpronounceablebyhumantongues)inthefi-
ery pits inwhich itwasspawned, tousmere
mortals it was known simply as EverQuest.
I actually shudder when I think back to how
utterly dependant those two poor soulswere
when it came to the sweet, sweet siren call
that beckoned them to her keyboarded bo-
som. Every day around 4pm it was though
the pied piperwouldbegin toplay his magi-
calnotesandFelixandKennywoulddropall
oftheir work,march upto theirrooms, close
theirdoors,and logontowhateverEverCrack
servertheybelongedtoinordertojoinupwith
theirfriendswhohadjustwokenupontheeast
coastofAmerica,onlytoalsobe onceagain
driven to their keyboards by the ever persis-
tentharpysongplayingintheirsubconscious.
Now,asyoucanimagine(frommycompletely
downtoearthandnotdramatisedinanyway
depictionof thecurse thatfollowed Felix and
Kenny from day to day), their actions could
notbuthaveanegativeeffectontheteamand
the work that needed tobedone. Withmost
of theirworking days beingmade upof four
ormaybe five hoursof actual timein frontof
theircomputers, itwas going tobedifficultin
theleast forthem tocontinuealong thispath
andstillremainapartoftheteam.Thismeant
thatDanwasleftwithnochoicebuttositdown
with themand have a long talk. Initially they
responded well, but unfortunately it wasnt
longuntiltheyfellbackinto theiroldpattern.
Danhadyetanothertalkandonceagain,things
gotbetter,butonlyforashorttime.Eventually
Danhadnochoicebuttogivethemanultima-
tum:eithertheyshapeupandbecomeeffective
andcommittedmembersof theteam,or they
wouldhavetopartwayswithus.Imnotsureas
totheirexactreasons(mybeliefisthattheytru-
lymissedalotofthethingsthattheywereused
tofromtheirlivesinAmerica),butinsteadoftry-
ingtoshapeuptheydecidedtoshipout.Felix
actuallycouldntwaittogetbacktotheUS,and
subsequentlyboughtplaneticketsandleftjust
afewdaysafterDansfinalmeetingwiththem,
whichwasaround themiddleof March 2000.
EventhoughFelix andKenny didnt leave us
underthebestofcircumstances,it wasnt as
thoughanyworkdidntgetdoneduringthetime
thattheywerestillapartoftheteam.Infact,
mostofthedemothatweendedupputtingto-
getherforE32000wasdonebeforetheyhad
left.Ourfirst goalwas tohave afunvehicle
simulation up and running with nice arcade-
stylephysics.Weachievedthisbythemiddle
ofJanuaryorsowithourfirstdemo,whichwas
afreeroamingarenafilledwithobstaclessuch
asramps,half-pipes,andloopswhereplayers
wouldtrytoscoreasmanypointsaspossible
by performing rolls, flips, spins, and various
other stunts in a given time limit. We knew
pretty soon thatwe wereonto something as
theentireteamendedupwastingwaytoomany
hoursplaytestingthisdemoonceitwasdone!
Now thatweknewthatwe aphysics system
that would handle the type of gameplay we
wanted ourplayers toexperience,we moved
onto creatinglevels thatwouldshowoff the
core gameplay experience of action packed
stunt driving. Our first level was designed
HISTORY WHERE IT ALL BEGAN
around a post-apocalyptic setting in the vein
of Mad Max, which had the player infiltrat-
ing anenemy compoundto rescue someone
before escaping and having to drive onto a
moving articulated truck. The gameplay here
was almost platformer-like in nature, as we
wanted to try something that hadnt really
beendone withvehicle-based games before.
OurnextlevelwassetinanAsiancitywherethe
player drovea three-wheeled ramen delivery
vehicle.Uponcompletingadelivery,the des-
tinationbuildingwouldexplodeandtheplayer
would have toescape chasing police officers
whothoughtthathewasthecauseoftheexplo-
sion.Thisgameplaywasmorestraightforward
A-to-Bdrivingbutittookplaceinafullypopulated
citycompletewithtraffic.Thecatchthatwehad
withthislevelwasthatthedeliveryvehiclehadanumbrellainthebackofitthatbobbedaround
likeaspringastheplayerdrove,andeveryone
who saw this immediatelywanted todrive it.
SoonenoughthemiddleofMaywasuponus
whichmeantthatitwastimeforE3,soweall
headedtoLAtopitchourgametopublishers.
We rented a small stand in the Kentia Hall,
which for the E3 uninformed was the small-
estofthethreeshow-hallsanditwasusually
hometomuchsmallerdeveloperstryingtoget
lucky. Throughout the show,wemanaged to
DEV.MAG ISSUE 1425
-
8/14/2019 Dev.Mag - 14
26/28
-
8/14/2019 Dev.Mag - 14
27/28
The topic of Mays devLAN in Johan-
nesburgwasArtificialIntelligence,and
we are very fortunate that we have
DannyDislekciaDaylivingupherewhopro-
videdus with a talk and some advice onthe
subject. Although the speaker was unavoid-
ablylate dueto family matters,Danny never-
thelessgaveagooddefinitionofAIinrelation
togamedevelopmentandabreakdownofthe
phasesorstepswhichanAImustgothroughin
agame,aswellasvarioussystemsavailable
whichthedevelopercanuseto createanAI.
William cairnswm Cairns opened his house
to the local members for the devLAN as he
hadbecome partly immobilised dueto a run-
ning accident inwhich hebroke his leg, and
having the devLAN in his home meant he
didnthaveto travel farand couldparticipate.
The group was quite small this time around
with just 5 ofus, but itstill seemsthe game
developers in Johannesburg are taking their
hobby seriously as half of us had an exist-
ingprojectwhichwewerealreadyworkingon
where we needed some form of dynamic in-
teraction.WewerehopingtousethedevLAN
as the perfect opportunity to get this done.
Danny attested that AI is the art of making
thingshappendynamically,andanAIcanfulfil
multipleroleslikehelpingtheplayermanagehis
resourcesandmaketheworldhesplayingin
morebelievablethanjustbeingabottheplayer
canplayagainst.Wethenexaminedthesteps
anAImusttakewhileoperatingwhichare:In-
formationGathering,InformationWeighingand
Information Output; after which we then ex-
ploredvarioussystemswhichadevelopercould
usetoletthecomputerreachadecision.We
looked atFall-through Logic, State Machines,
Heuristic Systems and Decision Trees and
thevariousbenefitsandcomplexitiesofeach.
ItsnoteworthythatWilliamfinishedasimulator
usingastatemachinewheretheplayerfought
againstotherAIsinagrowyourselforattack
othersscenario.Hisquickgraspofthecon-
ceptsand carefreeattitudeto flashygraphics
meanthefocusedallhisenergyontheproblem
spaceandinthefinaltestingofhisgame,he
hadquitebelievablecharacterstoplayagainst.
Alltoosuddenlytheeveningsetin,andwithother
commitmentstoattendtothemembersquickly
andefficientlybrokecampandheadedhome,
promisingeachothertomeetagainsoonand
TAILPIECE TIME TO CHILL
touploadtheirresultsofthedaysendeavours
whentheprojectsreachedapresentablestate.
I hope we have another devLAN soon as a
lot of work gets done on various projects at
these events and its the perfect time to ask
questionsof other developers, showoff what
youre working on, and learn a little bit more
about the vast field of game development.
FENGOL
To keep up to date about happenings concerning future dev-
LANs, be sure to regularly check up on the Game.Dev website
(www.gamedotdev.co.za) and the Game.Dev forums.
JOHANNESBURG DEVLANGATHERING FOR FUN AND ARTIFICIAL INTELLIGENCE
DEV.MAG ISSUE 1427
Occasionally, a few of the Game.Dev
membersdecidetogettogetherinanon-
Hotlabbykindofwayanddukeitoutwith
somecode.ThedevLANSareaproudex-
ample ofhowlocalgamedevelopersare
able tocombine a chilled attitudewith a
thirstforlearningsomethingnew.Oneof
theattendeesofthelatestsuchgathering
describestheexperience.
-
8/14/2019 Dev.Mag - 14
28/28