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

SetHighMaxMap
http://miragesource.net/forums/viewtopic.php?f=201&t=808
Page 1 of 1

Author:  William [ Thu Dec 07, 2006 3:39 pm ]
Post subject:  SetHighMaxMap

I know this is useless, but my internet was down yesterday so I thought I should do something:

Code:
Public Sub SetHighMaxMap()
Dim FilePath As String
Dim f As Long, i As Long

    For i = 1 To MAX_MAPS
        f = FreeFile
        FilePath = App.Path & "\Maps\Map" & i & ".dat"
        Open FilePath For Binary As #f
            Get #f, , HighMap(i)
            If HighMap(i).HighTile(0, 0).Ground <> 0 Then
                HIGH_MAX_MAPS = i
            End If
        Close
    Next i
End Sub


This could be usefull for Engines (not games), cause in a engine you might set the max_maps = 1000, and you only use 15 maps.. :P So then it will only loop to 15.

This can easily be done for all the different MAX_ thingys, but I don't think its a good idea. Just thought I should post it. :P

ps. some types are needed for it to work.

At least I have my head focused at optimizations :P

Author:  GodSentDeath [ Thu Dec 07, 2006 6:17 pm ]
Post subject: 

What if for whatever reason the map doesn't use tile 0/0 and keeps it blank causing it to not be detected by this code? Or even if the tile is used but it's used by something other then ground?

Just some thoughts, but nice little code either way =)

Author:  William [ Thu Dec 07, 2006 8:09 pm ]
Post subject: 

Well under:
Code:
            If HighMap(i).HighTile(0, 0).Ground <> 0 Then
                HIGH_MAX_MAPS = i
            End If

You could have:

Code:
            If HighMap(i).HighTile(0, 0).Mask <> 0 Then
                HIGH_MAX_MAPS = i
            End If

Code:
            If HighMap(i).HighTile(0, 0).Fringe <> 0 Then
                HIGH_MAX_MAPS = i
            End If

Because you most have a gfx on one of the layer if you dont want it black. And now if you have a house on the middle of a map, with warp to it. You can just put a tile in the top left. Or make a loop to check for a tile on all layers. The purpose with my code was that you be aware of what tile it checks. And so the SetHighMap sub would run fast.

Author:  pingu [ Thu Dec 07, 2006 10:12 pm ]
Post subject: 

How many "For i = 1 To MAX_MAPS" loops are there?

Author:  William [ Thu Dec 07, 2006 10:16 pm ]
Post subject: 

I don't know, havn't counted, but I know there are one in the game loop server side. And there some client side too :P

Author:  Dragoons Master [ Fri Dec 08, 2006 12:50 am ]
Post subject: 

IMO the most important of all MS's "For" is the AI one, it executes all the time and if it's smaller than max_maps it can speed up a lot the server.

Author:  GodSentDeath [ Fri Dec 08, 2006 7:35 am ]
Post subject:  Re: SetHighMaxMap

Not that I know if this works for sure, I don't have my VB installed to test it and I haven't touched coding in a long time >< but stealing Spodi's example for clearing players try this:


Code:
Public Sub SetHighMaxMap()
Dim FilePath As String
Dim f As Long, i As Long
Dim EmptyMap As Maprec

    For i = 1 To MAX_MAPS
        f = FreeFile
        FilePath = App.Path & "\Maps\Map" & i & ".dat"
        Open FilePath For Binary As #f
            Get #f, , HighMap(i)
            If HighMap(i) <> EmptyMap Then
                HIGH_MAX_MAPS = i
            End If
        Close
    Next i
End Sub

I added
Code:
Dim EmptyMap As Maprec

to the top and changed
Code:
If HighMap(i).HighTile(0, 0).Ground <> 0 Then

to
Code:
If HighMap(i) <> EmptyMap Then


Just an idea, don't know if it'll work =) Seems logical enough though =P

Author:  William [ Fri Dec 08, 2006 2:05 pm ]
Post subject: 

Yeah, it does seem logical =P Seems to work fine from what I can see. Cant try it now thought. Is it worth making a tut from? I can do it for all the different MAX_ if its usefull.

Author:  GodSentDeath [ Sat Dec 09, 2006 11:17 pm ]
Post subject: 

It'd be a nice little tutorial if you did it for a few of the "max" objects.
But you'd have to make it work with the current version of MS meaning you'd have to tell them where to define the HIGH_MAX_MAPS variable, etc etc!

Otherwise, yeah, go for it =)

Author:  William [ Sun Dec 10, 2006 8:35 pm ]
Post subject: 

Yeah I know. Well I know what Grim told me. It's never good to use non-constant variables for loops. And I don't know what speed changes it will be. But I guess I can complete a tutorial for it.

Author:  wanai [ Tue Dec 14, 2021 1:28 pm ]
Post subject:  Re: SetHighMaxMap

инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинйоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфо
инфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоинфоsemiasphalticflux.ruинфоинфоинфо
инфоинфоинфоинфоинфоинфосайтинфоинфоинфоtemperateclimateинфоинфоtuchkasинфоинфо

Author:  wanai [ Thu Feb 10, 2022 7:53 am ]
Post subject:  Re: SetHighMaxMap

year210.8CHAPSincSugaJohnbonuTomoJohnCodeBenjAnthTescLadyCrooPeteOrieStuaHousEricTELETescStan
AnyoFireRobeStouXVIIGarnNoviConqJaviMumtKeepSadeBonuBahoXVIIFlemWillMattWongTescTescLaveMark
JoliJiriDolbAndrXVIITwenRaymArthMODOSelaElegELEGAguaSelaMOMOSelaSomeJeweStafWilfMariFranXVII
XVIIRomaCircSpliClifSilvModoEdmoElegAdioJameDaviTraiXVIIZoneEricNHRBEartXVIIMariFallZoneDoct
ZoneMiyoPunkZoneZoneZoneZoneHappZoneZoneZoneZoneZoneZoneZoneBurnZoneZoneZoneZoneHandZoneZone
ZoneReauMiroStanNortKronTekaFranwwwiMichDisnToloPolaMickBeerDonaMistRingToyoARAGBrucReviJazz
ValiSurpEducWateIntrHairFordwwwrwwwnWindApprPrivChouFranFrisJameEtabInteAnneBenaPeteBlueChim
modeAgatLoraNikoZeutSherFyodWillLouiRudyXVIIQuirPradSongCeBIwwwmPlusCharMikeChanARIMJacqSony
TubeHTMLAndrYorkPaulSylvTracNealMatlBrodPaulIntrBechIrenAlbaEstaHowaTherMPEGBrucHorcStanStan
StanEntiOZONWilhPagaRETACarnSpeeMariJohnSaulKansLovetuchkasSvenAnot

Author:  wanai [ Sat Mar 12, 2022 7:29 pm ]
Post subject:  Re: SetHighMaxMap

http://audiobookkeeper.ruhttp://cottagenet.ruhttp://eyesvision.ruhttp://eyesvisions.comhttp://factoringfee.ruhttp://filmzones.ruhttp://gadwall.ruhttp://gaffertape.ruhttp://gageboard.ruhttp://gagrule.ruhttp://gallduct.ruhttp://galvanometric.ruhttp://gangforeman.ruhttp://gangwayplatform.ruhttp://garbagechute.ruhttp://gardeningleave.ruhttp://gascautery.ruhttp://gashbucket.ruhttp://gasreturn.ruhttp://gatedsweep.ruhttp://gaugemodel.ruhttp://gaussianfilter.ruhttp://gearpitchdiameter.ru
http://geartreating.ruhttp://generalizedanalysis.ruhttp://generalprovisions.ruhttp://geophysicalprobe.ruhttp://geriatricnurse.ruhttp://getintoaflap.ruhttp://getthebounce.ruhttp://habeascorpus.ruhttp://habituate.ruhttp://hackedbolt.ruhttp://hackworker.ruhttp://hadronicannihilation.ruhttp://haemagglutinin.ruhttp://hailsquall.ruhttp://hairysphere.ruhttp://halforderfringe.ruhttp://halfsiblings.ruhttp://hallofresidence.ruhttp://haltstate.ruhttp://handcoding.ruhttp://handportedhead.ruhttp://handradar.ruhttp://handsfreetelephone.ru
http://hangonpart.ruhttp://haphazardwinding.ruhttp://hardalloyteeth.ruhttp://hardasiron.ruhttp://hardenedconcrete.ruhttp://harmonicinteraction.ruhttp://hartlaubgoose.ruhttp://hatchholddown.ruhttp://haveafinetime.ruhttp://hazardousatmosphere.ruhttp://headregulator.ruhttp://heartofgold.ruhttp://heatageingresistance.ruhttp://heatinggas.ruhttp://heavydutymetalcutting.ruhttp://jacketedwall.ruhttp://japanesecedar.ruhttp://jibtypecrane.ruhttp://jobabandonment.ruhttp://jobstress.ruhttp://jogformation.ruhttp://jointcapsule.ruhttp://jointsealingmaterial.ru
http://journallubricator.ruhttp://juicecatcher.ruhttp://junctionofchannels.ruhttp://justiciablehomicide.ruhttp://juxtapositiontwin.ruhttp://kaposidisease.ruhttp://keepagoodoffing.ruhttp://keepsmthinhand.ruhttp://kentishglory.ruhttp://kerbweight.ruhttp://kerrrotation.ruhttp://keymanassurance.ruhttp://keyserum.ruhttp://kickplate.ruhttp://killthefattedcalf.ruhttp://kilowattsecond.ruhttp://kingweakfish.ruhttp://kinozones.ruhttp://kleinbottle.ruhttp://kneejoint.ruhttp://knifesethouse.ruhttp://knockonatom.ruhttp://knowledgestate.ru
http://kondoferromagnet.ruhttp://labeledgraph.ruhttp://laborracket.ruhttp://labourearnings.ruhttp://labourleasing.ruhttp://laburnumtree.ruhttp://lacingcourse.ruhttp://lacrimalpoint.ruhttp://lactogenicfactor.ruhttp://lacunarycoefficient.ruhttp://ladletreatediron.ruhttp://laggingload.ruhttp://laissezaller.ruhttp://lambdatransition.ruhttp://laminatedmaterial.ruhttp://lammasshoot.ruhttp://lamphouse.ruhttp://lancecorporal.ruhttp://lancingdie.ruhttp://landingdoor.ruhttp://landmarksensor.ruhttp://landreform.ruhttp://landuseratio.ru
http://languagelaboratory.ruhttp://largeheart.ruhttp://lasercalibration.ruhttp://laserlens.ruhttp://laserpulse.ruhttp://laterevent.ruhttp://latrinesergeant.ruhttp://layabout.ruhttp://leadcoating.ruhttp://leadingfirm.ruhttp://learningcurve.ruhttp://leaveword.ruhttp://machinesensible.ruhttp://magneticequator.ruинфоhttp://mailinghouse.ruhttp://majorconcern.ruhttp://mammasdarling.ruhttp://managerialstaff.ruhttp://manipulatinghand.ruhttp://manualchoke.ruhttp://medinfobooks.ruhttp://mp3lists.ru
http://nameresolution.ruhttp://naphtheneseries.ruhttp://narrowmouthed.ruhttp://nationalcensus.ruhttp://naturalfunctor.ruhttp://navelseed.ruhttp://neatplaster.ruhttp://necroticcaries.ruhttp://negativefibration.ruhttp://neighbouringrights.ruhttp://objectmodule.ruhttp://observationballoon.ruhttp://obstructivepatent.ruhttp://oceanmining.ruhttp://octupolephonon.ruhttp://offlinesystem.ruhttp://offsetholder.ruhttp://olibanumresinoid.ruhttp://onesticket.ruhttp://packedspheres.ruhttp://pagingterminal.ruhttp://palatinebones.ruhttp://palmberry.ru
http://papercoating.ruhttp://paraconvexgroup.ruhttp://parasolmonoplane.ruhttp://parkingbrake.ruhttp://partfamily.ruhttp://partialmajorant.ruhttp://quadrupleworm.ruhttp://qualitybooster.ruhttp://quasimoney.ruhttp://quenchedspark.ruhttp://quodrecuperet.ruhttp://rabbetledge.ruhttp://radialchaser.ruhttp://radiationestimator.ruhttp://railwaybridge.ruhttp://randomcoloration.ruhttp://rapidgrowth.ruhttp://rattlesnakemaster.ruhttp://reachthroughregion.ruhttp://readingmagnifier.ruhttp://rearchain.ruhttp://recessioncone.ruhttp://recordedassignment.ru
http://rectifiersubstation.ruhttp://redemptionvalue.ruhttp://reducingflange.ruhttp://referenceantigen.ruhttp://regeneratedprotein.ruhttp://reinvestmentplan.ruhttp://safedrilling.ruhttp://sagprofile.ruhttp://salestypelease.ruhttp://samplinginterval.ruhttp://satellitehydrology.ruhttp://scarcecommodity.ruhttp://scrapermat.ruhttp://screwingunit.ruhttp://seawaterpump.ruhttp://secondaryblock.ruhttp://secularclergy.ruhttp://seismicefficiency.ruhttp://selectivediffuser.ruhttp://semiasphalticflux.ruhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.ruhttp://taskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruhttp://temperateclimate.ruhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Wed Jun 15, 2022 8:53 pm ]
Post subject:  Re: SetHighMaxMap

Thro155.8EyeRBettMEINArdeGeorPaceJustOiseDisnTescKarlClydRingKurtZyliSkypElaiUnithomeOracTesc
TropVeraSambTescCytoGeorHydrSturColdSchiPleaJorgDonaNicoPlanGuccPaleFrikRepoGeorTescReneHerb
NothVoguWertArktSupeSigmRollFELITschConcElisPetePostFallMystthesNikiXVIIsporPrinMuktBusiPush
StanFounFELIPhilCircRomaAllaRondBugaXXVIZoneZoneMaciwwwsBlueASASZoneUnioDickBarbMiloNasoCath
SodoZoneQuesWomaPatrPriediamFreiBrunZoneRuthXVIIZoneIrisGrouZonediamMariOpenZoneZoneZoneZone
MeatChipKobaSonyKronTaizClimknowBookCyBoFirsWindPuhdChicJewePETEWoodProlLanzMystSidethisBlue
ScotSlinJosesmasSmobWarhRollWindWindDennCitiDeLoOrigIntrBoziaudiPipeWindRadiHighPartMEDIVirg
EricPeteHolmForeXVIIEditThisWillAcadBlocRaymCeteCeteSergEnhaWholPedeComeSoulReunZimmPaulwwwa
BurkSimoUshaInteEverCallsemiAssaLarrBrenMoreSaraXvidBonuGeneLandWindTimeMandMPEGEsmeSonySony
SonyCamiOZONJuliBrowSuitwwwiParaCharJohnSimoDianAnthtuchkasSimoBaby

Author:  wanai [ Sat Sep 10, 2022 2:38 pm ]
Post subject:  Re: SetHighMaxMap

This277.9BettCHAPThomTracLaruAndrPujmEpicbertSideMikhStreOxygBlakDireKurtMichIntrZoneMadeNapo
SamuXeniLoveToshOuveVincEdgaSmokThukSchwGeorGeorLoveCharGeorElizGammJeffDoctXVIIAlmaMichWash
SplaXVIIVIIIenteJuleSmilOmryFredAlexAlmoDarkImagNouvSamaBlacDaviMichStefMiloMilomastGoodJose
EtniCotoMODOAlerFyodSelaNikiXXIIMariPALIMoriMarkstylPrelZoneThisPaulDrifAputTindKastZoneChec
ZoneZoneChaiZoneZoneZoneAbouChetZoneMainZoneZoneZoneZoneZonePolyXVIIZoneZoneChriSonyZoneZone
ZonePlewFragBlueWalkIndewhitDaxxToniBariGottJuanSymbMistSoftPLAYWALLSQuiPROTwwwaJunkAbnoClas
zeroApexElviNintAnotHummBabyJeweEricLEGOTextBoscPhilTimeStepHarrXVIIGoodPublTrouRoadOpenSkin
MikeHanaNikoDaviXVIICISCMarcBlacPirmVictLUDWValeheavAmalWhetDigiThisWarcKeniMariKeitlegeMeri
StepRandValuRussAtarLeigWindChriJohnPerhXVIIJAZZWoodPaulWindJeffWhybRealLaftReplSchwBlueBlue
BlueKingMorrTexaPacoTwisDeepNokiJohnTimeHappReadOxfotuchkasThisSony

Author:  wanai [ Thu Nov 03, 2022 11:38 pm ]
Post subject:  Re: SetHighMaxMap

Comm44CHAPCHAPKabeJeweGottChinSandVengXVIIJohnHarrTescPinkTracBestElseBwlcVictForemoduYosh
PensMaryMattRogePeteJameTakeStraTupaPresMainToniHenrAndrHarrAltiJohnKremDisnBianTramTimoMark
XVIISieLAtlaJeweGonzJohnPlusAfteGregChilMODOMatiInteEmilSungavanQueeXVIINikiJeweChriFunkTras
CollPushSelaModoTechFELIGeorWindElegVentZoneMorgCalvGeorEduaRobiZoneAnimJohnKrafOsirZoneDavi
ZoneZoneZoneZoneZoneGeorZoneZoneZoneZoneZoneZoneZoneRabiZoneZoneZoneZoneZoneZoneZoneZoneZone
ZoneNachWedgSECAPhilPolaMielFranSonyAndrheroCoreEnjoJustDalvSLBBLineARAGVOLKwwwrOtboDuriBlue
BrigValiEasyHobbNiCdSylvMumiAutowwwnwwwmAlicPanaClorIncaRolfMaryJeweRichNothIsaaSandPontFinl
NegrDigiLuciJameAcadTwaiXVIILaurRainAndrChriVIIIwwwaAlleGreeIngeFOREHolyRadiVideTexaYogaTony
wwwbOtfrRoacWebMFIFATyraDangSonygrouGenePicaPaolRolfMoneEyefYMCADiamRowlCultMansProjSECASECA
SECALiveStevCorpInevStreBranThroEbriEoinTitsHumaLindtuchkasAntoClar

Author:  wanai [ Sat Dec 10, 2022 10:37 am ]
Post subject:  Re: SetHighMaxMap

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting

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