# Omnimaga

## Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: squidgetx on August 31, 2012, 09:50:52 pm

Title: Temple Run [Axe]
Post by: squidgetx on August 31, 2012, 09:50:52 pm
So I mentioned a couple weeks ago in the Ideas/Inspiration I might pick up porting Temple Run as a project...

Originally I thought I would try to use Mode7 or something, but in the end ended up making a near-complete 3d engine to work it :P So if I can keep the speed and figure out how to do textures as well, I might release the 3d engine as a separate useable library. The engine is really quite nice, it's all based off of a Point() routine that takes x,y,z, and a pointer and writes the x' y' values to the 4 bytes pointed to (also within the routine cameraX, cameraY, and vanishing point are controllable).

Well, it's now in a playable-enough state that I decided to make an official thread, along with a download and screenie, of course. It's still wireframe, making things kinda hard to see and some of the collisions may be glitchy, which is why I'm enlisting your help in fine-tuning it.

You are the black square (sprite coming soon!). There are no turns (yet), only holes, walls, and things to duck under. Use 2nd to jump, Alpha to duck. There is still a lot of work to do, but it's pretty cool as is already (at least I think so)

Edit: And I need a clipped line routine :(
Title: Re: Temple Run [Axe]
Post by: annoyingcalc on August 31, 2012, 09:52:21 pm
Looks Great!

Wow, I wondered if anyone was going to make temple run!
Title: Re: Temple Run [Axe]
Post by: MGOS on September 01, 2012, 05:22:54 am
3D looks cool so far!

Here is a line clipping routine for the bottom of the screen. I bet you can optimize it, that's just some ugly prototype I came up with using the similar triangles formula.

Code: [Select]
`Lbl LINIf r4>63r1-r3→r5?r4-r2*r1//r5-64+r2*r5//(r4-r2)→r363→r4EndLine(r1,r2,r3,r4)Return`
Use it just like the regular line command.
Title: Re: Temple Run [Axe]
Post by: Sorunome on September 01, 2012, 11:36:27 am
That's looking awesome so far! Keep up the cool work! :D
Title: Re: Temple Run [Axe]
Post by: ben_g on September 01, 2012, 01:39:38 pm
Graphics look really simular to those of my racing game. What does the engine support? Does it support rotation of camera and changes in the FOV (zooming in/out)?
Title: Re: Temple Run [Axe]
Post by: squidgetx on September 01, 2012, 07:36:04 pm
Thanks everyone!

Graphics look really simular to those of my racing game. What does the engine support? Does it support rotation of camera and changes in the FOV (zooming in/out)?
It doesn't support rotation, since I won't need it for Temple Run. If I ever make a separate general-case library release, I'll probably add rotation. It doesn't currently support zooming in/out either, but that's a really easy addition to make (basically just have to change the fixed focal length value to a variable)
Title: Re: Temple Run [Axe]
Post by: Link on September 01, 2012, 09:33:54 pm
Nice work, now I can finally play temple run in math class too! ^.^
Title: Re: Temple Run [Axe]
Post by: ruler501 on September 02, 2012, 12:58:01 am
Nice work, now I can finally play temple run in math class too! ^.^
/me does that anyways on phone :P

Would it be possible to make it touchpad like the fruit ninja game?
Title: Re: Temple Run [Axe]
Post by: leafy on September 02, 2012, 02:08:54 am
Thanks everyone!

Graphics look really simular to those of my racing game. What does the engine support? Does it support rotation of camera and changes in the FOV (zooming in/out)?
It doesn't support rotation, since I won't need it for Temple Run. If I ever make a separate general-case library release, I'll probably add rotation. It doesn't currently support zooming in/out either, but that's a really easy addition to make (basically just have to change the fixed focal length value to a variable)

Well, Temple Run does have rotations at 90 degrees. I suppose you could fudge it by doing a really fast animation to another straight segment, but I'm guessing it wouldn't look quite right.
Title: Re: Temple Run [Axe]
Post by: Spenceboy98 on September 02, 2012, 09:21:26 am
Nice work, now I can finally play temple run in math class too! ^.^
/me does that anyways on phone :P

Would it be possible to make it touchpad like the fruit ninja game?
I was hoping for something like this.
Title: Re: Temple Run [Axe]
Post by: squidgetx on September 02, 2012, 01:21:35 pm
Well, Temple Run does have rotations at 90 degrees. I suppose you could fudge it by doing a really fast animation to another straight segment, but I'm guessing it wouldn't look quite right.

Woops, yeah I guess I'll have to figure that out =/

Added a poll in terms of controls. Vote!
Title: Re: Temple Run [Axe]
Post by: DJ Omnimaga on September 02, 2012, 01:26:30 pm
Looks nice. Is that game kinda like rollercoaster or is it more like jumping to avoid platforms and stuff? I never played the original D:
Title: Re: Temple Run [Axe]
Post by: LincolnB on September 03, 2012, 11:02:25 pm
That's pretty impressive. I would say don't go with DT's keypad-as-touchscreen control scheme, although it was very innovative, it was nigh impossible to control on my 84+.
Title: Re: Temple Run [Axe]
Post by: Deep Toaster on September 03, 2012, 11:10:17 pm
If you limit it to the F1–F5 keys (since all you're doing is rotating left and right), and allow for multiple keys to be down at the same time (which would have made cheating a lot easier in Fruit Ninja but shouldn't be a problem here), it will be much easier to control. I tested something like it while planning the game, and it was very responsive—I'd say go for it :)

EDIT: You'll have to have a separate system for jumping up and down. Maybe double-tap on ZOOM key or something similar?
Title: Re: Temple Run [Axe]
Post by: TIfanx1999 on September 03, 2012, 11:28:02 pm
I thought a mode 7 engine would be a good way to go, but this looks really nice too. :)
Graphics look really simular to those of my racing game. What does the engine support? Does it support rotation of camera and changes in the FOV (zooming in/out)?

It really reminded me of your racing game when I first saw the topic too. :P

Anyho, this is gonna be really cool. Personally, I'd opt for a more conventional control scheme in this case.
Title: Re: Temple Run [Axe]
Post by: squidgetx on September 05, 2012, 09:49:57 pm
Update! Not much has changed since the first version gameplay wise, but thanks to some help from ben_g, textures (8x8) are somewhat supported! There is only one graphical glitch I have to iron out, you may be able to see it in the screenie. If anyone has ideas on what might be causing that problem let me know. Also I took out the sprite for now.

It runs a bit slower. Just kidding, it runs a whole heck of a lot slower. The screenshot is in 15mhz. I have some ideas for optimization though, principally perhaps unpacking the textures to be 64-byte sections of data instead of using the somewhat slower bit command, and maybe abusing the always-horizontal/vertical nature of the tiles. If I did that though, rotating would probably be impossible unfortunately. I could probably "fudge it" as leafy suggested though, maybe by simply animating the turn via a couple 768-byte bitmaps. Thoughts?
Title: Re: Temple Run [Axe]
Post by: Yeong on September 05, 2012, 09:53:34 pm
nice work :D
Title: Re: Temple Run [Axe]
Post by: parserp on September 05, 2012, 11:21:16 pm
Awesome update!

And it is still under 2KB? O.O
Title: Re: Temple Run [Axe]
Post by: TheMachine02 on September 06, 2012, 03:50:10 am
this is really good.

how the texture work ?
Title: Re: Temple Run [Axe]
Post by: TIfanx1999 on September 06, 2012, 08:16:57 am
In game dev, as long as the program functions fine and appears to do rotations there is no problem. Speed and functionality are always top priority. Your user will be none the wiser.  :ninja:
Title: Re: Temple Run [Axe]
Post by: shmibs on September 06, 2012, 05:18:36 pm
what command are you using to actually draw the textures? it looks reminiscent of line clipping problems.

EDIT: are texture edges moving to negative values past your viewing window/camera position?
Title: Re: Temple Run [Axe]
Post by: Sorunome on September 06, 2012, 06:51:57 pm
This is looking awesome! And you defenetly need to speed it up :P
Title: Re: Temple Run [Axe]
Post by: blfngl on September 06, 2012, 09:19:57 pm
Wow! Now time to make one for the nspire! ;)
Title: Re: Temple Run [Axe]
Post by: squidgetx on September 06, 2012, 09:51:00 pm
Erghh...

Minimal progress for today. Spent most of it trying to get rid of that display glitch, which by itself brought up a whole host of other problems -__-

I'm going to work on it more tomorrow. On a more conclusive note, it seems that the community is overwhelmingly in favor of a conventional control scheme, so that's what I'll be doing for now (makes things easier anyway)
Title: Re: Temple Run [Axe]
Post by: blfngl on September 07, 2012, 08:21:22 am
Good luck with this, it's really good! :)
Title: Re: Temple Run [Axe]
Post by: squidgetx on September 20, 2012, 10:11:05 pm
(Finally) update...

The major update is that that display bug is all but gone (Only a small bit remains but I know how to get rid of it). believe me, that took a huge amount of work...

Otherwise it looks more or less the same as before right? Hehe it does, only this screenie is running at 6mhz (compare to the last one going at 15mhz). Hooray!

Question: should I go for 16x16 textures or for additional shapes in the obstacle pieces (walls alongside, tops of obstacles, etc.)
Title: Re: Temple Run [Axe]
Post by: Spenceboy98 on September 20, 2012, 10:33:42 pm
It is slow..., but looks good! The texture kind of hurts my eyes.  O.O
Title: Re: Temple Run [Axe]
Post by: Sorunome on September 20, 2012, 10:51:32 pm
it is slow but sooooooooo awesome! :D
Great work so far!
And i'd say go for the faster solution :P
Title: Re: Temple Run [Axe]
Post by: Runer112 on September 20, 2012, 11:12:10 pm
squidgetx never fails to make awesome-looking stuff. But I'd certainly like to see how fast you could get that by trying to turbocharge it to maximum Axe capabilities. :P
Title: Re: Temple Run [Axe]
Post by: parserp on September 20, 2012, 11:17:55 pm
Looks awesome!

but...the guy kind of looks like a prancing horse O.O
Title: Re: Temple Run [Axe]
Post by: squidgetx on September 21, 2012, 11:02:52 am
Runer, you wouldn't happen to have any asm lying around for drawing white (or black) horizontal lines, would you? ;D
Title: Re: Temple Run [Axe]
Post by: Runer112 on September 21, 2012, 12:28:26 pm
Come on now, I bet you can make this pretty fast without using assembly. I'm always interested to see powerful things done in Axe. :P But feel free to reach out for optimization assistance too, I would imagine something like this could be challenging to optimize.
Title: Re: Temple Run [Axe]
Post by: shmibs on September 21, 2012, 09:27:19 pm
this is looking rather cool indeed.
is there any way to make the character sprite be masked by walls that are behind him already? the jumping ends up looking a bit strange otherwise.
Title: Re: Temple Run [Axe]
Post by: TIfanx1999 on September 23, 2012, 08:15:34 am
Title: Re: Temple Run [Axe]
Post by: GinDiamond on November 28, 2012, 03:47:52 pm
I hope this project isn't dead!
Title: Re: Temple Run [Axe]
Post by: TIfanx1999 on November 28, 2012, 04:20:26 pm
Quote
I've almost finished setting up my calculator dev environment up on Mint, so hopefully I'll be finished up with those things soon. In the transition process my Windows partition got nuked, but luckily I had these files in the cloud. (Unfortunately I lost some old beta projects...including temple run, the isometric platformer, and tiny wings)

I don't know about dead, but I wouldn't hold my breath for progress at the moment.
Title: Re: Temple Run [Axe]
Post by: squidgetx on November 28, 2012, 05:48:24 pm