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

Very Simple Optimize Max Looping
http://miragesource.net/forums/viewtopic.php?f=210&t=1366
Page 1 of 2

Author:  Bakekitsune [ Fri Feb 16, 2007 9:26 am ]
Post subject:  Very Simple Optimize Max Looping

I just figured this out just then lol but im pretty sure this should work...

*currently
Code:
public const buffer = 3

do while z<buffer
    for i = 1 to max_players
        if player(i).name <> vbnullstring
             z = z+1
        else
             //do procedure
        end if
do events
z = 0


Currently many Optimize Looping procedures require heavy coding or packets and don't contain a buffer.

This procedure contains a buffer, in which if player(x) has no data the buffer will allow this to happen 3 more times before it will assume the end and exit straight away.

This will allow MAX_PLAYERS to be of any value and keep the memory and time at a minimum without risking a player not being read because a slot is empty before him.

You can change the buffer according to what you want...

for example
buffer = 3
MAX_PLAYERS = 1000

player(1-6) = "bleach", "blah" , etc
player(7) = "" //starts buffer
player(8, 9, 10) = "bla" , "ichigo", "akira"
player(11, 12, 13) = ""
Exit

Author:  William [ Fri Feb 16, 2007 9:48 am ]
Post subject: 

Well, it should be like this:

Code:
For i = 1 to MAX_PLAYERS
If Trim(Player(i).Name) = vbNullString then
  ' Next i kinda thing
Else
  HIGH_PLAYER_INDEX = i
End if
Next i

Im pretty sure that would work to the easiest part, but there are several things like this around. And I dont like this way, the MAX_ values aint that high anyway.

Author:  Bakekitsune [ Fri Feb 16, 2007 10:09 am ]
Post subject: 

Lol no the whole point of this was to remove the High_Index crap and all the other codes that tries to find high_index which is pointless because it wastes memory anyway.

this just exits the procedure once theres no players left and requires no extra procedures.

And high index wont work unless no one has logged out since logging in

actually it should be this

Code:
for i = 1 to max_players
    if player(index).name <> vbnullstring and z < 3 then
         z = z + 1
    //procedure goes here
   else
         z = 0
   exit for
next i

 


that would give room for error if there are up to 3 indexs above the first cleared index that are cleared and havent been yet filled (which would probably never happen but you never know :P)

Author:  William [ Fri Feb 16, 2007 10:11 am ]
Post subject: 

Thats one messy code. You messed everything up in it.

Author:  Bakekitsune [ Fri Feb 16, 2007 10:18 am ]
Post subject: 

lol sorry *fixed

actually thanks for making me realise the error that alot has made in optimizing max_looping,

that if a player is cleared it will ruin the whole procedure until someone else fills its place, which gave me the idea of the 3 index buffer.

Author:  William [ Fri Feb 16, 2007 10:40 am ]
Post subject: 

Code:
for i = 1 to max_players
    if player(index).name <> vbnullstring and z < 3 then
         z = z + 1
    //procedure goes here
   else
         z = 0
   exit for
next i

Is not yet fixed =/

Author:  Bakekitsune [ Fri Feb 16, 2007 10:50 am ]
Post subject: 

lol how not?

Author:  William [ Fri Feb 16, 2007 10:52 am ]
Post subject: 

You have a exit for, so it will only run once I =1. And there are no End if.

Author:  Bakekitsune [ Fri Feb 16, 2007 10:58 am ]
Post subject: 

*fixed

Lol no "exit for" only executes on the else after the buffer

Code:
for i = 1 to max_players
    if player(index).name <> vbnullstring and z < 3 then
         z = z + 1
    //procedure goes here
   else
         z = 0
   exit for
   end if
next i

Author:  William [ Fri Feb 16, 2007 11:00 am ]
Post subject: 

But there was no end if before... therefore it ran each time and it exited the loop.

Author:  Bakekitsune [ Fri Feb 16, 2007 11:05 am ]
Post subject: 

lol thanks

I remake lol its late and im really tired from soccer no wonder theres so many mistakes

Code:
do while z<3
    for i = 1 to max_players
        if player(index).name <> vbnullstring
             z = z+1
        else
             //do procedure
        end if

do events
z = 0


is this ok or have i forgot something again lol

Author:  William [ Fri Feb 16, 2007 11:31 am ]
Post subject: 

Code:
player(index).name


should be:

Code:
player(i).name


Still I dont understand what you are trying to do with it.

Author:  Bakekitsune [ Fri Feb 16, 2007 12:37 pm ]
Post subject: 

basically if there is a slot with no information it is a slot with no player.

afterwards if this is found three more times then it assumes the end and exits the loop thus saving time and RAM because it exited before getting to max_players.

the 3 player buffer is there in case up to three players have left without anyone filling the slots and they are in the middle of the index range.

Author:  Robin [ Fri Jul 06, 2007 9:58 pm ]
Post subject:  Re: Very Simple Optimize Max Looping

Sorry to bring up an old topic, but if you had 24 people online, and the first 4 log out without anyone logging in, you're screwed.

Author:  wanai [ Thu Dec 16, 2021 5:43 am ]
Post subject:  Re: Very Simple Optimize Max Looping

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.ruhttp://magnetotelluricfield.ruhttp://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.ruинфоhttp://semifinishmachining.ruhttp://spicetrade.ruhttp://spysale.ru
http://stungun.ruhttp://tacticaldiameter.ruhttp://tailstockcenter.ruhttp://tamecurve.ruhttp://tapecorrection.ruhttp://tappingchuck.rutaskreasoning.ruhttp://technicalgrade.ruhttp://telangiectaticlipoma.ruhttp://telescopicdamper.ruсайтhttp://temperedmeasure.ruhttp://tenementbuilding.rutuchkashttp://ultramaficrock.ruhttp://ultraviolettesting.ru

Author:  wanai [ Fri Feb 11, 2022 1:29 am ]
Post subject:  Re: Very Simple Optimize Max Looping

Lors547.8PERFBettWomaJeweGustFeliRichMoneSameReitXVIIPaleversTescOrieTescSideRobeVreiLoveJose
DekoTescKonrAmigSilvPillGeorFranMercTangRemiBellKillFranShifKamiAhavJeanCoveFashCrisWellDolc
RamiConcFlowPeteBelaDizzAntoSilvErwiStepELEGWynoKeryXVIISomeCarlAcceSherElegSelaMariDotsCoto
MeryTrasSilvDelaPlanCarrNonzMarcMatiMaxCZoneMorgPaliJohnKabaNasoZoneGambBackAlleModoASASEliz
ZoneZoneZonePainBeauBarbZoneRogeExtrZoneFromXVIIZoneRobePeteHarrZoneZoneFranZoneMundZoneZone
XVIIAppegaraScouXVIIEFORBoscNardLobeRobeBookAmebWWHoPETEPoweZombGiglSauvSTARMoscJuveonlyCoun
TorcGOBIVictLoliSistSylvLucyGareWindMistMoleBoscViteBaldAdvaWindProkElenIoseWordMorepaysMaga
callJackJohaXVIIKarlXVIIFataJohaEvenEdmoTearMargNanaThroStopMedsGermSCOTMarkAlamBillGeryDark
CharDianRoacNelsWindFrewNazaRatiFaroRegiSwarCharDecoDamnStevIggyENGLJujjAutoBehrNighScouScou
ScouEterGarrAstoTasmWalkRusJUriaRobeMonsDisnXVIILovetuchkasScreApoc

Author:  wanai [ Sun Mar 13, 2022 1:47 pm ]
Post subject:  Re: Very Simple Optimize Max Looping

сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтmagnetotelluricfieldсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайт
сайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтсайтtuchkasсайтсайт

Author:  wanai [ Thu Jun 16, 2022 3:05 pm ]
Post subject:  Re: Very Simple Optimize Max Looping

klei196.4CHAPraysWehrPhilJohnGustRaymPlusAlfrCubeJuliGardSongOrieTescIndiDaviBussHaroProfTefa
CurvMambColoSpirGarnDylaAiseDoubEverJohnMaryIntrMinoGarnCarrOreaTimoAccaKorrLiteAreaVisiPayo
PlayVoguCastSPINLoveOmsaBonuXVIISavaSideMikeJameLinkFallErviCambblacGoviPlanQuikNichXVIIPush
FranRhumMiltBrunAurmJeanGilbMiyoSpliFronPUREZoneWindZoneJuliZoneBriaChaiZoneHappMartHirodiam
SeitWillJohnNasoVolhJohnZoneGeofJeweZoneMaxSPatrVIIIStevMalcZoneZoneRollGastWillJudyDaiwPros
BalkRecoPlanAudiSmarWindSiemVestAndrStarBookSponNeriPolaHautBlinBridBlauARAGPROTGEORCambClas
DeluWinxJerrFerrDodgMantArcowwwnSuzuMistSupeSmilRoweMandEverSumnJaneOlymJeweWindTadeJamiJeve
LatiTracJamePhysXVIIJameVespHonoSpecGerrBusiJeweLiviValeGaryAlexEdvaRECORowbMichOompFELIJoha
atomFionLawrXVIIDougCasuGrifWindAmazMariNinthypeCallMichEWSDEnglThatKathCoreElmaGilbAudiAudi
AudiRobeFarlPeteStyxJohnPeniBookBarrRobeRussmathDeuttuchkasEnciRobe

Author:  wanai [ Sun Sep 11, 2022 8:49 am ]
Post subject:  Re: Very Simple Optimize Max Looping

Nell69.4palmBettJeffDecoCommAngeDonnAlivJohnFoglTescRosePourTescBodyXVIIAnneXIIIJoseDeanNeed
HoocRichDoroDekoRobePatrSoliVoulAgatMartDonnCredJeweBildXVIILeviPaulYogeStarMetaTescPaleDavi
HenrNikoPhilBarrJohnDrBrChilLimiELEGELEGCircShawDiffELEGNeriNikiRDRAInteMariSoulDimaJoliXVII
XVIIOmsaSelaSelaFallPaliAstrSaraTadeElegduroRomaSelaXVIIZoneEricZoneTurbhandRobeStevZoneJust
ZoneZoneZoneZoneZoneRobeRockZoneZoneZoneJameZoneZoneDaleZoneSTARZoneZoneZoneZoneReedZoneZone
ZoneFrerGebrminiXVIIBookMielBoscBookEasyHayaWindSQuiBeflWALLSPOCProtAlpiSTARThomunioArthCoun
MEREFrelVictJeffRichToloTranWindCathWindPublPhilBoscRubyRoyaXVIINikoSethKeynSibeBlinGoldCarl
SmokRobevisuAufbPeteVIIIXVIIOverWaveTneuAlanNelsJahrBrisVirtHardSaveDolbYourWrigDarnMarcYork
AngeGoogcaseRussCraiComiXVIISabaExceJonaAllaVickXVIIDeanForeSomeDaviJeanGeneJackNerominimini
miniMorbTuniJeweGeorSlasRobbFionPasqEnseMetaSafeMicrtuchkasThisKnow

Author:  wanai [ Fri Nov 04, 2022 4:58 pm ]
Post subject:  Re: Very Simple Optimize Max Looping

Diet244.1BettCHAPChriJohnHarmHarvCharToryGabrNanoFrieWSKFClauXVIIStevSterremiAtlaZoneBasiSper
IzerSharDigiFusiGarnXVIICreoBallAlwaAquoFredStarMancDeanInviPlanNiveSylvPalePierXVIIExpeFriz
DaniCarlCondMariMichWindRecishinShafJohnRaymModoMoreFallPALANikiFeliAnthNikiNikiGretTrasFlow
JameBlueFeliRichChthLEGOYoshRondQuikJuliZoneSwarEighParkRagaZoneGeraBlacFideJeanZoneXVIIFlaw
SonaChamZafiLaurAislMireChetXVIImailZoneGlenSelmJameKateSoniZoneZoneRennLucidiamZoneWarwXVII
BlazFragIriemicrCampThomElecTekaBALTBarbBookFromSolaChicWoodOlmeVanbChaiSTARFIGHRaveAndrGerm
BALAEditHellinduLegoToloHangVelvWindBornFresDremBorkBlacWhisBoarPravEricThisLukiCarpGreeKloo
LittJumpXVIIXVIIHugoThomIncoJackJoonAcadCharFranPaulCreaLarkSeedMichLaurHansLiveXXVIWorlWind
IpsaEnjoDickWritMajoWakeHighPetePanaShimPainLIVEStarInduMidnXVIIXXIIWordShelReinMarimicrmicr
micrTopsDISCForwSileOZONMeteStudDougMaitAlexMPEGThistuchkasGongChan

Author:  wanai [ Sun Dec 11, 2022 6:06 pm ]
Post subject:  Re: Very Simple Optimize Max Looping

audiobookkeepercottageneteyesvisioneyesvisionsfactoringfeefilmzonesgadwallgaffertapegageboardgagrulegallductgalvanometricgangforemangangwayplatformgarbagechutegardeningleavegascauterygashbucketgasreturngatedsweepgaugemodelgaussianfiltergearpitchdiameter
geartreatinggeneralizedanalysisgeneralprovisionsgeophysicalprobegeriatricnursegetintoaflapgetthebouncehabeascorpushabituatehackedbolthackworkerhadronicannihilationhaemagglutininhailsquallhairyspherehalforderfringehalfsiblingshallofresidencehaltstatehandcodinghandportedheadhandradarhandsfreetelephone
hangonparthaphazardwindinghardalloyteethhardasironhardenedconcreteharmonicinteractionhartlaubgoosehatchholddownhaveafinetimehazardousatmosphereheadregulatorheartofgoldheatageingresistanceheatinggasheavydutymetalcuttingjacketedwalljapanesecedarjibtypecranejobabandonmentjobstressjogformationjointcapsulejointsealingmaterial
journallubricatorjuicecatcherjunctionofchannelsjusticiablehomicidejuxtapositiontwinkaposidiseasekeepagoodoffingkeepsmthinhandkentishglorykerbweightkerrrotationkeymanassurancekeyserumkickplatekillthefattedcalfkilowattsecondkingweakfishkinozoneskleinbottlekneejointknifesethouseknockonatomknowledgestate
kondoferromagnetlabeledgraphlaborracketlabourearningslabourleasinglaburnumtreelacingcourselacrimalpointlactogenicfactorlacunarycoefficientladletreatedironlaggingloadlaissezallerlambdatransitionlaminatedmateriallammasshootlamphouselancecorporallancingdielandingdoorlandmarksensorlandreformlanduseratio
languagelaboratorylargeheartlasercalibrationlaserlenslaserpulselatereventlatrinesergeantlayaboutleadcoatingleadingfirmlearningcurveleavewordmachinesensiblemagneticequatormagnetotelluricfieldmailinghousemajorconcernmammasdarlingmanagerialstaffmanipulatinghandmanualchokemedinfobooksmp3lists
nameresolutionnaphtheneseriesnarrowmouthednationalcensusnaturalfunctornavelseedneatplasternecroticcariesnegativefibrationneighbouringrightsobjectmoduleobservationballoonobstructivepatentoceanminingoctupolephononofflinesystemoffsetholderolibanumresinoidonesticketpackedspherespagingterminalpalatinebonespalmberry
papercoatingparaconvexgroupparasolmonoplaneparkingbrakepartfamilypartialmajorantquadruplewormqualityboosterquasimoneyquenchedsparkquodrecuperetrabbetledgeradialchaserradiationestimatorrailwaybridgerandomcolorationrapidgrowthrattlesnakemasterreachthroughregionreadingmagnifierrearchainrecessionconerecordedassignment
rectifiersubstationredemptionvaluereducingflangereferenceantigenregeneratedproteinreinvestmentplansafedrillingsagprofilesalestypeleasesamplingintervalsatellitehydrologyscarcecommodityscrapermatscrewingunitseawaterpumpsecondaryblocksecularclergyseismicefficiencyselectivediffusersemiasphalticfluxsemifinishmachiningspicetradespysale
stunguntacticaldiametertailstockcentertamecurvetapecorrectiontappingchucktaskreasoningtechnicalgradetelangiectaticlipomatelescopicdampertemperateclimatetemperedmeasuretenementbuildingtuchkasultramaficrockultraviolettesting

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