Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: markgrimes98 on June 16, 2013, 03:42:15 pm

Title: how to make fps in ti basic
Post by: markgrimes98 on June 16, 2013, 03:42:15 pm
i want to maek a fps like mw2 or black ops. i know to make siple programms like tic tac toe and rock paper scissors. i can also make menus and quadrtic formula prrograms. i am not rly sure how to maek large games. also i want to connect a calc to other calcs for mutiplayer.

thankx in advance.
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 16, 2013, 03:43:47 pm
well, you can't really 'make fps' as it is so slow anyways, you'll end up just having an infinity loop with some short pause at the end and redraw+recalc everything at the beginning of it like:
Code: [Select]
While 1
<calc position for stuff>
<draw stuff>

<pause for like .5 seconds>
End
Title: Re: how to make fps in ti basic
Post by: markgrimes98 on June 16, 2013, 03:46:15 pm
sorry i dont understand. what is "while"?

also what does the "1" do after while?
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 16, 2013, 03:52:11 pm
uh, that is a loop, it is far better to use than lbl and goto IMO, but you could put instead of While 1 also Lbl A and instead of End Goto A, but I would recommend looking into loops.
I made a tutorial somewhere, lemme check......
Oh, it isn't done yet, but here's the secret link: http://www.instructables.com/id/EOSAWS3H994VJ6R
Title: Re: how to make fps in ti basic
Post by: markgrimes98 on June 16, 2013, 03:54:35 pm
thank you for the link. i use labels to rpeat code.
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 16, 2013, 03:57:00 pm
Yeah, I used to do that too until I learned loops, they are a far more efficient way, less memory problems, faster, just overall better but only require a tiny bit more thinking, I would defenetley recommend starting to use While, Repeat and For instead of Lbl and Goto
Title: Re: how to make fps in ti basic
Post by: ben_g on June 16, 2013, 04:01:01 pm
Ti-BASIC isn't nearly powerfull enough for an fps. But if you would like to make a multiplayer game, you can look into calcNet. CalcNet lets you connect multiple calculators to each other even over the internet, and computers can interfere with this too, so the server software can run on a computer. CalcNet is included in DoorsCS7, and the latest version has a BASIC api.

If you really want to make an fps, I suggest you learn an other language, like axe or asm. If you shoose to use axe (which resembles basic a bit), you can look into AXEJH3D. If you shoose to use assembly (which is faster than axe, but also much harder, especially for beginners), you have a bit more options. AXEJH3D can still be used, or you can search for other engines, <self-advertising> like mine </self-advertising>.
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 16, 2013, 04:02:44 pm
speaking of calcnet, isn't there some dude making a basic lib for it?
Title: Re: how to make fps in ti basic
Post by: DJ Omnimaga on June 16, 2013, 04:04:11 pm
I wish you good luck to make a TI-BASIC FPS that runs higher than 0.05 FPS on a SE calculator. Even calc84maniac and Xeda112358's attempts don't even come close to that and they are like two of the best TI coders in the world.

Welcome here, though! :) (By the way, it might be good to do some effort on spelling (especially for our foreign members who have to use Google Translate to read our posts) and punctuation when posting on the forums, so that it's easier to read. ;))
speaking of calcnet, isn't there some dude making a basic lib for it?
Geekboy1011
Title: Re: how to make fps in ti basic
Post by: ben_g on June 16, 2013, 04:09:09 pm
speaking of calcnet, isn't there some dude making a basic lib for it?
The latest release of DCS7 (released yesterday) has a BASIC api for calcnet.

And actually, playable fps games are possible in basic, if you use some kind of super simplified raycasting with 90° angles, which looks like this:
(http://s14.postimg.org/o7d76yqy7/fps.gif)
I don't really think that this is what he wants.
Title: Re: how to make fps in ti basic
Post by: Augs on June 16, 2013, 04:13:58 pm
Maybe it's just a hunch, but I think this guy is a troll.

What makes me think he is a troll is that he has terrible spelling.

He has the most ridiculous idea.

And for someone who even knows what a quadrtic formula is, he should be able to spell.
Title: Re: how to make fps in ti basic
Post by: markgrimes98 on June 16, 2013, 04:26:10 pm
uhh im not a trolll. I just want to learn. also why is this idea rediculous? it might be haard but i could try.

@dj
ok, so making an fps with basic is prety much imposible. thats unfortunate. could i still do 3d things liek minecrft?
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 16, 2013, 04:30:29 pm
the idea is rediculous because our best coders haven't managed to do something like that yet.
There are often newbies who think that they could make like awesome projects like doom all the time just from start while they are still doing ti basic (not even axe) and many don't even know loops yet (sorry, know offence, i'm just explaining why)

And now to your second part - 3d is pretty hard, there are some engines but they are sloooooow, and they are still all in development. There are some other minecraft things like 2d minecraft in development though, e.g. tinycraft (http://ourl.ca/16224)
EDIT: to program something like that also takes years of experience, if you really wanne challenge yourself you should try yourself on something simple like pong first and see how well you do.
Title: Re: how to make fps in ti basic
Post by: ben_g on June 16, 2013, 04:32:09 pm
could i still do 3d things liek minecrft?
3d things: Yes, but only in axe or assembly if you want them to run at a reasonable speed. For the minecraft: maybe if you have a really optimized way of rendering, and use a very small (like 5*5*5) world (the size of 3D voxel objects can be huge, so big worlds won't fit in RAM anyway). But nobody has done anything like this before.
Title: Re: how to make fps in ti basic
Post by: Keoni29 on June 16, 2013, 04:35:11 pm
Even for an nspire 3d stuff is hard to code. There is a minecraft game for the nspire in 3d in developement and there is a 2d minecraft game for the 83+/84+, but a 3d minecraft game is very difficult to make. Rendering polygons is easier than rendering a big world made of voxels. There is a 3d lib for axe which might be the place to start if you were to attempt to make anything 3d for the 83+.
Title: Re: how to make fps in ti basic
Post by: DJ Omnimaga on June 16, 2013, 04:49:58 pm
I don't think we should judge people too fast, but of course we need to be realistic about what the calc can accomplish:

15 MHz Zilog 80 CPU
24 KB of RAM (21 on CSE models)
480-1530 KB of Flash storage memory (3500 on CSE models)
No graphic card/accelerator
And TI-BASIC is far slower than Axe and Assembly.

It's possible to make an FPS in BASIC, but it will look like this:

(http://xlib.mtv-music-generator.com/quake4basic.gif)

Minecraft could theoretically be possible too, but you would only be able to look up at 90° angle and down the same way, and turning around would look like the screenshot above. Plus the game would take ridiculous amounts of RAM. For example, a matrix based map that is 10x10x9 would take 8111 bytes of RAM. Also you wouldn't be able to see more than 9 blocks at once.

On a CSE calc, this is probably the best graphics and frame rate that you could pull from pure BASIC without using a single pic variable (the following animated GIF is fake, so it could actually be even slower, especially if you only coded TI-BASIC for less than 10 years, but it shows a small idea of how jumping in such minecraft game would be):
(http://xlib.mtv-music-generator.com/fakeminecraftjumpingmockup.gif)
Title: Re: how to make fps in ti basic
Post by: markgrimes98 on June 16, 2013, 06:26:47 pm
thanks everyone for teh help. i didnt realize the calc was so limited. i will thnk of another game to program.
Title: Re: how to make fps in ti basic
Post by: ben_g on June 17, 2013, 05:44:17 am
If you want to program games, i really reccomend to learn a language other than basic, like axe, grammer or assembly. If you really want to use basic however, you might also want to look into libraries like xlib (included in the doorsCS shell)
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 17, 2013, 05:50:27 am
oh yeah, you should use dcs then, all the libs it has included give you so many features, you'll swim in them. You'll be able to store in appvars stuff etc. and if you are awesome you'll even be able to do greyscale (though that is pretty advanced due to lack of speed)
Title: Re: how to make fps in ti basic
Post by: Streetwalrus on June 17, 2013, 05:54:54 am
And if you are awesome you'll even be able to do greyscale (though that is pretty advanced due to lack of speed)
DJ made it in Reuben Quest but again, DJ's the god of BASIC. :P
Title: Re: how to make fps in ti basic
Post by: DJ Omnimaga on June 17, 2013, 12:22:06 pm
Well, Reuben used Omnicalc, which is slower than DCS, so using DCS it would be easier. Axe Grayscale is even easier, though, since Axe does it for you.
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 17, 2013, 12:24:32 pm
but axe doesn't have lbls like you use 'em currently so you'll have to learn loops which i would recommend anyways :D
Title: Re: how to make fps in ti basic
Post by: Streetwalrus on June 17, 2013, 12:28:44 pm
Axe haz labels. :3 They're actually better than loops if you think of it from an ASM point of view.
Title: Re: how to make fps in ti basic
Post by: Sorunome on June 17, 2013, 12:31:20 pm
Axe haz labels. :3 They're actually better than loops if you think of it from an ASM point of view.
erm, don't you mean functions, that they just use the lbl token? :P functions!=lables, functions are faaaaaaaaaaaar more epic
Title: Re: how to make fps in ti basic
Post by: Streetwalrus on June 17, 2013, 12:34:14 pm
Axe doesn't have functions, it has sub routines (the difference is a little subtile but one thing is that variable focus doesn't exist for example). And you have the Goto command as well.
Title: Re: Re: how to make fps in ti basic
Post by: DJ Omnimaga on June 17, 2013, 01:59:32 pm
Aren't lbls in Axe like jumps in Z80 ASM?
Title: Re: how to make fps in ti basic
Post by: Streetwalrus on June 17, 2013, 02:25:08 pm
Yes they are so it's quite fast. ;) It's literally 3 bytes and 10 T-States
Title: Re: how to make fps in ti basic
Post by: ben_g on June 17, 2013, 02:27:18 pm
Aren't lbls in Axe like jumps in Z80 ASM?
The lbls in axe are basically pointers to certain pieces of code. And just like in z80 asm, you can either call them, or jump to them.
Because of this, axe lbl's are handled only by the compiler, and are thus 0 bytes large in the compiled program. The goto's or calls(subs) do take space and use CPU cycles, however.
Title: Re: how to make fps in ti basic
Post by: DJ Omnimaga on June 17, 2013, 05:21:35 pm
Yeah that's what I thought. This also means there are no memory leaks like when using a TI-BASIC lbl inside a block/loop, right?
Title: Re: how to make fps in ti basic
Post by: tr1p1ea on June 17, 2013, 05:52:06 pm
If you wanted to make an FPS i would suggest raycasting as opposed to 3D.

That being said, an fps is not the type of project to tackle when you're only starting out programming wise. The things id learn first are dealing with program flow, sprites, data structures and of course, the inner-workings of the calc and OS itself.

Still keep the fps goal, but maybe make it a long term one? :).

Out of curiosity, have you seen Gemini or other calc fps's?