
-----------------------------------
The one they call Greed
Wed May 24, 2017 12:05 pm

Game becomes unplayable randomly at times?
-----------------------------------
What is it you are trying to achieve?
I am making a RPG in the style of Fire Emblem, everything works well other then the occasional game breaking glitch or bug that just tends to happen at random times, I would like people to help find these errors and hopefully tell me how to fix them.


What is the problem you are having?
I do not know what is causing the bugs and glitches to happen, some of them only happen rarely like movement freezing up or buttons being unresponsive 


Describe what you have tried to solve this problem
Rewriting various parts of the program and making things as efficient as I know how


Please specify what version of Turing you are using
4.1.1

-----------------------------------
The one they call Greed
Wed May 24, 2017 4:51 pm

RE:Game becomes unplayable randomly at times?
-----------------------------------
On certain monitors the screen size might be a little larger then what fully fits on the screen, sorry for the inconvenience.

-----------------------------------
Insectoid
Wed May 24, 2017 5:17 pm

RE:Game becomes unplayable randomly at times?
-----------------------------------
The best way to solve bugs like this is to find a way to reliably reproduce them. When a bug occurs, note what you were doing, and then do exactly that again. If the bug re-occurs, you're on the right track. Then look at the code that handles what you did and what the variables would look like at the time the bug occurred.

There's a good chance that you have a loop somewhere that is taking way too long to execute, so I'd be looking at that.

-----------------------------------
The one they call Greed
Wed May 24, 2017 5:38 pm

RE:Game becomes unplayable randomly at times?
-----------------------------------
The thing is, I never found any of them, the ones I found I fixed right away, my friend found all of the bugs, I wasn't paying exact attention to anything he did, so I have no clue to how he managed to achieve them.

-----------------------------------
Insectoid
Wed May 24, 2017 6:58 pm

RE:Game becomes unplayable randomly at times?
-----------------------------------
Maybe you should have paid attention then.

Paste your code here and I'll take a look and see if I can point you in the right direction. I don't want to download a file.

-----------------------------------
The one they call Greed
Wed May 24, 2017 7:55 pm

Re: Game becomes unplayable randomly at times?
-----------------------------------

View.Set ("graphics:600,800")
%FSE IDEA#1: FIRE EMBLEM IN TURING
%DYLAN LAMOTHE 5/24/2017
%Range for movement allowed
var range, range2 : int := 3
var range3, range4 : int := 2
%Declaring fonts
var font1, font2 : int
%Fonts
font1 := Font.New ("Malaga:90:bold")
font2 := Font.New ("Malaga:20:bold")
%Used for movement tiles
var x, y, x2, y2, x3, y3, x4, y4, x5, y5, x6, y6, x7, y7, x8, y8 : int
%Used to get copies of the location of the unit
var A, B, A2, B2, A3, B3, A4, B4 : int
%Used to determine AI movement and random variables
var ran : int
%Current Units
var unit1 : int
var unit2 : int
var unit3 : int
var unit4 : int
%Units life
var lunit1, lunit2, lunit3, lunit4 : boolean := true
%The menu
var menu : int
%Stats for units
var hp1, damage1, lvl1 : int
var hp2, damage2, lvl2 : int
var hp3, damage3, lvl3 : int
var hp4, damage4, lvl4 : int
%Turn switch
var turn1, turn2, turn3, turn4 : boolean := false
%Character movement
var chars : array char of boolean
%Declaring units and menu spot
unit1 := 18
unit2 := 175
unit3 := 7
unit4 := 162
menu := 1
hp1 := 20
hp2 := 20
hp3 := 30
hp4 := 30
damage1 := 4
damage2 := 4
damage3 := 3
damage4 := 3
ran := 0
%Text array
var text : array 1 .. 2 of string
text (1) := "Blue Attacked! Dealt " + intstr (damage1 + ran) + " Damage"
text (2) := "Red Attacked! Dealt " + intstr (damage2 + ran) + " Damage"
procedure tilesdrawn
    %Draws out the entire board
    Draw.Line (0, 50, 600, 50, black)
    Draw.Line (0, 100, 600, 100, black)
    Draw.Line (0, 150, 600, 150, black)
    Draw.Line (0, 200, 600, 200, black)
    Draw.Line (0, 250, 600, 250, black)
    Draw.Line (0, 300, 600, 300, black)
    Draw.Line (0, 350, 600, 350, black)
    Draw.Line (0, 400, 600, 400, black)
    Draw.Line (0, 450, 600, 450, black)
    Draw.Line (0, 500, 600, 500, black)
    Draw.Line (0, 550, 600, 550, black)
    Draw.Line (0, 600, 600, 600, black)
    Draw.Line (0, 650, 600, 650, black)
    Draw.Line (0, 700, 600, 700, black)
    Draw.Line (0, 750, 600, 750, black)
    Draw.Line (0, 800, 600, 800, black)
    Draw.Line (50, 0, 50, 800, black)
    Draw.Line (100, 0, 100, 800, black)
    Draw.Line (150, 0, 150, 800, black)
    Draw.Line (200, 0, 200, 800, black)
    Draw.Line (250, 0, 250, 800, black)
    Draw.Line (300, 0, 300, 800, black)
    Draw.Line (350, 0, 350, 800, black)
    Draw.Line (400, 0, 400, 800, black)
    Draw.Line (450, 0, 450, 800, black)
    Draw.Line (500, 0, 500, 800, black)
    Draw.Line (550, 0, 550, 800, black)
end tilesdrawn
procedure tutorial
    %A tutorial and a little plot
    Font.Draw ("Welcome to the world of Fire Emblem! In turing...", 40, 800, font2, black)
    Font.Draw ("This is just a beta, not everything works..", 40, 760, font2, black)
    Font.Draw ("This is V0.7:Core program made", 40, 720, font2, black)
    Font.Draw ("INTRODUCTION", 40, 640, font2, black)
    Font.Draw ("You are part of an army,", 40, 600, font2, black)
    Font.Draw ("trying to defend against oncoming threats.", 40, 560, font2, black)
    Font.Draw ("Command your army! Survive!", 40, 520, font2, black)
    Font.Draw ("CONTROLS", 40, 480, font2, black)
    Font.Draw ("Use the arrow keys to move", 40, 440, font2, black)
    Font.Draw ("You only have 3 movements a turn", 40, 400, font2, black)
    Font.Draw ("Press enter to end your turn", 40, 360, font2, black)
    Font.Draw ("Press Tab to open your menu", 40, 320, font2, black)
    Font.Draw ("Up and down arrows to navigate menu", 40, 280, font2, black)
    Font.Draw ("Enter to confirm menu choice", 40, 240, font2, black)
    Font.Draw ("Press any button to continue (Small Delay)", 40, 200, font2, black)
    Font.Draw ("To battle, go next to enemy and press arrow...", 40, 160, font2, black)
    Font.Draw ("In the direction they are.", 40, 120, font2, black)
    Input.Pause ()
    delay (500)
end tutorial
procedure tilesarea
    %Shows the Unit on the tiles
    if lunit1 = true then
        for i : 1 .. 192
            %192 is the amount of tiles
            %Each tile has it so both the blue and red box can be atop of it.
            if unit1 = i then
                if i = 1 then
                    Draw.FillBox (10, 10, 40, 40, blue)
                    x := 10
                    y := 10
                    A := 1
                    B := 1
                end if
                if i >= 2 and i = 14 and i = 26 and i = 38 and i = 50 and i = 62 and i = 74 and i = 86 and i = 98 and i = 110 and i = 122 and i = 134 and i = 146 and i = 158 and i = 170 and i = 182 and i = 2 and i = 14 and i = 26 and i = 38 and i = 50 and i = 62 and i = 74 and i = 86 and i = 98 and i = 110 and i = 122 and i = 134 and i = 146 and i = 158 and i = 170 and i = 182 and i 