* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: CE Textlib tilemapping hack and April Fools Wolfeinstein 3D prank  (Read 1740 times)

0 Members and 1 Guest are viewing this topic.

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17499
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
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.
« Last Edit: April 02, 2016, 07:14:01 am by DJ Omnimaga »


  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Streetwalrus

  • Professional slacker
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Israel
  • Posts: 2791
  • Post Rating Ratio: +20/-0
  • ƎW∀⅁ ƎH⊥
    • View Profile
  • Gender: Male
This looks amazing, great job DJ. :D
  • Calculators owned: TI-80, HP 40G, TI-84 Plus rev G (yay 128k RAM), TI-83 Plus Silver Edition (broken LCD), TI-82 Stats.fr (black), TI-Nspire CX rev C (yay Nlaunchy), TI-83+ SE ViewScreen

Offline aeTIos

  • Dabbler in C
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Original 5
  • Join Date: Nov 2014
  • Location: Ede, NL
  • Posts: 994
  • Post Rating Ratio: +12/-0
  • hi
    • r_vdijk
    • /u/aetios
    • aetios
    • View Profile
  • Gender: Male
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

Offline Jkolade936

  • All Around Coolio
  • Super User
  • Join Date: Jan 2016
  • Location: Horseheads, NY
  • Posts: 1515
  • Post Rating Ratio: +9/-1
  • I'm an unknown loner. I try to change that.
    • Jkolade936
    • View Profile
    • My Sprites and Walrii Collection
  • Gender: Male
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: None of them. :'(
Does this qualify as a signature? 
The answer is "Sure."


Offline p4nix

  • Full User
  • Join Date: Jun 2015
  • Location: Germany
  • Posts: 402
  • Post Rating Ratio: +6/-1
  • Don't catch the ball.
    • p4nix
    • View Profile
  • Gender: Male
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)

Offline c4ooo

  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  • Super User
  • CW Contest II Winner
  • *
  • Join Date: Aug 2015
  • Location: 127.0.0.1
  • Posts: 836
  • Post Rating Ratio: +7/-2
  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
    • View Profile
  • Gender: Male
Obvius april fools joke is obvious.
??? ??? ???

Offline p4nix

  • Full User
  • Join Date: Jun 2015
  • Location: Germany
  • Posts: 402
  • Post Rating Ratio: +6/-1
  • Don't catch the ball.
    • p4nix
    • View Profile
  • Gender: Male
He got me :D
EDIT: Totally confused now.
« Last Edit: April 01, 2016, 03:19:44 pm by p4nix »
  • Calculators owned: fx9860GII (SH4)

Offline aeTIos

  • Dabbler in C
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Moderator
  • Original 5
  • Join Date: Nov 2014
  • Location: Ede, NL
  • Posts: 994
  • Post Rating Ratio: +12/-0
  • hi
    • r_vdijk
    • /u/aetios
    • aetios
    • View Profile
  • Gender: Male
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

Offline tr1p1ea

  • Full User
  • Join Date: Feb 2015
  • Location:
  • Posts: 218
  • Post Rating Ratio: +4/-1
    • View Profile
Very elaborate AF's ... I think it looks great :).

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17499
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17499
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
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-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline critor

  • Full User
  • Join Date: Dec 2014
  • Location:
  • Posts: 160
  • Post Rating Ratio: +6/-0
    • View Profile
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.
« Last Edit: April 01, 2016, 09:40:00 pm by critor »

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17499
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Well, to be fair, your raycaster actually supports variable walls height and stairs, which isn't the case of mine. :P
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Jkolade936

  • All Around Coolio
  • Super User
  • Join Date: Jan 2016
  • Location: Horseheads, NY
  • Posts: 1515
  • Post Rating Ratio: +9/-1
  • I'm an unknown loner. I try to change that.
    • Jkolade936
    • View Profile
    • My Sprites and Walrii Collection
  • Gender: Male
Didn't Ben R. 's Nostromo have flying and stuff, and still run pretty fast?
  • Calculators owned: None of them. :'(
Does this qualify as a signature? 
The answer is "Sure."


Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17499
  • Post Rating Ratio: +83/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
That was not a raycaster, plus it was written in ASM.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games