Join us on Discord!
You can help CodeWalrus stay online by donating here.

CE Textlib tilemapping hack and April Fools Wolfeinstein 3D prank

Started by Dream of Omnimaga, April 01, 2016, 11:09:29 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dream of Omnimaga

In August 2015, DrDnar released CE Textlib, an ASM library to enhance TI-BASIC programs that uses home screen text, by allowing colors in them and drawing rectangles that can be between 1x1 and 26x10 characters large. It featured chaining, so that multiple commands could be called from 1 single Asm(prgmTEXTLIB instruction, to minimize VAT-searching lag.

However, in March 2016, I discovered that CE Textlib did not check if you tried drawing rectangles outside the home screen boundaries or larger than 26x10 characters and also looped through the screen. By abusing this, the rectangles could also be made not aligned with the Output() grid. Because of the chaining feature, this allowed me to make a tile-mapper with actual sprites in BASIC without Doors CE 9 and with good speed, which eventually became First Fantasy II:



What follows is an April Fools joke with a fake Wolfeinstein 3D CE Textlib animated screenshot, but the tilemapper above is actually real:

But this was just the beginning, because by taking advantage of how fast CE Textlib can draw multiple rectangles at once, I decided to attempt taking CE Textlib one step further, so I started learning 3D and raycasting. After much hassle, especially this evening,  I have finally managed to achieve something previously thought impossible in hybrid BASIC: Wolfeinstein 3D CE!


Currently, this clone of the popular 1993 first-person shooter supports shooting and wall collision, but ammo doesn't work, green doors have no animation (they open instantly) and there is no enemy nor power-ups. Also, for speed reasons the entire screen is erased then redrawn every frame, so some flickering might be noticed from time to time. The walls are drawn using 18 vertical rectangles and the only way to eliminate the flickering would be to update the floor and ceiling using 36 small rectangles, which would be much slower than erasing everything with just one.

While this looks nowhere as good as the real game and that much better graphics could be achieved in C or ASM, I wanted to show off how far CE Textlib limits could be pushed. Unlike First Fantasy II, Wolfeinstein 3D CE isn't available for download yet, as it still needs polishing, but hopefully it can end up into an actual game in the near future!

Doors CE 9 rectangle commands will support chaining. If such speed can be achieved with a non-hook-based library in a raycaster, imagine how fast it would be with xLIBCE chained rectangles.


</End of April fools prank>


However, TI-BASIC raycasting was actually attempted before, by Axcho from United-TI, who released Ionquest Demo in 2004:
http://www.ticalc.org/archives/files/fileinfo/349/34947.html

It runs at 1.5 FPS on a TI-84 Plus CE and could be modified to use CE Textlib or even xLIBCE's chained rectangle commands for faster speed. The April 1st prank above was inspired from his 3D game. Also, pseudo 3D racing games would definitively be possible with CE Textlib, since an xLIB Outrun clone was attempted before for the TI-84 Plus SE, but the graphics quality would probably be on-par with the fake Wolfeinstein 3D screenshot.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

novenary


aetios

A bit choppy, but wow that really shows off the capabilities of the CE. Imagine if that was written in C *.*
ceci n'est pas une signature

Dudeman313

Quote from: aeTIos on April 01, 2016, 11:44:38 AM
A bit choppy, but wow that really shows off the capabilities of the CE. Imagine if that was written in C *.*
Yeah, that is pretty cool! Nice utilization of  the CE's  potentials.
  • Calculators owned: TI-84 PCE
  • Consoles, mobile devices and vintage computers owned: Android O Phone
Does this qualify as a signature? 
The answer is "Sure."


p4nix

DJO, you have been chosen to be the official BASIC-god-ninja-wizard from now on... Raycasting in basic... oh my god...
  • Calculators owned: fx9860GII (SH4)

c4ooo


p4nix

He got me :D
EDIT: Totally confused now.
  • Calculators owned: fx9860GII (SH4)

aetios

Quote from: c4ooo on April 01, 2016, 01:35:20 PM
Obvius april fools joke is obvious.
I actually don't think so, DJ has been working on this for some time already and he once showed me an early beta via telegram.
ceci n'est pas une signature

tr1p1ea


Dream of Omnimaga

Quote from: c4ooo on April 01, 2016, 01:35:20 PM
Obvius april fools joke is obvious.
You should download the FFII demo in the other topic. Even with more rectangles to draw it still runs at decent speed.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Dream of Omnimaga

On a side note, because of how CE Textlib works, I think I might be able to implement special effects such as when you take damage, the screen would flash to a red-ish hue and when picking up items it would flash to green. I have dynamic color palette support in FFII and since Wolfeinstein 3D only draws 1 set of rectangle in the screen (vs 48 for FFII), I can change colors in real time.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

critor

Wow.

PrimeCaster 3D written in Basic for the much more powerful HP Prime looks very slow in comparison :
https://tiplanet.org/forum/viewtopic.php?t=15033

Calculator :


Software : (faster, thus using smaller rays)


I was sure I had made as much optimisations as I could and it couldn't be improved further... seems I was wrong.

Dream of Omnimaga

Well, to be fair, your raycaster actually supports variable walls height and stairs, which isn't the case of mine. :P
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Dudeman313

Didn't Ben R. 's Nostromo have flying and stuff, and still run pretty fast?
  • Calculators owned: TI-84 PCE
  • Consoles, mobile devices and vintage computers owned: Android O Phone
Does this qualify as a signature? 
The answer is "Sure."


Dream of Omnimaga

That was not a raycaster, plus it was written in ASM.
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U

Powered by EzPortal