* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: HP Prime 3D Racer and Snake games  (Read 2254 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18243
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
HP Prime 3D Racer and Snake games
« on: March 07, 2016, 10:34:50 pm »
Mark Power has released Racer for the HP Prime, which once again shows the power of HP PPL language and this calculator hardware. Now at version 28, it features pseudo 3D graphics in the style of Outrun, multiple layers of parallax scrolling in the background, day and night mode and smooth gameplay.



There is currently only one course in the game, but if you can figure out how it was made, then you can probably make your own track in the ResetLoad() sub-routine.

Download link: http://www.hpmuseum.org/forum/thread-5628.html


Also, while this is much more simple from a technical standpoint, the HP Prime lacked a Snake game for some reasons. Thanks to @nullweist, there is now one, which features difficulty and color options:



Download link: https://codewalr.us/index.php?topic=1173.msg33769#msg33769


  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Jkolade936

  • All Around Coolio
  • Super User
  • Join Date: Jan 2016
  • Location: Horseheads, NY
  • Posts: 1515
  • Post Rating Ratio: +9/-1
  • I'm an unknown loner. I try to change that.
    • Jkolade936
    • View Profile
    • My Sprites and Walrii Collection
  • Gender: Male
Re: HP Prime 3D Racer and Snake games
« Reply #1 on: March 07, 2016, 10:53:05 pm »
These look cool! But I do not have an HP Prime, and neither do I feel like trying to figure out the emulator.
  • Calculators owned: None of them. :'(
Does this qualify as a signature? 
The answer is "Sure."


Offline ordelore

  • Full User
  • Safe-haven access
  • Join Date: Oct 2015
  • Location:
  • Posts: 82
  • Post Rating Ratio: +2/-0
  • 8x
    • @ordelore8x
    • ordelore8x
    • @UCJ9TFxpyxonUZvAv-S8K_1A
    • /u/ordelore8x
    • ordelore
    • 112/11231
    • View Profile
    • My WIP Story
Re: HP Prime 3D Racer and Snake games
« Reply #2 on: March 07, 2016, 11:05:58 pm »
Impressive!
  • Calculators owned: TI-84+SE, TI_Nspire CX
Calc Wars is still alive (I hope)

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18243
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: HP Prime 3D Racer and Snake games
« Reply #3 on: March 07, 2016, 11:11:42 pm »
These look cool! But I do not have an HP Prime, and neither do I feel like trying to figure out the emulator.
It's not even close to hard to use. The issue is if you get caught since it seems like you cannot use your laptop for entertaimnent purposes. Otherwise you just install it for free and you don't even need a ROM.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline alexgt

  • Just your friendly neighborhood Ninja Stach Fancy Iron Man
  • Super User
  • Join Date: Dec 2014
  • Location: Behind you
  • Posts: 2611
  • Post Rating Ratio: +6/-1
  • Something should go here...
    • /u/alexgt9123
    • View Profile
  • Gender: Male
Re: HP Prime 3D Racer and Snake games
« Reply #4 on: March 08, 2016, 01:11:43 pm »
Wow these look great! I need to get back to programming my prime <_<
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

Offline critor

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 174
  • Post Rating Ratio: +6/-0
    • View Profile
Re: HP Prime 3D Racer and Snake games
« Reply #5 on: March 11, 2016, 02:51:50 pm »
Very nice. ;D

I've made a little video and added the Sega Out Run soundtrack (as there's already the Sega Out Run car sprite ;) ) :

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18243
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: HP Prime 3D Racer and Snake games
« Reply #6 on: March 11, 2016, 05:06:18 pm »
Cool, I'll watch later. :)

I need to examine the code later to see how fast the game runs at lower resolution/quality.

Also @alexgt do you remember Trailblazer Prime? It was a 3D PlainJump clone with textured floor, but sadly it doesn't work on newer firmwares.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Snektron

  • Lvl 69 Russian Snake
  • CodeWalrus Staff
  • Super User
  • Topic Management
  • Join Date: Dec 2014
  • Location: Netherlands
  • Posts: 3155
  • Post Rating Ratio: +31/-0
  • SSSssssss.....
    • RobinDeWalvis
    • Kzyrox
    • RobinDeWalvis
    • View Profile
    • quantuminfinity
  • Gender: Male
Re: HP Prime 3D Racer and Snake games
« Reply #7 on: March 15, 2016, 06:29:21 pm »
That racing game looks cool :) also snakes
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18243
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: HP Prime 3D Racer and Snake games
« Reply #8 on: March 15, 2016, 07:08:18 pm »
>Snakes

Someone now needs to make a mod of that HP Snake game and replace the snake blocks with :walrii: with the front one being pink. :P

Also I need to check the code of that racing game to see if those backgrounds and road graphics use pre-rendered PNGs or if they were generated with code. It seems like the sky, as well as the mountains, could easily be generated with some code to save space. The trees could probably be generated with a randomized graph curve, then a gradient applied. The clouds might be another story, but if they were made more simple, I bet it would be possible.
« Last Edit: March 15, 2016, 07:11:07 pm by DJ Omnimaga »
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline MPower

  • New User
  • Join Date: Mar 2016
  • Location:
  • Posts: 2
  • Post Rating Ratio: +0/-0
    • View Profile
Re: HP Prime 3D Racer and Snake games
« Reply #9 on: March 23, 2016, 10:25:42 pm »
Hi Everyone,

I'm glad you like the 3D Racer. I'd like to answer some of your questions...

Regarding the roads: there are two - Easy and Hard. Easy shows off an undulating straight road. You don't need to steer on this section, but it makes the terrain tracking obvious as some people didn't think I'd implemented that. The Hard (original) track has hills but perhaps they are less obvious unless you look at the car and the scenery. The Hard track requires more aggressive steering.

To change the tracks just edit the ConfigureTrack() method. There are comments in there to explain what the parameters to AddRoad() are. Just don't make the curves too tight (otherwise you can't steer around them) or overrun the number of road segments. Also I wanted to keep the speed up so the parallax scrolling of the background uses a single BLIT_P for each layer. So when you make a curve one way, make sure you curve back by the same amount by the time you get to the end of the track otherwise you will run out of background!

Regarding the backgrounds: they are prebuilt PNG files with transparency. There are day backgrounds and night backgrounds. When the game starts the PNGs are loaded into GROBs so that I can use BLIT_P. I used very simple backgrounds with little texture and compressed the PNG files (using tinypng dot com) so that they occupy relatively little space. I did try a photorealistic night sky at one point but the Prime ran out of RAM.

It seems like the PNG files are held in flash until AFiles() loads them into a GROB. Then they occupy RAM. So you seem to be able to have lots of PNGs on the calc ready to use and as long as you don't have massive GROBs you are ok. You could generate the GROBs programatically as suggested, but I think you would still stress the RAM if they were too big.

I already use 6 of the 10 GROBs: G0 is the display; G1 is my frame buffer where I build the scene before BLITing it G0; G2 is the sky; G3 is hills/city; G4 is trees; G5 is a composite of all the cars. I'm thinking about adding road side trees so they would take up another GROB, but also slow the frame rate as they need to be scaled, clipped and the physics routine needs to detect collision of the objects.

If you want to have a look at the code and try to optimise it for me so that I can add roadside objects, look at the methods which have RT in the comments (for Real Time). The other methods are not time critical. I've done a fair bit of tuning already to gains are hard to come by.

I notice that critor has found a bug! The lap display on my Prime shows Lap 1/3 because I use Standard display mode. On his Prime he must have Fixed 4 decimal format as his Prime shows Lap 1.0000/3.0000. I'll fix that in v29.

If anyone has further suggestions I'd love to hear them. My colleagues and I were taking turns playing to get the best time a few days ago and it was suggested that I include an old school leaderboard so that people can put their initials against their times.

If only the Prime could play sounds, that would be the icing on the cake  :)

Offline DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 18243
  • Post Rating Ratio: +91/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: HP Prime 3D Racer and Snake games
« Reply #10 on: March 23, 2016, 10:34:22 pm »
Hi MPower and welcome to the forums. :)

Regarding the roads, I was impressed that you managed to implement hills and especially the scrolling background. We have a pseudo 3D racing game on the TI-83+ from 1999 called Lotus Turbo Challenge and when you are in a curve, the background doesn't even scroll an inch. I once made an xLIB engine that did but it ran at 3 FPS. I'm impressed that the HP Prime can achieve such high frame rate for a racing game despite the 320x240 resolution. Good job :)

And I see about the BLIT'ed background. DO you think you could have made the background repeat, so that it uses two BLIT_P commands and its position gets reset once it reaches a certain point?


And yeah it's better to not use too many large GROB's at once, because then the calculator has issues. Also it's best to set all 10 GROB's to 1x1 pixel when exiting or entering the game, from what I heard. Memory problems are more noticeable when you use an application instead of program, because they simply won't run at all.


Highscores would definitively be a nice addition, as well as a title screen and perhaps multiple pre-generated tracks, even if not many. It would then be a full racing game :)


As for music, I wish as well. I remember that the HP 48g and a lower-end model (39gs I think?) could play beep sounds, but sadly the HP Prime lacks a sound buzzer.

Do you plan to make more games for the HP Prime in the future? I made one in the past, which is called HP Prime Tunnel and I plan to make more, but it has been a long while since I coded for it.
  • Calculators owned: TI-57, 73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games