I'm working on a new game in tier 1 and this is the error I receive Process terminated with status -1073741819 (0 minutes, 4 seconds).
I'm concerned that somehow my compiler is not Registered properly because after running install about 5 times now I have yet to see any way in which it asks for my registration code so on the forums I found a guy post about it and followed his directions to put my serial code in place but nowhere in the program does it verify that it is recognizing my serial code. My programs run when I reinstall the compiler and then suddenly they crash every time or part of the program don't run at all. Here's a part of the code being used that crashes. At first it would compile with the arrays being Dim map[105,105] as mapstats but if I went above 105 it would crash in version 1076. I just installed 108, manually added my serial code again and then compiled with a much higher DIM[500,500] as mapstats but now the pathfinding code will not even run and if I dim it lower it crashes again.
Function FillMap(Mx,My,Rm,Rb,Rt,Lv)
NumberOfRooms = CreateText("xx")
SetTextPosition(NumberOfRooms,GetVirtualWidth()/2,GetVirtualHeight()/2)
GoodMove as integer
GoodMove = 1
roomcount = 1
roomoneset = 0
for x = 0 to MapSizeX
for y = 0 to MapSizeY
if x=0 or y=0 or x = MapSizeX or y = MapSizeY
Map[x,y].tile = _WALL_EDGE
endif
next y
next x
REPEAT
if roomcount = 1
RoomSizeX = 4
RoomSizeY = 4
else
RoomSizeX = random(rb,Rt)
RoomSizeY = random(rb,Rt)
endif
RandomX=random(1,MapSizeX-RoomSizeX)
RandomY=random(1,MapSizeY-RoomSizeY)
for a = 0 to RoomSizeX
for b = 0 to RoomSizeY
if (RandomX+RoomSizeX > MapSizeX or RandomY+RoomSizeY > MapSizeY)
GoodMove = 0
else
if map[RandomX+a,RandomY+b].room > 0 or map[RandomX+a,RandomY+b].tile > 0
GoodMove = 0
endif
endif
next b
next a
for a = -1 to RoomSizeX+1
for b = -1 to RoomSizeY+1
if map[RandomX+a,RandomY+b].room > 0 or map[RandomX+a,RandomY+b].tile > 0
GoodMove = 0
endif
next b
next a
if GoodMove = 1 // there is space for the room so lets build it.
if roomcount = 1 and roomoneset = 0 // if this is room 1 then it has to be a special size.
hero.x=RandomX+1
hero.y=RandomY+1
PX=hero.x-VIEWMAPSIZEX/2
PY=hero.y-VIEWMAPSIZEY/2
roomoneset = 1
else
inc roomcount,1 // increment first so we dont have a room 0 which is what all corridors are set to.
endif
for a = 0 to RoomSizeX // begin setting the rooms up in the map array
for b = 0 to RoomSizeY
if a = 0 and b = 0
map[RandomX+a,RandomY+b].start = RoomCount
map[RandomX+a,RandomY+b].RoomSizeX = RoomSizeX
map[RandomX+a,RandomY+b].RoomSizeY = RoomSizeY
endif
if a = 0 or b = 0 or a = RoomSizeX or b = RoomSizeY
map[RandomX+a,RandomY+b].tile = _WALL
map[RandomX+a,RandomY+b].room = RoomCount
else
map[RandomX+a,RandomY+b].tile = _FLOOR
map[RandomX+a,RandomY+b].room = RoomCount
endif
map[RandomX+a,RandomY+b].room = roomcount
next b
next a
failed = 0 // a room was successfully made so reset the failures for next room
if roomcount = rm then finalroomset = 1
else
inc failed,1 // every time there isn't enough space we tally it and retry another random space.
endif
GoodMove = 1
ClearScreen()
SetTextString(NumberOfRooms,str(roomcount))
sync()
UNTIL (roomcount = Rm and finalroomset = 1) or failed > 500
deletetext(NumberofRooms)
map[hero.x,hero.y].tile = _STAIRS_UP
//Add Doors
for a = 0 to MapSizeX
for b = 0 to MapSizeY
if map[a,b].start > 0
NumDoors = Random(1,4)
repeat
DoorPlacement = Random(1,4) // North,south,east or west gets the door
if DoorPlacement = 1 // North
repeat
DoorX = a + random(1,map[a,b].roomsizex-1)
DoorY = b
if map[DoorX,DoorY].tile <> _DOOR
map[DoorX,DoorY].tile = _DOOR
DoorPlaced = 1
else
inc failed,1
endif
until DoorPlaced = 1 or failed > 20
DoorPlaced = 0
dec NumDoors,1
elseif DoorPlacement = 2 // south
repeat
DoorX = a + random(1,map[a,b].roomsizex-1)
DoorY = b + map[a,b].roomsizey
if map[DoorX,DoorY].tile <> _DOOR
map[DoorX,DoorY].tile = _DOOR
DoorPlaced = 1
else
inc failed,1
endif
until DoorPlaced = 1 // or failed > 20
DoorPlaced = 0
dec NumDoors,1
elseif DoorPlacement = 3 // east
repeat
DoorX = a + map[a,b].roomsizex
DoorY = b + random(1,map[a,b].roomsizey-1)
if map[DoorX,DoorY].tile <> _DOOR
map[DoorX,DoorY].tile = _DOOR
DoorPlaced = 1
else
inc failed,1
endif
until DoorPlaced = 1 // or failed > 20
DoorPlaced = 0
dec NumDoors,1
elseif DoorPlacement = 4 // west
repeat
DoorX = a
DoorY = b + random(1,map[a,b].roomsizey-1)
if map[DoorX,DoorY].tile <> _DOOR
map[DoorX,DoorY].tile = _DOOR
DoorPlaced = 1
else
inc failed,1
endif
until DoorPlaced = 1 // or failed > 20
DoorPlaced = 0
dec NumDoors,1
endif
until NumDoors = 0 `or failed > 50
DoorPlaced = 0
endif
next b
next a
failed = 0
for a = 0 to MapSizeX
for b = 0 to MapSizeY
if map[a,b].tile = _WALL or map[a,b].tile = _FLOOR or map[a,b].tile = _WALL_EDGE
CollisionMap[a,b] = 1
endif
next b
next a
DoorsCount=0
for a = 0 to mapsizex
for b = 0 to mapsizey
if map[a,b].tile = _DOOR or map[a,b].tile = _HIDDEN_DOOR
inc DoorsCount,1
doors[DoorsCount].x=a
doors[DoorsCount].y=b
endif
next b
next a
for a = 1 to DoorsCount
if a > 1
DiscoveredPath$=FindPath(doors[a].x,doors[a].y,doors[a-1].x,doors[a-1].y,0,2500)
else
DiscoveredPath$=FindPath(doors[a].x,doors[a].y,doors[a+2].x,doors[a+2].y,0,2500)
endif
DrawPath(DiscoveredPath$)
next a
// Fill the gaps
for a = 0 to Mx
for b = 0 to My
if map[a,b].tile = _EMPTY then map[a,b].tile = _WALL
next b
next a
Endfunction
Global MapSizeX as integer
Global MapSizeY as integer
Global ViewMapSizeX = 10
Global ViewMapSizeY = 8
MapsizeX = 100
MapSizeY = 100
Dim MAP[MapSizeX,MapSizeY] as mapstats
Type TNode
H as Integer //distance to end
G as Integer //distance from start
ParentX as Integer //coord x of parent cell
ParentY as Integer //coord y of parent cell
EndType
//these two vectors define offset of search patterns
//directions are respectively null,N,W,S,E,NE,SE,SW,NW
Dim DsX[8] as Integer = [0,0,1,0,-1,1,1,-1,-1]
Dim DsY[8] as Integer = [0,-1,0,1,0,-1,1,1,-1]
//an array for the open list of cells
Dim OpenList[MapSizeX*MapSizeY,1] as Integer
//an array for the closed list of cells
Dim ClosedList[MapSizeX*MapSizeY,1] as Integer
//matrix of nodes to help calculate path
Dim MapCalc[MapSizeX,MapSizeY] As TNode
Dim collisionmap[MapSizeX,MapSizeY]
Global DiscoveredPath$ = ""