It is currently Sun Nov 19, 2017 9:15 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Sun Jan 10, 2010 5:43 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1518
Location: Fukuoka, Japan
I should have wrote by "basic collision detection" it meant "not finished" ;) The only one that "eject" the character is when you hit the floor. I extract the value of how many pixel to eject based on the direction you enter the block when extracting the metatile attribute (tentative code). I didn't do the left/right one yet since I need to re-factor the velocity and want to do it at the same time.

UncleSporky wrote:
It feels like it takes slightly longer than it should to start moving when you press a button, but maybe this is just due to the slow running speed.


I guess in that case it just the frame timer to when the actor can actually start to move that is too long (6 or 8 frames?). It's hard to get exact value like the real game. Those details I will need to tweak by hand at a later stage.

For the "leg stuck" in the wall, I didn't know. The leg bend is normal when you start running but it shouldn't stay that way and should reset to stand still. It must be caused by one of the re-factoring I did yesterday and the animation is not reset properly. Thanks to point it out.

tokumaru wrote:
Even though you said you wouldn't do it, it would be cool if you made the whole game, because then I'd be able to play it! =)


If you're ready to wait many, many years, I can see what I can do :) Once my second child get born next month... Let just say my free time will be almost non existent. I will have higher priority things to take care of.

@Celius

On the first read I didn't get the way you do it but I will try to read it again since it could be simpler than my way. Here's how I do it (but don't use the results yet for left/right ejection yet):

Code:
   ; First check if we have to extract the index of how deep inside the block
   ; is posX/posY and from which direcion
   lda Param::direction
   beq directionInfoFinish      ; Nothing set? No direction to extract

   lda #DIRECTION_LEFT      ; Comes from left side of block?
   and Param::direction
   beq notFromLeftSide      ; No, try right side
   
   lda zpView_firstMetatileColumnIndex ; Yes, use first metatile column index for value inside block
   sta Local::columnIndex      ; and store inside temp variable
   jmp notFromRightSide      ; Skip right since cannot be both at same time

notFromLeftSide:   
   lda #DIRECTION_RIGHT      ; Comes from right side of the block?
   and Param::direction
   beq notFromRightSide      ; No, try to test from top
   
   sec
   lda #METATILE_SIZE      ; To find value, we have to take the max of metatile size
   sbc zpView_firstMetatileColumnIndex ; minus position of index
   sta Local::columnIndex      ; and store it in temp variable. No skip here
   
notFromRightSide:   
   lda #DIRECTION_UP      ; Comes from top of the block?
   and Param::direction
   beq notFromTopSide      ; No, try bottom side

   lda Param::posY         ; Remove higher part so we get value from 0 to 15
   and #$0F
   sta Local::rowIndex      ; and store it in temp variable
   jmp directionInfoFinish      ; Skip bottom since cannot be both at same time

notFromTopSide:
   lda Param::posY         ; Remove higher part so we get value from 0 to 15
   and #$0F         ;
   sta Local::rowIndex      ; And save it
   lda #METATILE_SIZE      ; To find value, we have to take max of metatile size
   sbc Local::rowIndex      ; minus location found
   sta Local::rowIndex      ; And save it
   
directionInfoFinish:   


Maybe it's more complicated than nothing but once I use the value for left/right, it should work. The view prepare the values. The actor manager take care of what to do with the results.

Sivak wrote:
I wonder if I'll ever do a game that scrolls. :shock:


I'm sure you will. You already have a lot of code that can be re-used in your next game (game ai, animation of sprite etc). Once you get in your engine a way to scroll you're map, you're ready to go. And it's has nothing to do with MMC3: my demo in it's current state would run without a mapper at all if I wanted to. You can always ask me question if there is something that you want to know on how I did it.

Now the scroll is working fine because the actor movement is 1 pixel per frame. Once I add 1.25 at the velocity... I guess I will have to fix a lot of limit bugs..

@everyone:

By the way, is there any other homebrew that actually scroll like what I'm trying to do for my MM9 proof of concept except for sack of floor wich is in nbasic? I want to check how they do it for velocity. For now I have a blank and can't remember one homebrew with source.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 10, 2010 6:51 pm 
Offline

Joined: Sat Nov 17, 2007 8:44 pm
Posts: 385
tokumaru wrote:
Sivak wrote:
I wonder if I'll ever do a game that scrolls. :shock:

At the rate you are progressing, this is probably the next logical step! =)

THE NES NEEDS MOAR SCROLLING HOMEBREWS!!!


You know, despite that Sivak has already made one, I'm working on a game that doesn't scroll like his. It's not due to difficulties in writing tiles in real time, it's because the game I am trying to emulate doesn't scroll either. :) It's all a matter of style.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 10, 2010 7:56 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10114
Location: Rio de Janeiro - Brazil
I didn't mean that a non-scrolling game can't possibly be fun/good (it can still be an interesting game if something else is original enough among the homebrews), but that's the one thing that the homebrew scene is really lacking.

This game for example, doesn't really have any scrolling except for screen transitions (which is completely different than continuous scrolling) but it appears so well made that I really feel like playing it. I have several good things to say about it, even if scrolling isn't one of them.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 10, 2010 8:07 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19232
Location: NE Indiana, USA (NTSC)
If I'm not going to have a lot of time to work on President, perhaps I should just package up its source tree so far so that others can look at it.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 7:17 am 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1518
Location: Fukuoka, Japan
I was able to work this week to correct the camera so it would have the same velocity as the real game (or really close). I use the same parameters as MM2 since they said many time that the game was based on this one. Here's the 2010-01-17 build.

@UncleSporky:
The scrolling speed should now be up to par with MM9 or close. Does it still feel like a slow start or it seems better? The count of frame before starting (feet move forward before running) was not adjusted, just the velocity.

Regarding collision detection, I just added a quick hack before posting the file to block left and right a little bit. There is one bug were you can jump on top of something and MM will stay in the jump animation and I will fix it later. My main goal was to fix the scrolling so it could accept more than 1 pixel per frame. It was hell and took a lot of re-factoring but now it seems to work. It has more the MM feel and speed compared to before. It works on my famicom too.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 10:10 am 
Offline

Joined: Sun Jun 24, 2007 4:17 pm
Posts: 17
Location: Denmark
Amazing and ambitious project... keep up the good work :-)


Last edited by nesworld on Sun Jan 17, 2010 12:22 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 11:22 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10114
Location: Rio de Janeiro - Brazil
nesworld wrote:
Amazing and ambiguous project...

Are you sure this is the word you were going for? Didn't you mean "ambitious"? =)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 12:22 pm 
Offline

Joined: Sun Jun 24, 2007 4:17 pm
Posts: 17
Location: Denmark
Yeah, dunno what I was smoking when I wrote that ;)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 4:58 pm 
Offline

Joined: Sat Nov 17, 2007 8:44 pm
Posts: 385
Banshaku wrote:
@UncleSporky:
The scrolling speed should now be up to par with MM9 or close. Does it still feel like a slow start or it seems better? The count of frame before starting (feet move forward before running) was not adjusted, just the velocity.

No, it still feels slow and weird to me. For comparison, load up Megaman 6 and tap forward rapidly. You'll see his leg bend first, but you'll also be able to inch forward. In your engine all this accomplishes is wiggling his leg.

Primarily it just takes a few frames too long for him to actually begin moving.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 6:42 pm 
Offline
User avatar

Joined: Tue Jun 24, 2008 8:38 pm
Posts: 1518
Location: Fukuoka, Japan
UncleSporky wrote:
No, it still feels slow and weird to me. For comparison, load up Megaman 6 and tap forward rapidly. You'll see his leg bend first, but you'll also be able to inch forward. In your engine all this accomplishes is wiggling his leg.

Primarily it just takes a few frames too long for him to actually begin moving.


Depending on which version of MM you play the delay before moving is different. MM6 does react a lot faster when you tap rapidly, I remember that. I need to re-test MM9 to see how close is it to MM6. If I remember well, you could tap very little and only the leg was moving, which I reproduced. If you did press a little bit longer, it started to move without walking but yes, it does feel "sticky" in a way. Changing the delay is only one constant so I will try to reduce it and see how it goes.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 8:05 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10114
Location: Rio de Janeiro - Brazil
Banshaku wrote:
Depending on which version of MM you play the delay before moving is different.

If you are actually treating it as a "delay", that might be the problem. I just checked all MM games, and in the first 2 he doesn't always move on quick button taps, but from 3 onwards he always does.

No matter the game though, there is no delay in the programmatic sense of the word, it just happens that a fractional displacement is applied every time. So, in MM 1 and 2, even though he doesn't always move on quick taps, eventually he'll move a pixel if you tap the button enough times for the fractions to add up to a whole pixel.

In your demo, we can tap forever and he'll never move, he'll just twitch the leg and remain on the same spot. So I suggest you should add another byte to the coordinates in order to handle the fractional parts, if you aren't already doing so.

Other than that, things have improved a lot. Collision detection is much better and it's got a much better MM feel now. You just have to fix these walking issues.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 8:38 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3950
When inching forward in Megaman 2, you move forward one half pixel each try.
In Megaman 3-6, it's a whole pixel.
In Megaman 1, it seems to move you forward 3/5 of the time.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 17, 2010 8:53 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10114
Location: Rio de Janeiro - Brazil
Dwedit wrote:
In Megaman 3-6, it's a whole pixel.

He appeared to move 2 pixels every few tries, so I'm guessing it's slightly more than a whole pixel every try, as the fractions eventually add up to an extra pixel.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 18, 2010 3:10 am 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7266
Location: Chexbres, VD, Switzerland
It's a known fact that the ground is less "slippery" in Mega Man 3-6. Probably Megaman "accelerate" in 1-2 while he's straight at his max speed in 3-6, I might be wrong tough. Samme applies when he stops.

Personally what mother me the most is something when Megaman is landing. It really doesn't look real to me - but I might be wrong.

_________________
Life is complex: it has both real and imaginary components.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 18, 2010 3:33 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2981
Location: Tampere, Finland
Bregalad wrote:
Personally what mother me the most is something when Megaman is landing. It really doesn't look real to me - but I might be wrong.

I noticed the same, he seems to sink in to the floor for one frame or so.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 49 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group