Home | News | Downloads | Projects | Articles | Awards | Forums | Chat | Guestbook | About | Arcade
InvisionFree - Free Forum Hosting
Fully Featured & Customizable Free Forums
Learn More · Sign-up Now



Forum Topics Replies Last Post Info
Older topics
Here you can access all topics posted from May 12th 2005 to Apr 9th 2006 (In read only mode).
1126 15694 9 Apr, 2006, 11:06
In: Last Post[GAME]Learn how to count to...
By: DJ Omnimaga
 

Pages: (2) [1] 2  ( Go to first unread post ) post

 [83+ BASIC]Here's why Kalan's better coder than me, (metroid map loading code)
xlibman
Posted: 7 Jul, 2006, 19:28


Ragol666


Group: Founder
Posts: 11283
Member No.: 1
Joined: 9 Apr, 2006



hmm okay dysfunction was always wondering why map loading took so long in Diortem and Metroid II (between 1 and 4 seconds), well before you continue reading, I must warn you: the code below may be offensive to BASIC programmers, because there is so many things that are done at map loading that after a while the code went so messy that it now reminds me my old days of Illusiat (without the Lbl/gotos) shocked2.gif knight3.gif and I got headache reading it. Btw this is one of the reason why Diortem died the first time, I gave up on this code. Now i rewriten most of it before finishing metriod but still... I was wondering if there would be some stuff that could be made more optimized in this mess >.<?

CODE
0→PMT
If A≤1:Then:7→A:â-100→â:If PV=7 or PV=4:P+6→P:End
If A≥8:Then:2→A:â+100→â:If PV=7 or PV=4:P-6→P:End
If A>1 and A<8:Then:If [A](A,B)=4 or [A](A,B)=5 or [A](A,B)=16 or 17=[A](A,B:[b][/b]prgmASCR:End
If B≤1:Then:11→B:â-1→â:If PV=7:Q+10→Q:End
If B≥12:Then:2→B:â+1→â:If PV=7:Q-10→Q:End
If PV≠7 and PV≠4:Then:0→R:0→PV
End
real(10,2,0
DelVar Pic3DelVar Pic0DelVar [A]:"AM"+sub("0123456789",iPart(10fPart(.01â))+1,1)+sub("0123456789",10fPart(.1â)+1,1
real(10,0,0
prgmXTEMP000
real(10,1,0
"AE0
If PV≠4 and PV≠7:Then
If [A](1,1)≠36 and â>700 and â<3700 and â≠2225 and â≠1318 and â≠2220 and â≠1919 and â≠1826 and â≠716 and â≠1616 and â≠2115 and â≠1816 and â≠2630 and â≠1222 and â≠2629 and â≠1339 and â≠1637 and â≠2829 and â≠1918 and â≠2221 and â≠1925 and â≠1118 and â≠1018 and â≠2121 and â≠2120 and fPart(â/100)≠.17
1→PV
End
If (I<10 and â=709) or (â≥4035 and â≤4039) or (â≥1638 and â≤1642:2→PV
If â=2239:Then
2→S:4→PV:37→P
End
If PV≠7 and I<8 and â=4836:Then
-6→P:-10→Q:0→N:1→T
7→PV:1→R:8→I
End
If PV=7:"AE7
If PV=4:"AE4
If PV=2:Then:8.5→P:75→Q:100→R:-.25→T:"AE2
End
If PV=1:Then:1+(â>1800)+2(fPart(â/100)>.2→S:[b][/b]S→R:2randInt(0,1)-1→T:2randInt(0,1)-1→N:If S<3:0→N:Repeat 22>[A](P,Q
randInt(3,10→Q:randInt(3,6→P
End
"AE1
End
If I<6 and â=1317:Then:6→PV:.5→T:.5→N:-4→P:6→Q:20→R:6→I:"AE6
End
If I<10 and â=2108:Then:8→PV:0→T:0→N:0→P:0→Q:20→R:"AE8
End
If I<3 and â=2220:Then:5→PMT:9→U:5→R:1→T:4→I:7→Q
"AE3
End
real(10,0,9
real(9,1,3
real(2,0,0,0,12,8,0,12,0,8,1,0,8,1
StorePic 3
prgmAHUD


Yes I have been coding calcs for 5 years since july 4th I know I should do better >.< ... might be cuz of my long 8 months break as well, I dunno ._.


--------------------
user posted image
Join us on IRC on #omnimaga at irc://unitedti.org!
user posted image
Top
kalan_vod
Posted: 8 Jul, 2006, 0:40


Super mega post whore of the doom


Group: Members
Posts: 2365
Member No.: 43
Joined: 19 Apr, 2006



blink.gif


Yeah I see a few things to work on, it will improve speed and size some what. I assume the â is theta? Btw, if vars are in use (I think your using PV b/c the other vars are in use), I would use a temp var that was being used. Ie. If T was being used in game, store it to a list and then use T as the temp var. Therefor you could use delvar instead of going 0->PV, which would save 1byte + 1byte using A instead of PV. I will give it a work over later on Sat or Sun, but I am tired and going to work early and all day on Sat. Hope I helped tongue.gif
Top
Spellshaper
Posted: 8 Jul, 2006, 5:34


rectangular puddle


Group: Coders Of Tomorrow
Posts: 1996
Member No.: 5
Joined: 10 Apr, 2006



QUOTE (xlibman @ Jul 8 2006, 02:28 AM)
CODE

...

If [A](1,1)≠36 and â>700 and â<3700 and â≠2225 and â≠1318 and â≠2220 and â≠1919 and â≠1826 and â≠716 and â≠1616 and â≠2115 and â≠1816 and â≠2630 and â≠1222 and â≠2629 and â≠1339 and â≠1637 and â≠2829 and â≠1918 and â≠2221 and â≠1925 and â≠1118 and â≠1018 and â≠2121 and â≠2120 and fPart(â/100)≠.17

...

That can be reduced to

CODE
If [A](1,1)≠36 and â>700 and â<3700 and fPart(â/100)≠.17 and not(min(â≠
{2225,1318,2220,1919,1826,716,1616,2115,1816,2630,1222,2629,1339,1637,2829,1918,2221,1925,1118,1018,
2121,2120


err... at least I think so ^^
Somebody correct me if I'm wrong

/edit: I shifted the list one line down cause dunno why it started messing up when I tried to do that long If-statement in one line

This post has been edited by Spellshaper on 8 Jul, 2006, 5:38


--------------------
The tooth fairy teaches children that they can sell body parts for money.

All power corrupts, but I need the electricity!

I gave sanity a shot... not my fault it failed >_<!
Top
xlibman
Posted: 8 Jul, 2006, 12:34


Ragol666


Group: Founder
Posts: 11283
Member No.: 1
Joined: 9 Apr, 2006



hmm interesting, I should try this to see if it works, lot smaller


--------------------
user posted image
Join us on IRC on #omnimaga at irc://unitedti.org!
user posted image
Top
kalan_vod
Posted: 8 Jul, 2006, 12:38


Super mega post whore of the doom


Group: Members
Posts: 2365
Member No.: 43
Joined: 19 Apr, 2006



What exactly can â be?
Top
xlibman
Posted: 8 Jul, 2006, 12:49


Ragol666


Group: Founder
Posts: 11283
Member No.: 1
Joined: 9 Apr, 2006



the big N in the finance app, its the map ID


--------------------
user posted image
Join us on IRC on #omnimaga at irc://unitedti.org!
user posted image
Top
kalan_vod
Posted: 8 Jul, 2006, 13:15


Super mega post whore of the doom


Group: Members
Posts: 2365
Member No.: 43
Joined: 19 Apr, 2006



I figured that, as graphlink changed it to it tongue.gif.
Top
Demon
Posted: 8 Jul, 2006, 14:46


Post whore


Group: Members
Posts: 531
Member No.: 102
Joined: 3 Jul, 2006



QUOTE
the code below may be offensive to BASIC programmers....I got headache reading it.


It's not offensive but it confused the heck out of me - I just looked at the first few lines and my brain went:
QUOTE
ERR:OVERFLOW
1: QUIT
2: GOTO

But I never knew you could use those FINANCE vars as... er, well, vars...
knight3.gif

*pyro_xp2k still has a long way to go...


--------------------
*Click!* *Gasp!* OMG!! WTF?! LOL, M8.

Timendus of MaxCoderz:
"I guess people are just so used to yelling on about their problems instead of contacting the people who could fix it because they've been taught by Microsoft and some others that problems are always there to stay, and complaining about in the proper place them will not make any difference whatsoever."
Top
Super Speler
Posted: 8 Jul, 2006, 15:07


Post whore


Group: Coders Of Tomorrow
Posts: 779
Member No.: 95
Joined: 18 Jun, 2006



QUOTE
But I never knew you could use those FINANCE vars as... er, well, vars...

Well, you can and not only that but Finance Vars are not only faster then normal Vars but faster then Ans as well, which is the reason I use them in anything that needs to have an ubsurly high screen refresh rate.


--------------------
[color=red]Currently conquering the world. In Phase 1.
List of members of private army:[/color]
SilverCalcKnight, TD-Linux, Kuro, Cure, Weregoose, Lolbbq, elfprince13, leofox, Brazucs, +ZERO+, Radical Pi, shadow, bananaman, trigkid213, netham45, Full-Metal-Randomist, myfavcolorchanges, Fallen Ghost, trevmeister66, lolje, Harrierfalcon, clementop, blm22, Mexi1010, baorder54, Bking0, frenchcalc1, TheStorm, jimbauwens, Sting::Ray, IAmACalculator, MechaTech84, Groene07, Angel14995, Xphoenix, lordofthegeeks, tama and...

(\__/)
(='.'=)
(")_(")
[color=red]If you wish to join PM me.[/color]

[QUOTE=Ad on omnimaga]Ti 83 Game Programming: Move your career forward with an accredited online degree![/QUOTE]
[QUOTE=Netham45]It isn't really a problem, but it kind of scares me when people randomly quote me, like they are stalking me.[/QUOTE]
Top
xlibman
Posted: 8 Jul, 2006, 15:31


Ragol666


Group: Founder
Posts: 11283
Member No.: 1
Joined: 9 Apr, 2006



blink.gif that I didnt knew shocked2.gif

ok I guess I'll try to use those instead of A and B for character moving then if i make a new game tongue.gif


--------------------
user posted image
Join us on IRC on #omnimaga at irc://unitedti.org!
user posted image
Top
kalan_vod
Posted: 9 Jul, 2006, 3:33


Super mega post whore of the doom


Group: Members
Posts: 2365
Member No.: 43
Joined: 19 Apr, 2006



Well they can't be deleted like with A-theta and they take up one extra byte I believe.
Top
xlibman
Posted: 9 Jul, 2006, 7:26


Ragol666


Group: Founder
Posts: 11283
Member No.: 1
Joined: 9 Apr, 2006



you mean, token wise? (as some tokens takes 2 bytes instead of 1)


--------------------
user posted image
Join us on IRC on #omnimaga at irc://unitedti.org!
user posted image
Top
kalan_vod
Posted: 9 Jul, 2006, 13:57


Super mega post whore of the doom


Group: Members
Posts: 2365
Member No.: 43
Joined: 19 Apr, 2006



QUOTE (xlibman @ Jul 9 2006, 07:26 AM)
you mean, token wise? (as some tokens takes 2 bytes instead of 1)

Finance vars.
Top
xlibman
Posted: 9 Jul, 2006, 16:09


Ragol666


Group: Founder
Posts: 11283
Member No.: 1
Joined: 9 Apr, 2006



yeah I know you are talking about those, but when pasting for example "PMT" in a program does it takes 2 bytes instead of 1? Like lowercase letters? Also technically we cant even delete a finance var, as it will be set back to 0 so it will always take space


--------------------
user posted image
Join us on IRC on #omnimaga at irc://unitedti.org!
user posted image
Top
Super Speler
Posted: 9 Jul, 2006, 16:41


Post whore


Group: Coders Of Tomorrow
Posts: 779
Member No.: 95
Joined: 18 Jun, 2006



QUOTE
yeah I know you are talking about those, but when pasting for example "PMT" in a program does it takes 2 bytes instead of 1? Like lowercase letters? Also technically we cant even delete a finance var, as it will be set back to 0 so it will always take space

Lets go over the advantages and disadvantages.

Advantages:
-Fastest

Disadvantages:
-Can't use with DeleteVar or for(
-2 bytes rather then one.

So I will say this: it is not always the best choice of variable, but is a nice thing to know that it can be used if needed.


--------------------
[color=red]Currently conquering the world. In Phase 1.
List of members of private army:[/color]
SilverCalcKnight, TD-Linux, Kuro, Cure, Weregoose, Lolbbq, elfprince13, leofox, Brazucs, +ZERO+, Radical Pi, shadow, bananaman, trigkid213, netham45, Full-Metal-Randomist, myfavcolorchanges, Fallen Ghost, trevmeister66, lolje, Harrierfalcon, clementop, blm22, Mexi1010, baorder54, Bking0, frenchcalc1, TheStorm, jimbauwens, Sting::Ray, IAmACalculator, MechaTech84, Groene07, Angel14995, Xphoenix, lordofthegeeks, tama and...

(\__/)
(='.'=)
(")_(")
[color=red]If you wish to join PM me.[/color]

[QUOTE=Ad on omnimaga]Ti 83 Game Programming: Move your career forward with an accredited online degree![/QUOTE]
[QUOTE=Netham45]It isn't really a problem, but it kind of scares me when people randomly quote me, like they are stalking me.[/QUOTE]
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
DealsFor.me - The best sales, coupons, and discounts for you

Topic OptionsPages: (2) [1] 2  post





TI-Freakware's TI Ring
TI-Freakware's TI Ring
[ Join Now | Ring Hub | Random | << Prev | Next >> ]

Hosted for free by InvisionFree* (Terms of Use: Updated 2/10/2010) | Powered by Invision Power Board v1.3 Final © 2003 IPS, Inc.
Page creation time: 0.2249 seconds | Archive

Skin by xlibman and Jc
All programs and games are property of their respective owners.