CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: Jim Bauwens on May 03, 2015, 01:05:25 PM

Title: [TI-Nspire Lua] Dino
Post by: Jim Bauwens on May 03, 2015, 01:05:25 PM
Hi all,

Just wanted to show this little game that I did in my free time:

(http://tiplanet.org/modules/archives/captures/x1430432416screen2.png.pagespeed.ic.Cw5zFhCsw_.png)

It's a port of the Dino game that you can play in Google Chrome when you have no internet connectivity. As it's ported, gameplay should be the same. I hope some people enjoy it :)

Download link: http://tiplanet.org/forum/archives_voir.php?id=206578
Title: Re: Dino
Post by: CKH4 on May 03, 2015, 01:07:03 PM
Very cool, I love that game on my phone when I forgot to turn on WiFi or mobile data. Looks great, too bad I don't have an nspire. :(

Also if you get a gif of it that would be great.
Title: Re: [TI-Nspire Lua] Dino
Post by: Snektron on May 03, 2015, 01:15:55 PM
Oohh cool! Whatch out you dont get sued though :P
Title: Re: [TI-Nspire Lua] Dino
Post by: Jim Bauwens on May 03, 2015, 01:28:10 PM
Don't worry, the game itself is open source (with a BSD-style license), just as the rest of the Chromium project.
Title: Re: [TI-Nspire Lua] Dino
Post by: Snektron on May 03, 2015, 01:29:04 PM
Ooh great :D
Title: Re: Dino
Post by: alexgt on May 03, 2015, 03:23:52 PM
looks cool I will put it on my Nspire if I start using it again :)
Title: Re: Dino
Post by: LD Studios on May 03, 2015, 05:22:47 PM
not compatible with OS 3.2 :'(
Title: Re: Dino
Post by: Jim Bauwens on May 03, 2015, 06:21:56 PM
Quote from: LD Studios on May 03, 2015, 05:22:47 PM
not compatible with OS 3.2 :'(

I'm using image resources hence that issue. It might work on 3.2 if you swap them with TI.Image strings, however I don't know if it will still run at the same speed.
Title: Re: Dino
Post by: alexgt on May 03, 2015, 06:24:40 PM
I have 3.6 but I haven't tried it out yet :-\
Title: Re: Dino
Post by: LD Studios on May 03, 2015, 08:42:28 PM
Quote from: Jim Bauwens on May 03, 2015, 06:21:56 PM
Quote from: LD Studios on May 03, 2015, 05:22:47 PM
not compatible with OS 3.2 :'(

I'm using image resources hence that issue. It might work on 3.2 if you swap them with TI.Image strings, however I don't know if it will still run at the same speed.
From what I've seen, images cause more lag with the resources than with the strings. Could you send me the source so I can try it out though?
Title: Re: Dino
Post by: Dream of Omnimaga on May 04, 2015, 01:33:36 AM
Wow I didn't know about that Chrome easter egg, since I always have my connection enabled and it never showed up on my phone. I'm gonna try the Nspire version when I have a chance. Glad to see new calculator stuff from you :walrii:
Title: Re: Dino
Post by: Jim Bauwens on May 04, 2015, 09:26:37 AM
Quote from: LD Studios on May 03, 2015, 08:42:28 PM
From what I've seen, images cause more lag with the resources than with the strings. Could you send me the source so I can try it out though?

I've just done some tests on OS 3.9 (or 4.0, don't remember, short term memory loss) and speed is exactly the same. But of course speed might be different between OS versions.. Can you try the attached script on your handheld and report the result? (Press enter to start the benchmark). I'll do a test on later OS versions when I get home. (I currently only tried on Nspire-Emu).

Quote from: DJ Omnimaga on May 04, 2015, 01:33:36 AM
Wow I didn't know about that Chrome easter egg, since I always have my connection enabled and it never showed up on my phone. I'm gonna try the Nspire version when I have a chance. Glad to see new calculator stuff from you :walrii:

Well, you need to know about it to be able to play it ^^ Oh don't worry I'm still fairly active with my TI-Nspire research. Just in the underground :walrii:

Title: Re: Dino
Post by: Dream of Omnimaga on May 04, 2015, 02:21:37 PM
Oh OK, I thought it appeared immediately lol. I guess the game is in the Chrome undergrounds like your Nspire development :P
Title: Re: Dino
Post by: Ivoah on May 04, 2015, 03:41:43 PM
Is this a port or a clone?
Title: Re: Dino
Post by: alexgt on May 04, 2015, 08:11:28 PM
I am quite certain it is a clone but don't quote me on that
Title: Re: Dino
Post by: CKH4 on May 04, 2015, 08:14:36 PM
Quote from: Jim Bauwens on May 03, 2015, 01:05:25 PMAs it's ported, gameplay should be the same.
Title: Re: Dino
Post by: Snektron on May 04, 2015, 08:15:35 PM
Quote from: alexgt on May 04, 2015, 08:11:28 PM
I am quite certain it is a clone but don't quote me on that
:trollface:
Title: Re: Dino
Post by: alexgt on May 04, 2015, 08:19:17 PM
Ohh sorry should read the discriptions better  :-[

Quote from: Cumred_Snektron on May 04, 2015, 08:15:35 PM
Quote from: alexgt on May 04, 2015, 08:11:28 PM
I am quite certain it is a clone but don't quote me on that
:trollface:
Lol :trollface:
Title: Re: Dino
Post by: Dream of Omnimaga on May 04, 2015, 11:29:36 PM
Let's not hijack the topic, guys. :)
Title: Re: Dino
Post by: Duke "Tape" Eiyeron on May 05, 2015, 01:07:29 PM
And pelase lower the frequency of short posts (few or no words) that isn't on topic, please.
Title: Re: [TI-Nspire Lua] Dino
Post by: Jim Bauwens on May 05, 2015, 04:14:36 PM
I did some benchmarks:


Used image: 320x240 full spectrum gradient

TI-Nspire OS 3.2.4

draw image string: 15.12ms

TI-Nspire OS 3.6

draw image string: 14.08ms
draw image resource: 14.51ms

TI-Nspire OS 3.9

draw image string: 14.16ms
draw image resource: 14.15ms

TI-Nspire OS 4.0

draw image string: 14.26ms
draw image resource: 14.21ms


3.6 and higher seem to be in general faster than 3.2 for drawing images. Speed between resources and string based images are basically equal. Using image resources also reduces the total size of your final tns document.

In any case is there still an actual reason to stay on 3.2? On a CX there shouldn't be really that much of a difference.
Title: Re: Dino
Post by: Dream of Omnimaga on May 05, 2015, 04:55:12 PM
What about OS 3.1? I see no reason to stick to 3.2 unless you want 3.2.3 which is the only OS with arabic language, but 3.1, 3.6 and 3.9 got Ndless.
Title: Re: [TI-Nspire Lua] Dino
Post by: Jim Bauwens on May 05, 2015, 05:34:53 PM
I just tested on 3.1 ...

TI-Nspire OS 3.1

draw image string: 222.6ms


That's about 15x slower than the other versions..
Title: Re: Dino
Post by: CKH4 on May 05, 2015, 07:59:06 PM
I'm kinda surprised, I would expect speed not to change between different oses. Did you do multiple tests or just one per os?
Title: Re: Dino
Post by: alexgt on May 05, 2015, 08:02:09 PM
Ndless could be causing it but I don't think so without Ndless it still takes 15 seconds to get into the stupid file manager <_<
Title: Re: Dino
Post by: Jim Bauwens on May 05, 2015, 09:05:49 PM
Quote from: CKH4 on May 05, 2015, 07:59:06 PM
I'm kinda surprised, I would expect speed not to change between different oses. Did you do multiple tests or just one per os?

Naturally I ran the test multiple times. Besides that I take the average of thousand drawing operations. The reason is because in earlier versions they used a very unoptimized drawing routine. I expected it to be slow, but not that slow.

Quote from: alexgt on May 05, 2015, 08:02:09 PM
Ndless could be causing it but I don't think so without Ndless it still takes 15 seconds to get into the stupid file manager <_<
The only cause of this is unoptimized code.
Title: Re: Dino
Post by: CKH4 on May 05, 2015, 09:07:40 PM
OK that sounds good, if I ever get an nspire I'll get this game. As a feature request you should make another not exact port one with more ground and maybe another gamemode like super jump or super speed.
Title: Re: [TI-Nspire Lua] Dino
Post by: Jonius7 on May 07, 2015, 11:35:51 PM
Quote from: Jim Bauwens on May 05, 2015, 05:34:53 PM
I just tested on 3.1 ...

TI-Nspire OS 3.1

draw image string: 222.6ms


That's about 15x slower than the other versions..

Holy crap, I've been still developing on 3.1, and I don't have a license of the TI-nspire Software, so I don't know how I'd use image resources.
Title: Re: Dino
Post by: Adriweb on May 09, 2015, 04:05:33 PM
Cumulating demos of the TI-Nspire Computer Software (student and teacher editions), you get 4 months of trial :) I'd recommend using 3.6 or later (though 3.9 got some nice lua additions)
Title: Re: Dino
Post by: Dream of Omnimaga on May 09, 2015, 04:15:50 PM
Quote from: CKH4 on May 05, 2015, 07:59:06 PM
I'm kinda surprised, I would expect speed not to change between different oses. Did you do multiple tests or just one per os?
In OS 3.1's case, there were massive improvements in image rendering in OS 3.2 or 3.6, explaining why it's so much slower in 3.1.
Title: Re: Dino
Post by: Dream of Omnimaga on May 18, 2015, 08:28:57 PM
So yeah I wanted to try on OS 3.1 and it doesn't work, so I guess I'll have to wait until I upgrade to 3.6 (if ever).