Results 1 to 10 of 16

Thread: Weird problems with collision in Super Heli Land

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by User137 View Post
    Also debugger says that MarioGO is nil for some reason. Clearly it is not nil because this code doesn't stop the procedure
    For some reason the Lazarus has trouble debuging SuperHeliLand. I don't know why since I don't have much expirience with Lazarus.
    Yesterday when I played a bit with project options I managed to athleast get insifght into Mario.X variable. But don't ask me how as I have no idea. Maybe this might help those of you who has more expirience with Lauzarus.

  2. #2
    Yeah, it might be that it has problems with projects that refer to C code, like Allegro? Or project that contains allegro.pas. Anyone tried to test that?

  3. #3
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Try setting a debugger breakpoint before where it crashes on you when your game gets to that point it'll stop and allow you to use the Evaluate & Modify tool. Go to Run -> Evaluate / Modify... and the tool will come up. In the Expression textbox you will want to put the name of your declared object in here.

    It should either tell you it's null for sure or give you a list of all it's contents. If it is null then you may be referencing it improperly or freeing unknowingly.

    What version of Lazarus are you using and on what OS? (I'm guessing Windows most likely?)
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #4
    @Will
    I folowed your advice but I had no much sucsess in debugging Drkhog's code.
    When I use Evalueate tool it usually shows that object is "nil" which is verry strange as the object gets destroyed only on one place and that code isn't called.
    Other times the Evaluate tool shows that memory at adress "x" cant be acsessed.
    But based on the fact that the character is moving without the problem even when Evaluate tool shows that MarioGO is either "nil" or that its memory can't be read it clearly shows that something is wrong with debugging.

    I'm using Lazarus 1-0.10 with FPC 2.6.2.


    BTW: Does Lazarus have auto-evaluate functionality like Delphi has?

  5. #5
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    Quote Originally Posted by SilverWarior View Post
    When I use Evalueate tool it usually shows that object is "nil" which is verry strange as the object gets destroyed only on one place and that code isn't called.
    Other times the Evaluate tool shows that memory at adress "x" cant be acsessed.
    Could also be that it's not being created properly. If we cancel out the debugger issue.

    Quote Originally Posted by SilverWarior View Post
    I'm using Lazarus 1-0.10 with FPC 2.6.2.

    BTW: Does Lazarus have auto-evaluate functionality like Delphi has?
    I've not done a lot in Lazarus lately and I think I only just got into Lazarus 1.x just after it hit the new major version number so I couldn't tell much about it's stability unfortunately. Though I have had problems with the GBD debugger on Mac using Lazarus in the past while it was in 0.9x.

    You mean hovering your mouse over the code to see the values as you step through each line of your code? Yes, but if that's not what you mean, I don't know.

    Guess I'm not much help here.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  6. #6
    Quote Originally Posted by WILL View Post
    You mean hovering your mouse over the code to see the values as you step through each line of your code? Yes, but if that's not what you mean, I don't know.
    Lazarus can't always evaluate class variables, but shouldn't have issues with unit variables and constants, or those that are declared inside procedures. Sometimes i declare such variable just to copy the value from class var into unit var, to be able to see its contents.
    (Lazarus uses GDB, which is not perfectly compatible with FPC or Lazarus. In that sense Delphi's debugger might be way ahead.)

    And sorry about derailing the thread, i only mentioned the nil value quickly, and even told you that i made sure that it's not actually nil. I did also try compile and run the actual project, and couldn't find reason for weird collisions yet.

  7. #7
    SilverWarrior, I'm using Laz 1.0 with FPC 2.6.0. Maybe that's the problem? Dunno.

    @User137, @Will - it's not much of a crash now, as I've eliminated source of it (I call State.Update differently now and threads don't get in the way). It's more collision either being stuck (app doesn't freeze as when I press ESC in Debug State game is returning to main menu) or gets epilepsy.

    I have strong feeling that it may have something to do with how I now update states, but can't pinpoint exact source of a problem (calling too often?). Last night (12/13 august) I've spend debugging issue. Nothing came out of it.

  8. #8
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25
    I'm afraid I'm not very knowledgeable with threading so my advice stops there.

    That would make a great PGD tutorial btw! (How To Use Multithreading In Your Games 101)
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #9
    In timer thread only variable is increased, which serves as queue. Actual update now takes place in main loop, but I can't find out why it does bad things to collision (not as bad as previous code which cased crashing, mid you).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •