Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: skuller972 on March 15, 2009, 03:11:57 pm

Title: prgmHEROGAME
Post by: skuller972 on March 15, 2009, 03:11:57 pm
I am creating a basic RPG called herogame. It will use a "crossroads feature" which, after doing something in a general label, will goto lblCR and will redirect you to the town or place you were before you did this. It also uses LHERO and LSTAT, telling the place the hero is at and equipment and his stats. Any advice on parts of the game will be graciously accepted.
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 15, 2009, 03:18:30 pm
Sounds interesting but you shouldn't use gotos your going to run into a memory error very quickly.
Title: Re: prgmHEROGAME
Post by: DJ Omnimaga on March 15, 2009, 03:47:51 pm
Nice, and welcome here :). As Noah said I would recommend against Gotos/Lbl, unless you use a Goto outside a While/Repeat/For/If-End loop, to prevent memory leaks. A lot of my old games for the TI-83+ from back in 2001-2004 did and for some of the games, especially the oldest ones, when you play for about 30 minutes-1 hour in a row, when saving your game or shopping for items you end up with a ERR:MEMORY. Outside such loop there's no problem, though, altough if your game is very huge it might take a while to load when a Lbl is at the complete bottom of the game.
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 15, 2009, 03:48:47 pm
Yeah it's just better to not use them at all.
Title: Re: prgmHEROGAME
Post by: cjgone on March 15, 2009, 04:17:47 pm
Avoid gotos at all cost, save yourself!
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 15, 2009, 04:20:07 pm
(http://imgs.xkcd.com/comics/goto.png)
Title: Re: prgmHEROGAME
Post by: skuller972 on March 15, 2009, 05:14:58 pm
haha funny comic
what do you suggest in place of gotos and lbls that would work and have a crossroadish feature but no memory problems?
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 15, 2009, 05:16:57 pm
Might I suggest sub-programs.
http://tibasicdev.wikidot.com/subprograms
Also look at the wiki as a whole it's a great resource.
Title: Re: prgmHEROGAME
Post by: skuller972 on March 15, 2009, 05:21:31 pm
oh, i could make a program for things like maps and info and stats screens, and then it would pop back in the same spot, and the map would set the variables for the town and i could put in prgmMAP:prgmCROSROAD to send to the town's program
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 15, 2009, 05:22:39 pm
Yeah that's usually the better to do it.
Title: Re: prgmHEROGAME
Post by: skuller972 on March 15, 2009, 05:24:07 pm
but wouldn't that stack programs and lead to a memory error too?
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 15, 2009, 05:25:23 pm
Nope when a sub-program exits it fixes all the open ends and things like that.
Title: Re: prgmHEROGAME
Post by: DJ Omnimaga on March 15, 2009, 05:39:52 pm
True. The only way it can still cause leaks is if you run a sub program inside itself, a mistake I did in many of my old games. This is common when a Game Over occurs and we are lazy and decide to just run the main prgm again to go immediately to the title screen. Game also runs slower and slower with the time
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 15, 2009, 05:40:48 pm
Yeah with that one you can cheat and tell them to hit enter.
Title: Re: prgmHEROGAME
Post by: skuller972 on March 15, 2009, 05:42:39 pm
yeah i had played one like that before
it was a game where you took a turn and then went to the server program and then it calculated the turn and then you went to the game and so on
i was afraid of a memory leak so i edited it (basic) but noticed no changes' probably because there were only like 3 turns a game
Title: Re: prgmHEROGAME
Post by: simplethinker on March 16, 2009, 02:58:28 pm
You can almost always replace Lbl/Goto with either some kind of loop or and If:Then:Else statement.  The TI-BASIC Developer (http://tibasicdev.wikidot.com/) is a great resource for BASIC programming.  You should check it out ;D

Yeah it's just better to not use them at all.
Avoid gotos at all cost, save yourself!
On this I must disagree with you guys.  However rare, there are instances where Lbl/Goto is better than the other options.  In Chip's Challenge, calling the engine from another program or embedding the engine within a loop was leading to a 40% decrease in speed (this does not mean a Goto is used while running the game, but after you win/lose I use a Goto to get back to level selection).  When you use a Goto, the BASIC parser starts searching for the corresponding label from the top of the program, meaning in most cases it's significantly slower than a loop.  As long as you use Lbl/Goto carefully and correctly memory errors are easily avoidable (but still, don't use them unless you absolutely have to!).

And welcome to Omnimaga and good luck on your game skuller972  ;D
Title: Re: prgmHEROGAME
Post by: skuller972 on March 16, 2009, 08:08:48 pm
i have completed the intro and have a concept for the stats and stuff

EDIT:
I am changing it from a medeival kind of game to aspace kind
Title: Re: prgmHEROGAME
Post by: trevmeister66 on March 16, 2009, 08:54:40 pm
Nice. Can't wait to see how this turns out.
Title: Re: prgmHEROGAME
Post by: kalan_vod on March 16, 2009, 09:37:10 pm
It sounds like something nice, hope to see more progress soon!
Title: Re: prgmHEROGAME
Post by: skuller972 on March 17, 2009, 08:29:46 pm
ok i made a pretty durable subrogram that outputs wordwrap text using instring for backslashes and also has a pause feature that says "pressenter" and flickers and this takes the previousmans for the string so it works in more programs than one
Title: Re: prgmHEROGAME
Post by: DJ Omnimaga on March 18, 2009, 02:16:57 am
I assume you mean for convos with NPCs, rigth?
Title: Re: prgmHEROGAME
Post by: trevmeister66 on March 18, 2009, 11:53:15 am
Nice. It's always good to come up with quick/easy ways to do something that would normally take a lot of space up.
Title: Re: prgmHEROGAME
Post by: skuller972 on March 18, 2009, 07:03:30 pm
yeah and it means that you can customize the program to fit your needs. i might even make like a editing guide which defines all of the variables and whatnot
Title: Re: prgmHEROGAME
Post by: skuller972 on March 28, 2009, 11:58:52 am
sorry everyone, project scrapped. stupid lunarIDE deleted all ram and a few archive things... then when i downloaded omnicalc to get a ram recovery, it garbage collected..
fuck
Title: Re: prgmHEROGAME
Post by: noahbaby94 on March 28, 2009, 12:35:43 pm
Don't use omnicalc for ram recoveries use groups frequently to make temp back-ups then use ti-connect to make perm back-ups.
This is something that can happen if you rely on groups too much though.
http://ourl.ca/3225
Title: Re: prgmHEROGAME
Post by: skuller972 on March 28, 2009, 12:43:39 pm
oh thanx but still it is scrapped
Title: Re: prgmHEROGAME
Post by: DJ Omnimaga on March 28, 2009, 06:53:21 pm
Aw this sucks, I hate when this happens. In the future, make sure to back up frequently, because we never know what may happen. I give this advice for both BASIC and ASM, pure or not. Some people might not know but it's possible to get a memory loss with no ASM code, even with fresh new batteries and not pulling them out while game is running. Thanks to some TI-OS bugs

With my current project, for now I am on the process to switch to a differen ASM program because it messes up with grouping functions and the game crashes after I did group backup.

I do hope you start a new game soon, though
Don't use omnicalc for ram recoveries use groups frequently to make temp back-ups then use ti-connect to make perm back-ups.
This is something that can happen if you rely on groups too much though.
http://ourl.ca/3225
Yeah this is what killed Illusiat 2002, when it was 70% complete and taking 59 KB of memory. I think i was about to finish chapter 3 (out of 5).
Title: Re: prgmHEROGAME
Post by: kalan_vod on March 31, 2009, 12:43:11 am
We should make a list of times/programs deleted due to not backing up..It would be huge! I just hope people will be able to learn from others..
Title: Re: prgmHEROGAME
Post by: DJ Omnimaga on March 31, 2009, 03:21:40 am
We should make a list of times/programs deleted due to not backing up..It would be huge!
(http://www.mtv-music-generator.com/mtvmg4/over9000.jpg)
Title: Re: prgmHEROGAME
Post by: kalan_vod on March 31, 2009, 05:01:44 pm
Lol, good ole times! (DBZ)