Terrario, a Terraria rewrite for the calculator
Posté le 10/07/2020 16:05
2021 Casio Awards winner, thanks everyone!
Hi. I noticed a while ago there weren't any games like Terraria or Minecraft available for Casio calculators. For the past while I've been working on rewriting Terraria in C for the SH4 calculators using gint. I'm not sure when if ever I'll finish it, since it is a fairly big project, so I've decided to put it here for now.
Here are a few screenshots of the progress so far (some may be out-of-date):
Main menu
Gameplay
Inventory
Crafting
Equipment
A visualisation of a generated world (click for full detail)
The game runs at 30FPS. Worlds are 1000x250 tiles large (640x250 on the 35+E II / GIII).
The control scheme and a crafting guide can be found in the game's About menu.
This forum page is updated regularly with the latest release of the game, as well as a changelog in the comments.
If you aren't sure what an item does, feel free to search it up on the
official Terraria wiki.
Most recent update:
Jungle and a bunch of content.
Up next:
Who knows?
The attached file contains the latest build of the game, as well as instructions and a screenshot compiling script and map tool.
The source code repository as well as early builds of the game can be found at
this GitHub repo and
its Gitea mirror. Obviously, expect bugs in these early builds, though I take care to remove the major ones I find before releasing.
Due to the very large world, the save files for this game are big. Make sure you have at least 450kB of storage space before installing the addin (300kB on Graph 35+E II), and try to keep at least 300kB free afterwards. Tampering with the files in the TERRARIO folder will corrupt the save, so don't do that. The game will warn you if you have low storage space available, so that you can optimise your storage.
NOTE: You must have a Graph 35+ E, Graph 35+E II, fx9860GII, or fx9750GIII model calculator to run this game.
Fichier joint
Citer : Posté le 20/10/2020 19:27 | #
Probablement un problème de gint en toute honnêteté, je n'ai pas de Graph 85 donc jamais pu faire un portage complet. Si tu as du temps pour faire un test complet et qu'on voie s'il y a des soucis, hésite pas à faire un tour sur le topic de gint.
Citer : Posté le 20/10/2020 19:30 | #
Probablement un problème de gint en toute honnêteté
Pas sur car je crée un add-in sur Gint et il passe très bien sur la calculatrice !
Citer : Posté le 20/10/2020 20:14 | #
Which version of the game are you testing?
Does the error appear immediately?
Terrario uses gint functionality that the tutorial game doesn't, it's possible there is a fatal bug there. Additionally, since your calculator is an SH3 model it's possible that the older versions will just crash instead of showing a menu saying it can't run.
Citer : Posté le 20/10/2020 20:40 | #
Tous les bugs ne sont pas déterministes, mais je suis content d'apprendre que les bases marchent ! On m'a dit cependant qu'il y avait des problèmes de retour au menu.
Oh that's right. Quick reminder of SH3 limitations in terms of memory:
• Only 8k of static RAM; no ILRAM, XRAM, YRAM or SPU memory
• Not always a 256k-half-RAM available at 88040000
• Pretty small heap (48k I believe)
Citer : Posté le 24/10/2020 16:49 | # | Fichier joint
Update:
- Completely overhauled the about menu
-- Has a tab for credits and build info
-- Has a tab for control info
-- Has a tab for a crafting recipe guide
- Added a splash screen on startup
- Added vines and doors, as well as surface tunnels
- Made zombies and slimes a bit smarter
- A few bug fixes.
Citer : Posté le 26/10/2020 04:09 | #
Wow! This looks really amazing!
I tried running it on my 9750GIII and go this error: Mem alloc returned NULL! Please report this bug.
You mentioned running it in an emulator. Is that the one in the Casio's SDK or something different?
Citer : Posté le 26/10/2020 04:33 | #
That's rather strange, we solved that problem before. Is this on the latest build, and does it happen directly when starting the game?
I'm planning using recent developments to change the world system in a way that will make the addin compatible with 9750GIII models by default, so any problems like this should be solved soon.
Citer : Posté le 26/10/2020 05:13 | #
It happens with the file posted on 10/24. I get as far as the menu screen then get the error when I selected New Game.
Citer : Posté le 26/10/2020 05:29 | # | Fichier joint
Could you try the attached build? World gen will probably be very messed up due to the tiny world size but it should work.
Citer : Posté le 26/10/2020 05:35 | #
Same problem. I reset the calculator too.
Citer : Posté le 26/10/2020 05:52 | # | Fichier joint
Alright, one size smaller. This one runs on my 9860GII so I'd be very surprised if it didn't work on your 9750GIII.
Citer : Posté le 26/10/2020 08:17 | #
Can confirm same error on my 9750GII
Citer : Posté le 26/10/2020 09:03 | #
Last version (05:52) runs on my Graph 35+E II by the previous one (05:29) fails with an alloc error when trying to load the world (it does boot up).
Citer : Posté le 26/10/2020 09:25 | #
I'm moving allocated buffers used during world generation to the XRAM, which should fix the problem in the next release (if I haven't moved the world to SPU RAM by then).
Ajouté le 26/10/2020 à 09:44 :
I'll move the world on Graph 35+E II / fx9750GIII models to the PRAM, where it'll still be smaller than the world on the Graph 35+ E / fx9860GII but it will avoid the fragmented heap. These changes mean the heap will only be used for runtime buffers such as chests and entities.
Citer : Posté le 26/10/2020 16:00 | #
I was able to malloc three 10k of chunks of memory and thirty 1k chunks with the Casio SDK, but haven't figured out how to malloc with gint yet. Maybe that kind of test on each model would be useful?
Citer : Posté le 26/10/2020 16:02 | #
gint does not provide a separate heap implementation, it just wires the malloc/free functions currently exposed in <gint/std/stdlib.h> to the corresponding SDK functions (because there's no other robust way to use that area anyway).
The amount of memory you got doesn't really fit with what we know about the GIII series. Specifically, the heap size was raised to 90k when adding Python. You can normally see that on one of the hidden menus but the key combination was changed or removed so we don't have access to it right now.
Citer : Posté le 26/10/2020 16:19 | #
gint does not provide a separate heap implementation, it just wires the malloc/free functions currently exposed in <gint/std/stdlib.h> to the corresponding SDK functions (because there's no other robust way to use that area anyway).
10148 chunks of 1k eachas predicted.What's the downside to using the built in malloc? I know you can reach fragmentation without a virtual memory system, but that is manageable if malloc is otherwise reliable. Maybe it makes sense to grab a huge chunk once with malloc (if it lets me) and manage it myself?
Citer : Posté le 26/10/2020 17:41 | #
Actually this is just a placeholder stdlib.h, gint as a kernel does not provide a standard library. Until now I've coded in the needed functions but I don't feel this is the right way to go around this problem. There's been a newlib port but with some issues and currently no maintainer. Recently we felt like sharing existing and missing libc code, so I hope this will be resolved soon into a proper libc support.
There's no specific downside to using the system's malloc (it works) but there are downsides to relying on it. There are many known problems about the allocator. There is a lot of fragmentation going on, you can't always allocate large blocks even at the start of an add-in (as you've seen), and even with smaller objects it ends up too fragmented to reliably use infinitely. Which sounds like a best-fit to be honest. xD
Yes you could do that and I would support this approach if only there was any guarantee for what you can allocate at the start of the add-in. Maybe it's still worth it if you get 4 blocks and manage 4 pools with a robust malloc. I would be interested to see how this would turn out.
Citer : Posté le 28/10/2020 12:10 | #
Quick sitrep:
Major under-the-hood changes. The next update (fingers crossed, should be coming out in a few days) will have a single build that works on both models, through the hard work of Lephenixnoir and Yatis documenting the SPU present on the Graph 35+E II / fx9750GIII. SH3 support is also firmly and permanently ended.
Citer : Posté le 01/11/2020 10:42 | # | Fichier joint
Update:
- There is now only one build for both models
- Due to usage of a new RAM resource, worlds on the Graph 35+E II / fx9750GIII can now be 640x250 tiles large
- Added underground cabins (with empty chests as there isn't any loot in the game right now)
- Made the surface generation a bit better and vines not as aggressive
- Updated the map tool to generate vines and trees
- Added a progress bar to world generation.
Citer : Posté le 03/11/2020 23:50 | #
Thanks for the update. I can confirm that it loads and runs on my fx-9750GIII. The rolling flash of the LCD is pretty noticeable. though I don't have anything to compare it to. Keep the updates coming!