π
<-

"Journey in Odessia", un nouveau jeu RPG en Nspire Lua !

:32tins: :32tinsktpb: :32tinsktpn: :32tinscas: :32tinstpkc: :32tinstpktpb: :32tinstp: :32tinscastp: :32tinscmc: :32tinscx: :32tinscxcas:

"Journey in Odessia", un nouveau jeu RPG en Nspire Lua !

Unread postby Adriweb » 21 Jun 2023, 10:50

De nos jours, les jeux programmés en Lua pour TI-Nspire se font de plus en plus rares (malheureusement !), mais nous avons de temps à autre de jolies surprises de la part de la communauté… ;)

Aujourd'hui, c'est le cas, et nous avons l'honneur de te parler d'un jeu qui est sorti il y a peu, "Journey in Odessia", par Raymond Nirnberger, un ingénieur logiciel californien qui a profité de son temps libre pendant le Covid pour revenir sur la programmation sur calculatrice comme au lycée, mais cette fois ci avec le dernier modèle haute-gamme de TI, la Nspire CX II :)

Au sein d'un RPG tour-par-tour décrit comme "au style japonais" (cf. Pokémon, Breath of Fire.. sur GameBoy), tu dois sauver une princesse, combattre des monstres, tout en amassant de l'expérience et bien sûr de l'or.

Le jeu se présente en noir et blanc / 1-bit, avec du texte, des images, sprites, décors variés…
Il y a véritablement eu un gros travail sur le graphisme :bj:

On évoluera dans 150 scènes/cartes, ce qui en fait probablement un des plus gros jeux disponibles sur TI-Nspire… d'ailleurs, n'hésite pas à nous dire combien de temps il aura fallu pour terminer le jeu ;)

Dans sa présentation du jeu, Raymond insiste sur l'envers du décor, en précisant que ce qu'il y a aussi d'intéressant, c'est comment le jeu a été programmé, notamment pour le moteur de jeu. En fait, il a créé un outil en C# qui prend des bitmaps et les convertit en appels d'API, avec du code Lua stocké dans des fichiers JSON. D'après les dimensions de l'écran accessible au script sur machine (318x212), il y a eu une découpe en 6x 53*53 carrés de pixels pour le côté horizontal et 4x 53*53 carrés de pixels pour le vertical. Des optimisations de rendus sont ensuite faites, comme par exemple pour savoir quelle couleur domine la scène actuelle afin de choisir le blanc ou le noir comme couleur de fond et changer les pixels individuels par dessus par la suite.

Le code source Lua est disponible :)

L'auteur nous partage ci-dessous (en Anglais) des détails techniques dans l'histoire du développement du jeu
The author shares the story (in English) of the development of his game, in technical details, below:
Raymond Nirnberger wrote:
Show/Hide spoilerAfficher/Masquer le spoiler
Journey in Odessia (How it started):

My name is Raymond Nirnberger, and I am a software engineer in Los Angeles, California. I started this project in 2020 when I got furloughed to one day a week at my job that I had with a solar company. Covid hit the business really hard, and the economy was essentially shut down. The company had zero revenue and was bleeding money left and right. I felt disappointed in the furlough, but I suppose it made sense to a certain degree. A positive effect of the furlough was that I had a lot of free time and was reminiscing back to playing games on my TI graphing calculator in high school. I was impressed with the CPU and RAM specs of the TI-Nspire CX II model. I went ahead and bought it for around $150.

When I went to ticalc.org, I saw that most of the Nspire games were compiled to native ARM, and that they required a jailbreak exploit in the OS and could only be run on the Ndless hacked OS. Ndless only runs on older models. I didn’t like that the ability to play games and run native ARM programs would be dependent on when you bought the calculator. The TI Nspire comes with a Lua programming documentation manual, and there were a few items that (when combined) would allow me to make my Japanese style retro RPG. These programming API methods were the following: gfx:setColorRGB, gfx:drawString, gfx:fillRect, gfx:drawRect

What would allow transitions/animations/…. on.timer

It was at that point that I had a lightbulb moment. Technically, that’s all I would need to build the kind of game that I wanted. With the right tools, I could allow the game to run on any calculator without jailbreaks or exploits. Texas Instruments wouldn’t be able to kill my game without killing an advertised feature: the stripped down Lua interpreter that is widely used. If you give me the ability to write text, and fill a rectangle with black or white pixels, you’ve essentially given me all that I need.

=========================

Journey in Odessia (Tooling and how it was built):

I’m a huge fan of C#. I enjoy using Visual Studio, which in my opinion is one of the best tools available for programmers. Essentially, this is how the development process worked:

The working area of the Nspire CX II’s is 318 x 212 pixels. A common denominator of 318 and 212 is 53 x 53. This gives the game a working area of 6 horizontal tiles and 4 vertical tiles (the tiles are 53 x 53 pixel images). I used Adobe Photoshop to stitch together maps with these tiles. There are currently 150 scenes in the game, and more are planned.

In the code, each scene contains a folder with all tiles that are used in the scene, and a collection of tiles that are “forbidden”. Forbidden, in this case, means that you cannot walk into a certain object (no walking into trees, buildings, etc).

There is also a folder containing all assets used in the game. The crazy part:

I wrote a C# console/terminal program that scans each scene’s .bmp file. Each pixel in the .bmp file is exclusively black or exclusively white. The code scans each tile and asks itself: Are there more black pixels than white pixels? If so, fill the whole tile black, and then only draw the white pixels.

It then re-scans the scene’s .bmp file and maps each 53 x 53 pixel square to one of the tiles found in the assets folder. To be clear, a tile is a 53 x 53 pixel tree, rock, wall, etc.

During the re-scan, it writes each asset/tile to a set of colored coordinates. It then draws each tile on the screen and adjusts when you walk left/right/up/down, etc. Each 53 x 53 pixel area on the screen is mapped to a function pointer. In Lua, functions are first-class variables and can be referenced in such a way.


For performance improvements, the game does the following:

When you enter a scene/map, it scans to see which tile occurs the most. It then, upon loading, sets all the tiles to the one tile that is found the most, and then re-maps the 2nd most-found, 3rd most-found, 4th most-found, etc tiles properly.

There is much more that can be said about the development process for this game, but for now I think I’ve become verbose enough.


Téléchargement: archives_voir.php?id=3274531

Source/topic original: viewtopic.php?f=17&t=26215

MyCalcs: Help the community's calculator documentations by filling out your calculators info!
MyCalcs: Aidez la communauté à documenter les calculatrices en donnant des infos sur vos calculatrices !
Inspired-Lua.org: All about TI-Nspire Lua programming (tutorials, wiki/docs...)
My calculator programs
Mes programmes pour calculatrices
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 79%
 
Posts: 14749
Images: 1119
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
MyCalcs profile
Twitter: adriweb
GitHub: adriweb

Return to News TI-Nspire

Who is online

Users browsing this forum: No registered users and 10 guests

-
Search
-
Social TI-Planet
-
Featured topics
Grand Concours 2024-2025 - Programmation Python
Comparaisons des meilleurs prix pour acheter sa calculatrice !
"1 calculatrice pour tous", le programme solidaire de Texas Instruments. Reçois gratuitement et sans aucune obligation d'achat, 5 calculatrices couleur programmables en Python à donner aux élèves les plus nécessiteux de ton lycée. Tu peux recevoir au choix 5 TI-82 Advanced Edition Python ou bien 5 TI-83 Premium CE Edition Python.
Enseignant(e), reçois gratuitement 1 exemplaire de test de la TI-82 Advanced Edition Python. À demander d'ici le 31 décembre 2024.
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
12345
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1284 utilisateurs:
>1219 invités
>58 membres
>7 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)