Author Topic: Chip's Challenge  (Read 37482 times)

0 Members and 1 Guest are viewing this topic.

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Chip's Challenge
« Reply #30 on: November 28, 2008, 10:13:38 pm »
Update time!  I'm done with programming all the items as well as the water, ice, force, and fire tiles.

Next up is the behavior of movable blocks on ice/force/fire and then implementing switches (with lots and lots of optimization spaced throughout).  After that are the enemies and the timer, followed by redesigning the HUD (to make it look pretty with the timer), lots and lots more optimization, transferring 150 levels to the calculator, more optimization, get guinea pigs for testing, fixing the many major flaws that will undoubtedly be found, optimize......

@ deeph: Thanks for the sprites and tiles.  The fire tile, suction boots, flippers, fire boots need a bit of tweaking (I'm sorry if I sound rude, I'm really bad at phrasing things correctly with only text.  I appreciate your work ;D)

@ anyone who's written a massive BASIC game before:  For the algorithm used to determine the player's next spot when there's a lot of tile-induced movement (like sliding on ice, tiles that push you in a certain direction) along with user input, does ~250 bytes seem big?  (This doesn't include the action once it decides where you will be moving)

Here's a screenie of level 3
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

metagross111

  • Guest
Re: Chip's Challenge
« Reply #31 on: November 28, 2008, 10:27:53 pm »
nice job so far! it looks great! i do offer myself up as your humble guinea pig. also, no. im doing pokemon, and 250 bytes is enough for half an attack effect. if you can fit a mechanic so necessary in that much space, then go for it. optimize as you can, if you wish.

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Chip's Challenge
« Reply #32 on: November 28, 2008, 10:36:58 pm »
nice job so far! it looks great! i do offer myself up as your humble guinea pig. also, no. im doing pokemon, and 250 bytes is enough for half an attack effect. if you can fit a mechanic so necessary in that much space, then go for it. optimize as you can, if you wish.

Thanks :)

I'm not quite at the guinea pig state yet since, in order to help me organize/figure out where to stick stuff, there are a few snippets so poorly coded that I would be embarrassed to show my face anywhere associated with programming for months if they were to get out :-[

250 bytes is short compared to some of my other algorithms, but 250 for the sole purpose of determining left/right/up/down seems excessive :o (though I should probably take into account the fact I've never written a movement routine with so much going on).
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

metagross111

  • Guest
Re: Chip's Challenge
« Reply #33 on: November 28, 2008, 10:43:43 pm »
can i see that particular code? or is that against your moral fibre?

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Chip's Challenge
« Reply #34 on: November 28, 2008, 10:55:03 pm »
I've mastered movement routines.
For example, mine for Nyaar is a little under 100 bytes.
Of course, this is JUST for moving and determining if you can move to that spot.

With the map and sprite rendering plus the scrolling it's 185 bytes exactly.

So, what I'm saying is... let me see the code and I'll be able to help you.

(EDIT: Added bonus... have you seen the speed of it? =D)

P.S. Sorry if I sound like I'm bragging. >_<
I actually just want to help.

(EDIT2: Now that I think of it... I wouldn't know how to implement moving enemies into this system. Well, I have an idea... but I don't feel like testing it out.)
« Last Edit: November 28, 2008, 11:07:38 pm by {AP} »

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Chip's Challenge
« Reply #35 on: November 28, 2008, 11:36:00 pm »
Since there is tile-induced movement with varying dominance over user input I calculate the direction/change in position and leave determining if the new spot can be moved to to another subprogram, currently 283 bytes and I'm estimating another 200 bytes after I implement switches.

N=tile currently on
D=direction (-1=left, 1=right, -.01=up, .01=down)
L3(6)=ice skates yes/no
L3(7)=suction boots yes/no
K=key press (using xLIB's getKey)

N between 21 and 25 are ice tiles, so '2<abs(N-23' is true when it's not an ice tile.
If you land on a regular ice tile (N=21) you continue in the direction you stepped on it.  The others are curved and redirect you depending on how you come at it.  My name for them is "ice NW/NE/SW/SE" depending on the corner it's in.  For ice NW: if your direction is 'up' it changes it to 'right', if your direction is 'left' it changes to 'down',  and so on for NE/SW/SE.

N between 17 and 20 are force tiles.  They push you in a certain direction, but you have limited control over Chip (you can move off to the side, but not directly against how their pushing you).  20=right, 19=left, 18=down, 17=up

Here's the code for determining 'D'.  I have the 'If:Then:End' statement to increase speed even though they're adding about 10 bytes (I did speed tests to confirm they help).  It's only 164 bytes now, but I'm estimating another 90-100 bytes for when I add in the semi-bordered floors and switch tiles.
Code: [Select]
:If L3(6) or 2<abs(N-23:Then
:(K=3)-(K=2)+E-2((K=1)-(K=4→D
:If not(L3(7
:D+(N=20)-(N=19)+E-2((N=18)-(N=17→D
:Else:ND
:D+1.01((Ans=-.22 or Ans=-22)-(Ans=.25 or Ans=25))+.99((Ans=-24 or Ans=.24)-(Ans=23 or Ans=-.23→D
:End
(E-2 is the little E to the -2 power, ie .01)

Enjoy ;D
« Last Edit: November 29, 2008, 12:21:24 am by simplethinker »
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Chip's Challenge
« Reply #36 on: November 29, 2008, 12:11:19 am »
Since you do need direction... from what I can see, you're doing fine.
I had forgotten about the tiles you can only enter from one direction and the teleport tiles.

You did it better than I would have.
Direction is nothing I ever needed to (or wanted to) bother with.

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Chip's Challenge
« Reply #37 on: November 29, 2008, 12:40:04 am »
P.S. Sorry if I sound like I'm bragging. >_<
I actually just want to help.
Nyaar is an accomplishment that deserves to be bragged about! ;D

Quote
(EDIT2: Now that I think of it... I wouldn't know how to implement moving enemies into this system. Well, I have an idea... but I don't feel like testing it out.)
Why did you have to remind me the enemies are moving.  I've had such a good day so far :(.  It's gonna be a freakin' pain, and there are at least 5 levels I might have to leave out because the massive number of enemies to keep track of would probably make the calculator shoot sparks and explode :o :boom: (that's another smiley we're missing, the exploding one)

Quote
Direction is nothing I ever needed to (or wanted to) bother with.
Once you get the hang of it it's pretty simple (although getting the hang of it is the hard part).  I had to try about 4 different ways to group the tests to get that last little 76 byte gem (it starts 'D=1.01...').  There is a tiny little bug, which could potentially give someone a small advantage, that would require a complete rewrite of the code in the program that determines if the tile can be moved onto as well as cause a major speed loss, so I already have my first nearly useless easter egg.

[edit] @{AP}: What is your avatar?  Is that a whale flying in and landing on/squishing a little puppy?
« Last Edit: November 29, 2008, 01:35:07 am by simplethinker »
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: Chip's Challenge
« Reply #38 on: November 29, 2008, 01:49:52 am »
[edit] @{AP}: What is your avatar?  Is that a whale flying in and landing on/squishing a little puppy?
Actually, I think it's a sea lion that jumps from behind the rocks. Correct me if I'm wrong...
« Last Edit: November 29, 2008, 02:24:39 am by {AP} »
Former Coder of Tomorrow


Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Chip's Challenge
« Reply #39 on: November 29, 2008, 02:24:04 am »
It's supposed to be a seal.
Though, yes... it's doing what it looks like it's doing.

Explanation:
http://www.newgrounds.com/portal/view/435047

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: Chip's Challenge
« Reply #40 on: November 29, 2008, 03:51:09 am »
simplethinker > Yeah, those tiles looks really bad in 8x8, I think yours are better.

edit : Don't you think it'll be better if you don't xor the player's sprite ?
« Last Edit: November 29, 2008, 03:57:18 am by deeph »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Chip's Challenge
« Reply #41 on: November 29, 2008, 03:57:26 am »
wow looks nice so far, tiles looks pretty sweet, keep up the good work!
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline simplethinker

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 695
  • Rating: +16/-5
  • snjwffl
    • View Profile
Re: Chip's Challenge
« Reply #42 on: November 29, 2008, 12:06:08 pm »
Thanks ;D

simplethinker > Yeah, those tiles looks really bad in 8x8, I think yours are better.

edit : Don't you think it'll be better if you don't xor the player's sprite ?
I'm using mostly your tiles, but level three doesn't have any switches, gravel or enemies so it doesn't show them.  For the boots and fire tile I'm just using 'Fi', 'fi', 'fo', 'w' as place holders.  Yours are way better than what I had :) and you're still gonna be close to the top of the credits if/when I get this game done.

Right now I'm just using 'or' since 'xor' looks worse.  Eventually I'll be using different sprites depending on the tile it's on, but right now I'm using one sprite.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true." -- Professor Robert Silensky



Chip's Challenge: ħ%

Offline deeph

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 138
  • Rating: +6/-0
    • View Profile
    • deeph.servhome.org
Re: Chip's Challenge
« Reply #43 on: November 29, 2008, 01:00:43 pm »
Maybe with a mask it can be better (just xor it before put the sprite) :



Or I think xor a white square before xor the sprite will have the same effect.

Offline {AP}

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 981
  • Rating: +74/-3
  • I am Webmaster!
    • View Profile
    • Removed From Game
Re: Chip's Challenge
« Reply #44 on: November 29, 2008, 01:09:09 pm »
No... you 'and' the mask and then you 'or' the sprite.