Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Ki1o

Pages: [1] 2
1
Axe / Converting from Prgm to App
« on: March 23, 2023, 10:28:52 pm »
Way way late, but thanks to both E37 and Zeda I was able to implement a working A* Algorithm in my game. The source for the project is on Github here: https://github.com/kiloments/axe-rl
I've been pretty inconsistent in working on it, but recently I started back up again. I've reached the point where I need to make the program into an app. I thought it would be as simple as change from compiling to No Shell to Compiling as an Application, but once I did it looked like the my appvars were somehow being corrupted. When I moved around the map random tiles would get changed when I left an area and came back to it. The attached gif illustrates what I mean.

You can also see a little confused slime walking outside the map. This is because the DistMap appvar I'm using to calculate the AI is somehow also being corrupted. It's initially spawned in the room that gets corrupted then wanders its way out ignoring collision. I even compiled an older working version to verify and it seems to confirm. Everything works as a program and not as an App. I would like any help in beginning to convert this project into an app. And any other advice/optimizations you may have. Thanks!

2
Axe / A* Star and Min Heap Help
« on: July 10, 2022, 10:55:38 am »
I've been trying to implement an A* Star algorithm in Axe, but I've been encountering a whole host of bugs or things I can't explain. I need help so I'm hoping that @E37 reads this. It is in this code where I also get a few appvar bugs. Here is the whole AI code so far.
Code: [Select]
..AI
L2+00->->^^oDistMap
L2+02->->^^oTargetX
L2+04->->^^oTargetY
L2+06->->^^oStartX
L2+08->->^^oStartY
L2+10->->^^oCurrX
L2+12->->^^oCurrY
L2+14->->^^oHCost
L2+16->->^^oGCost
L2+18->->^^oSize
L2+20->->^^oMinIndex
L2+22->->^^oRoot
L2+24->->^^oRIndex
L2+26->->^^oMinHeap
Data(~1,1,~36,36)->^^oAIDir
Goto AIEND
Lbl DoMobAI
DrawGame()
For(M,0,Mobs-1)
^^oMobArray+(M*4)->Mob
CalculatePath(NewX,NewY,{^^oMobX+Mob},{^^oMobY+Mob})
End
Return
Lbl CalculatePath
GetCalc("appvDISTMAP")->DistMap
Fill(^^oTargetX,400,0)
~3->Size
Fill(DistMap,1296,|EFF)
[r1]->TargetX
[r2]->TargetY
[r3]->StartX
[r4]->StartY
Ge\tDistance(TargetX,TargetY,StartX,StartY)->HCost
GCost->{(TargetY-6)*36+(TargetX-6)+DistMap}
Insert(TargetX,TargetY)
While 1
Extract()->A
GCost++
0->J
For(4)
A+sign{^^oDir+J}->T
T^48->CurrX
T/48->CurrY
(CurrY-6)*36+(CurrX-6)->C
If ({T+Floor}<2)?({C+DistMap}=|EFF)
Ge\tDistance(CurrX,CurrY,StartX,StartY)->HCost
Insert(CurrX,CurrY)
GCost->{C+DistMap}
End
J++
End
EndIf ((CurrX=StartX)?(CurrY=StartY))
Return
Lbl Parent
Return ([r1]-3)/6
Lbl LeftChild
Return (6*[r1])+3
Lbl RightChild
Return (6*[r1])+6
Lbl ShiftUp
While ([r1]>>0)?({^^oMinHeap+Parent([r1])}>{^^oMinHeap+[r1]})
Swap(Parent([r1]),[r1])
Parent([r1])->[r1]
End
Return
Lbl ShiftDown
While 1
LeftChild([r1])->MinIndex+3->RIndex
If RIndex<<Size
If {^^oMinHeap+RIndex}<{^^oMinHeap+MinIndex}
RIndex->MinIndex
End
End
Swap([r1],MinIndex)
MinIndex->[r1]
EndIf (Size<<MinIndex)?({^^oMinHeap+MinIndex}>={^^oMinHeap+[r1]})
Return
Lbl Swap
{^^oMinHeap+[r1]}->[r3]
{^^oMinHeap+[r1]+1}^^r->[r4]
{^^oMinHeap+[r2]}->{^^oMinHeap+[r1]}
{^^oMinHeap+[r2]+1}^^r->{^^oMinHeap+[r1]+1}^^r
[r3]->{^^oMinHeap+[r2]}
[r4]->{^^oMinHeap+[r2]+1}^^r
Return
Lbl Insert
GCost+HCost->[r3]
([r2]*^^oFloorWidth+[r1])->{[r3]->{Size+3->Size+^^oMinHeap}+1}^^r
ShiftUp(Size)
Return
Lbl Extract
{^^oMinHeap+1}^^r->Root
{^^oMinHeap+Size}->{^^oMinHeap}
{^^oMinHeap+Size+1}^^r->{^^oMinHeap+1}^^r
Size-3->Size
ShiftDown(0)
Return Root
Lbl Ge\tDistance
abs([r1]-[r3])+abs([r2]-[r4])
Return
Lbl AIEND
First off, the appvar bugs that I have been getting. I am declaring the point for the DISTMAP appvar at the same time as the FLOOR appvar like so:
Code: [Select]
GetCalc("appvFLOOR",2304)->Floor
GetCalc("appvDISTMAP",1296)->DistMap
I'm only editing the floor appvar. I do not resize this in any way. If I do not call
Code: [Select]
GetCalc("appvDISTMAP")->DistMap again in CalculatePath(), then nothing will happen and the appvar doesn't get modified even though it exists. If I create the appvar in the AI code, then the pointers for the floor and the distmap somehow get mixed up and random garbage is scrolled in on the screen. The same thing happens if the distmap appvar already exists when I run the main program. However this only occurs for the distmap appvar as the floor appvar never has this issue. Also calling
Code: [Select]
DelVar "appvDISTMAP" does nothing. Not sure how this works. Please explain appvars to me like I'm 5 because something is not making sense.
Another bug I experience is using custom named variables to hold function labels. If that's not something that's possible please let me know. I know custom variables are 2 bytes and I am making sure of that so I don't know what is going on there. It only works with Alpha variables.
Back to the MinHeap, my ShiftUp function seems to do nothing. I don't know where the logic is failing. Each entry in the MinHeap is 3 bytes. The first byte is the F Cost of a given tile and the 2 bytes after that are the tile's offset. I'm trying to sort by F Cost, so that the lowest F Cost is the root of the MinHeap. Is the problem with my ShiftUp function or the Swap function? Please help! Thanks  :banghead:

3
Axe / Axe Loops not Working as Expected
« on: December 09, 2021, 07:26:50 pm »
I am working on a basic debugger for procedurally generated floors for my roguelike project. However, I am running into a recurring issue that I am not sure how to fix, let alone what the cause may be. I am hoping that someone with a bit more knowledge on Axe can tell me what I am doing wrong, or if there is simply an issue with Axe or the calculator.

What I am attempting to do simply generate 9 rooms and take a look at the values of the room to see if they are acceptable. However I keep randomly getting stuck in a loop either when the program executes, or when I try to give it any input. Here is the full source:

Code: [Select]
.G
L₄+22→→°RoomStart
L₄+24→→°RoomWidth
L₄+26→→°RoomHeight
L₄+28→→°RoomX
L₄+30→→°RoomY
L₄+32→→°NewRoomX
L₄+34→→°NewRoomY
L₄+36→→°Invalid
L₄+38→→°UR
L₄+40→→°LL
L₄+42→→°NewRoomX2
L₄+44→→°NewRoomY2
L₄+20→→°Rooms
Fill(L₁,36,0)
0→Rooms→RoomX→RoomY→RoomHeight→RoomWidth
ClrDraw
GenFloor()
CheckFloor()
Main()
Lbl Main
While 1
Input()
EndIf getKey(15)
Return
Lbl CheckFloor
For(J,1,Rooms)
J*4+L₁-4→Z
J+(J*((J>0)*4))-4→Y
DrawText(1,Y,"(")
DrawInt(4,Y,{Z})
DrawText(13,Y,",")
DrawInt(16,Y,{Z+1})
DrawText(24,Y,")")
DrawInt(29,Y,{Z+2})
DrawInt(38,Y,{Z+3})
End
Return
Lbl GenFloor
While Rooms<9
GenRoom()
PlaceRoom()
End
Return
Lbl GenRoom
GetRoomStart()
While 1
GetRoomSide()→RoomWidth
End!If ChkRoomWidth()
While 1
GetRoomSide()→RoomHeight
End!If ChkRoomHeight()
Return
Lbl PlaceRoom
If Rooms<9
RoomY+RoomHeight-1→{RoomX+RoomWidth-1→{RoomY→{RoomX→{Rooms+1→Rooms*4+L₁-4}+1}+1}+1}
End
Return
Lbl GetRoomStart
6+(rand^(33))→RoomX
4+(rand^(40))→RoomY
Return
Lbl GetRoomSide
4+(rand^(9))
Return
Lbl ChkRoomWidth
(RoomX+RoomWidth-1>41)
Return
Lbl ChkRoomHeight
(RoomY+RoomHeight-1>43)
Return
Lbl DrawText
For(I,0,length(r₃)-1)
conj({r₃+I}-32*4+°CharSprites,L₄+50,4)
Fill(L₄+54,4,0)
DrawChar()
End
Return
Lbl DrawInt
r₃/10+16→{L₅}
r₃^10+16→{L₅+1}
For(I,0,1)
conj({L₅+I}*4+°CharSprites,L₄+50,4)
Fill(L₄+54,4,0)
DrawChar()
End
Return
Lbl DrawChar
Pt-On(r₁+(I*((I>0)*4)),r₂,L₄+50)
Return
Lbl Input
If getKey(9)
ClrDraw
0→Rooms
GenFloor()
End
Return
[]→°CharSprites
[0000000080800080]
[A0A00000A0E0E0A0]
[60C060C0A060C0A0]
[40A060E040400000]
[4080804040202040]
[A040A0000040E040]
[000040800000E000]
[0000008000204080]
[E0A0A0E0C04040E0]
[E020C0E0E06020E0]
[A0A0E020E08060E0]
[E080E0E0E0204040]
[E0A0E0E0E0A0E020]
[4000400040004080]
[0020402000E000E0]
[00804080E0200040]
[40A0E04060A0E0A0]
[C0E0A0E0E08080E0]
[C0A0A0E0E0C080E0]
[E0C08080E080A0C0]
[A0E0A0A0E04040E0]
[6020A040A0C0A0A0]
[808080E0E0E0A0A0]
[C0A0A0A0C0A0A060]
[C0A0E080E0A0E040]
[C0A0C0A0E08020E0]
[E0404040A0A0A060]
[A0A0A040A0A0E0E0]
[A040A0A0A0A04040]
[E02080E000000000]

The results are never consistent. Sometimes it runs perfectly and it outputs the data I want, but it doesn't update the screen with the new screen data. Exiting the loop works. Sometimes it does nothing. Just freezes up. And other times it outputs the data but is completely unresponsive. If anyone wants to look through the above and give their insights that would be greatly appreciated. Thanks.

4
Axe / Looping Through an Array in Axe
« on: June 25, 2021, 04:49:37 pm »
Hey all,
So I'm current working on a roguelike project but I have hit an annoying stumbling block that I'm not sure how to solve.
I'm implementing a mob system where I can add mobs to various map coordinates and display them on the screen. I'm also using their position to determine whether or not they should be drawn as well as for collision. The array that I've set up works perfectly and I can draw them to the screen, but I am encountering a weird bug(?) when I loop over the array in a for loop to compare values. Here is the full code that I have written so far:
Code: [Select]
.A
./front frames
[FFC1C3E7C33E23FB]→Pic0
[C1C3E7C33E62F3FF]
[FFC1C3E7C37CC4DF]
[C1C3E7C37C46CFFF]
./right frames
[FFC1E1EBA13E22DB]
[C1E1EBE1DF9393E7]
[FFC1E1EBE19F93DB]
[C1E1EBE1BE2223E7]
./left frames
[FF8387D7857C44DB]
[8387D787FBC9C9E7]
[FF8387D787F9C9DB]
[8387D7877D44C4E7]
./back frames
[FF83C3FFA3223BF3]
[83C3FFA3227AF3FF]
[FF83C3FFC544DCCF]
[83C3FFC5445ECFFF]
./slime frames
[FFFFFFC7A3410183]→Pic2
[FFFFC7A3A38383C7]
[FFFFFFC7A3410183]
[FFFFFFFF81600081]
./wall tile, 00
[45FF11FF45FF11FF]→Pic1
./ground tile, 01
[FFFFFFFFFFEFFFFF]
./tile map
[00000000000000000000000000000000000000000000000000000000000000000000000000]→GDB0
[00000000000000000000000000000000000000000000000000000000000000000000000000]
[00000000000000000000000000000000000000000000000000000000000000000000000000]
[00000000000000000000000000000000000000000000000000000000000000000000000000]
[00000000000000000000000000000000000000000000000000000000000000000000000000]
[00000000000000010101010100000000000000000000000000000101010101000000000000]
[00000000000000010101010100000000000000000000000000000101010101000000000000]
[00000000000000010101010100000000000000000000000000000101010101000000000000]
[00000000000000010101010100000000000000000000000000000101010101000000000000]
[00000000000000010101010101010101010101010101010101010101010101000000000000]
[00000000000000000000000000000000000101010101010100000101010101000000000000]
[00000000000000000000000000000000000101010101010100000101010101000000000000]
[00000000000000000000000000000000000101010101010100000101010101000000000000]
[00000000000000000000000000000101010101010101010100000101010101000000000000]
[00000000000000000000000000000100000101010101010100000000010000000000000000]
[00000000000000000000000000000100000000000000000000000000010000000000000000]
[00000000000000000000000000000100000000000000000000000000010000000000000000]
[00000000000000000000000000000100000000000000000000000000010000000000000000]
[00000000000000000000000000000100000000000101010101010101010000000000000000]
[00000000000000000000000000000100000000000101010101010000000000000000000000]
[00000000000000000000000000000101010101010101010101010000000000000000000000]
[00000000000000000000000000000000000001000101010101010000000000000000000000]
[00000000000000000000000000000000000001000101010101010000000000000000000000]
[00000000000000000000000000000000000001000000000100000000000000000000000000]
[00000000000000000000000000000000000001000000000100000000000000000000000000]
[00000000000000000000000000000000000001000000000100000000000000000000000000]
[00000000000000000000000000000000000001000000000100000000000000000000000000]
[00000000000000000000000000000000000001000000000000000000000000000000000000]
[00000000000000010101010101010101000001000000000000000000000000000000000000]
[00000000000000010101010101010101010101000000000000000000000000000000000000]
[00000000000000010101010101010101000000000000000000000000000000000000000000]
[00000000000000010101010101010101000000000000000000000000000000000000000000]
[00000000000000010101010101010101010101010101010101010101010101000000000000]
[00000000000000000000000000000000000000000000000000000000000000000000000000]
[00000000000000000000000000000000000000000000000000000000000000000000000000]
[00000000000000000000000000000000000000000000000000000000000000000000000000]
[00000000000000000000000000000000000000000000000000000000000000000000000000]
0->Q->P→V->H→I→J→F→S→L->K->T
Fix 5
AddMob(1,0)
AddMob(2,2)
AddMob(15,9)
AddMob(2,26)
ClrDraw
Repeat getKey(15)
  ./192 is the offset from the beginning of GDB0
  Q*37+P+192→Z
  If getKey(3) and (I=0) and (J=0) and ({Z+1+GDB0}=1)
    If Z+1≠M
      1→I
      32→S
    End
  End
  If getKey(2) and (I=0) and (J=0) and ({Z-1+GDB0}=1)
    If Z-1≠M
      0-1→I
      64→S
    End
  End
  If getKey(1) and (I=0) and (J=0) and ({Z+37+GDB0}=1)
    If Z+37≠M
      1→J
      0→S
    End
  End
  If getKey(4) and (I=0) and (J=0) and ({Z-37+GDB0}=1)
    If Z-37≠M
      0-1→J
      96→S
    End
  End
  F++
  H+I+I→H
  V+J+J→V
  If (H-8=0) or (H+8=0)
    P+I→P
    0→H→I
  End
  If (V-8=0) or (V+8=0)
    Q+J→Q
    0→V→J
  End
  DrawMap()
  DrawMob()
  Pt-Off(44,28,Pic0+(F/3^4*8)+S)
  ...Text(0,0,Z►Dec)
  For(E,1,L)
    E*4+L₁-4→G
    Text(0,E*6,{G+2}ʳ►Dec)
  End
  ...
  DispGraph
End
ClrDraw
Fix 4
Lbl AddMob
  ./r1 = x, r2 = y
  ./creates an array [x,y,y*37+x+192]
  If L<18
    r₂*37+r₁+192→{r₂→{r₁→{L+1→L*4+L₁-4}+1}+1}ʳ
  End
Return
Lbl DrawMob
  For(E,1,L)
    E*4+L₁-4→G
    {E*4+L₁-2}ʳ→M
    Text(0,0,M►Dec)
    ./If ((M-192≤Z) and (M+192≥Z))
      ./Text(0,E*6,"Drawn")
      {G}-P*8→r₁
      {G+1}-Q*8→r₂
      ./Text(0,0,M►Dec)
      Pt-Off(44+r₁-H,28+r₂-V,Pic2+(F/3^4*8))
      ./Else
      ./Text(0,E*6,"Not Drawn")
    ./End
  End
Return
Lbl DrawMap
  Q*37+P→T
  ClrDraw
  For(B,0,10)
    For(A,0,14)
      A-1*8-4-H→C
      B-1*8-4-V→D
      Pt-On(C,D,{B*37+A+T+GDB0}*8+Pic1)
    End
  End
Return
The problem occurs at the line If (M-192≤Z) and (M+192≥Z) because it is not checking for all values of M, only the last value of M. At first I thought I was doing something incorrectly, so I made a test program that compares a given value with a set of values in a variable length array:
Code: [Select]
.ARRAY
ClrHome
0→L
193→A
AddEntry(1156)
AddEntry(193)
AddEntry(208)
AddEntry(447)
Repeat getKey(15)
  CheckArray()
End
ClrHome
Lbl AddEntry
  r₁→{L+1→L*2+L₁-2}ʳ
Return
Lbl CheckArray
  For(I,1,L)
    {I*2+L₁-2}ʳ→B
    If A=B
      Output(0,0,"EQUAL")
      Pause 1800
      ClrHome
      Else
      Output(0,0,"NOT EQUAL")
      Pause 1800
      ClrHome
    End
  End
Return

This code runs perfectly. I've been commenting out various parts of my original code to see where I am going wrong, but I can't quite solve it on my own. I'm hoping a fresh pair of eyes might give some insight as to why it is not working. Thanks.
Cross-posting from Cemetech to see if anyone here might know.

5
Miscellaneous / Black People, Unite!
« on: May 21, 2013, 08:19:15 pm »
I'm a little dismayed and sort of sad that there aren't many African-American programmers.  I'm wondering if there are any here on this site or if I'm all alone.  So yeah... step up! Show yourselves!

6
TI Z80 / Vulcan's Labyrinth - A z80 Spiral Knights Clone
« on: March 17, 2013, 05:27:14 pm »
Greetings Omnimaga! I came up with this idea a few days when I was thinking of the world layout for another project of mine, Rebirth: The Soul of Icarus.  Basically the title says it all: it's a Spiral Knights clone.  I'm not sure of sprite size just yet but I've started thinking about some of the concepts story and gameplay wise.  It will be, of course an ARPG except it will be set in a Greek/Roman/Fantasy mythology mashup world. Backstory and Background information:
Vulcan, the Roman equivalent to the Greek god Hephaestus, the blacksmith god, created a special labyrinth commissioned by Zeus in order seal away the mountain Olympus, which fell to Earth after Hades corrupted it.  Eventually, the whole labyrinth became corrupted as well as the fallen gods and it merged itself with the Underworld.  Your goal is to explore this mysterious labyrinth, defeat the corrupted gods, end the reign of Hades, and restore Olympus.  The world's survival depends on your success.  But don't worry, you won't be alone.  Many other soldiers have also taken up this cause and will work alongside you on your mission.

So yeah... my current vision is to make the game endless.  Meaning that-you-may-have-reached-the-center-and-fought-all-the-bosses-but-your-quest-isn't-over sort of endless.  Hopefully I can make it expandable with expansion packs and new quests and side-missions and maps and whatnot.  Yeah.. it's pretty ambitious.  But I do hope to finish Rebirth first though.
Thoughts? Comments? Oh, and do you think it would be better off as a community project?

7
TI Z80 / Rebirth: The Soul of Icarus
« on: December 19, 2012, 04:17:06 pm »
Greetings to all of Omnimaga. I am pleased to announce my first official project in Axe.  ;D  It shall be an RPG called Rebirth: The Soul of Icarus. I'm not going to reveal much plot wise but it has Greek mythology as well as Dante's Inferno influences. This will be a learning project for me and I hope to see it to completion. I probably will make it open source and I also will also ask a lot of questions and for help. It won't be a terribly long and expansive RPG but a small one with hopefully a good plot. So far I have planned out most of the plot as well as gameplay and I hope to post updates as time goes by. Thank you.

8
WabbitStudio Software Suite / Stop RAM clears?
« on: December 19, 2012, 04:09:36 pm »
Hello all, I finally got Wabbit to work (I used a different OS) but now I have just a slight problem. Every time I close it and then open it, my RAM clears. Is there a way to stop this from happening? Thanks.

9
Axe / Jumping
« on: November 19, 2012, 06:44:27 pm »
Ok I got basic gravity and movement with acceleration and all that but there is a problem with my jump. If you hold down 2nd you go up but as long as you hold it you still go up. How can I make it so you jump a certain height and then come back down regardless of whether you hold down the button or not? (No code please simply explain it)

10
WabbitStudio Software Suite / Wabbit not working...
« on: November 16, 2012, 08:16:28 pm »
Greetings. I recently downloaded Wabbit to my computer and I uploaded the ROM to it. The problem is, every time I turn it on, it just says RAM Cleared and it freezes; refusing to respond to any key presses. What's wrong?  :-\

11
General Calculator Help / How ROM dump?
« on: November 11, 2012, 03:05:07 pm »
I have Rom8x but it is missing the necessary programs to dump the ROM is there any other way to do this?

12
General Calculator Help / Terrible terrible problem....
« on: November 11, 2012, 02:09:44 pm »
Ok I am using Pixelscape to make my sprites and I exported them as Axe source. When I open it to edit the program I get an inverted screen with a bunch of random scrolling chars then a RAM clear  :'( . What's the problem and how can I fix it? I am using zStart and DoorsCS.

13
General Calculator Help / MathPrint glitching up
« on: November 10, 2012, 02:09:47 pm »
Hi all. I have  TI-84+ SE. All I have on it is DoorsCS and Axe. Whenever I use mathprint in school for fractions and stuff and press enter to calculate it it always skips down to the middle of the screen. If I were to use a square root in that fraction then the calc would cut out completely and I would get a RAM clear. What seems to be the issue here?  ??? If it helps, I use the homerun feature a lot for Axepaint.

14
Axe / Library in an appvar?
« on: October 07, 2012, 08:10:17 pm »
Ok bear with me for this one... Is it possible to make a command library and place it an appvar?

15
Axe / Displaying greyscale sprites
« on: October 03, 2012, 08:39:31 pm »
I'm trying to see if I can display a sprite that has greyscale in it but I keep coming across a weird bug.  This is the code I have
.header
[Hex data] -> Pic1
[Hex data]
pt-on(15,20,Pic1)
repeat getkey(15)
Disphgraphr
end

The first hex is for the top buffer while the second is for the bottom.
When I run it, the sprite is displayed in monochrome while there is some greyscale "junk" along the top of the screen.
what am I doing wrong exactly?
Sorry for the bad post I am on my phone.

Pages: [1] 2