Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Link Swimming  (Read 4971 times)

0 Members and 1 Guest are viewing this topic.
Link Swimming
« on: March 27, 2010, 02:18:31 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Okay, I have added the swimming feature. In this feature Link will swim automatically when he comes in deep water and can only get out in shallow water. By pressing Z Link will dive. By pressing X link will get a boost. His movement direction will be fixed, but can still turn his facing direction.

The feature exists of:
- 9 sets of sprites gathered under: Link->Swim
- The script LinkSwim, which is an action script.
- The 2 scripts swim_check_x and swim_check_y.
- Slight alterations in objLink events: Step and Draw.
- Major alteration in objLink event: Key press
- Added the objects: parWater, objWaterDeep and objWaterShallow.

I made a complete different step event for movement. Although the movement is fully based on the basic step event. The major difference is that Link has to remain on the parWater objects when in the Swimming state.

Note that I did not implement a Drowning state, because simply it is not the same. Although both are initiated when Link is positioned on objWaterDeep. Drowning is still something different from actual swimming.
« Last Edit: April 04, 2010, 07:21:40 pm by Niek »
Logged
Re: Link Swimming
« Reply #1 on: March 28, 2010, 08:11:35 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Uhm, if it works okay without flaws. I'd like to know as well. Just something that shows it is tested.
Logged

Mamoruanime

@Mamoruanime
Re: Link Swimming
« Reply #2 on: March 28, 2010, 08:14:53 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I'll test it when I get home from work :P haven't gotten around to it yet.
Logged
Re: Link Swimming
« Reply #3 on: March 28, 2010, 08:16:27 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Thanks, I do appreciate some C+C.
Logged

Dark-Hylian

Silence
Re: Link Swimming
« Reply #4 on: March 28, 2010, 09:45:47 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 370
Works fine for me. Nice work.
Logged
  • Dawning Hour

Mamoruanime

@Mamoruanime
Re: Link Swimming
« Reply #5 on: March 29, 2010, 03:10:10 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I don't remember how swimming was in MC so correct me if I'm wrong, but it seems as if there should be some form of momentum feel to the swimming. It basically feels as if link's just moving slower with a sprite change in water, instead of actually having that feel of hitting the water and swimming. It was that way in lttp, but again I can't remember if it's that way in MC. All in all though, its solid. I tried breaking it and it didn't work :P
Logged
Re: Link Swimming
« Reply #6 on: March 29, 2010, 09:11:35 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Good to hear that it didn't broke. I have been looking at the swimming, but I can't detect a momentum. When I stop pressing the d-pad Link comes to a complete stop instantly.

I can provide a save game to check it out if you want/need it and I'm allowed to.
Logged

Dark-Hylian

Silence
Re: Link Swimming
« Reply #7 on: March 29, 2010, 10:18:25 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 370
I think there is a teeny tiny bit of a drag, but not much of a resistance / momentum factor, definitely not as prominent as Ice movement. I'm replaying MC today, so, I'll tell you when I get there =D
Logged
  • Dawning Hour
Re: Link Swimming
« Reply #8 on: March 29, 2010, 10:51:28 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Okay, thnx DH.
Logged

pxl_moon (dotyue)

Team Dekunutz
Re: Link Swimming
« Reply #9 on: March 29, 2010, 01:43:05 pm »
  • .越//
  • *
  • Reputation: +5/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2280
I didn't look at the code... but i bet its not done: maybe the swim code should be asking if there are "flippers" or not... when not link gets damage and resets , if there is then link begins swimming...
Logged

~~Resources~~
~Minish Cap Style~

Minish Cap Beta:Firerod Icon, Majoras Mask:ChuChu, Ocarina of Time:Gossip Stone, Oracle Series:Link plays the "Herpes of Ages", Impa, Wand Maker: HUD
~GB-Zelda Style~
Ocarina of Time: Deku Caca
~Other~
Paper Mario Style Zelda&Link, Tetra Trackers HUD-Cleanups

Re: Link Swimming
« Reply #10 on: March 29, 2010, 02:33:39 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Yue, you are correct. Like I said in the first post drowning is a separate state that has different movement code and reactions to key presses. Adding a check  to see if the player has "flippers" is easily done. The problem I am still struggling with is how best to store information like that.
Logged

Dark-Hylian

Silence
Re: Link Swimming
« Reply #11 on: March 31, 2010, 01:11:04 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 370
I checked the MC game, and when swimming, you slide a little bit, like 4 pixels, forward, and don't move until held for about .5 seconds after you've begun moving. I'd factor in some ice based movement, but tone it down greatly.
Logged
  • Dawning Hour
Re: Link Swimming
« Reply #12 on: April 03, 2010, 08:17:55 pm »
  • AKA "Micah DS"
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1347
Like everyone else is saying, I definitely think it needs a tad bit of a momentum feel because it doesn't seem quite right. Besides that and the boost needing fixing up (which you mention in the first post), I tried very hard to break it and found nothing out of the ordinary (not yet anyway). Nice coding work here! I'll try to get around to checking out some more of the scripts and do some more testing later.
Logged
  • My Music
Re: Link Swimming
« Reply #13 on: April 04, 2010, 07:38:17 pm »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
UPDATE: I just added some momentum to the swimming. I had forgotten that I had VBA, so I took a look at what the momentum of Link is by watching frame by frame. The momentum actually lasted 1 frame. What actually looks as the momentum are the extra graphical water ripples.

Ah well, the first post contains the code in the rar file.If you don't like the momentum I suggest you play around with the momentum parameters (the final parameter in the indicate lines):
Code: [Select]
if (able_x){
        //if you're holding left/right Link builds up speed
        if (hold_l || hold_r) move_x = scrAcc(move_x,maxi_x,hori_v,1.0);  <<----
        //otherwise you're not holding left/right and Link is slowing down
        else move_x = scrDec(move_x,0.8);                                         <<----
    } else {
        move_x = scrAcc(move_x,maxi_x,sign(move_x),2.0);                   <<----
    }
    if (able_y){
        if (hold_u || hold_d) move_y = scrAcc(move_y,maxi_y,vert_v,1.0);  <<----
        else move_y = scrDec(move_y,0.8);                                         <<----
    } else {
        move_y = scrAcc(move_y,maxi_y,sign(move_y),2.0);                   <<----
    }
Logged

Dark-Hylian

Silence
Re: Link Swimming
« Reply #14 on: April 07, 2010, 01:45:28 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 370
are you supposed to shoot you forward when you use the lantern in the water??
Logged
  • Dawning Hour
Re: Link Swimming
« Reply #15 on: April 07, 2010, 06:31:01 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
Yes and no. When swimming, the weapons assigned to the buttons are overridden by the swimming state. Even if the HUD shows the weapons the actions are different. The B (Z) button makes Link dive underwater. The A (X) button gives Link a boosted swim. With the boost while moving Link gets a boost in the direction of his movement (which includes diagonal movement) and while "standing still" you get a sudden boost in the direction Link is facing.

Before I programmed swimming I have been dragging Link through Lake Hylia and the Temple of Droplets for over 3 hours on my NDS Lite making notes. The only thing that I still forgot to program is what happens when Link gets caught in a waterfall (see Temple of Droplets).



DH: It surprises me that you never submitted the swimming ability for Link yourself. I know you have been working with the engine earlier in one of your own projects and added swimming to it. You have programming skills in GML.
Logged

Dark-Hylian

Silence
Re: Link Swimming
« Reply #16 on: April 08, 2010, 02:11:17 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 370
My previous swimming engine had a somewhat faulty speed up engine, and I wasn't going to include the diving. The speed up was based off the roll, and I was attempting to set up a little momentum factor, like we've been discussing previously.

I have been working on it, but it's a little different from how you guys do the whole ZFGC MC Engine. The new Diety engine I'm working on is closer to the code you've been using. Once I have finished my menu and minimap, I might submit those.

I just figured the zooming around when you pressed the button without any visual changes, then had to wait a while while it ran you into the wall was a bit of overkill =P
Logged
  • Dawning Hour
Re: Link Swimming
« Reply #17 on: April 20, 2010, 02:52:53 am »
  • *
  • Reputation: +4/-0
  • Offline Offline
  • Gender: Male
  • Posts: 207
When you are stationary in the water and press the opposite direction to what youre currently facing AND the "swim fast" button together, Link swims backwards. I dont know if you could call this a glitch or not but it does seems to be quite an odd behaviour.
Logged
Re: Link Swimming
« Reply #18 on: April 20, 2010, 10:00:58 pm »
  • You heard of the thing from the place with stuff?
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 604
Well, that is his backstroke. :P
Logged
Sorry, I can't think of a more interesting sig. > .>
Re: Link Swimming
« Reply #19 on: April 24, 2010, 08:48:12 am »
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3725
When you are stationary in the water and press the opposite direction to what youre currently facing AND the "swim fast" button together, Link swims backwards. I dont know if you could call this a glitch or not but it does seems to be quite an odd behaviour.
My apologies for the late reply and thanks for testing it. But I have taken a look at it and yes it is odd behavior. But it is behavior that I had to program explicit, because the Minish Cap does that also. Once Link goes into a boost Link's movement direction stays constant, but Link's facing direction can change.

Thus what happens is you press the X key that initiates the boost and sets the correct values. And then in either the same gamecycle or the next one you change the direction in which Link is facing to the opposite side. I know it is very odd behavior. But it is Minish Style odd behavior.

Well, that is his backstroke. :P
Yes he can also do a sidestroke  XD
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.342 seconds with 77 queries.

anything