Author |
Message |
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 14 Feb 2004 11:38:15 pm Post subject: |
|
|
W00T! um...Bryan...i hope you get the lists shortened soon. my level is too big and i still have to code the last frame...
also: the lists that say how many mines/water/enemies/upgrades per frame there are are all 10 elements....combine them, and add the appropriate offsets when accessing them.
about the buttons: GREAT IDEA! maybe, the data will be 2 elements: 1 for the button position and one for the line it adds (same compression as the level drawing routine) |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 15 Feb 2004 10:31:17 am Post subject: |
|
|
Quote: //program start
If 23=iPart(%I //check to see if this time we're running the prog or calling a sub
Then
If .1=fPart(%I
Then
//sub1
End
If .2=fPart(%I
Then
//sub 2
End
//repeat for each sub
Return
End
//main prog starts here
Ok, which of the following is slower:
No subroutine:
Code: prgmIMRIGHT // : )
ClrHome
Output(1,1,"YES:
"NO
If X=1:"YES
Output(1,5,Ans
or with a subroutine:
Code: prgmIMWRONG
ClrHome
Output(1,1,"YES:
"NO
1:prgmSUB
Output(1,5,Ans
Code: prgmSUB
If Ans=1:Then
If X=1:"Yes
End
Return
I'd say it's the one without a subroutine. Wanna know why? Well:
Take a good look at what really happends in the second program:
Code: ClrHome
Output(1,1,"YES:
"NO
1:prgmSUB //calling prgmSUB also takes some time
If Ans=1:Then //this also takes time
If X=1:"Yes //same as no sub program, so this line doesn't add time cmopaired to the first program
End //end takes time
Return //return takes some more time
Output(1,5,Ans
Doesn't that take more time to execute than this:
Code: ClrHome
Output(1,1,"YES:
"NO
If X=1:"YES
Output(1,5,Ans
So unless your calc can travel in time without loosing information from the future, code1 + more_code = more_time_to_execute_than_only_code1.
Last edited by Guest on 15 Feb 2004 10:36:00 am; edited 1 time in total |
|
Back to top |
|
|
Bryan Thomas Outer Limit Software
Advanced Member
Joined: 20 May 2003 Posts: 298
|
Posted: 15 Feb 2004 11:13:02 am Post subject: |
|
|
Lmao Arcane. So what you are telling me is that it would be better to not usse subroutines?
Well the ones I am worried about are the ones inside the loop. Because the nme Subroutine IS faster is a sense because I leave it at different times if certain things arent true. So that way It doesn't try and check everything all at once, It checks some stuff and if It isnt true, then it leaves the program without getting to the big if statements, which SAVES time. So Instead of putting the whole subroutine in a Then statement inside the loop that would have to check everything, I prefered to do it this way. If you tell me that putting this whole big prog inside of a huge then statement inside a loop wont slow it down, I would not believe you |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 15 Feb 2004 11:28:01 am Post subject: |
|
|
Bryan Thomas wrote: Lmao Arcane. So what you are telling me is that it would be better to not usse subroutines?
No, only faster.
There's a trade-off between size and speed, try not to use subroutines if you don't need them or when you only use it once or twice in a main game loop where speed is more important than a few saved bytes. However, who cares if it takes 0.1 seconds longer to load a menu when it saves 300bytes p. menu?
I'd say, when you're done with a game, replace (use the rcl function in combination with a temp program) the subroutine calls in places where speed is more important with the actual subroutine's code and then see if the increased speed makes up for a bigger program size.
Last edited by Guest on 15 Feb 2004 11:30:42 am; edited 1 time in total |
|
Back to top |
|
|
Bryan Thomas Outer Limit Software
Advanced Member
Joined: 20 May 2003 Posts: 298
|
Posted: 15 Feb 2004 12:08:31 pm Post subject: |
|
|
Yeah, Maybe Ill do that after, just to test it out and see how it works out for me
BTW: I succeeded in reduciing the size of the level data, I reduced it to 6 lists per level (maybe 7 if I do platform switches) that was originally 10 lists. I then Cut every list in half by combining the cells together into one 4 digit number. I could not do the enemy list, because If I cut that in half it would greatly affect the speed of enemy checking. I then combined all 5 lists and made them into one. Saving me around 75 bytes. Overall after I changed code in the main prog all the subroutines, and lists. I generally annialated about 600 bytes of the required free ram space !! Maybe more |
|
Back to top |
|
|
X1011 10100111001
Active Member
Joined: 14 Nov 2003 Posts: 657
|
Posted: 15 Feb 2004 03:48:43 pm Post subject: |
|
|
You could probably save the most space by using strings. |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 15 Feb 2004 05:07:07 pm Post subject: |
|
|
it would save abotu 100 bytes and be slower/harder to access. i say leave as.
Arcane...all my proposal would do would to be save a few bytes and keep the same speed as its already operating. in my example, i said that my exasmple would not be effective, it just showed how to do it. yours does the same. we're really talking about 500 byte subs that are several times in a single loop, and there may be other loops that they are called in. it would be easier and take less space if they were subroutines
contra only operates with about 2k (not running) and that goes down to about 1 k when running (when the temp levels are made). i say that we get as much space as posible |
|
Back to top |
|
|
Bryan Thomas Outer Limit Software
Advanced Member
Joined: 20 May 2003 Posts: 298
|
Posted: 15 Feb 2004 06:43:27 pm Post subject: |
|
|
yeah Hart, Ill do that, but I might have to recenter everything. good Idea tho :D
Yeah, I originally was gonna use strings, however the level took forever to generate and did not offer me enough to keep it so slow, but thatnks anyway
Last edited by Guest on 15 Feb 2004 06:44:35 pm; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 15 Feb 2004 10:07:27 pm Post subject: |
|
|
well, the score and lives shouldnt have to be recentered...you should just have to recenter the credits...thats involves what, changing 3 numbers? |
|
Back to top |
|
|
Bryan Thomas Outer Limit Software
Advanced Member
Joined: 20 May 2003 Posts: 298
|
Posted: 16 Feb 2004 01:06:32 pm Post subject: |
|
|
Hey hey hey hey, shhhhhhh
Level 2 almost done yayayaya |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 16 Feb 2004 02:09:57 pm Post subject: |
|
|
he is already using subs. my code was to move all the subs to one program |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 16 Feb 2004 08:46:21 pm Post subject: |
|
|
how i would do it:
2->E
repeat until player dies or goes to the next level
repeat until a key or E=0
getkey->C
if a pixel is not on, E-1->E
end
if E=0 then make the player fall one cell down adn 2->E
rest of code to check for movement/shooting/etc.end |
|
Back to top |
|
|
Arcane Wizard `semi-hippie`
Super Elite (Last Title)
Joined: 02 Jun 2003 Posts: 8993
|
Posted: 17 Feb 2004 07:51:49 am Post subject: |
|
|
Yeah, just use pixeltest (or some other form of collision detection) to see if the player is standing on something and lower the player's position if he isn't. |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 17 Feb 2004 12:46:53 pm Post subject: |
|
|
well, use a timer for it too. in teh game, you can move several spaces while falling... |
|
Back to top |
|
|
Bryan Thomas Outer Limit Software
Advanced Member
Joined: 20 May 2003 Posts: 298
|
Posted: 17 Feb 2004 05:11:27 pm Post subject: |
|
|
This is how I did it: This is just an example
Delvar G:Delvar F:1->C
Repeat F
If not(Pxl-test(A+7,B+1
Then
G+C->G
If G>=1
Then
Text(A,B,"___
A+7->A:1->C
End:Else:Delvar G:End
getkey
If Ans=25:Then
A-7->A:.5->C
End:End
Basically G is the gravity variable. When the pxl test proves false, it adds C to G, until G is above 1, and when G is above 1, you fall. However I had to make it so when you jump, it changes C to a lower number, so it takes long to reach 1, therefore you stay in the air longer, but once you fall back down, C remains 1 and you fall full speed.
***knowing me I probably screwed the code all up. Its not really supposed to work and is NOT optomized but it gives you a general idea how I did it****
Last edited by Guest on 17 Feb 2004 05:12:11 pm; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 17 Feb 2004 11:22:07 pm Post subject: |
|
|
and you were telling me off for misleading people on how easy it would be to move teh credits (its isnt exacly 3 numbers, not that i recall) |
|
Back to top |
|
|
Keith Pierce
Advanced Member
Joined: 02 Feb 2004 Posts: 411
|
Posted: 18 Feb 2004 01:47:06 pm Post subject: |
|
|
Excellent program! |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 19 Feb 2004 01:10:03 pm Post subject: |
|
|
excellent doenst begin to describe it.... |
|
Back to top |
|
|
Bryan Thomas Outer Limit Software
Advanced Member
Joined: 20 May 2003 Posts: 298
|
Posted: 19 Feb 2004 10:02:19 pm Post subject: |
|
|
Im curently working on making the boss more advanced. instead of just shooting out of his guns, he will get angry and fire a laser which will force you off of the platforms. Which will give the boss a bit more character
Also the second level is completed, the list have been fully reduced, and I got an idea to allow user made levels. |
|
Back to top |
|
|
|