CodeWalrus

Development => Calculators => Calculator News, Coding, Help & Talk => Topic started by: Dream of Omnimaga on March 27, 2016, 02:33:12 PM

Title: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Dream of Omnimaga on March 27, 2016, 02:33:12 PM
So here are some bad news about the new TI-Nspire CX CR4 hardware, regarding Ndless games:

Critor compared the speed of some TI-Nspire games using the original hardware, and the new CR4 screen hardware with Ndless 4.2 compatibility mode. Here are some results, in summary:

-Jetpack Impossible: Runs 3 times slower (still playable, though)
-Another World: 50 times slower (virtually unplayable)

https://www.youtube.com/watch?v=4tMx8FsH_s8
https://www.youtube.com/watch?v=jmEdkiHaJ-I

Basically, it is heavily recommended for game programmers to not rely on compatibility mode in order to make their games run fast, but simply update them so that they won't suffer from severe slowdowns as a result of the screen compatibility layer, such as only updating the necessary parts of the screen during gameplay rather than everything. Basically, do like on the TI-84 Plus C Silver Edition, which required partial screen redraw in order to run fast enough.

Source: https://tiplanet.org/forum/viewtopic.php?p=198935#p198935
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: critor on March 27, 2016, 02:46:29 PM
Thanks for sharing the informations. :)

Vogtinator has rebuilt Another World with the latest CR4 compatible nSDL library.
It's apparently enough to solve the problem.

Download : https://tiplanet.org/forum/viewtopic.php?f=43&t=18160&p=198939#p198939
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Dream of Omnimaga on March 27, 2016, 03:11:20 PM
Do you have speed tests for more games?
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: critor on March 27, 2016, 03:17:40 PM
No. I'm currently focusing on updating programs.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Dream of Omnimaga on March 27, 2016, 03:32:03 PM
Ah ok thanks. I hope most games won't need updates. X.x
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Lionel Debroux on March 27, 2016, 04:17:06 PM
From these tests, it looks like most games which draw lots of content to the screen will need updates.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: critor on March 28, 2016, 08:12:58 PM
I've updated nDoom :
https://tiplanet.org/forum/viewtopic.php?f=43&t=18163

Doom's internal buffer is 320x200.
So instead of a simple memcpy for the old 320x240 screen, I've a got some code which converts and copies the data at the same time for the new CR4 240x320 screen.

In the end, updated nDoom is just slightly slower on CR4, 20% without any overclock :
https://www.youtube.com/watch?v=L2mYkz8px94

But you should notice something strange in the first 30secs of the video, before I start playing...
The CR4, on the right, seems to be much faster than the CR3 - twice as fast ! :o
It's, by far, the first calculator to display the game menu, and to start rendering the 3D map.
(I'm pressing keys at the same time on both calculators)
Performances which can't be explained just by the CPU frequency increase from 132 to 156MHz.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Ivoah on March 28, 2016, 08:34:40 PM
Quote from: critor on March 28, 2016, 08:12:58 PM
But you should notice something strange in the first 30secs of the video, before I start playing...
The CR4, on the right, seems to be much faster than the CR3 - twice as fast ! :o
It's, by far, the first calculator to display the game menu, and to start rendering the 3D map.
(I'm pressing keys at the same time on both calculators)
Performances which can't be explained just by the CPU frequency increase from 132 to 156MHz.
Could TI have changed to a faster NAND chip? That would seem to explain why loading times are less.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Adriweb on March 28, 2016, 08:36:33 PM
Current hypothesis is that the higher AHB freq. positively affects the NAND speed as it is its clock source ?
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Dream of Omnimaga on March 29, 2016, 03:31:40 AM
I'm glad that the loading times are actually faster on the new hardware. Also I notice that the speed drop in compatibility mode for graphics isn't that bad for nDoom. It almost seems to run close to the original game, which is good. I hope that all other games can be updated to not suffer from severe lag.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: critor on March 29, 2016, 06:23:25 AM
That's not the compatibility mode.
That's the new nDoom version supporting the CR4 hardware.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Dream of Omnimaga on March 29, 2016, 04:31:59 PM
Oh ok, I  thought it still went through the compatibility mode. Thanks for converting it :)
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: critor on May 15, 2016, 09:37:32 PM
By the way, there are some lines about nDoom in a recent article on Intel iQ :
https://iq.intel.com/how-doom-1-inspired-the-diy-gaming-movement/

What do you think about it ?
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Dream of Omnimaga on May 15, 2016, 10:14:42 PM
You know, for a company that used to make computer processors and that is mostly oriented into the technology business, Intel sure has a lot to learn about website hosting, because the first thing that struck my mind when clicking your link is how slow their website was loading.

Anyway it's nice that calculator programming still gets recognition outside the TI community. :) I wish however that more websites did that, because there are so many more calculator programs and games that are interesting besides the big franchise ports such as Mario, Doom, etc, which big blogs tend to focus exclusively on.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: gnmmarechal on May 15, 2016, 11:28:30 PM
Wow, TI really are cs. I'm glad I got a Rev. D and managed to join the A-I master race, though I also own a Rev. T. Actually, recently, when I got my Rev.T, I saw a blue-back TI-Nspire (all the new models, like my rev. T, have a white back) on the shop... I might take it, though I doubt it is on A-I. Hum... I know a few people who couldn't care less about Ndless with a Rev.A and a Rev.D.... Would they perhaps trade their calcs with my rev.T? :D
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: critor on May 17, 2016, 09:09:14 AM
Quote from: critor on May 15, 2016, 09:37:32 PM
By the way, there are some lines about nDoom in a recent article on Intel iQ :
https://iq.intel.com/how-doom-1-inspired-the-diy-gaming-movement/

What do you think about it ?
Quote from: DJ Omnimaga on May 15, 2016, 10:14:42 PM
You know, for a company that used to make computer processors and that is mostly oriented into the technology business, Intel sure has a lot to learn about website hosting, because the first thing that struck my mind when clicking your link is how slow their website was loading.

Anyway it's nice that calculator programming still gets recognition outside the TI community. :) I wish however that more websites did that, because there are so many more calculator programs and games that are interesting besides the big franchise ports such as Mario, Doom, etc, which big blogs tend to focus exclusively on.

That very small part is based on what I've replied to some questions by the article author.
I've tried to make them as comprehensive and accurate as possible. Read below :
Quote from: critor>Why Doom? What is it about the game that made you say, "I want to play that on a calculator?

As a math teacher, programmer and video games player, I've always been interested in 3D raycasting engines. I had already developed my own raycasting engines, as an online Java applet back in the day, and more recently for the HP Prime color calculator.

But for nDoom, the story is different. Doom was first ported to a calculator, the TI-Nspire monochrome calculators released in 2007, by "Mrakoplaz", in early January 2011. He started from the C source code released by Id Software in 1997.

Then, Mrakoplaz left for military service, and Texas Instruments released the TI-Nspire CX color calculator in April 2011. Of course, nDoom couldn't run on the new different hardware, not even in grayscale.
So I took on the project, to make it compatible with the new hardware (color screen, touchpad, new timers...), and released the first color calculator Doom port in January 2012.

I've also improved many other things :
- ability to select the IWAD file you want to use, and therefore be able to play other games than Doom 1 (IWAD files from commercial games running the same engine, or 3rd party IWAD files)
- support for the slightly different Doom 2 IWAD file format
- very early support for the more different Heretic IWAD file format

I'm quite proud of the IWAD compatibility : you can play most commercial games running the Doom raycasting engine : Doom, Ultimate Doom, Doom II Hell on Earth, the Final Doom Plutonia Experiment and TNT Evilution expansion packs, Chex Quest, Chex Quest 2 ...



>Could you tell me a little about the calculator you ported the game to? And What kind of specs are we talking? Maybe you could speak about the oldest, least advanced piece of technology you've gotten Doom to run on.

The monochrome TI-Nspire calculators ('2007 Clickpad, '2010 Touchpad) feature a 4bpp 320x240 grayscale screen, 32MB Flash ROM, 32MB SDRAM, and a 32-bits ARM CPU running between 90 and 120MHz depending on the operating system version. It can be overclocked to 150MHz.

The color TI-Nspire CX calculators from 2011 feature a 16bpp 320x240 color screen, 128MB Flash ROM, 64MB SDRAM, and a 32-bits ARM CPU running at 132 or 158MHz depending on the hardware version. It can be overclocked to 220-240MHz.

Note that there is another color calculator Doom port: CGDoom, released in June 2012 by MPoulpe, for the less powerful Casio fx-CG10/20 released early 2011.
The color Casio fx-CG10/20 calculators feature a 16bpp 396x224 color screen, 32MB Flash ROM, 2MB SDRAM, and a 32-bits SH-4 CPU running at 58MHz. It can be overclocked up to 260MHz.
This Doom port is much slower and it's highly advised to overclock the calculator.
It includes inferior support for Doom 1 and Doom 2 IWAD files. I didn't test all files, but Final Doom TNT Evilution doesn't work on it for example.



>Was it hard to do? Are there any hardware limitations to overcome, and how did you work around them? No need to get super-technical with this question, but if you could explain in summation, that would be cool.

I'm not saying it was easy, but I didn't run into difficult issues. If there were any, Mrakoplaz dealt with them in his initial port. The game runs smoothly on all TI-Nspire calculators, there's no need to overclock.

Monochrome TI-Nspire calculators have an unsolvable hardware limitation, though. Their probably passive LCD screen has significant ghosting. It makes playing games without a fixed background quite hard and unpleasant, as you literally can't see anything when moving.

(Another hardware limitation is for the Casio fx-CG10/20, which only feature 2MB SDRAM. That's quite low, and you have to perform many tricks to save space, like temporarily moving SDRAM data to the slower Flash ROM, which of course slows down the game)



>Is this the lowest Doom could go, or would it be possible to push it even more lo-fi?

Frankly, no idea :D
We all know that once in a while, someone does crazy, ground-breaking stuff. Perhaps this article can be a challenge ? ;)

--------------------

Resources if needed :
* Gameplay videos :
- monochrome TI-Nspire : https://www.youtube.com/watch?v=EfRKNXuRIho
- color TI-Nspire CX : https://www.youtube.com/watch?v=PGVUsYRVRbw
- color Casio fx-CG10/20 : https://www.youtube.com/watch?v=24gH-led9Rg

* Downloads :
- nDoom for TI-Nspire : https://tiplanet.org/forum/archives_voir.php?id=3889
- CGDoom for Casio fx-CG10/20 : https://tiplanet.org/forum/archives_voir.php?id=6054

I regret that the Mrakoplaz, author of the first calculator Doom port, was not mentionned in the final article.
An "Omnimaga developper group" is credited for it, when if I remember well there was no such group for the Nspire *monochrome* port as the code was 99% by Mrakoplaz, and let's say with 1% help from me around raycasting bugs.

Linking one of the original sources (Omnimaga or TI-Planet) instead of a 3rd party one could have been more accurate too. But I don't really mind, seeing what Omnimaga has become since late 2013.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: Dream of Omnimaga on May 17, 2016, 04:41:41 PM
It might be wise to tell the author about the authoring mistake, so people won't be misled. Many sites attributed nDoom to me when it first came out and people kept asking me when it would be finished or how to install it, because they thought I or the Omnimaga team made it. MRaklopaz never joined the Omnimaga team, he was just an active (and great) programmer who happened to contribute to the site.

That said, nDoom authorship changed since 2011, so it would be wise to also include you and whoever else ported it to the color calculators as successors to the project. Big blog articles tend to make that mistake of not attributing hobbyist projects to the right authors, so I can't blame them in particular. As for the source, it's a difficult thing since the project mostly moved to TI-Planet after MRaklopaz left, so while Omni was the original source, it's not the current one, so maybe they could have linked to both or left out Omni?

Also nice answers you have there. I didn't know you had an interview with the article author.


Also this is not related to nDoom in particular @critor but if you release softwares, then I discovered that it can be a bad idea to copyright or attribute your release under the name of the site or company you are in charge of, no matter how much you trust the rest of the team. Instead of (c) 20XX CompanyName - http://companyORpersonalsite.url you should use (c) 20XX Critor - http://companyORpersonalsite.url, else if you step down from that company then in a few years the company can forget who really made the software then take over ownership of the software as they see fit, something that sadly happened in the TI community in the past. It's fine if you include the company URL if it's not part of the copyright, though, plus even if it is then it will be seen as your official site at the time of the software release.
Title: Re: Ndless games might run from 3 to 50 times slower on TI-Nspire CX CR4 hardware
Post by: SiphonicSugar on May 17, 2016, 10:39:19 PM
This is why I am going to mass-producing the "dream calculator."