Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: VB,NET 2008 TV project hangs up for long periods of time.  (Read 1790 times)
peteym5
Community Member
*
Posts: 101


« on: November 13, 2010, 05:39:07 PM »

I am trying to debug my programs that uses Truevision3D 6.3, VB.NET 2008, and Windows 7. I am using window mode so I can see where the program crashes. The program frequently freezes long periods of time and VB.NET does not tell me why that is happening (not responding to system) or eventually tells me a deadlock is detected. It runs smoothly full screen mode, but if the program stops because of an error, I cannot see the program code to see where an error occurred. I am not sure if this is a conflict with 6.3 and vb.net.

I know a few may suggest converting to 6.5, but that is not compatible with 6.3 code and my program is huge. I need to figure the same statements in 6.5. I had issues getting 6.5 running in the past and is why I set the conversion to the side. I cannot find any good running samples also.
« Last Edit: November 13, 2010, 06:34:23 PM by peteym5 » Logged
peteym5
Community Member
*
Posts: 101


« Reply #1 on: November 13, 2010, 07:43:14 PM »

does anybody still come onto this thread anymore? hope I can get a reply soon.
Logged
Dimple
Community Member
*
Posts: 580


« Reply #2 on: November 13, 2010, 08:40:50 PM »

Post the code please, so we can can look at it and see if we can find what is causing you problems( see the icon # in post reply) best thing in the world, for posting your code!

 
Logged

Using VB.NET, TV3D 6.5, VISTA
~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

- Baltasar Gracian
purri
Community Member
*
Posts: 77


« Reply #3 on: November 14, 2010, 01:19:03 AM »

Do u have do.events() inside mainloop?
Logged
peteym5
Community Member
*
Posts: 101


« Reply #4 on: November 14, 2010, 02:31:38 PM »

"Do u have do.events() inside mainloop?"

no it does not have any of those statement. I did manage to debug the program to the point it works without any major crashing.

posting code may be an issue.


I cannot post the whole program since it has hundreds of subroutines right now.

Code:
       
        Point4 = Point1
        BoxMode = ModeStandard
        Last_Door = 0
        Do
            FrameAmount = TV.TimeElapsed / (64 - System.Math.Abs(SpeedDebug - 1))
            TV.Clear()
            Char_Auto = True
            ButtonMode = 0
            Find_Near_Items()
            Cell_X = Int((16 + Camera_Pos_Y) / 32)
            Cell_Y = Int((16 + Camera_Pos_X) / 32)
            If Party_Layer < 4 Then
                Camera_Pos_Z = CellAlt(Cell_X, Cell_Y, Party_Layer) - 16
            Else
                Camera_Pos_Z = Party_Layer * TallConst
            End If
            '    ScrTxt.NormalFont_DrawText " " & Int(Cell_X) & " " & Int(Cell_Y) & " " & Int(Camera_Dir), 32, 24, Box_Font_Color, "Opening"
            Party_Control()
            Process_Projectiles()
            Process_Spell_Effect()
            Check_AI_Characters()
            Human_Actions()
            Position_Mesh_Characters()
            If Camera_Type = 0 Then
                Dir_X = System.Math.Sin((Char_Dir(Party_Leader)) / Convert_Factor)
                Dir_Z = System.Math.Cos((Char_Dir(Party_Leader)) / Convert_Factor)
                If CameraNormal = True Then
                    Camera.SetPosition(Char_X(Party_Leader) - Dir_X * 6.25, Char_Z(Party_Leader) + 6.75, Char_Y(Party_Leader) - Dir_Z * 6.25)
                Else
                    Camera.SetPosition(Char_X(Party_Leader) - Dir_X * 5.65, Char_Z(Party_Leader) + 6.85, Char_Y(Party_Leader) - Dir_Z * 5.65)
                End If
            Else

            End If
            Camera.SetLookAt(Char_X(Party_Leader), Char_Z(Party_Leader) + 6.25, Char_Y(Party_Leader))

            If Map_Type = PageMap Then
                If Char_Y(Party_Leader) / 32 > (ViewSize / 2) * PageSectorSize Then
                    ViewFirstX = (Char_Y(Party_Leader) / (32 * PageSectorSize)) - ViewSize / 2
                    If ViewFirstX > PageSectors_Width - ViewSize Then ViewFirstX = PageSectors_Width - ViewSize
                Else
                    ViewFirstX = 0
                End If
                If Char_X(Party_Leader) / 32 > (ViewSize / 2) * PageSectorSize Then
                    ViewFirstY = (Char_X(Party_Leader) / (32 * PageSectorSize)) - ViewSize / 2
                    If ViewFirstY > PageSectors_Length - ViewSize Then ViewFirstY = PageSectors_Length - ViewSize
                Else
                    ViewFirstY = 0
                End If
                ViewLastX = ViewFirstX + ViewSize
                ViewLastY = ViewFirstY + ViewSize
                PS.Manage_Visable_Sectors()
            End If

            If Explosion_CountDown > 0 Then Animate_Explosion()
            If Door_Moving(Door_Anim_Number) >= 0 Then Animate_Door()
            If Push_Item >= 0 Then Animate_Pushable_Item()
            If Dig_Item > 0 Then Animate_Dig()
            If Transport_Phase >= 0 Then Process_Transport()
            If Sky_Type > 0 Then TVAtmos.Atmosphere_Render()
            If Landscape_Type > 0 Then Land.Render()
            If Explosion_Light_Luma > 0 Then
                Explosion_Light_Luma = Explosion_Light_Luma - FrameAmount * 0.1
                If Explosion_Light_Luma > 0 Then
                    Light.SetLightColor(Effects_Light_ID, Explosion_Light_Luma, Explosion_Light_Luma, Explosion_Light_Luma * 0.65)
                Else
                    Light.SetLightPosition(Effects_Light_ID, TrueVision3DTVGlobals_definst.Vector(-256, -256, -256))
                End If
            End If

            For n = 0 To 15
                If Model_Status(n) = True Then
                    Actor(n).SetPosition(Model_X(n), Model_Z(n) + 4, Model_Y(n))
                    Actor(n).SetRotation(0, Model_Dir(n), 0)
                    Actor(n).Render()
                End If
            Next n

            If Map_Type = PageMap Then
                If Char_Y(Party_Leader) / 32 > (ViewSize / 2) * PageSectorSize Then
                    ViewFirstX = (Char_Y(Party_Leader) / (32 * PageSectorSize)) - ViewSize / 2
                    If ViewFirstX > PageSectors_Width - ViewSize Then ViewFirstX = PageSectors_Width - ViewSize
                Else
                    ViewFirstX = 0
                End If
                If Char_X(Party_Leader) / 32 > (ViewSize / 2) * PageSectorSize Then
                    ViewFirstY = (Char_X(Party_Leader) / (32 * PageSectorSize)) - ViewSize / 2
                    If ViewFirstY > PageSectors_Length - ViewSize Then ViewFirstY = PageSectors_Length - ViewSize
                Else
                    ViewFirstY = 0
                End If
                ViewLastX = ViewFirstX + ViewSize
                ViewLastY = ViewFirstY + ViewSize
                PS.Manage_Visable_Sectors()
            End If

            Scene.SetMipMappingPrecision(Scene_Precision_Adjust)
            Scene.SetTextureFilter(TrueVision3D.CONST_TV_TEXTUREFILTER.TV_FILTER_ANISOTROPIC)
            Scene.RenderAllMeshes()
            Display_Box()
            TV.RenderToScreen()
        Loop Until Exit_from_Game = True Or GameSolved = True

I do not see anything in the main loop that can cause it. As you can see, it calls many subroutines and many global variables.
Logged
Mithrandir
Community Member
*
Posts: 325


« Reply #5 on: November 14, 2010, 08:07:23 PM »

It is best to add DoEvents in the main loop in windowed mode, otherwise the program will be essentially stuck in a loop blocking the rest of operating systems functionality. It is ok to have a loop but the operating system won't like it too much. A good place to put it is right after TV.RenderToScreen().

Another option is not to use main loop. You can put the code from your main loop into form paint event. Then you'll have to call Invalidate() to make the it work as a loop. This won't block anything since everything is handled using events.

I assume that at the moment your main loop is inside Form.Load event/method. That basically means that your form never ends the loading. That might be something to consider.
Logged
António Mateus
Community Member
*
Posts: 58


WWW
« Reply #6 on: November 15, 2010, 05:27:47 AM »

And better yet, use a managed loop Wink

Search the foruns for an example!
Logged
peteym5
Community Member
*
Posts: 101


« Reply #7 on: November 15, 2010, 04:53:01 PM »

thankyou, will try those things. program is running more smoothly now. I am holding off on converting to TV6.5 until I know everything is running better.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks