Results 1 to 10 of 23

Thread: PGDmC: Knight Fever

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Quote Originally Posted by ?ëu?±o Mart??nez View Post
    Another medieval game for the contest! We have 3, right?
    It is just 1/3 of the games, hardly a strong trend. And medieval themes are among the most popular ones. Medieval and SF. Are there two SF games or more?

  2. #2
    The game is practically ready for upload, I just need to get all the art finished and into the game. Here's the main menu and a pic of you ingame.





    The gameplay is very simple, two buttons for attacking, three buttons for movement, goblins spawn progressively faster as time goes on, and anytime a goblin dies without you killing it (such as in a lava pit) you lose points. Will have the game up ASAP

    EDIT: Also, it suffers from a crippling bug that closes the game due to accessing a bad part of memory. I can't replicate this bug, and even with a try except statement and other stuff, it still SIGSEGVs.

    Code:
    function grabCollisionArrayPixel(xz,yz:integer;xx,yy:integer) : byte;
    begin
      if ((yz mod 512) = 0) then inc(yz);
      if ((xz mod 512) = 0) then inc(xz);
      if(yy < 1) then yy := 1;
      if(xx < 1) then xx := 1;
      try
        result := arrayCollisionPixels[yy,xx]^[ (512 * (yz mod 512)) + (xz mod 512) ];
      except
        raise exception.create('Bad memory access');
        writeln('SIGSEGV noted');
        result := 255;
      end;
    end;
    If anybody could help me with stopping this from crashing I would majorly appreciate it. It's certainly not xx and yy being out of bound, and the second value can range from 0 to 262144. By my calculations, (512 * (yz mod 512)) + (xz mod 512) should never be larget than 262143, even if yz and xz are both 511. So any ideas?
    Last edited by Winwardo; 16-07-2011 at 02:59 PM.

  3. #3
    function grabCollisionArrayPixel(xz,yz:integer;xx,yy:intege r) : byte;
    begin
    if ((yz mod 512) = 0) then inc(yz);
    if ((xz mod 512) = 0) then inc(xz);
    if(yy < 1) then yy := 1;
    if(xx < 1) then xx := 1;
    try
    result := arrayCollisionPixels[yy,xx]^[ (512 * (yz mod 512)) + (xz mod 512) ];
    except
    raise exception.create('Bad memory access');
    writeln('SIGSEGV noted');
    result := 255;
    end;
    end;

    If anybody could help me with stopping this from crashing I would majorly appreciate it. It's certainly not xx and yy being out of bound, and the second value can range from 0 to 262144. By my calculations, (512 * (yz mod 512)) + (xz mod 512) should never be larget than 262143, even if yz and xz are both 511. So any ideas?
    What about if yz or xz are negative?
    eg
    xz = -10;

    xz mod 512 gives a result -10 (!!)
    Last edited by Jimmy Valavanis; 30-03-2012 at 04:08 PM.

  4. #4
    I had never thought of that Jimmy!
    I changed it to
    if ((yz mod 512) <= 0) then begin inc(yz); writeln('Error #001 caught'); end;
    and suddenly partway through I found that being written to my console, went up the the top left corner of the map and there were goblins outside the map! I just need to make it so they'll auto-delete if they try going outside the map, and that should fix the crash!

    Thank you so much Jimmy, you've saved the entry from random crashing

    EDIT: Nope, seems there are other issues too. But that was one of them. :///

    Double Edit: I seem to have trapped all the crashes now and stopped them from happening, so if it does crash when it's entered, I'll be pretty annoyed, heh
    Last edited by Winwardo; 16-07-2011 at 08:15 PM.

  5. #5




    Finished, just in time!
    Uploaded to the FTP, and I've got a Dropbox redirect setup just incase something happens to the FTP and/or people want to try out the game without going to the FTP.
    Download it here!

    This has been a fun experience getting this game created and finished by the deadline, hope everyone else enjoyed doing this as well ( ignoring the stress of not being finished until fairly late into the contest )
    Quick note: One of my playtesters had a bug where the goblins would pile up in a deathzone instead of taking damage. He had Windows 7 32-bit. If anyone else has this problem, please tell me and your specs to see if I can pinpoint the issue!

  6. #6
    I just tried you game on Windows (64b) but didn't experience that problem. I did notice a situation in you 'castle' level where all enemies appearing from the right side are stacked on top of each other.

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
  •