CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: Adriweb on October 18, 2015, 11:25:47 pm

Title: [ti-84+ce] Mandragore - Tilemap-based game for the CE, made in C
Post by: Adriweb on October 18, 2015, 11:25:47 pm
These last few days, Critor and I (well, I was just helping him a bit) have been working on a game for the TI-83 Premium CE / TI-84 Plus CE, "Mandragore", which is in fact originally a game from the 80s for computers like the C64 / ZX Spectrum / CPC etc.
In this game, you have to find your way around the map collecting things and visiting places.

(https://i.imgur.com/ajHOgDg.jpg) (https://tiplanet.org/forum/gallery/image_page.php?image_id=6027) (https://i.imgur.com/ha9ZOwP.jpg) (https://tiplanet.org/forum/gallery/image_page.php?image_id=6032)

Here's a Youtube Video (http://is.gd/97uzhs) of it in action (though not the latest version).

For better performance, the game uses the CE's LCD 8bpp mode and redraws only needed tiles. As you can see, there is no scrolling-lag as there would have been if made in pure-Basic (there is however the "standard" OS repeat-keys delay, which we'll probably fix later on).
What's "special" about this game is that it is, as far as we know, the first "big" thing written in C for the CE :) (We've had headaches working around ZDS' C language (≈ C89) compiler limitations...)
For that, Critor and I used TI-Planet's upcoming online C compiler (https://codewalr.us/index.php?topic=742.0), and its real-time multi-user editing feature proved immensly useful :D

Anwyay, it's available to download here : http://ti-pla.net/a328137
Of course, it's open-source so anyone can learn from it :) We ourselves have to thank MateoConLechuga (and possibly others?) for some 8bpp-related routines.

via https://tiplanet.org/forum/viewtopic.php?f=41&t=17421
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: DJ Omnimaga on October 18, 2015, 11:30:13 pm
I was wondering what was the story behind this game because on Google Hangout I noticed that your sprites only used a few colors similar to ZX Spectrum colors. I now have my answer :P

I hope the upcoming online C compiler will help the TI community produce games (and of course features an easy to access English version :) )

Also this news exacerbates the need for a TI-83 Premium CE/84+CE emulator, so that we can take proper screenshots.

(https://img.ourl.ca/critoradriwebrpg.png)

Good job Critor and Adriweb for porting this old game :). It reminds me of Ultima and Dragon Warrior.
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: Araidia on October 19, 2015, 02:30:04 pm
Awesome!
It's nice seeing new things for the TI84 Plus CE(since it's the only calculator I own)
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: Araidia on October 20, 2015, 06:40:08 pm
Does this require any other programs to be installed, such as CE Textlib?
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: DJ Omnimaga on October 20, 2015, 06:54:04 pm
CE Textlib is only for BASIC programs actually, while this game uses C. I don't know if it's nostub or requires a shell, though.
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: Adriweb on October 20, 2015, 08:08:47 pm
No, it requires nothing, just launch it with Asm(
(But you can launch it with Cesium or PHASM if you want, I guess)
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: p4nix on October 20, 2015, 08:27:44 pm
Seems that casio is much easier than TI :P You'll even have a fancy icon then instead to start it manually with Asm(
But anyway, cool stuff you are working on. I wonder how hard it is to get started with C on this calculator - programming on casio is quite easy because you already get a SDK.

/me runs
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: Adriweb on October 20, 2015, 08:40:32 pm
Quote from: p4nix on October 20, 2015, 08:27:44 pmSeems that casio is much easier than TI :P You'll even have a fancy icon then instead to start it manually with Asm(

Shells can provide you with icons too ;) (And things Noshell-like, like PHASM, make "Asm(" optional)

Quote from: p4nix on October 20, 2015, 08:27:44 pmBut anyway, cool stuff you are working on.

Thanks :)

Quote from: p4nix on October 20, 2015, 08:27:44 pmI wonder how hard it is to get started with C on this calculator - programming on casio is quite easy because you already get a SDK.

As hard as opening a page in your browser, if you use TI-Planet's online CE C compiler (when it's out) :P
It looks like this, for this code:
(https://i.imgur.com/HRd6FdU.png) (https://i.imgur.com/uoeVFGC.png)
So... you pretty much just have to code, see warnings and/or errors as you hit the build button, and try it out on your calc :)

An easy-to-setup/use emu side-by-side for debugging would be nice, too. Maybe one day... ?
But the current TODO/WISH list has already several things to take care of (multi-files projects is a big thing in the list...)
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: p4nix on October 20, 2015, 08:49:36 pm
Oh, forgot about that great online tool. But what would you have to do in order to do it offline?
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: Adriweb on October 20, 2015, 08:55:49 pm
Quote from: p4nix on October 20, 2015, 08:49:36 pm
Oh, forgot about that great online tool. But what would you have to do in order to do it offline?

Basically, set up ZDS as described here (https://www.cemetech.net/forum/viewtopic.php?p=235931#235931).
The include file is available here: http://wikiti.brandonw.net/index.php?title=84PCE:OS:Include_File
For work on ASM/C libs, see Mateo's files (posted here and there)
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: Lionel Debroux on October 21, 2015, 05:25:42 am
And the parts of the code not directly related to TI-Planet integration, which were derived from the resources Adriweb has linked to, will be open source.
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: DJ Omnimaga on October 21, 2015, 05:27:35 am
Quote from: Adriweb on October 20, 2015, 08:40:32 pm
Quote from: p4nix on October 20, 2015, 08:27:44 pmSeems that casio is much easier than TI :P You'll even have a fancy icon then instead to start it manually with Asm(

Shells can provide you with icons too ;) (And things Noshell-like, like PHASM, make "Asm(" optional)

Quote from: p4nix on October 20, 2015, 08:27:44 pmBut anyway, cool stuff you are working on.

Thanks :)

Quote from: p4nix on October 20, 2015, 08:27:44 pmI wonder how hard it is to get started with C on this calculator - programming on casio is quite easy because you already get a SDK.

As hard as opening a page in your browser, if you use TI-Planet's online CE C compiler (when it's out) :P
It looks like this, for this code:
(https://i.imgur.com/HRd6FdU.png) (https://i.imgur.com/uoeVFGC.png)
So... you pretty much just have to code, see warnings and/or errors as you hit the build button, and try it out on your calc :)

An easy-to-setup/use emu side-by-side for debugging would be nice, too. Maybe one day... ?
But the current TODO/WISH list has already several things to take care of (multi-files projects is a big thing in the list...)
Another thing that TI has over Casio is that a Flash app with zero bytes of code in it will not take 29 KB by default  like on the Casio fx-CG20 :P
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: critor on October 26, 2015, 01:24:16 pm
Did you reach the end ? ;)
My best play is in 1086km :
(https://tiplanet.org/forum/gallery/image.php?mode=thumbnail&image_id=6033) (https://tiplanet.org/forum/gallery/image_page.php?image_id=6033)

I don't know if it's the shortest way.
So in order to help you and still give you some place for enhancements, here's a non optimal youtube walkthrough in 1092km :
http://www.youtube.com/watch?v=J3FktZ2nF54

The official map may help you too :
(https://i.imgur.com/uT9Qcmjm.png) (https://i.imgur.com/uT9Qcmj.png)
Title: Re: "Mandragore" - Tilemap-based game for the CE, made in C
Post by: DJ Omnimaga on October 29, 2015, 06:47:02 am
I was surprised that every step represented 1 Km. I guess that's due to the map being a world map lol. I thought it took like 25-30 steps before reaching 1 km, if not more. I wonder if this game engine could be expanded into a full game?

The Reign of Legends 3 had a step counter as well, but since that game also had battles that involved grinding and lots of searching around in dungeons, the step counter would usually reach 15000 near the end (I once hacked my save file to have 99 levels and all spells from the start and still reached 10000). IIRC Final Fantasy III or VII had one too and it went very high. I can't imagine walking this much in real life for some adventure while carrying this much equipment XD
Title: Re: Mandragore - Tilemap-based game for the CE, made in C
Post by: critor on February 26, 2016, 08:46:01 pm
Here's the full map of the Mandragore kingdom :
(https://codewalr.us/proxy.php?request=http%3A%2F%2Fi.imgur.com%2Fyqpmztcm.png&hash=ea5b471cf916db6c4ee2272bc204e9ee) (http://i.imgur.com/yqpmztc.png)

Yes, all this fits in your calculator. ;)
Title: Re: [ti-84+ce] Mandragore - Tilemap-based game for the CE, made in C
Post by: Dudeman313 on February 26, 2016, 08:56:50 pm
I gave up on this game because I got lost. :P Thank you!
Title: Re: Mandragore - Tilemap-based game for the CE, made in C
Post by: DJ Omnimaga on March 05, 2016, 06:43:39 pm
I like those big maps :D. Also I beat the game a while ago. As mentiones before, an RPG using that map would be nice. It would be like an enhanced version of Mandragore.
Title: Re: [ti-84+ce] Mandragore - Tilemap-based game for the CE, made in C
Post by: Dudeman313 on March 05, 2016, 06:55:35 pm
Quote from: DJ Omnimaga on March 05, 2016, 06:43:39 pm
I like those big maps :D. Also I beat the game a while ago. As mentiones before, an RPG using that map would be nice. It would be like an enhanced version of Mandragore.

I think so too, but to make it an RPG, maybe you might be able to actually enter and explore the towns that have actual buildings, and maybe scale the overall map down and add side quests....I have the best ideas for these things..... :blah:
Title: Re: Mandragore - Tilemap-based game for the CE, made in C
Post by: critor on March 05, 2016, 07:00:44 pm
It hasn't been newsed about yet, but you can clone the Mandragore project on TI-Planet, and rebuild it online. :)
https://tiplanet.org/pb/?id=2043_1456696956_3aafc2954b

So it's quite easy to customize the game as you want starting from this working project.

Code is under GPL, so feel free to learn and create ! :D
Title: Re: Mandragore - Tilemap-based game for the CE, made in C
Post by: Adriweb on March 05, 2016, 07:02:16 pm
(warning: the toolchain is going to be updated soon, so a few things will have to change - well especially for upcoming programs)
Title: Re: [ti-84+ce] Mandragore - Tilemap-based game for the CE, made in C
Post by: Dudeman313 on March 05, 2016, 07:06:41 pm
Quote from: critor on March 05, 2016, 07:00:44 pm
It hasn't been newsed about yet, but you can clone the Mandragore project on TI-Planet, and rebuild it online. :)
https://tiplanet.org/pb/?id=2043_1456696956_3aafc2954b

So it's quite easy to customize the game as you want starting from this working project.

Code is under GPL, so feel free to learn and create ! :D

Oh, okay. What's GPL?
And must I make a TI-Planet account to clone it? I don't have a Facebook, and as I don't know French, I
really don't spend much time there, except to look thru the CE archives.
Quote from: Adriweb on March 05, 2016, 07:02:16 pm
(warning: the toolchain is going to be updated soon, so a few things will have to change - well especially for upcoming programs)
That's good to know.  :)
Title: Re: Mandragore - Tilemap-based game for the CE, made in C
Post by: critor on March 05, 2016, 07:24:12 pm
The TI-Planet interface should be shown to you in english, if your browser reports your prefered langage is not french.
If not, add &lang=en at the end of the url.

Yes, you'll have to register, as the cloned project needs to be linked to an account.

GPL is a widely used free software license, granting you the right to run, study, share, and modify the source code.
Title: Re: Mandragore - Tilemap-based game for the CE, made in C
Post by: Adriweb on March 05, 2016, 07:26:18 pm
At some point, I'll see about non-logged-in access, but that will have less features because things cannot be linked to an account (for saving etc.)
Title: Re: Mandragore - Tilemap-based game for the CE, made in C
Post by: DJ Omnimaga on March 11, 2016, 07:22:41 am
Nice news Critor. As for my idea, it would not necessarily require new maps for villages, as it could simply be like Illusiat 6 through 12, where villages are just a menu letting you go to the inn, shop, sometimes talk to one or two NPC in there and exit. Some NPC's could give you keys and stuff to access new dungeons after you completed the others. Dungeons would obviously be new maps. Battles would just be like Dragon Warrior (after all, the world map looks very similar to Dragon Warrior)
Title: Re: [ti-84+ce] Mandragore - Tilemap-based game for the CE, made in C
Post by: Dudeman313 on March 11, 2016, 02:19:09 pm
Sounds good to me! :D