Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Lavos

Members
  • Posts

    867
  • Joined

  • Last visited

Posts posted by Lavos

  1. @'Mohenjo:

    > That makes me feel better XD I've debated on switching to dx9 for awhile but didn't want to change all the code since I had other things to do. As for the FMOD to FMODex, from what I googled, you have to pay for FMODex? If so then no. The GDI might be do-able but we'll see if it'll fit in this update or if it has to wait for another one (time frame and all).

    I've made a wrapper for it, use it if you think you can replace the old FMOD.
    Download: [CLICK HERE](http://www.mediafire.com/file/91ttx254r1g8o5w/FMOD-EX.rar)
  2. ooooOOOO!OO!O!OOOOOOOOOooooO! brb im gunna do it now.

    * * *

    @'Growlith1223':

    > nono, you don't have to reset the GetTick, only the tmr variables within the Loop(both client and server), basically, that first if for GetTick < 0, create an End If and within that, just do HasRollBack = True. in the loop, around the beginning of the loop, check if HasRollback = True, if so, reset values and HasRollback = false

    So heres what i did.
    ```
    Public Sub GameLoop()

       Dim FrameTime As Long
       Dim Tick      As Long
       Dim TickFPS   As Long
       Dim FPS       As Long
       Dim i         As Long
       Dim LoopI     As Long
       Dim FogTmr    As Long
       Dim ClockTmr  As Long
       Dim Result    As FMOD_RESULT

       MenuType = 1
       ShadeOut = True

       If hasRollback = True Then

           ' reset timers
           FogTmr = 0
           ClockTmr = 0
           Menu_Alert_Timer = 0
           TradeTimer = 0

           LastUpdateTime_ElasticBars = 0
           LastUpdateTime_GameInput = 0
           LastUpdateTime_WalkTimer = 0
           LastUpdateTime_MapAnim = 0
           LastUpdateTime_Ping = 0
           LastUpdateTime_TextureReset = 0

           hasRollback = False

       End If
    ```Etc. Etc.

    then 

    ```
    Public Function GetTick() As Long

       GetTick = GetTickCount

       If GetTick < 0 Then
           hasRollback = True
           GetTick = GetTick + MAX_LONG
       End If

    End Function
    ```
    Do I have to reset timer from data type recs and other places as well?
    like player(myindex).attackTimer ? or Just the timers from the loop?
  3. @'Growlith1223':

    > only thing i will warn you about, is, i suggest checking to see if GetTick has rolled back, and do like a global value, check that global var if it's true, and if it is, reset all tmr vals to 0\. this will prevent everything from locking up as while it rolls back, this function makes sure it's always a positive, so if getTickCount = -MAX_LONG, then GetTick will = 0 because of that, and increment from there, resetting those tmr values will prevent everything from locking up, rendering, game logic, etc.

    Okay I have the function setup this way.

    ```
    Public hasRollback as boolean
    ```
    ```
    Public Function GetTick() As Long

       GetTick = GetTickCount

       If GetTick < 0 Then GetTick = GetTick + MAX_LONG

       If hasRollback = True Then
           If GetTickCount = -MAX_LONG Then
               GetTick = 0
           End If
       End If

    End Function
    ```
    how do you suppose i do a check with the boolean if it is true?
  4. @'Growlith1223':

    > @Lavos, the bytes would be removed by not initializing a second variable, which is the Dim Result As Long, you can use the function name as the variable, being as it doesn't return until it exits out or hits the end of the function.
    >
    > As for the 64-bit timer, what do you mean? if you mean timeGetTime, that one still rolls back but it takes a little longer

    You're right, I swapped TimeGetTime back out with using GetTickCount and it had a big difference in performance.Ended up using your method in the end.  :D
  5. @'Growlith1223':

    > You /should/ be fine? i don't remember there ever being an issue with doing this on one side only.

    Does it really conserve bytes just by removing a few lines of code?

    P.S: Thanks for the optimization idea, i managed to clean up a lot of code using the 64 bit-system timer.
  6. @'Growlith1223':

    > ```
    > Function GetTick() As Long
    >       Dim Result As Long
    >       Result = GetTickCount()
    >       If Result < 0 Then Result = Result + INT_MAX
    >       GetTick = Result
    > End Function
    >
    > ```
    > this is another way of doing it as well. im sure there are better ways of doing this but this is a more efficient way as it's not doing a double call on GetTickCount. and also, if you're really having performance issues with this, i suggest you optimize your code.

    I have my engine ticks setup like this:
    ```
    Public Function GetTick() As Long

       If GetTickCount < 0 Then
           GetTick = MAX_LONG + GetTickCount
       Else
           GetTick = GetTickCount
       End If

    End Function
    ```
    I think its much better now.
  7. Did more work on the title screen and the launcher, but with all the coding there wasn't that much to show but a crap load of bug fixes. =( anyway , i've uploaded a video.

    https://youtu.be/VxjSCUYCq1c

    ![](http://i.imgur.com/kalCgQo.png)
    P.S.: Just quit your project and help me!
×
×
  • Create New...