Mirage Source

Free ORPG making software.
It is currently Thu Mar 28, 2024 1:44 pm

All times are UTC




Post new topic Reply to topic  [ 85 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 6:53 pm 
Offline
Newbie

Joined: Thu Jun 07, 2007 3:28 pm
Posts: 19
also i found this in big reds edit. he didnt remove the fps cap ??? but yet it still runs at 49 + fps ?

' Lock fps
Do While GetTickCount < Tick + 20
DoEvents
Loop

thats from his source


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:07 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
It doesn't matter how you tweak those numbers in the cap, removing it should set your fps to around 500-1000.

If nothing happens when you remove that cap, then the fault is not the cap. The fault is that you must be running a unbelievable big gameloop and doing a tremendous amount of things in it. I dont know what kind of things es has in its gameloop, but I doubt they messed it up that big.

So I'd bet you have done something wrong when trying to add this, post all your code and hope for someone to take the time and read it.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:14 pm 
Offline
Newbie

Joined: Thu Jun 07, 2007 3:28 pm
Posts: 19
Moved this to a help topic.


Last edited by frozengod on Wed Sep 26, 2007 7:24 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:20 pm 
I got an idea.

Don't use ES.


Top
  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:21 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Worst thing in that?

Visual Inventory xD

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:21 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
OMG, what did you just do????? xD

Make a new topic for this in the help board. And for god sake use the CODE tag and not the quote tag. And hell, I will never ever read that code without indents..

Edit:
Code:
 If Val(GetVar(App.Path & "\Main\Config\config.ini", "CONFIG", "SpeechBubbles")) = 1 Then


They are using a getvar in the gameloop, use a variable es Please!

ps. I cant even find the visual inventory in all of that code..

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:22 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Use spoiler tags too :|

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:22 pm 
Offline
Newbie

Joined: Thu Jun 07, 2007 3:28 pm
Posts: 19
well, this is ES version 1, and ive been working on my personal project for 2-3 years now and its got so much i dont want to have to redo, id rather redo the game loop than sacrifice my work =/, trust me im wanting to kick myself for starting over there rather than here :P
sorry ill move that to the help section :P
erm this blows lol


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:24 pm 
Offline
Community Leader
User avatar

Joined: Mon May 29, 2006 1:00 pm
Posts: 2538
Location: Sweden
Google Talk: johansson_tk@hotmail.com
I don't have anything more to say really.

_________________
I'm on Facebook!My Youtube Channel Send me an email
Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Sep 26, 2007 7:25 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
I did warn you xD

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Nov 07, 2007 7:50 pm 
Anyone have a copy of the source code he had uploaded? Both links are dead..


Top
  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Sun Feb 03, 2008 6:12 pm 
Offline
Pro

Joined: Mon May 29, 2006 5:01 pm
Posts: 420
Location: Canada, BC
Google Talk: anthony.fleck@gmail.com
I know this is a pretty dead topic, but whatever haha.

I have been messing with this tutorial on and off for a few weeks and finally decided to attempt to get some help. I am using a vanilla MSE and only have tried to add this in. This is what I got.

I have added in the new variables like BigRed said to do, as well as initializing the surfaces and setting the color keys. This is my BltMap sub.

Code:
Dim Ground As Long
Dim Anim1 As Long
Dim Fringe As Long
Dim x As Byte
Dim y As Byte

    With rec
        .top = 0
        .Bottom = ((MAX_MAPX + 1) * PIC_X)
        .Left = 0
        .Right = ((MAX_MAPY + 1) * PIC_Y)
    End With
   
    DD_LowerBuffer.BltColorFill rec, RGB(0, 0, 0)
    DD_UpperBuffer.BltColorFill rec, RGB(0, 0, 0)

    For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX

            With Map.Tile(x, y)
                Ground = .Ground
                Anim1 = .Mask
                Fringe = .Fringe
            End With
           
            ' Ground
            With rec
                .top = Int(Ground / 7) * PIC_Y
                .Bottom = .top + PIC_Y
                .Left = (Ground - Int(Ground / 7) * 7) * PIC_X
                .Right = .Left + PIC_X
            End With
            Call DD_LowerBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT)
           
            ' Mask
            With rec
                 .top = Int(Anim1 / 7) * PIC_Y
                 .Bottom = .top + PIC_Y
                 .Left = (Anim1 - Int(Anim1 / 7) * 7) * PIC_X
                 .Right = .Left + PIC_X
            End With
            Call DD_LowerBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)

            ' Fringe
            If Fringe > 0 Then
                With rec
                    .top = Int(Fringe / 7) * PIC_Y
                    .Bottom = .top + PIC_Y
                    .Left = (Fringe - Int(Fringe / 7) * 7) * PIC_X
                    .Right = .Left + PIC_X
                End With
                Call DD_UpperBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
           
        Next x
    Next y


I believe this is correct, I have removed the animation part of it to be replaced with this:

Code:
Sub BltAnimation()
Dim Anim As Long
Dim x As Byte
Dim y As Byte

For y = 0 To MAX_MAPY
        For x = 0 To MAX_MAPX
       
            Anim = Map.Tile(x, y).Anim
           
            If Anim > 0 Then
                With rec
                    .top = Int(Anim / 7) * PIC_Y
                    .Bottom = .top + PIC_Y
                    .Left = (Anim - Int(Anim / 7) * 7) * PIC_X
                    .Right = .Left + PIC_X
                End With
                Call DD_LowerBuffer.BltFast(x * PIC_X, y * PIC_Y, DD_TileSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
            End If
           
        Next x
    Next y
End Sub


The other Subs like BltItem, Npc and Player have only been changed from BackBuffer to MiddleBuffer. Umm, in my GameLoop I have this:

Code:
        ' Clear the back and middle buffers
        DD_BackBuffer.BltColorFill rec, RGB(0, 0, 0)
        DD_MiddleBuffer.BltColorFill rec, RGB(0, 0, 0)


Which is right under the End If for the Clear Surfaces check. Then I have this:

Code:
' Draw all buffers to the back buffer
        With rec
            .top = 0
            .Bottom = ((MAX_MAPX + 1) * PIC_X)
            .Left = 0
            .Right = ((MAX_MAPY + 1) * PIC_Y)
        End With
   
        Call DD_BackBuffer.BltFast(0, 0, DD_LowerBuffer, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        Call DD_BackBuffer.BltFast(0, 0, DD_MiddleBuffer, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)
        Call DD_BackBuffer.BltFast(0, 0, DD_UpperBuffer, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY)


Right before the back buffer is locked for the text to be drawn. I guess thats all. The Call BltMap is right after the GettingMap boolean in "mapdone" packet and I have added them to the EditorMouseDown and Cancel subs too however the tiles, items, npcs and players are all not being shown and there is no trailing on the map and no errors :P. Oh, also I did move the InitDirectX. I cannot seem to figure out where I went wrong and hope somebody can help me :D. Thanks a lot!


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Mon Feb 04, 2008 11:49 pm 
Offline
Pro

Joined: Mon May 29, 2006 5:01 pm
Posts: 420
Location: Canada, BC
Google Talk: anthony.fleck@gmail.com
I know how everyone around he reacts to impatience and stuff but there has been 20 more views on the topic and no replies :(. Sorry for double posting..

I have tried more to figure this out but can't get it. I have read the tutorial a few times over. I know there is one person who can help me out.. Robin :lol:.


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Feb 05, 2008 4:37 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Why is it that when people don't get a reply they always post my name?

What am I? Some sort of public property? Am I here to perform for you? Do you want me to perform!?

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Feb 05, 2008 7:46 pm 
Offline
Pro

Joined: Mon May 29, 2006 5:01 pm
Posts: 420
Location: Canada, BC
Google Talk: anthony.fleck@gmail.com
Robin wrote:
Why is it that when people don't get a reply they always post my name?

What am I? Some sort of public property? Am I here to perform for you? Do you want me to perform!?


Haha, not really. I just know you have added this to Winds Whisper, and as far as I know, your the only one who has had it working properly.


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Feb 05, 2008 8:32 pm 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
DFA got it working.. and he told me the trick to it, something needed to be changed.. or re-ordered or soemthing.


BUT, I forget, I can message him later maybe if I remember.


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Feb 05, 2008 10:05 pm 
Offline
Newbie

Joined: Sat Jun 23, 2007 2:11 am
Posts: 16
this tutorial is to easy, i dont see why you people have so much trouble with it ;)
i could add it to a blank mirage in 10 mins :P


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Feb 05, 2008 10:29 pm 
Offline
Pro
User avatar

Joined: Thu Dec 14, 2006 3:20 am
Posts: 495
Location: California
Google Talk: Rezeyu@Gmail.com
Because as is, it doesn't work.

There's something that needs to be changed.
If you take whats here right now, and add it to a vanilla MSE, it'll display incorrectly.


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Feb 05, 2008 11:08 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
I'm sure that's not the case, as I've managed to do it every time I needed it without adding anything.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Feb 06, 2008 12:20 am 
Offline
Pro

Joined: Mon May 29, 2006 5:01 pm
Posts: 420
Location: Canada, BC
Google Talk: anthony.fleck@gmail.com
Alright, well I will take a look at it when I get home. I have DFA on messenger so I will maybe talk to him about it too. Thanks for the replies. I will look over the tutorial again, too.


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Mar 25, 2008 11:22 pm 
Offline
Regular
User avatar

Joined: Sat Dec 08, 2007 11:16 pm
Posts: 25
This toturial is fine, apart from the map animation. If the map animation stay in the lower and upper buffer, they will not work as you would have to clear the upper & lower buffer every animation frame. If you use the Middle buffer they will work, but you will be able to walk over the fringe animation tiles. If you clear the upper & lower buffer every frame the map will dissapear as you will clear the map. Thats the only problem i can see with this tut.

POST EDIT
Sorry, i've just realised Mirage don't have Fringe animation layers. Sorry don't listen to me i don't know what i'm talking about.

_________________
Online Dragonball - 2D DX8 Role Playing Game


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Mar 26, 2008 8:08 am 
Offline
Knowledgeable

Joined: Sat Jul 08, 2006 8:24 am
Posts: 339
Tut works fine. I made 2 surfaces, one for ground/mask and one for fringe. Everything in between still is regular. I prefer it that way.


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Wed Mar 26, 2008 12:11 pm 
Offline
Submit-Happy
User avatar

Joined: Fri Jun 16, 2006 7:01 am
Posts: 2768
Location: Yorkshire, UK
Mozza wrote:
This toturial is fine, apart from the map animation. If the map animation stay in the lower and upper buffer, they will not work as you would have to clear the upper & lower buffer every animation frame. If you use the Middle buffer they will work, but you will be able to walk over the fringe animation tiles. If you clear the upper & lower buffer every frame the map will dissapear as you will clear the map. Thats the only problem i can see with this tut.

POST EDIT
Sorry, i've just realised Mirage don't have Fringe animation layers. Sorry don't listen to me i don't know what i'm talking about.


You still have difficulty understanding buffers don't you.

The 'layering' effect is still there. If you render the Fringe Animation tiles after the player, even if you render them to the Middle Buffer, it will still appear above the player on the game screen.

_________________
Quote:
Robin:
Why aren't maps and shit loaded up in a dynamic array?
Jacob:
the 4 people that know how are lazy
Robin:
Who are those 4 people?
Jacob:
um
you, me, and 2 others?


Image


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Tue Nov 02, 2021 8:18 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Econ216.3BettCHAPMamaWindJeweXVIILoveRafaRabiBestAtlaOmsaBobbalceTescFiskMikaHousGlenOlivChes
JuliHomeDeadExotthirFreeSexySheiSereNiveEugeBoucHereGarnDoctPresRichMavaBookHenrHaveXVIIChar
SpacLiliBaixSunnCotoAmarWoolDigiPockmicrPradStanNeviXVIIHeinPaulmailCircChroYorkMccrPrinWorl
ArktUnreJaanHoMMScooAngeClicenriVondJuliAdelMenuAlexZoneFuxiWildGeorCheoZoneZoneRescLudwZone
diamZonediamFireHumaZoneKiddLadiZoneXVIIZoneZoneZoneZoneZoneJohnSympMercNasoStilZoneMarcXVII
ZoneBrucMadePoweElecKronLiebKatsBookCHARBontVasiTexaJeweFiesLastWoodCaseProlARAGENSVDICOtrac
CleaEducEducRaisDodgMegaMimiBritWindDorlDanaConnWinxJohnFresCultDaviAmerADupLadyJameJeweAudi
LukiSagaCharXVIIXVIIAcadsomeAeroRainMartLiyaBestRobeWhitRollBarbVasiEddiSingNiccTwenEugeKlau
RobeRichRoacEnglJonaAdamreceWindMatlemocWindIvanVirgClifFredNichErleRussKeunOnkeJonaPowePowe
PoweAstrMafiOlivremiBittwwwrMartXiaoLudwLeShManaaututuchkasBriaSelt


Top
 Profile  
 
 Post subject: Re: Optimized Surfaces
PostPosted: Fri Feb 18, 2022 1:38 am 
Offline
Mirage Source Lover

Joined: Sun Jul 04, 2021 4:04 am
Posts: 456192
Econ208.8BettAIDSVivaStarGaleExpeSomeJoseXVIIHermJasmHoosMileWindLoreSambTescWindHughTadeStef
SpekAlicStyxLiviWindKeraPhilAtlaGAAPJackFyodDifeWestPolyVinoFredRETAPaleMichQuenMiraAnitKera
JohnAnurNintNormNighLineWindMediMoviSonysatiMcBaAureZdenOetkPrasPatrVansLucifantCircSympYell
ModeBudoEnriNelsWendStonAdobJeanDougQuanPierAeolVirgZoneEnteJeweFOTOtaglMiyoZoneWoulBarcZone
ArtsGanjdiamNothFIPRZoneVisiEricZoneWindZoneZoneZoneZoneZonediamRichWitoZoneGuitRHINGaryXVII
ZoneRaamXVIICARDMessKronVestCataBookNichPinnCHARPrelPonnCarrLukaDonaCaseSonywwwnXVIIChemFOLK
CleaEducEducEminWorlWaltKidsWindWindWindDisaValeChouCalvUrinThisPeteMarbFantSofiJameLighDwig
KerbClayDaviXVIIDaviKareStefHonoBornNighPeteGammCodeBeenNextRockJohnBillVictLastCapiattiHDMI
natiLarrwwwrWindPennBernBookwwwawwwsCafeFIFAWWIIAmerKateKlauTomaWindBeveJennLeonThemCARDCARD
CARDWordMegaSouloberToniMariRuedExceCaryRussHansFivetuchkasPainMarc


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 85 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group