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

Advice for BASIC

Started by xMarminq_, November 17, 2016, 03:55:55 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xMarminq_

Should someone like me who is making his first BASIC program separate it into bits that run as one or just one big program?
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

SiphonicSugar

Bits, it keeps it more organized ,and less likely to slow down.
  • Calculators owned: TI-89, TI-84 Plus, TI-92, TI-84 Plus C SE, and TI-Nspire CAS with Touchpad
I'm just trying to grab some inspiration. :P

xMarminq_

How would I do that exactly?
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

SiphonicSugar

Oh gosh, lets see... It actually depends on how large the program is, if its a medium to large game, you should make different parts, but not for small things.
  • Calculators owned: TI-89, TI-84 Plus, TI-92, TI-84 Plus C SE, and TI-Nspire CAS with Touchpad
I'm just trying to grab some inspiration. :P

xMarminq_

Planning for a huge 25k game.
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

SiphonicSugar

Oh, so say you have the movement engine, then the battle engine, all in 2 different programs.

PROGRAM:MOVEMENT
code
If battle is going to start
prgmBATTLE
code

PROGRAM:BATTLE
code
  • Calculators owned: TI-89, TI-84 Plus, TI-92, TI-84 Plus C SE, and TI-Nspire CAS with Touchpad
I'm just trying to grab some inspiration. :P

xMarminq_

Ill try a huge iceberg and the try to break it into icecubes
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Unicorn

Quote from: xMarminq_ on November 17, 2016, 04:05:18 AM
Planning for a huge 25k game.
Is this your first TI BASIC game? If so, I suggest not attempting to write some sort of huge RPG or something, but starting off with something a bit smaller, like a small shooter or something.

I'm not sure if DJ has already said this, but my advice ;)
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

p2

theres actually no real problem to pure filesize in basic but when you program grows and grows you'll come to the point where you actually have to abandon the project as it grows way too slow which isreally sad after coming all that way...
thats actually the reason many of us stop programmign at all as its too frustrating.
you should see basic as training on how to create programs in general as real games (REALLY BIG ones I mean) will then be developed in other languages.
but that doesnt mean you should stop that project, it's great for learning ;) also the game might actually be fun ^^
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

xMarminq_

Thanks! Should be done with some part of he game soon!
  • Calculators owned: Ti-84 Plus CE, Ti-84 Plus (can be borrowed from my school)
I don't associate with associations

Dream of Omnimaga

Quote from: SiphonicSugar on November 17, 2016, 03:59:38 AM
Bits, it keeps it more organized ,and less likely to slow down.
Not necessarily. If your game has few sub-programs then it doesn't make a difference, but for large games with dozens of them, the slowdown can be significant. Metroid II 84+ ran at 4 FPS during early development, only to slow down at 2 FPS near the end, even without any change to the map engine.


However, sub-programs or sub-routines are inevitable if you want to avoid code repetition and I really recommend splitting your game into small sub-programs if you're developing it on-calc, as it will take less time to scroll through the code.

Also once you improve at TI-BASIC, read about Internal sub-programs http://tibasicdev.wikidot.com/subprograms

Internal sub-programs is a trick involving Goto where Goto is pretty much used as a Call command, but you have to keep the sub-routines code as high as possible in the game code to avoid lag. (otherwise the lag defeats the point of using internal subroutines.
  • 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

p2

I ONLY did on-calc programming and the two things I hated most about it:
- scrolling through a 20line block of code and accidentally pressing CLEAR
- scrolling itself <_<

also many LBLs and GOTOs (especially with conditions around them) make it possible to reduce the program size, but debugging that as as good as impossible... <_<
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Dream of Omnimaga

It's not as bad nowadays on the monochrome calcs or the C Silver because of Doors CS' ability to scroll instantly to errors when choosing Goto, and I believe there was a tool to jump directly to specific Lbls in a program via a parser hook and key combo, but on the CE it's an absolute nightmare.

This was the same on monochrome calcs before Doors CS became stable enough to be useable in late 2010. The result is that we instead often merged multiple lines as you say, and the ensuing accidental CLEAR was annoying. The CLEAR button had the worst possible location and they should never have included 2nd+ENTRY inside the program editor. That was as bad as CLEAR.


Nowadays I prefer programming on a PC, but it took me about a decade before getting used to it and testing programs is annoying because I have to transfer them over and over to an emulator.
  • 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

p2

Quote from: DJ Omnimaga on November 21, 2016, 05:38:24 AM
It's not as bad nowadays on the monochrome calcs or the C Silver because of Doors CS' ability to scroll instantly to errors when choosing Goto, and I believe there was a tool to jump directly to specific Lbls in a program via a parser hook and key combo, but on the CE it's an absolute nightmare.

This was the same on monochrome calcs before Doors CS became stable enough to be useable in late 2010. The result is that we instead often merged multiple lines as you say, and the ensuing accidental CLEAR was annoying. The CLEAR button had the worst possible location and they should never have included 2nd+ENTRY inside the program editor. That was as bad as CLEAR.


Nowadays I prefer programming on a PC, but it took me about a decade before getting used to it and testing programs is annoying because I have to transfer them over and over to an emulator.
yeah I killed hhuge parts of my programs like that (pressing clear) but actually I loved the 2ND+ENTRY as I often used it to copy almost similar blocks and paste them a couple of time ;D
  • Calculators owned: ti-83+, ti-84+, ti-84+, ti-84+se, ti-84+se(te), ti-nsphire, ti-nsphire CAS, ti-nsphire CX-CAS, ti-voyage, ti-voyage, Who reads this list anyways...?
Anyway war sucks. Just bring us your food instead of missiles  :P ~ DJ Omnimaga (11.10.2016 20:21:48)
if you cant get a jframe set up, draw stuff to it, and receive input, i can only imagine how horrible your game code is _._   ~ c4ooo (14.11.2016 22:44:07)
If they pull a Harambe on me tell my family I love them ~ u/Pwntear37d (AssangeWatch /r/)
make Walrii great again ~ DJ Omnimaga (28.11.2016 23:01:31)
God invented the pc, satan the smartphone I guess ~ p4nix (16.02.2017 22:51:49)

Dream of Omnimaga

The problem with 2nd+ENTRY is that it erased the entire line of code as well. Also I think it cycled all the time, which was not very reliable when pasting the same thing over and over. I prefered making a separate program then using 2nd+RCL
  • 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