Download from the archives here: https://www.cemetech.net/programs/index.php?mode=file&path=/84pce/asm/games/dinorun.zip
Source code: https://github.com/commandblockguy/dino-run-ce



Original first post:
------------------------------------------------------------------------------------------------------------------------------------------

To give you guys something to do while you wait for me to finish Nanotube, I've started working on a clone of the dinosaur game from the Google Chrome "no internet" screen. I hope to make it as accurate as possible to the original game, so I've been stealing sprites, constants, and pixel measurements from the original game.

The original game is only 150 pixels tall, so I added a black letterbox around the game so that I can properly measure things. I will remove it / make it the same color as the background when I release the game. In the screenshot, you can see the frame time (in 32K timer intervals) and the frame rate prior to the limitation. As you can see, I'm still a good deal above the target frame rate of 60.

Currently, I only have the jump mechanics and dinosaur and horizon rendering finished, but these should be almost exactly identical to the original game.
Looks good, so far, and pretty faithful to the original. Keep it up.

Also, what is Nanotube? It sounds like a shell or something, but you already have Ultimate Shell CE.
epsilon5 wrote:
Also, what is Nanotube? It sounds like a shell or something, but you already have Ultimate Shell CE.

It sounds more like a CalcNet-based YouTube rendering engine to me.

The dino game does look really good; I don't see any difference between what you have so far and the Chrome version. I can't wait to see the rest of it, if you already have this working, the rest shouldn't be too hard.
Whoops, somehow missed both of the replies to this. I'll blame my IRC client and the fact that Cemetech keeps logging me out and clearing my unread posts.

Nanotube is a work-in-progress networking library for the CE. It's not CalcNet-based, nor does it render videos. It's based on the lwIP networking stack, and will eventually allow people to write programs for the calculator that can connect to the internet using a USB ethernet or WiFi adapter or a computer acting as a bridge. I thought I made a topic for it, but I guess not, so I should get around to doing that at some point.

Anyways, here's a progress update on Dino Run:

I've gotten obstacle generation working. I'm using a slightly different method than the original for this, to make it easier to implement in C. The original adds a new obstacle when it needs to appear on the screen, and keeps a list of previous obstacles around for a while so that it can avoid repeating the same type multiple times in a row. In my implementation, I have a fixed number of obstacle slots, and whenever one obstacle leaves the screen I add a new obstacle to that slot the correct distance from the obstacle before it. Because the gap distance varies as a function of current speed, this creates a small inaccuracy due to the fact that the original takes the speed right when the obstacle appears on-screen, while mine considers the speed sometime before then. That should be almost unnoticeable, however, especially compared to the fact that I don't deduplicate obstacles.

Collision detection sounds like a pain, so I might implement some of the graphical effects, like clouds, the high score counter, and night mode, next. I'm also debating whether to start the game with a fake "no internet" page, or to just leave it on the "game over" screen like Rico's Flappy Bird clone does.

EDIT: woot woot, I'm an "Expert" now! (this is my 500th post)
After going to the max score on the chrome t-rex game, it just resets to zero and keeps on going. The game of course just keeps getting faster and faster, adds birds, and day-night cycles. I don't what others think, but you should add a cool, satisfactory ending once u ever reach 99,999 (or maybe another number). The programmers at Google behind the t-rex game claims it would take 17 million years to beat the t-rex game (the game just goes too fast for your computer and then just stops?). I don't even know what that means, but an ending after you just spent the last 45 minutes perfecting jumps to the pixel sounds like a cool idea.

I realize you're trying to make this game as close as possible to the real chrome t-rex game, but an ending sounds like a good idea.
At least in the current Chrome version, the game's speed tops out at 13 pixels/frame, which, given that the game starts out at 6 pixels/frame and accelerates at 0.001 pixels/frame^2, means that the dino should stop accelerating in under 2 minutes. The birds and day/night cycle happen a long time before the score rolls over. I'm not sure what the 17 million year max means - I found the quote from the developer mentioning it but I don't see anything in the code that enforces it, so it must be some precision limit that makes the game unplayable.

I currently don't plan on adding an ending, as I want the clone to be as accurate as possible, as well as the fact that I have no idea what I would actually do for such an ending. Maybe after 17 million years, I'll add an asteroid strike.

EDIT: added some clouds

I may have to make those darker so you can see them on a physical calc, as the LCD isn't too great.
I added a score counter:

The high score doesn't work yet as I haven't implemented high score saving (or a game over condition, for that matter). It's also a bit too light, which I'll fix when I poke the palette when adding night mode.
I've implemented collision detection:

The FPS drop is due to the box rendering - I do a rough collision check before testing the boxes visible on-screen, so the speed impact isn't that bad.
I think I'll add a game-over check next, so that it's actually playable, then add audio because that sounds fun.
Looks good, I didn’t expect the collision detection to be as accurate as it appears to be. How are you planning to implement sound?
I'm going for as much accuracy as possible, so I copied the collision boxes from the actual game. And for sound, just through the steam controller using the same method as before. I might add the option to use a USB audio device later if I or someone else makes a library for it.
commandblockguy wrote:
...
I'm also debating whether to start the game with a fake "no internet" page, or to just leave it on the "game over" screen like Rico's Flappy Bird clone does.
...


Start w/ a "no Internet" screen, and maybe 0 bars in the corner, to add to the authenticity?
SM84CE wrote:
commandblockguy wrote:
...
I'm also debating whether to start the game with a fake "no internet" page, or to just leave it on the "game over" screen like Rico's Flappy Bird clone does.
...


Start w/ a "no Internet" screen, and maybe 0 bars in the corner, to add to the authenticity?


Agreed
Nice concept. I have to say, this seems like great project. Imagine students trying to access this game at school and you just pull up with a Ti84.
I got night mode working:

Now I just have the start screen and sound left, as well as figuring out why my HID library slows the game down so much.
This is nice.
This looks really good; nice work!
I've decided to release the game now, without USB support. Apparently interrupt transfers, which are necessary for HID (keyboard/mouse devices) to work still aren't supported by usbdrvce, but I've been using them anyway. I may release a new version that supports steam controller audio support soon (as that's currently working fairly reliably, if not quickly), and once usbdrvce supports interrupt transfers I'll be sure to add keyboard support too.

I also decided against adding the fake no internet screen, as it would have to look nothing like the original due to the way that I've aligned the game in the center of the screen.

I've uploaded version 1.0 to the Cemetech archives, and you can also download it immediately from the GitHub releases page.
Is this playable on the monochrome calcs? Such as TI-84 Plus
Unfortunately, no. The CE has an entirely different processor and screen dimensions so the same program can't run on both calculators.
commandblockguy wrote:
Unfortunately, no. The CE has an entirely different processor and screen dimensions so the same program can't run on both calculators.

You should make a monochrome version then 😉
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement