Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: epic7 on November 25, 2011, 12:24:26 pm

Title: Grappler!
Post by: epic7 on November 25, 2011, 12:24:26 pm
Grappler: Hook Champ for Calculator

This game's kinda like Hook Champ where a guy grapples to a block above him and swings around through the level until a giant demon thingy catches up and eats him.


Old screenies

(http://img.removedfromgame.com/imgs/0-screenie.gif)

Early version of tilemap and enemy:
(http://img.removedfromgame.com/imgs/tilemapper.gif)


If you've never heard of Hook Champ, this is what it looks like.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: leafy on November 25, 2011, 12:34:41 pm
I would probably figure out acceleration first, but Zedd takes care of that for you. I've played Hook Champ, and when I saw the title before opening the thread I was like "Hook Champ port?" :D If you want to draw the rope from the character, change where you draw your character or where the rope is linked to.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: aeTIos on November 25, 2011, 01:00:02 pm
Epic7, now I hate you. I was gonna port this ! :@

(Just kidding ;))
Title: Re: Untitled Grappling Hook Game (for now)
Post by: chattahippie on November 25, 2011, 01:35:07 pm
Try drawing the line twice as far away when you are doing multiple jumps, it looks like the character is catching up to where you draw it too fast
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 02:56:31 pm
Names:
Grappling Guy- sounds close to gravity guy
Hook man- ... Not really
Hook champ Ti- meh
Grappler!- idk
These mediocre ideas are all I can think of at the time :P

For line drawing, on the key press, the ropes top coordinates go up at a 45° angle until they hit something. It should work, but I'll try having it go out more on the consecutive jumps
Title: Re: Untitled Grappling Hook Game (for now)
Post by: aeTIos on November 25, 2011, 03:04:53 pm
Taser?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 03:21:51 pm
I think Zedd would be an excellent choice for this game :) As it would give you access to the rope physics library, which I think would make this awesome :D
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 03:50:31 pm
Right now, I'm going to make that simple program where objects move to the center of the screen. But I keep getting undefined errors.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 04:06:14 pm
Did you read all of the documentation?  There are a number of constants you have to define yourself, or else it will throw an error. 
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 04:12:09 pm
I've solved a bunch of errors already. Do you have to do addZ to add every object that will be affected?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 04:13:29 pm
yes you do, that is the only way to add objects into the Zedd world (besides adding them through manual byte manip :P)
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Nick on November 25, 2011, 04:16:00 pm
did you already solved the line problem (that it stick after the man instead of before it)? otherwise i have a solution here

alpha is 45° (we can choose it, 45 would be good), and beta is 45° too because the third angle is 90°.
tan(alpha) = (x2-x1)/y with tan(45°)=1 ==> y=x2-x1 ==> x2 = y+x1

so the grabpoint (x,y) has to be the height of the guy (measured form the top) + the x point of the guy right now
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 04:22:06 pm
The ceiling might be varied and have blanks in it. That's why I used pxltest. Would what you have work for that?

And for zedd, I'll go read more of the manual before asking more questions
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 04:23:43 pm
You might want to cast a ray in order to determine where to atatch the hook, that way you will guarantee you will be able to attach to a roof that is varied
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Nick on November 25, 2011, 04:26:37 pm
hmm, then it will get harder, even impossible with that formula, as you have 2 unknown variables.. then you could use a for loop and increase x and decrease y so you describe a straight line going 45 degrees to the upper corner), untill the pxltest gives true, those x and y you can store in 2 new variables and use them
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 04:27:57 pm
/me wishes he knew what that meant (@builderboy)

In zedd, do you store sprite stuff to Str0SP? And how would I add that with AddZ and then display it?

@nick I think that's exactly what I did. I posted my code in a topic n the axe forum.i
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 04:46:10 pm
Basically the same thing Nick said XD keep doing pixel tests at a 45 degree angle moving away from the player until you find a wall.  And yes sprite information is stored in Str0SP. 

To add an object into the game, simply execute AddZ(X,Y,Width,Height,Mass,Sprite #) where your sprite number is the sprite found in Str0SP.  0 would refer to the first sprite in Str0SP, 1 would refer to the second and so on.  To display and simulate everything, simple run SimZ(), which will run the simulation for 1 frame, and draw all of your objects onto the screen.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 04:48:56 pm
Is this all said in the readme?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 04:51:11 pm
Indeed, the documentation is quite extensive.  There is also a list of functions that Zedd provides in Functions.txt
Title: Re: Untitled Grappling Hook Game (for now)
Post by: aeTIos on November 25, 2011, 04:52:52 pm
And Zedd won't send to my calc >:(
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 04:53:49 pm
D: What kind of errors does it give you?  It's just a basic source program, so it shouldn't have anything special qualities to it x.x
Title: Re: Untitled Grappling Hook Game (for now)
Post by: aeTIos on November 25, 2011, 04:56:14 pm
The sending thing just freezes. (I use TiLP, might try *cough* TI-Connect *cough*)
Title: Re: Untitled Grappling Hook Game (for now)
Post by: DJ Omnimaga on November 25, 2011, 04:57:45 pm
This looks pretty great. Will you release the source of the grappling hook routine when finished because maybe someone could eventually use it if he ever makes a Metroid game with the grappling hook item. :P
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 05:06:03 pm
Error recieved = Undefined
Goes to = CLZ()
Code for my failed zedd program:

.ZTEST
L1->GDB0OB
L4->GDB0VR
4->GDB0FR
LoadZ(0,15)
10->X
10->Y
[FFFFFFFFFFFFFFFF]->Str0SP
AddZ(10,10,8,8,10,0)
Repeat getKey(15)
ClrDraw
SimZ()
DispGraph
End
Return
prgmZEDD
Lbl CallZ
If S>48
A--
Else
A++
End
Return

Code for my grappling program:
Code: [Select]
:.AAHOOK
:DiagnosticOff
:[1028103854382828]➔Pic1
:[102A123C50B82828]
:[FFFFFFFFFFFFFFFF]➔Pic2
:1➔R➔X−1➔H➔Q➔B➔P
:48➔Y
:Fix 5
:Repeat getKey(15)
:Lbl 1
:ClrDraw
:If X<<1 ;Needs boundaries for now
:1➔X
:End
:If X>88
:88➔X
:End
:If (H=0) or (H=1) ;H is pretty much the status of the player while grappling
:If getKey(3)
:X++
:If H=1
:S++ ;increases rope top X coord. Will explain later
:End
:1➔R
:End
:If getKey(2)
:X−−
:If H=1
:S−−
:End
:0➔R
:End
:End
:If H=1 or H>40
:If getKey(2)
:0➔R
:End
:If getKey(3)
:1➔R
:End
:End
:For(A,0,11)
:Pt-On(A∗8,1,Pic2
:Pt-On(A∗8,56,Pic2)
:End
:If (getKey(54))∗((H=0)+(H>40))∗(B=0) ;Checks if ready to grapple
:X➔S
:Y➔T
:R➔θ
:Repeat pxl-Test(S,T) ;S and T are the top rope coords
:T−−
:If θ
:S++
:Else
:S−−
:End
:End ;That went at a 45 angle to find the ceiling
:If Y=48 ;Checks if on ground and makes it jump if not
:1➔H
:Else
:2➔H
:End
:End
:If H=1
:Y−− ;While jumping, the player can change direction. In the beggining getkeys, I made it change S to preserve the 45 degree angle.
:If Y≤28 ;I should actually put the pxl-test part after the jump so that the moving of s is unneccesary.
:2➔H
:End
:End
:If H>1
:If H≤40
:1➔P
:Line(X+7,Y,S,T) ;Line draw
:Else
:0➔P
:End
:If H<20 ;Here down checks the status of the player and adds or subtracts from the coordinates
:Y++
:If θ
:X++
:Else
:X−−
:End
:H++
:If Y=48
:0➔H➔P➔S➔T
:10➔B
:End
:End
:If H≥20 and (H≤40)
:If θ
:X++
:Else
:X−−
:End
:Y−−
:If Y<9
:56➔H
:0➔P
:End
:H++
:End
:!If H≤40
:If H≤52
:H++
:If θ
:X++
:Else
:X−−
:End
:If Y<9 ;Abort if the guy touches the ground
:56➔H
:0➔P
:End
:Y−−
:ElseIf (H≥52)∗(H≤55)
:H++
:If θ
:X++
:Else
:X−−
:End
:End
:If H>55
:If Y<48
:Y++ ;Fall to the ground after the grappling is done!
:If θ
:X++
:Else
:X−−
:End
:Else ;Resets after hitting the ground
:0➔H➔S➔T
:End
:End
:End
:End
:Pt-On(X,Y,P∗8+Pic1)
:If B
:B−−
:End
:DispGraph
:End
With a varied ground, I'll probably use more pxl-tests rather then checking the y coordinates
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 05:12:49 pm
Oh whoops, rename CallZ to CLZ instead, seems I was mixing syntax x.x Bwt, what is the callback function for?  It looks like it accelerates you left if you are on the right side of the screen, and right if you are on the left side of the screen?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 05:13:58 pm
Its a test program. I figured you'd know since it was the example you put in the readme :P

Problem list:
1. GDB error- fixed
2. GDB error- fixed
3. Sprite error- fixed
4. AddZ error- fixed
5. CLZ error- fixed
6. GDB error- Unfixed- Goes to GDB0WD
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 05:16:44 pm
Ahhh I see, I thought that was your actual code XD Yeah it looks like the documentation goes both ways on the Callback function, just remember to name it CLZ() instead of CallZ()
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 05:42:01 pm
See anything else wrong?
Now axe takes me to where it mentions GDB0WD
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 05:59:08 pm
Oh i believe you need to define GDB0WD as the width of your tilemap in sprites
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 05:59:57 pm
I'm not using a tilemap in that program

I put 96 in that and then put 1 in gdb0tm since I didnt know what to put. Now, I get no errors but the spe doesn't move.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: aeTIos on November 25, 2011, 06:00:16 pm
Not now.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 06:02:06 pm
Zedd works off of a tilemap, it is the only way objects know what to collide with. 
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 06:13:58 pm
Can you edit my program so i can see what you did and make it work next time?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 06:17:47 pm
It's probably not moving because GDB0TM is pointing to somewhere that has data in it, and Zedd is treating that data as a tilemap.  Since I don't think you are actually creating a tilemap, that area of memory is probably full of nonzero numbers, which Zedd thinks is solid tiles, so all your objects are stuck in solid tiles.  You need to actually set up an empty tilemap for things to start working.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 06:26:48 pm
I used L2 for it, now it works. In the real game, I'll have a scrolling tilemap.

Now, how would I make a floor that isn't affected by the gravity?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 06:28:12 pm
Hmmm I just realize how much scrolling this game might have, and Zedd doesn't support scrolling D:
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 06:31:24 pm
D:
Either I remove scrolling, stick with linear gravity and stiff ropes, or try to figure out physics by myself.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 06:33:12 pm
You could try to implement the physics yourself, and then use the rope library as a basis for your rope code.  I think this game wouldn't be the same without scrolling, as there wouldn't be really long levels. 
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 06:35:50 pm
/me goes to physics tutorials.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 07:40:05 pm
Im going to see how my physics attempts turn out.

Does wabbit crash when compiling to anyone else?

Also any title ideas? :P
Title: Re: Untitled Grappling Hook Game (for now)
Post by: parserp on November 25, 2011, 07:42:06 pm
Does wabbit crash when compiling to anyone else?

Also any title ideas? :P
is far as i know it is impossible to compile axe programs in wabbit.
title? maybe:
Spoiler For Spoiler:
epic7's game that is incredibly awesome because it has hooks and stuff like that
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 07:43:34 pm
Or a shortened abbriviated version: Egtiiabihhaslt!
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Builderboy on November 25, 2011, 07:56:07 pm
I've compiled Axe programs in Wabbit countless times o.O Are you sure you have the latest version?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 07:56:49 pm
No... Where did you get the latest version?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: aeTIos on November 25, 2011, 08:35:42 pm
For me the latest version breaks.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 08:36:07 pm
Me too D:

I actually need to wrap up robogun first. But that will be quick

ATTEMPTED GRAVITY:

100% FAIL.
CANT EVEN GET THE PLAYER TO MOVE!!

Errors found so far: 6

I want to try a tilemap soon.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 25, 2011, 09:48:30 pm
Moving left and right works.
At the button press, the guy jump and puts his arm out. Then it freezes.
I cant find what Im doing wrong.
If it all just stops, there must be something vital I'm missing or screwing up.
Code: [Select]
PROGRAM:HOOKSR
:.AAHOOK
:DiagnosticOff
:[1028103854382828]➔Pic1
:[102A123C50B82828]
:[FFFFFFFFFFFFFFFF]➔Pic2
:1➔R−1➔H➔Q➔B➔P
:256➔X ;Doin teh 256 inflation
:12288➔Y
:Fix 5
:Repeat getKey(15)
:Lbl 1
:ClrDraw
:If X∕256<<1
:256➔X
:End
:If X∕256>88
:22528➔X
:End
:If (H=0) or (H=1)
:If getKey(3) ;Moving left and right works
:X+256➔X
:1➔R
:End
:If getKey(2)
:X−256➔X
:0➔R
:End
:End
:If H=1 or H>40
:If getKey(2)
:0➔R
:End
:If getKey(3)
:1➔R
:End
:End
:For(A,0,11)
:Pt-On(A∗8,1,Pic2
:Pt-On(A∗8,56,Pic2)
:End
:If (getKey(54))∗((H=0)+(H>40))∗(B=0)
:If Y/256=48 ;Checks if it needs to jump
:1➔H
:Else
:2➔H
:End
:End
:If H=1
:Y−256➔Y ;Jump!
:If Y∕256≤28
:2➔H ;End Jump
:X∕256➔S ;Sets S and T's coordnates not in sub-pixels
:Y∕256➔T 
:R➔θ ;Sets Right to theta
:Repeat pxl-Test(S,T)
:T−− ;Goes up at 45 degree angle to find ceiling.
:If θ
:S++
:Else
:S−−
:End
:End
:End
:If H>1 ;It freezes from here down here; nothing happens
:If H≤40
:1➔P
:Line(X/256+7,Y/256,S,T)
:Else
:0➔P
:End
:If H<15 ;Fall with connected rope
:Y+256➔Y
:If θ
:X+256➔X
:Else
:X−256➔X
:End
:H++
:If Y∕256=48
:0➔H➔P➔S➔T
:10➔B
:End
:End
:If H≥15 and (H≤25)
:If H<21
:Y+(256−((H−15)∗25))➔Y ;My attempted curve
:Else
:Y−((H−15)∗25)➔Y
:End
:End
:If H≥25 and (H≤40)
:If θ
:X+256➔X
:Else
:X−256➔X
:End
:Y−256➔Y ;Now rise with the rope connected
:If Y∕256<9
:56➔H
:0➔P
:End
:H++
:End
:!If H≤40 ;Now the rope releases
:If H≤50
:H++
:If θ
:X+(384−(H−40)∗10)➔X ;Go fast, then slow after the rope releases
:Else
:X−(384+(H−40)∗10)➔X
:End
:If Y∕256<9
:56➔H
:0➔P
:End
:Y−−
:ElseIf (H≥50)∗(H≤60)
:H++
:If H<56
:Y+(256−((H−50)∗25))➔Y ;Curve
:Else
:Y−((H−50)∗25)➔Y
:End
:End
:If θ
:X+256➔X
:Else
:X−256➔X
:End
:End
:If H>55
:If Y∕256<48
:Y+256➔Y ;Now fall down
:If θ
:X+256➔X
:Else
:X−256➔X
:End
:Else
:0➔H➔S➔T ;Reset once it touches the ground
:End
:End
:End
:End
:Pt-On(X∕256,Y∕256,P∗8+Pic1)
:If B
:B−−
:End
:DispGraph
:End
To isolate where it screws up,
:If H>1
:If H≤40
:1➔P ;Well, this 1->P kicks in
:Line(X/256+7,Y/256,S,T) ;Line doesn't draw
:Else
:0➔P
:End
:If H<15 ;Fall with connected rope
:Y+256➔Y ;This doesnt work here
: ; the movement stuff below it doesnt work either.

The curves are kind of crappy, but ill improve them once it works,.
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Yeong on November 26, 2011, 07:36:52 am
When I first saw this topic, I thought it was gonna be bionic commander XD
Good luck with it XD
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 26, 2011, 10:54:29 am
Yep, I still need a name. Maybe Grappler or something :P
Title: Re: Untitled Grappling Hook Game (for now)
Post by: Michael_Lee on November 26, 2011, 11:27:39 am
With Zedd, couldn't you theoretically make the ceiling and floor part of the tilemap and make any protrusions moving objects?
Title: Re: Untitled Grappling Hook Game (for now)
Post by: epic7 on November 26, 2011, 11:45:30 am
Well, the floor and ceiling would have to be scrolling too since it is varied
Title: Re: Untitled Grappling Hook Game (for now)
Post by: collechess on November 26, 2011, 11:55:10 am
Looks nice.  I once made something kind of like that in Gamemaker but it was endless because I was too lazy to make actual levels.  For the name, I used grapplebot, but that was because the main character was a robot. 
Title: Re: Grappler!
Post by: epic7 on November 26, 2011, 06:24:03 pm
I'll probably stick with Grappler as a name ;)

Now to figure out why my guy freezes in midair <_<
Title: Re: Grappler!
Post by: epic7 on November 26, 2011, 09:30:27 pm
Geez, Im stuck. I can't see what's wrong. I'll just do what I did once,
Print out the whole code,
Sit down with a mug of hot chocolate while carefully going through the code like the calc would.

It's the same as before, but with inflation. Ive never worked with inflation though.

But I'm sure I'll figure something out! :D
Title: Re: Grappler!
Post by: annoyingcalc on November 26, 2011, 11:29:52 pm
this project is looking awesome
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 05:13:57 pm
Looking forward to this project (And Robogun lol) Nice Job!
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 05:39:45 pm
RoboGun is done. For some reason when running it in wabbit, I get an invalid error. It's in no shell, I made sure. ???
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 05:47:09 pm
I got that too, Try compiling it in Ion, That works with noshell :)
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 06:25:58 pm
Maybe it's over the size limit
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 06:27:10 pm
could you send me the source, I think I got an idea!
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 06:29:54 pm
Wut?
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 06:32:42 pm
Well I guess you could do this, I was just going to compile it in every shell, then test all of them till one works, then give it back to you lol :)
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 06:34:38 pm
It works, but I got invalid error when running it in noshell in wabbit.

Running it with asm( on calc doesn't work eithrr
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 06:36:26 pm
have you downloaded noshell into wabbit? Thats your problem
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 06:38:04 pm
I made sure the program was no-shell.
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 06:38:42 pm
But do you have noshell on wabbit!
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 06:41:54 pm
You don't need anything to run it in no-shell, just asm(
Title: Re: Grappler!
Post by: Builderboy on November 27, 2011, 06:43:36 pm
What error is it giving you?  How large is your program executable?
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 06:45:03 pm
NO NO NO, lol, is your program compiled in noshell? If so then on wabbit emu, you need noshell to run it. so in order to play robogun on wabbit, you must download noshell on to it.
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 06:45:37 pm
Invalid error.  It might be too large; it is 9707 bytes.
Title: Re: Grappler!
Post by: Builderboy on November 27, 2011, 06:47:57 pm
NO NO NO, lol, is your program compiled in noshell? If so then on wabbit emu, you need noshell to run it. so in order to play robogun on wabbit, you must download noshell on to it.

Saintrunner calm down.  He is correct, if you compile a program under the option No Shell, you do not need the program no-shell to run it.  All no-shell does is allow you to run programs without going to Mirage, Doors, Ion, or using the Asm() command.

And yes Epic, if your program is over 8100 bytes, you will not be able to run it from the homescreen with Asm().  You need to run it using a shell.  However, if your executable is over 8800 bytes, it cannot run as a program at all without a library like Fullrene or Crabcake, or needs to be an application. 
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 06:50:07 pm
Ok. I'll get fullrene.
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 07:03:41 pm
Hmm, really? I've always had to have noshell to run noshell compiled programs.
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 07:04:08 pm
Noshell is a program??
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 07:05:59 pm
No, sorry I meant, all of my programs I used no shell to compile, I've had to have noshell downloaded and installed to run them on my calc and wabbit
Title: Re: Grappler!
Post by: Builderboy on November 27, 2011, 07:09:18 pm
The only thing NoShell does is allow you to run all programs from the homescreen without Asm().  Compiling for No Shell simply allows you to run programs on the homescreen with Asm().
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 07:15:04 pm
ok I know, all I was saying was you need noshell installed to run a program you compiled in noshell. I know what noshell does, I just wanted to know if Epic had noshell on wabbit, cause that might have been his problem

screenie because clearly my typed words don't make sense... sigh

and sorry but no I'm not mad or yelling
Title: Re: Grappler!
Post by: Builderboy on November 27, 2011, 07:16:15 pm
You will find that if you use Asm(prgmFADE), everything works fine, which is what I have been saying :)
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 07:19:01 pm
ok cool :) well I guess we were arguing two completely irrelevant points lol :) Glad thats worked out
Title: Re: Grappler!
Post by: Builderboy on November 27, 2011, 07:19:45 pm
Indeed it would seem so, anyways back on topic x.x Can't wait to see more progress ^^
Title: Re: Grappler!
Post by: saintrunner on November 27, 2011, 07:20:52 pm
SAME :)
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 10:24:31 pm
Yunhua's tutorials scrolling tilemaps look really hard. I think I have a simpler way. Howevercould be Wrong since I've never done a tilemap before.

How should the character die?
1. Enemy chasing it,
2. Avalanche style,
3. Endless pits
4. Lava (might make pxl-tests harder)
5. Something else...
I'll probably do a combination.
Title: Re: Grappler!
Post by: leafy on November 27, 2011, 10:26:19 pm
Yunhua's tutorials scrolling tilemaps look really hard. I think I have a simpler way. Howevercould be Wrong since I've never done a tilemap before.

Yunhua's method is actually the simplest there is IMHO.
Title: Re: Grappler!
Post by: epic7 on November 27, 2011, 10:28:59 pm
Lol, then my idea will probably fail :P.  :
Title: Re: Grappler!
Post by: ztrumpet on November 27, 2011, 11:18:35 pm
For the record, I believe No Shell (the App) works just like Mirage does, only without the GUI.
Title: Re: Grappler!
Post by: epic7 on November 28, 2011, 03:19:50 pm
Omy original idea was to have a variable to take away from the coordinates of the pt-on, shifting it. But that would slow it down with a large tilemap.

I'll just take a look at yunhua's

tI might have it endless. Several GDBs saved and then have them choosed at random once they run out to be copied onto the gdb used in the game. 


Title: Re: Grappler!
Post by: saintrunner on November 28, 2011, 03:42:36 pm
How should the character die?
1. Enemy chasing it,
2. Avalanche style,
3. Endless pits
4. Lava (might make pxl-tests harder)
5. Something else...
I'll probably do a combination.

You should have an enemy chasing it, and have spikes on the floor! So when you start grapling, you have to keep going of you'll die!
Title: Re: Grappler!
Post by: epic7 on November 28, 2011, 03:48:11 pm
I'll probably just do chasing enemy and endless pits
Title: Re: Grappler!
Post by: saintrunner on November 28, 2011, 03:49:26 pm
sounds good :)
Title: Re: Grappler!
Post by: epic7 on November 28, 2011, 03:54:20 pm
Do you think the map should be more than 64 pixels high? t
Title: Re: Grappler!
Post by: saintrunner on November 28, 2011, 04:01:32 pm
not sure, I'd have to play it.
Title: Re: Grappler!
Post by: epic7 on November 29, 2011, 04:26:14 pm
Status update 1
Progress:
Not much

Problems:
Guy getting stuck in the air.
---------------------------------------------------------------

Ok, I can't figure out the problem. Ive tried to find the values of the variables by displaying them on the screen. I got some information from them, but I still cant fix it.

Main problem is that the guy gets stuck in the air.

Location of problem is by the first inequality, checking H

By memory:
If H>1
If H<41
Line(x/256+7,y/256,s,t
;A few other things I cant remember now
If H<15
H++
Y+256->Y
If theta
X+256->X
else
X-256->X
end
If Y/256 = 48 ;If hits the ground
;stops grappling
end
end
some more stuff and then ends.

So, when it reaches the above code and when H = 2, it works. However, it completely skips this when H = 3. It is like 3 is not in between 2 and 40!
To see if the thing is screwing up, I made it display H>1 and H<15. I forgot to do H<41, but that should be true if H<15 (unless the calc thinks 14 and below are greater than 40 O.O)

Both H>1 and H<15 returned 1, but yet it still skipped my Ifs.

I don't know what to do now D:
Title: Re: Grappler!
Post by: epic7 on November 29, 2011, 10:41:39 pm
ERROR FIXED!! :w00t: :w00t:
Quote from: M. Bison
YYYESSS!! YYESSSS!

The error was simply screwing up ends. I'm going to start programming the computer with indents :P

Now that The Game actually functions, I can now see how the grappling is performing. Conclusion after playing: my grappling curves are unbelievably unrealistic. So, now progress can resume! :w00t:

:w00t:

I solved it by trying builderboy's idea. His idea was to make is displae value of a Var before the problem. When the Text( never worked, I realized that there must be something before where I thought the problem was.

The problem was that once H reached 3, it didn't work. I never closed an end in the right spot so the if H>1 was acutally nested in a if H=2.
Title: Re: Grappler!
Post by: epic7 on November 30, 2011, 09:23:09 pm
So, how should I do the grappling?

I was thinking of having the user hold 2nd to swing and let go of it to release the grappling hook.

I might make it to always make it hit at a 45 degree angle and swing down until the rope is vertical, then change direction.

Suggestions
Title: Re: Grappler!
Post by: aeTIos on December 02, 2011, 10:44:13 am
I think holding 2nd is the best way.
Title: Re: Grappler!
Post by: epic7 on December 07, 2011, 03:58:57 pm
Finished with grappling.

I made parabolic curves for rope swings :w00t:
Hold 2nd to swing implemented :w00t:
More realistic gravity :w00t:

I lost some progress, but remade it in science class >:D

I'll grab a screenie later
Title: Re: Grappler!
Post by: epic7 on December 08, 2011, 06:17:37 pm
Screenie:
(http://img.removedfromgame.com/imgs/screenieee.gif)
I let the player adjust the moment of release with letting go of the button.

I make the guy warp to the beginning since I don't have scrolling yet.

When the guy goes back up from the swing, it looks kinda bad, so I might tweak it. I had it better before, but because of ram clear, I remade that part <_<

Sometimes it grapples to the floor, but that will be taken care of.

Also do you think the dude travels to far on one swing?

Also I might make the going left swing better and flip the sprite.

Suggestions?
Title: Re: Grappler!
Post by: Nick on December 08, 2011, 06:22:59 pm
nive, you solved it! well done..
The travelled distance is too big imo, and it seems that it is possible to catch the ceiling really far, maybe too far

it's always so painfull to hear something got lost with a ram clear xs
Title: Re: Grappler!
Post by: epic7 on December 08, 2011, 06:24:07 pm
I think its too far, yes.

Seems possible to catch what really far?

Going left needs to be changed too.
Title: Re: Grappler!
Post by: Nick on December 08, 2011, 06:26:19 pm
well, when you're flying really fast, the rope gets attached to the ceiling to far i think, that causes it to go faster an faster, so eventually (if you do it good) you can make him fly endlessly fast
Title: Re: Grappler!
Post by: epic7 on December 08, 2011, 06:28:36 pm
That can't happen in my code, though.
Title: Re: Grappler!
Post by: epic7 on December 08, 2011, 09:04:36 pm
I added a lot to the gravity. That takes almost 96 pixels off of max distance in one swing.
(http://img.removedfromgame.com/imgs/0-screenie.gif)
Here, using 3 scale greyscale, I made a test for it by putting all grey under the game. It makes the other stuff look like crap though <_<
(http://img.removedfromgame.com/imgs/1-screen.gif)
I might put some greyscale designs in the background in the future if there's a way to improve it.
Title: Re: Grappler!
Post by: epic7 on December 09, 2011, 08:28:50 pm
I had an idea for pxl texts. Would this work?

For(E,0,W/256)
If pxl-Test(X/256,Y/256+E+8) ;only checks left side right now
;reset stuff
Goto PP
End
End
Lbl PP
Title: Re: Grappler!
Post by: leafy on December 10, 2011, 01:15:23 am
I had an idea for pxl texts. Would this work?

For(E,0,W/256)
If pxl-Test(X/256,Y/256+E+8) ;only checks left side right now
;reset stuff
Goto PP
End
End
Lbl PP

I would recommend (to make this go faster)
{°W+1}→θ
For(E,0,θ)
If pxl-Test({°X+1},{°Y+1}+E+8) ;only checks left side right now
;reset stuff
Goto PP
End:End
Lbl PP

Although if your character is essentially a rectangle all you need to do is check the top and bottom corners.
Title: Re: Grappler!
Post by: epic7 on December 10, 2011, 08:53:54 am
Since I haw no idea what's going on in that code, :P
Would pxltest({°X+1}+6,.........
Check the part 6 pixels to the right?
Title: Re: Grappler!
Post by: saintrunner on December 10, 2011, 11:59:38 pm
this makes me feel like a Spiderman game is possible!
Title: Re: Grappler!
Post by: epic7 on December 11, 2011, 12:04:04 am
Change the sprite and it IS spiderman pretty much :P/me wants to see if he can use any of the new axe features in this game
/me reminds himself to give butts credit for his help
Title: Re: Grappler!
Post by: epic7 on December 11, 2011, 07:44:22 pm
Added new poll ^
Title: Re: Grappler!
Post by: annoyingcalc on December 11, 2011, 07:50:13 pm
YEAH! That would be awesome!
Title: Re: Grappler!
Post by: LincolnB on December 11, 2011, 10:42:01 pm
/me reminds himself to give butts credit for his help

No problem, I'm glad to help!
Title: Re: Grappler!
Post by: epic7 on December 11, 2011, 10:50:29 pm
I think I'll go with vertical and horizontal scrolling.

If I had a lot of levels, I'd have tons of GDB data.
I was thinking of making a a bunch of GDBs that are chosen randomly after each one runs out of tilemap data and have them all end and start in the same place do they'll fit together not just end at a wall O.O
Title: Re: Grappler!
Post by: leafy on December 12, 2011, 02:06:27 am
That sounds great, but fairly difficult. It's nice seeing the progress you've made so far, though and butts nice engine ^^
Title: Re: Grappler!
Post by: epic7 on December 12, 2011, 09:29:00 pm
So, how would I get data from another 8xp?

PROGRAM: HOOKSRC
..AHOOK ;grappler src
prgmGDB
;rest

PROGRAM: GDB
..TMAP
[blah]->GDB1
;lotsa data

If I did that, could I use GDB1 in grappler from using the library?



Title: Re: Grappler!
Post by: leafy on December 12, 2011, 09:39:22 pm
Yes, that would work. Once you include prgmGDB you're absorbing all the data in prgmGDB into your main program.
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 04:27:06 pm
This is how my enemy sprite is looking now:
(http://img.removedfromgame.com/imgs/enemy.bmp)
I decided to replicate the hook champ enemy since I lack the artistic skills to make my own. :P
I just put it in paint, shrunk it, and edited it to be monochrome.
Looks just like the original one O.O/me goes to turn it into hex
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 04:43:39 pm
WOAH cool sprite! how do you use paint to do that?
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 04:46:40 pm
I got the real image, changed any colors or greyscale to black and white, scaled it down to 24x24, and then changed the greyscale spots to all monochrome. /me cant explain anymore since he has to go to piano lessons
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 04:47:25 pm
awesome :) how do you get it to the calc?
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 06:08:20 pm
... I use ti-connect for the 96x64 screens, but for this, I'll need the hex.

If there's nothing to do that for me, I'll just divide the sprite into sections and use the HEXPIC program that came with axe :P
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 06:09:40 pm
Perhaps I might post my pic_sprite_data to hex program that I made :D (uses xLib)
If you want it, just tell me XD
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 06:11:32 pm
What does it do?/me doesn't have xLib
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 06:20:13 pm
xLib is contained in DCS7 ;)
Basically, you can choose the size of the sprite (up to 88x56), choose a picture, and it converts it to hex in axe format (8x8 pack) for you. :D
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 06:22:33 pm
........
.... YYYYYYYYYYYYYYEEEEEEEEEEEEEEEAAAAAAAAAAAAHHHHH!

Would I store my big sprite to pic1 or something then open it in teh program?
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 06:24:55 pm
Here. Use it well. XD
It's ok. It's only 386 bytes XD
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 06:41:42 pm
/me downloads
/me goes to check out bannana editor

Hmm... the pic is a bit distorted on calc. Maybe wrong dimentions?

Edit: Yeah, its not working out :P
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 09:29:17 pm
What do you mean by it's not working out?
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 09:29:49 pm
Random pixels rather than the monster I wanted :/
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 09:30:22 pm
did you delete the space in front of the hex code?
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 09:31:07 pm
I got the same thing while trying to make a BIG head!
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 09:31:11 pm
... yep
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 09:35:44 pm
I only got the top left corner of my head to show up..
Title: Re: Grappler!
Post by: epic7 on December 13, 2011, 09:37:30 pm
Using the right dimentions?

ALSO I got it to work with jacobly's hex! :D
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 09:41:03 pm
ok. I just tried and it worked perfectly. ???
What was the sprite dimension? which number did you type?
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 09:41:11 pm
I'm using 16x16....I think I can fix it by just adding to my pic
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 09:42:30 pm
The sprite have to be stored in picture.
Is it?
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 09:43:52 pm
yep. wait...so how am I supposed to set dimensions? I just typed 16 in when it asked for the width in the bananas thing.
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 09:48:58 pm
Oh. You're using Bananas. XP
What exactly are you trying to do?
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 09:51:05 pm
make a 16x16 sprite...
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 09:53:04 pm
so what you do is...

1. type 16 in the width
2. Edit sprite
3. Convert to hex/save it into pic.

I've tried multiple time so it should work...
Also, for making it display on axe:
(16x16 for an example)
[HexFile→Pointer
Pt-On(0,0,Pointer
Pt-On(8,0,Pointer+8
Pt-On(0,8,Pointer+16
Pt-On(8,8,Pointer+24
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 09:54:46 pm
yeah I just figured that out....thanks anyways :)
Title: Re: Grappler!
Post by: Yeong on December 13, 2011, 09:55:34 pm
Ah. You're welcome. :D
BTW, you could've posted all this in Bananas thread <_<
Title: Re: Grappler!
Post by: saintrunner on December 13, 2011, 09:58:45 pm
lol...yeah sorry. I said
I'm using 16x16....I think I can fix it by just adding to my pic
awhile ago, and this is what I meant, so yeah
Title: Re: Grappler!
Post by: hellninjas on December 14, 2011, 09:58:47 am
/me likes
/me clicked Heck Yeah! on the poll to avoid stretching necks...
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 04:48:05 pm
So, go to heck yes.avi now :P

I hope my tilemapping will work. I'll compile and see how much it screws up, which it usually does on my first try of things :P
/me compiles

EDIT:
Ok tilemapping works, but not done.
The speed is about a quarter of what it was before, so..........
Screenie
(http://img.removedfromgame.com/imgs/tilemapper.gif)
Enemy is there :P
I might want to make the guy actually walk :P
But maybe if I speed it up again, it'll blur enough like it did before to make the player not really notice XD
Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 05:33:30 pm
are your pics and other various pointers, in or outside of the main loop?

looks great though
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 05:34:51 pm
You mean like
[FFFFFFFFFFFFFFFF]->Pic1
[345647835678465]->GDB1
Type of stuff?
Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 05:35:16 pm
yeah, a lot of the time the problem is having too much unneeded stuff in the loop
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 05:37:38 pm
Lolnope. I'll have a lot of that stuff O.O
I don't even put it in the main program.
I made a library 8xp to store all the data which is put in before the main loop.
Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 05:39:22 pm
hmmm...I don't know then, thats usually my problem....By the way! I love the enemy!
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 05:40:41 pm
So do I :P
I'll probably need more enemy sprites, one of it about to eat the player, and one of it eating the player.

Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 05:41:31 pm
OHH that'll be cool!  oh and I still don't understand how to use paint to do that O.O
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 05:59:49 pm
It was pretty easy to do that.
I shrunk down the size to 24x24
Then I changed all colors to either black or white
(http://img.removedfromgame.com/imgs/see.png)
I'm going to figure out how to convert them now
Title: Re: Grappler!
Post by: parserp on December 14, 2011, 06:13:53 pm
spongebob? O.o
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 07:10:10 pm
Oh yeah. My little brothers use my computer account sometimes :P

I built a conversion program with Quigibo's code.
Now I'll make sprites and bug butts about his code making my code slower than the code before the code was put in the code when I coded code. :P /me lost

Optimization progress:
*approximate speed*
Before tmap: 0.033 sec/loop
After tmap: 0.095 sec/loop
Optimization 1: 0.063 sec/loop
Optimization 2: 0.0596 sec/loop

Optimized, but still a lot slower than it was before <_<
Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 09:07:48 pm
screenie? and maybe you code post your source so people here can help optimize :)
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 09:37:48 pm
Don't have time now for full screenie and code.

Second sprite for enemy:
About to eat the player :P
(http://img.removedfromgame.com/imgs/enemy2.bmp)
Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 09:38:33 pm
looks good :)
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 09:39:37 pm
I've had trouble with the sprite of the enemy eating the player :P

And I'll probably use that same sprite when he spits out the player as well.

I might tweak it, since it looks like the enemy is shocked or something :P
Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 09:41:23 pm
just open the mouth a little more and tilt it forward onto the grappler guy. should look fine
Title: Re: Grappler!
Post by: epic7 on December 14, 2011, 09:47:47 pm
I don't want to mess around with tilting now :P, I just changed his eyes (which changes a lot of expression), and then tweaked the mouth.
Title: Re: Grappler!
Post by: saintrunner on December 14, 2011, 10:19:01 pm
ok then, that works
Title: Re: Grappler!
Post by: epic7 on December 15, 2011, 09:16:50 pm
Screenies attached
Title: Re: Grappler!
Post by: saintrunner on December 15, 2011, 09:23:23 pm
Nice! looks slow....but you know that lol, good luck speeding it up :P
Title: Re: Grappler!
Post by: epic7 on December 15, 2011, 09:46:32 pm
It's faster on calc, but the speed is around 5 seconds to walk across the screen. 

Next up, collisions

Then enemy coding

Then I can start a couple levels
Title: Re: Grappler!
Post by: saintrunner on December 15, 2011, 09:48:31 pm
cool stuff :) Now I'm off to add levels for seeker (with my new engine, lol all I add is lines, and it does the rest)
Title: Re: Grappler!
Post by: ztrumpet on December 15, 2011, 10:38:26 pm
That looks pretty great.  Nice job on it!
Title: Re: Grappler!
Post by: leafy on December 16, 2011, 12:43:12 am
That speed needs some improvement but that enemy sprite is awesome :O
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 03:58:18 pm
Thanks!
I don't have full (not on 83+BE right?) so its stuck at 6mhz

Like I said before the length of a loop was
.033
Then with tilemap tripled to
.095
Then with optimizations it got down to
.063 (shown on screenie)
Now, I made it so that the tilemap updates every other loop, which gets it to
.43
However, movement is a little bit irregular since the frames each display after a different time :P
But it doesn't make it look bad.

Screenie:
*this is to show the speed of the game, not how much my tilemap screw up when the guy goes too far*

Its faster on calc.
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 05:30:39 pm
very cool, it looks great! Are you going to add Y axis scrolling, cause that would be boss.
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 05:47:25 pm
Yeah, I'll add Y.

Also, do you have the link for the tilemap compression thingamajig?

Anyone know how to do pxl-testing for the collisions?
Or is there maybe an easier way for using a tilemap?
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 07:08:08 pm
Also, do you have the link for the tilemap compression thingamajig?

Oh yeah, sorry I forgot about that. I'll try and get that to you later today. And for pxl based collisions, you can go ahead and use the engine I wrote for Seeker if you want to.
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 09:52:14 pm
Can you explain how that works?
Title: Re: Grappler!
Post by: saintrunner on December 16, 2011, 09:56:58 pm
Yeah I still need to know how the jumping part works
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 10:01:47 pm
Jumping isnt really that bad.

Saintrunner:
[FFFFFFFFFFFFFFFF]->Pic1
56*256->Y
0->X->V->W->A->B->J
Repeat getKey(15)
If getKey(54)
-256->W
256->V
8->B
End
If Y/256>57 ;simple collision :P
56*256->Y
0->A->B->V->W
End
V+A->V+X->X
W+B->W+Y->Y
Pt-On(X/256,Y/256,Pic1)
DispGraphClrDraw
End

Where X,Y are coordinates
V,W are velocities
A,B are accelerations

I need to figure out my collisions before I start making the tilemaps have obstacles.
Title: Re: Grappler!
Post by: saintrunner on December 16, 2011, 10:30:41 pm
Those variables are confusing me...and the 256 is just so it's more accurate right?
Title: Re: Grappler!
Post by: leafy on December 16, 2011, 10:32:13 pm
Jumping isnt really that bad.

Saintrunner:
[FFFFFFFFFFFFFFFF]->Pic1
56*256->Y
0->X->V->W->A->B->J
Repeat getKey(15)
If getKey(54)
-256->W
256->V
-8->B
End
If Y/256<57 ;simple collision :P
56*256->Y
End
V+A->V+X->X
W+B->W+Y->Y
Pt-On(X/256,Y/256,Pic1)
DispGraphClrDraw
End

Where X,Y are coordinates
V,W are velocities
A,B are accelerations

I need to figure out my collisions before I start making the tilemaps have obstacles.

Shouldn't it be If Y/256>57? :P
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 10:39:26 pm
Oh you're right, I get screwed up sometimes with the Y coordinates :P

Saintrunner, fix that inequality and I forgot to add that it needs to do
0->V->W->A->B
After it.
(edited the post)

And 256 is for accuracy.
I'm using variables for Location, velocity, and acceleration, which I think works nicely.
Title: Re: Grappler!
Post by: saintrunner on December 16, 2011, 10:42:11 pm
ok thanks
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 10:46:15 pm
Can you explain how that works?

So I have two subroutines, MoveX and MoveY. Each of these moves the character as far as the [velocity variables] dictate, stopping the character and zeroing the [velocity variables] if there's a pixel in the way.

Basically, I have a loop set up that loops from 1 to however large the [velocity variable] is (negative values of the [velocity variable] made things a little complicated, but it wasn't too bad). Inside this loop is another loop that goes from [zero] to the [height of the sprite] minus one, doing a buttload of pxl-test commands to see if there's anything in the way. If there's anything in the way, stop the MoveX or MoveY routine, and move the character position as far as they can (up to a point) without hitting something.

It looks kinda like this: assuming X is the X_COORDINATE and D is the X_VELOCITY. Pretend that X_VELOCITY is positive (so the character moves down). Assume there's no inflation, and X_VELOCITY (D) is 3, so the character can potentially move 3 pixels in the downward direction, and this is written out in non-loop form (which is highly impractical but demonstrates the concept fairly well).

1. Look to see if there's any filled in pixels in the 8-pixel-wide row directly beneath the character (assume a rectangular character).
2. If there's none, move the character one pixel down, and repeat step 1 until you've already gone as far as you had the potential to go (You don't want to go fifteen pixels, you want to go three, because X_VELOCITY is three, and X_VELOCITY is the maximum number of pixels your character can move in a frame.
3. If there are any, stop moving the character. Return from the subroutine, get on with the rest of the game logic and whatnot.

That probably didn't make much sense. But hopefully that^^, coupled with studying the source code of my engine, will help you.
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 10:49:26 pm
/me scans
You mean for how fast the velocity is, the farther down and larger area to check for pixels?
Title: Re: Grappler!
Post by: parserp on December 16, 2011, 10:50:29 pm
/me scans
You mean for how fast the velocity is, the farther down and larger area to check for pixels?
exactly. (so it doesn't accelerate through stuff) :)
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 10:52:46 pm
Parser's right ^
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 11:04:05 pm
That's exactly what I tried! However it always detected a pixel and tragically failed. I thought I was using the wrong strategy. I guess I was right!

I still have that code commented out in grappler, so I'll tweak untill I give up or fix it.

In other news, this has been my 1000th post!
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 11:05:28 pm
That's exactly what I tried! However it always detected a pixel as tragically failed. I thought I was using the wrong strategy. I guess I was right!

I still have that code commented out in grappler, so I'll tweak untill I give up or fix it.

In other news, this has been my 1000th post!

Haha this is my first ever working attempt at accurate collision detection. I have seriously tried >9001 times.
Title: Re: Grappler!
Post by: leafy on December 16, 2011, 11:08:21 pm
Butts that's a pretty inefficient way, though. It means that the faster you go, the more checks it will take and the slower it will go.
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 11:09:14 pm
Butts that's a pretty inefficient way, though. It means that the faster you go, the more checks it will take and the slower it will go.

Eh, it was the only way I could think of for purely pxl-test based collisions. I'm sure tilemap collisions are more efficient.
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 11:09:43 pm
What the efficient way?
Title: Re: Grappler!
Post by: leafy on December 16, 2011, 11:10:25 pm
Butts that's a pretty inefficient way, though. It means that the faster you go, the more checks it will take and the slower it will go.
Eh, it was the only way I could think of for purely pxl-test based collisions. I'm sure tilemap collisions are more efficient.

From my experience it's usually faster to move the object by all the velocity, then move it backwards pixel by pixel until it stops colliding.
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 11:10:48 pm
Well, the thing about tilemap collisions is that it's harder to support things like slopes and really small tiles. In a tilemap based system, you collide with tiles regardless of whether or not you chose to display them.
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 11:12:13 pm
That's a good idea :D

Would you reccomend pxltests or tilemap collisions?

My tilemaps are all 8x8 square that all collide with the guy
Title: Re: Grappler!
Post by: LincolnB on December 16, 2011, 11:14:48 pm
That's a good idea :D

Would you reccomend pxltests or tilemap collisions?

Personally, I'd go for the pxltests, however you want to implement it. Leafy, the way I see it a problem with that way is that if you want to have really thin tiles, like a line, you might end up accelerating right through them.
Title: Re: Grappler!
Post by: epic7 on December 16, 2011, 11:17:40 pm
And Ill have bricks that have a border but on the inside will be somewhat empty.
So it might stop colliding early with leafy's.

But... If I wanted to, how would I do a tilemap collision?
Title: Re: Grappler!
Post by: LincolnB on December 17, 2011, 04:50:32 pm
uh...I would PM BuilderBoy or leafiness0. I know how to do it in theory, but have yet to implement it.
Title: Re: Grappler!
Post by: epic7 on December 17, 2011, 05:30:56 pm
I think I'll probably use leafy's strategy from above and try to tweak the tiles so it won't stop colliding early.
Title: Re: Grappler!
Post by: ztrumpet on December 17, 2011, 10:09:56 pm
You could also just cap the "terminal" velocity of the character.  This would limit the checking so it would have a maximum of places to check.  For instance, if you capped your Yvelocity var at 512, the character could only move a maximum of two pixels down per frame (assuming *256 inflation).

As for tilemap based collisions, check here: http://ourl.ca/4279/169823
Title: Re: Grappler!
Post by: epic7 on December 18, 2011, 10:43:43 pm
Ok, I wrote some subroutines for the collisions. It works, but there are many bugs such as falling through floors or getting stuck in walls. Also the enemy seems to kill you immediately if you start moving as soon as the loop begins :P

There are also lots of other screw ups that show up occasionally. 

Thanks for the collision idea, leafy!
Title: Re: Grappler!
Post by: yunhua98 on December 19, 2011, 04:40:50 pm
wow.  This game looks amazing.  I love how you're using the ropes.
Title: Re: Grappler!
Post by: epic7 on December 19, 2011, 04:41:57 pm
Thanks! And... What ropes? :P
(You mean how grappling hooks use rope?)
Title: Re: Grappler!
Post by: epic7 on December 19, 2011, 07:28:35 pm
I might have to make all blocks solid for doing pxl-tests unless I find a better way....

Textured blocks are what's causing me to get stuck in bricks I think.

After that, I'll still have to tweak my subroutines.

Also, made a userbar in paint!
|
V
Title: Re: Grappler!
Post by: Builderboy on December 19, 2011, 07:30:31 pm
Use virtual pixel tests (http://ourl.ca/4279/169823) :D They function exactly like pixel tests, but return the solidity of a pixel instead of the color
Title: Re: Grappler!
Post by: epic7 on December 19, 2011, 07:35:32 pm
Question Bombardment:
So copy gdb to L1?

Do I need masks if I only have a few triangle tiles that will be fully solid?

I don't understand what N is for.

Do X and Y need to be in r1 and r2?

Do I need to divide X (or r2) by 256 if its inflated?

W is tilemap width (in tiles) right?
Title: Re: Grappler!
Post by: Builderboy on December 19, 2011, 07:58:09 pm
So copy gdb to L1?
L1 is just the pointer to your tilemap data.  Replace L1 with the pointer to your tilemap data

Do I need masks if I only have a few triangle tiles that will be fully solid?
You only need masks if you want your tiles collision to be anything other than a square

I don't understand what N is for.
N signifies the number beyond which all tiles are solid.  For example if your first 3 tiles were scenery, and not solid, you would use 3 for N.  The routine tests for the tile number, and if it is greater than N, it considers the tile solid.  By ordering all of your tiles empty first, followed by solid, you can make this really easy.

Do X and Y need to be in r1 and r2?
r1 and r2 are the X and Y onscreen coordinates, measured in pixels from the top left corner of the tilemap.  If your coordinates are inflated, you don't want to use the inflated version, but first de-inflate them to get the onscreen pixel coordinates.

W is tilemap width (in tiles) right?
Yes
Title: Re: Grappler!
Post by: epic7 on December 19, 2011, 08:13:48 pm
So for L1 do instead
[lotsa hex]->L1
But I'll have many different tilemaps, so they can't all be stored to L1...

r1 and r2 are the player coordinates from the top left corner of the map, not the coordinates on the screen, correct?

If I have no scenery, N will start at 0, so then it will check if it is less than 0??

Title: Re: Grappler!
Post by: Builderboy on December 19, 2011, 08:16:41 pm
You don't need to use L1, as I was saying replace L1 with the pointer to your tilemap data.  You could replace L1 with Str01 if that was where your tilemap data was stored.

And if the only empty tile is 0, you would want to check if the tile number is greater than zero if you were checking for a solid tile. 
Title: Re: Grappler!
Post by: epic7 on December 19, 2011, 08:18:45 pm
So... What do I do if I have no scenery?
Wait... Do empty 00 tiles count as scenery?
Title: Re: Grappler!
Post by: Builderboy on December 19, 2011, 08:22:16 pm
Like I said, if the only empty tile is tile#0, you would want to check if the tile number is greater than zero to detect a solid tile
Title: Re: Grappler!
Post by: epic7 on December 19, 2011, 08:23:45 pm
So then
If {r2/8*W + (r1/8)+L1}
Will check collision?
Title: Re: Grappler!
Post by: Builderboy on December 19, 2011, 08:25:34 pm
If L1 points to your map data, then yes
Title: Re: Grappler!
Post by: epic7 on December 19, 2011, 08:31:22 pm
:D
Ok, I'll replace my pxl-tests and eventually post the outcome, hopefully good :P
Title: Re: Grappler!
Post by: epic7 on December 21, 2011, 06:55:09 pm
I did it, but it fails <.<
(http://img.removedfromgame.com/imgs/fail.gif)
It gets frozen and I have to pull a battery.

Methinks the while statement screwed up and won't ever be false, causing infinite loop.

But however, the tilemap should show up if everything else does...

Actually, it never should virtual pxltest until the player moves.
The only one that works when the player is moving still uses the regular pxl-test (which I forgot to change) and it used to work.
Title: Re: Grappler!
Post by: kindermoumoute on December 22, 2011, 10:19:49 am
Wooow, look like worms wxw :


Here some hard trick if it could give to you idea :


Good luck to this awesome game. :)
Title: Re: Grappler!
Post by: Nick on December 22, 2011, 10:21:23 am
that guy has played that game to much :)
Title: Re: Grappler!
Post by: epic7 on December 22, 2011, 08:01:58 pm
Now collisions work with grappling. However, when on the ground, it freezes for a while every time the player walks or hits the ground from a swing. So it looks like when there is an x velocity and the player hits the ground or is on the ground, the game freezes for about 10 seconds.
Title: Re: Grappler!
Post by: leafy on December 22, 2011, 09:40:45 pm
Put your code somewhere and I'll see what I can do. It sounds like you're unnecessarily running through a bunch of loops.
Title: Re: Grappler!
Post by: epic7 on December 23, 2011, 05:22:22 pm
It works less now. It just freezes. I think it stopped working because I fixed an error. (It makes sense to me :P)

http://willyou.typewith.me/p/Grappler%20Collisions
^ Code for subroutines

Btw, H is the variable that tells what phase the player is in. For example, when H=0, that means the player is standing on the ground and when H=41, the player is falling.

Edit: Changed link
Title: Re: Grappler!
Post by: epic7 on December 24, 2011, 04:17:05 pm
Ok, I redid my whole collision system using Builderboy's advice.

It still doesn't work <_<

Well, I give up for today D:

Btw, if anyone can take a look, the code is here: http://willyou.typewith.me/p/Grappler:%20Collisions%20attempt%203
Title: Re: Grappler!
Post by: epic7 on January 01, 2012, 02:53:04 pm
No progress lately....
I haven't really been motivated to redo the virtual pxl tesing again :/

I'll definately finish grappler, but I need to make collisions work before I can make anything else.
Title: Re: Grappler!
Post by: TIfanx1999 on January 02, 2012, 09:54:47 am
Hmm... well I may have a few... gifts for you when you resume this. :D