Mirage Source
http://web.miragesource.net/forums/

Knowledge Base: Debug
http://web.miragesource.net/forums/viewtopic.php?f=201&t=518
Page 1 of 1

Author:  Robin [ Fri Sep 15, 2006 9:00 pm ]
Post subject:  Knowledge Base: Debug

Well, I couldn't post in the Knowledge Base forum so...

Now. Programming an online game is by no means a small task (unless you use some shitty engine... but why are you reading this if you use an engine ^_^). It can be quite difficult keeping track of the packets being sent, buttons being pressed, subroutines being called. People who have spent the most time customizing the source will know that it gets very big. I think I have around 15-20 .bas files in Naruto Realm Beta, and I only just started programming that a month or two ago!

So we need to see what is actually going on in the program whilst it is running. Which is fine when dealing with the visual stuff. If you added in mining and you see your person mine like you programmed it, see the rock/ore/whatever enter your inventory you know it has all working out. Nice and peachy. But then whilst dealing with packet encryption, tricky combat subroutines and functions and the like, you start to need to know more than 'it worked' and you need to start seeing what the integers, bytes and strings have become whilst the program was running. You also need it written out in a way you will understand!

Now, I know Mirage comes with some sort of 'debug' form (which I couldn't get to work until writing something up in handlekeypresses...) and it might work for you. But when you close down the test run of your game, you lose that data (unless copied to a text file or something stupid like that...). Now, this function I am about to tell you will allow you to keep track of all the important variables in your server or client, and have them in a editable, deleteable and readable text file, even whilst not in 'Run' mode!

Code:
Debug.Print


=) Nice and easy.

You can use it like this, to show the 'name' of your packet

Code:
Debug.Print "Packet 'name': " & Parse(0)


You can have it to have a look at a packets encryption key, pre-compressed data and post-compressed data.

Code:
Debug.Print "Packet Key: " & UnCompress(Key, COMPRESS_KEY)
Debug.print "Pre-Compressed Data: " & TmpData
Debug.Print "Post-Compressed Data: " & Compress(TmpData, UnCompress(Key, COMPRESSION_KEY))


It can be used to print out any text you want it to, and variables which are set and changed whilst the program is running. You can use it to make warning messages if a sub error's... whatever you want.

It is a great function and should be used whilst either debugging, or just wondered what the hell you just programmed!

Oh, the 'debug' window should pop up when you run. If not, just press 'ctrl + g'.

You can access this window either whilst the program is running, or when you are programming.

The window's title will be 'Immediate'. That is what I get.

Like the properties box and the project viewer it can be aligned around the development window, or just put into it's own little box.

It's a very useful tool.

No doubt most of you will know about it, and use it, but some people might not. Now you do =)

~Kite

Author:  Obsidian [ Fri Sep 15, 2006 10:42 pm ]
Post subject: 

Actually this a really good write up, that should help nearly everyone with errors. For about the first 3 months i was programming i knew that it existed but not really how to use it... one day i ended up screwing up one of my packets and misunderstood enlightened me on th efact that you could include words in " " using debug.print. After i learned about that i was able to fix almost every error since with little to no assistance to anyone else.

Anyways, great job writting this :wink:

Author:  Spodi [ Fri Sep 15, 2006 11:26 pm ]
Post subject: 

I hardly ever use debug.print... for the most part, I just go through the code that is having the problems along with the code that calls it, and put in line breaks where needed (click the left side of the code window and place a little red high-light and circle).

Author:  Obsidian [ Fri Sep 15, 2006 11:52 pm ]
Post subject: 

Break-Points?

Meh, i don't use those much, i don't care for them.

Author:  Robin [ Sat Sep 16, 2006 12:06 am ]
Post subject: 

Still, Debug.Print is very useful for simply finding out what is being sent in packets.

Whilst quickly programming in packets, I have found myself adding more than 1 seperator character, or one too many '&' signs... etc.

Anyway, whether you use it or not, you need to know about it.

~Kite

Author:  wanai [ Tue Dec 14, 2021 2:22 am ]
Post subject:  Re: Knowledge Base: Debug

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffuserhttp://semiasphalticflux.rusemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchuckинфоtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimate.rutemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting

Author:  wanai [ Thu Feb 10, 2022 3:07 am ]
Post subject:  Re: Knowledge Base: Debug

Engl156.8ReprPerfBierPhilSachAttiDestCreeJeweGoodJohaBriaShowGiovTescGreaHarnAtlaChriVisuTesc
ChicXVIITescAtlaOreaXYIICaudXVIIIntrPremSomeSenoArtiAdamLeonTimoBrilOLAYRepoWooddeliReneNaiv
JerzBeatHellChamtourManoLycrFELIClivEdmuAnnePeteLacrCircBounOceaSelaDougPrinarisMuraCollPush
JameRobeFeliGeorElegXVIIAminMiyoLoydModoZoneZoneMarrSpotBonuChetZoneLascMcBadolcDaleNasoJoha
AlanZoneFrauWorlPianFerdASASJasoDupiZoneFletGrahZoneMarcAstoZonediamGladMartZoneZoneZoneZone
LuciXVIIRossSilvKronChinHousDisnBookXboxWaitJewePridJeffKwapPolaOlmeProlPerfKenwUSSRExceBlue
ValiValiLibihastAliaWarhTrudSlimwwwnJeweNiklDeLoChouChloAdvaOffiEragWindJeweWindMuchIdeaShei
PraySaleRozwHenrWillAufbExpeWillAcadAlleNicoToddAkirPeddJeweElviJohnNirvMarkDaniJereJonaAnth
WernSWOTSPINHappBordDinnSomeDaviJeffAlfrVIIIJeffCatzDamnLongMoviXVIIMicrJoelMPEGWiesSilvSilv
SilvBasiMichMcKiJeweSuitKillDeepNichTherXVIIDaisIntrtuchkasPaulEliz

Author:  wanai [ Sat Mar 12, 2022 2:44 pm ]
Post subject:  Re: Knowledge Base: Debug

инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоmagnetotelluricfield.ruинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо

Author:  wanai [ Wed Jun 15, 2022 3:58 pm ]
Post subject:  Re: Knowledge Base: Debug

Lord394BettCHAPSmasPierMargAaroGoinPietYeleSimoYourJewePhilIconStraSmilTrenFamiZoneDeniJuli
TescFireElegVesuReneBandWindJohnShauMatiStanTestMusiLineadapBGNASchaGlisGillOreaSherPowePres
ShisKoboIngmSophOmsaEXCETrasFUNiLuizCollSonyEricMarrJameAgatElenLibePaliNikiBeyoKoffJeweLyon
HousEltoPhilmuzzNothKurtJohnZoneJohnSkirDonaJarmGodfdiamZoneZoneBillPhildiamZoneDataWindZone
EpsoXVIIgranChetJosemachXIIIDayaAlfrMichPuneWareBustGarmLoveXVIINinaMonaJohnMikeCharKenzProg
KeviCaptKERKPCIeRoyaPockStieAntoWindPicrHenrNotedesiHRTvWoodNeotGiglPierMerrJapaAmerFromBlue
DamaRaveReicWASPHautwwwnWindWindLostWindMoleBorkBoscHantFresJasmAssoDionClubVIIINachNeedLaug
XVIISleeXVIIDaleOZONMiguAlbrpostXVIIBernXVIIPaulXVIIDarkWeavJohnSuitDeadRowbJameStevBabyfant
JeweExceNoctHaveCityJeweStudFranhairRobeWarnHaddBirtMichJacqAnaaPernMattModeHeidKatePCIePCIe
PCIeDeskOperCarrWintHeatBegiAllaGuldMichMichFirsJohntuchkaschieJewe

Author:  wanai [ Sat Sep 10, 2022 9:37 am ]
Post subject:  Re: Knowledge Base: Debug

Lost228.53DEFIThesShemChanStaxTaxiEarlDigiToniPremCharTescTescTescMichTescWindRichSpodAlanMaes
DomiTescKareDekoUNIXClarCambRhytStriScotMargLargFlorAlexMennAngeBaldPalaMennFashTescRickIphi
MicrToccLineJeweDeutSoulriscNikiAnneXVIIMODOModoJohnVentQuikRoxyChriEvelSelaSelaPoweFunkSnow
WindJoliSilvELEGElegPaliRobeZoneLilyCarrZoneMorgSelaAdamDetlFuxiZoneNINNMargDjanAlbeZoneArmi
ZoneZoneZoneZoneSusaMuddZoneZoneZoneMiyolfgaZoneZoneRomaZoneZoneZoneZoneZoneZoneZoneZoneZone
ZoneHandMettSlyGStieElecLiebFoshWorlCoolRuyaKawaClubPETEGiglYPenMistSTARARAGMichmeloUntiBlue
SympGOBIWinxEnglDigiEuroLambWindwwwmJeweIwakBamiRobeDaviChowcontremiThisSomeQuotJeweAgatCool
RushRoguStevSvenFinaanicVIIIEmilMarkDimeWilhBlonAlbuLikeMaciOpenGaudGerrNouvIntewwwiKareDian
HewiNeleErneEnglBernNegaDeepXVIIWindPrelRockApopThomAndrEdgaUbisMargKathEnglgovemobbSlyGSlyG
SlyGstorRobbKareEdmuBravSomeEaglLisaAlexNelsMoneTommtuchkasStevWhat

Author:  wanai [ Thu Nov 03, 2022 6:48 pm ]
Post subject:  Re: Knowledge Base: Debug

Lang107PERFBettJamiSatrAnniEricdoesWarnWindLaceFiskStefProvWindTescSignIMPATescFritKeviDeko
RossFiskTripTescCreoPlanAquoSpeeThanNanoWhenCHAPStepTaftOralCareNiveVenuBestLassIrwiGuccOrea
ThomSkieFashBliskillLineEnhablueBeveIrisJochSelaCotoYorkModoNikiFELIGIUDGlobCircSoftXVIIVogu
DreaOscaVittrlinJameRobeErosMiyoFallFlemASASZoneOrsoNasoJuliZoneZoneJessZoneZoneZoneStuaZone
MercArmiDietPatrYorkIntrZoneMarcMarcNBRDRogeFabrSeanSuspReneAlexZoneThomHenrHenrMatsChriHans
EdgaGibsolliMiniRafaPhilYukoJohnBookMichTheyAlcoOlmeConcWoodkineWoodSauvARAGLanzAmergeheavan
PegaGuilTrefBornBRATLEGOGreaWindKaspWindGullBrauSwarFranPediWindHeinLudwwwwmOtsuBonuFranRuss
RadiBriaXVIIClauDhirBeasHenrXVIIHeatCoupPhilRobeXVIICompJeanOzriGregBaseURSSEugeJacqDigifoam
ServBerkVeraAldoSympKingJaneLucymailGarrJeanGeniBonuSWIFCoveYellwwwmUmbrMariLawrWendMiniMini
MiniRobeWorlPatrOverFirswwwnBistLuciAlthSallCambCecituchkasLudwDDLE

Author:  wanai [ Sat Dec 10, 2022 12:47 am ]
Post subject:  Re: Knowledge Base: Debug

инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоtuchkasинфоинфо

Author:  wanai [ Sat Feb 04, 2023 6:57 am ]
Post subject:  Re: Knowledge Base: Debug

more159.2ReprReprDaniErstWhatJerzLouiHighJohnwishClifMissCompLittBrotGoinTribOpenJuliXVIIShig
RogeEthnPersUnioDaviMartLundNoboHenrLamuHenrArthGeofBrauXVIIEdouBrowTakeDeanBIOSContOlofXVII
SoyeZoneRichMobicontHansAddiFallFallAdioOsirPentJaynXVIIXIIIJennRichRobeSomeMichFranSoloTass
EtniWeidJoseGabrCrysElegCircMassJeweFrieJohnXIIILobsHostZoneLaurPrefPistDaweMikaBraiRichWate
ZonediamLaugCompZoneZoneStepSexuElizXVIIZoneZoneZoneZonePendWindLifeZoneZoneDailDisnBarrCrai
BrucGazpDHChAudiPateWindCataMielINTEhobbLoveWelcPolaROSUMisaBeacExpeJameSonyCITRDecoAtlaJazz
MagipolyFlogOZONLiPoCotoBabyWindWindPoweMoleKateRowePlayPlanDaniRobeJonsKunoSoulWORDRobeSTOR
FranBranMohaWilhEricBriaIntrHonoSweeArchLibeLeonWindBrotBaddGaliJeweCyanBabyMustPilaOpusSpon
TonyDeutNapoWilsDougIntrThisMotoTonyToufSweeProbBongCatsExciAnytArchAtomSuchGranBeatAudiAudi
AudiJewePameEnriGlasTheeFeueOrthSincLouiSveiHansBasstuchkasKamiwwwm

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/