Omnimaga
Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started 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.
-
Sounds interesting but you shouldn't use gotos your going to run into a memory error very quickly.
-
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.
-
Yeah it's just better to not use them at all.
-
Avoid gotos at all cost, save yourself!
-
(http://imgs.xkcd.com/comics/goto.png)
-
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?
-
Might I suggest sub-programs.
http://tibasicdev.wikidot.com/subprograms
Also look at the wiki as a whole it's a great resource.
-
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
-
Yeah that's usually the better to do it.
-
but wouldn't that stack programs and lead to a memory error too?
-
Nope when a sub-program exits it fixes all the open ends and things like that.
-
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
-
Yeah with that one you can cheat and tell them to hit enter.
-
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
-
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
-
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
-
Nice. Can't wait to see how this turns out.
-
It sounds like something nice, hope to see more progress soon!
-
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
-
I assume you mean for convos with NPCs, rigth?
-
Nice. It's always good to come up with quick/easy ways to do something that would normally take a lot of space up.
-
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
-
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
-
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
-
oh thanx but still it is scrapped
-
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, thoughDon'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).
-
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..
-
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)
-
Lol, good ole times! (DBZ)