π
<-
Chat plein-écran
[^]

"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 !

Message non lude Adriweb » 21 Juin 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 a écrit:
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
Image

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...)
Avatar de l’utilisateur
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Prochain niv.: 80.3%
 
Messages: 14617
Images: 1218
Inscription: 01 Juin 2007, 00:00
Localisation: France
Genre: Homme
Calculatrice(s):
MyCalcs profile
Twitter/X: adriweb
GitHub: adriweb

Retourner vers News TI-Nspire

Qui est en ligne

Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 164 invités

-
Rechercher
-
Social TI-Planet
-
Sujets à la une
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Aidez la communauté à documenter les révisions matérielles en listant vos calculatrices graphiques !
Phi NumWorks jailbreak
123
-
Faire un don / Premium
Pour plus de concours, de lots, de tests, nous aider à payer le serveur et les domaines...
Faire un don
Découvrez les avantages d'un compte donateur !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partenaires et pub
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
1831 utilisateurs:
>1815 invités
>12 membres
>4 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)
-
Autres sites intéressants
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)