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

Pages: [1] 2 3 4   Go Down

Author Topic: Pokemon Walking Engine  (Read 12266 times)

0 Members and 1 Guest are viewing this topic.
Pokemon Walking Engine
« on: July 04, 2008, 03:01:29 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I was going to include a pause menu with this engine, but I am currently refining the way in which the menu is drawn.  This walking engine is a replication of the character movement in Pokemon Blue.  It is pretty basic and more features will be added later.

Includes:
- Walking on a Grid
- Solid Object Collision
- Correct Animation Rate
- Fixed View

Preview:


Download: PokemonWalk.gmk (30.93KB)
« Last Edit: September 23, 2008, 08:11:27 am by 4Sword »
Logged
Re: Pokemon Walking Engine
« Reply #1 on: July 04, 2008, 03:47:45 am »
  • Wooper Don't Give a !@#$%
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1457
Good stuff, but friendly tip, you might want to considering renaming this. I mean, just read the topic title, realize this is ZFGC, remember the shitstorm over how this place supposedly gets nothing but walking engines, and reconsider the topic title.
Logged
ROLL TIDE WHAT? **** YOU!!! Geaux Tiga

~The Gaurdians of ZFGC~
Kirby, metallica48423, Max, Vash, walnut100
  • Gamers & Developers Unlimited
Re: Pokemon Walking Engine
« Reply #2 on: July 04, 2008, 04:06:30 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I figured that if I got a shitstorm that I would at least get something.  It is kind of funny in that I was once dumbfounded by how "Ash"'s footwork worked.  Like, if you are moving to the next grid space, before getting there one of your feet comes out, and then you stop and then if you move again in the same direction, you transition to the other foot.  I was going to try and find the image_speed by screen capturing the Pokemon Blue ROM which alters your image by position.  Meh, that was a complicated way of thinking about it; also, if I based image transition simply based on distance traveled, it would not animate if there were an obstacle in your way.

In regards to the menu, I left it out more specifically because upon observation of the way the Game Boy rendered it, the borders, arrows, and even letters all fit into 8 x 8 image sizes, so with that in mind I plan on rewriting what I had by basically mosaic-ing all of those 8x8s from a font sprite set instead of having stored complete images.  It sounds like I am over-thinking it, but in terms of efficiency, there are a lot of menus with different sizes, and doing it the way I mentioned with the mosaic like idea would make it better.

Also, thanks for the comment, I was surprised that someone saw this, lol.
Logged

Giverny

Christ on Acid
Re: Pokemon Walking Engine
« Reply #3 on: July 06, 2008, 08:21:08 pm »
  • Bitte Scheiße
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Female
  • Posts: 1159
nice engine :p
As for the menu thing, in Pokemon Blue, the menu is a background, moer specifically a tileBG. Its to save RAM and ROM  and stuff.
Logged
THEGivernyPROJECT
~LynkW-Surrender Global
  • Surrender Global Forums
Re: Pokemon Walking Engine
« Reply #4 on: July 06, 2008, 08:34:38 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Well I do not know if I will be able to replicate precisely how it is rendered due to the different structures of both Game Maker and the Game Boy, but this is how I draw the outer frame of my menus currently for any size of menu I want:

Code: [Select]
startxm = argument0;
startym = argument1;
lengm = argument2 - 2;
heigm = argument3 - 2;

draw_sprite(spr_font,98,startxm,startym); 
draw_sprite(spr_font,104,startxm, startym + ((heigm + 1) * 8));
draw_sprite(spr_font,100,startxm + ((lengm + 1) * 8),startym);
draw_sprite(spr_font,106,startxm + ((lengm + 1) * 8),startym + ((heigm + 1) * 8));

for (a = 1; a <= lengm; a += 1)
{
  draw_sprite(spr_font,99,startxm + (a * 8),startym);
  draw_sprite(spr_font,105,startxm + (a * 8),startym + ((heigm + 1) * 8));
}

for (b = 1; b <= heigm; b += 1)
{
  draw_sprite(spr_font,101,startxm,startym + (b * 8));
  draw_sprite(spr_font,103,startxm + (a * 8),startym + (b * 8));
}

It could even be more simplified if I replaced the variable names in the bottom part with just the argument names.  I am trying to make it so that when I draw static text that it does not refer back to the variables in this script; which should be easy enough, I just have to change the way blank white space and text are allocated when drawn.  Right now I have it all set up so that draw_menu, draw_txts, and draw_arro are all separate.  Somewhat of an issue comes up when when calling draw_txts because the white space extends to where the arrows drawn x-coordinate, but it is not that much to worry about.
Logged
Re: Pokemon Walking Engine
« Reply #5 on: July 07, 2008, 12:53:18 am »
  • Drop down and give me 9000!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 426
Looks like you've put a lot of effort into this.

I remember back in the GM day I made a pokemon walk engine(which has been long since lost forever). But unfortunately it was mostly drag and drop 'cause I couldn't really understand the concept of gml and struggled with the language. But it was fun to walk around in, I had townspeople who randomly walked around in the game and it was impossible to collide and get stuck in them. I also observed FFIV and made a walk engine, I watched the movement in the game and what I was doing so closely I'm pretty sure I almost got it just like the game.

Oh how I wish I could make games in gamemaker again, unfortunately due to the high criticism of it and the difficulty for me to learn a programming language from scratch I think I'd be better of sticking to composing music. But the urge to make a game is so strong, and gamemaker isn't that bad when you know what you're doing, I like this walk engine very much. Reminds me of when I made my own :).
Logged
I like potato.
  • My Myspace
Re: Pokemon Walking Engine
« Reply #6 on: July 07, 2008, 05:02:33 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Thanks, but it only looks like a lot of effort because I included commenting with the code so that others could learn from it more easily if they wanted to.  I am really trying hard to make it as efficient as it can be though; in doing so, I ended up siding with the built in place_snapped function rather than doing it custom with modulus and the number 16 with both x and y to determine if the character is on the grid. 

Game Maker is just a tool that if used well it cannot be mocked totally.  Pokemon Blue is fun to work with in that its challenges are code related so I will probably continue working with it alone until I can get into making Pokemon in something like C# if possible.  I also have a Legend of Zelda game that has a movement engine modified from Goodnight's in its sprite checking that is pretty good; you can swing your sword, go in and out of buildings, and move around with your shield out at a slower speed.  I might just release that later because I do not know how far I will get on that, but it is helpful because the code is nice and the animations for Link are done well.

But yeah, a while back I went through a game making slump.  A while ago I started trying again and now it just feels kind of natural and challenging in a good way.  It is not so much my passion, but it feels nice. 
Logged
Re: Pokemon Walking Engine (Also WIP Menu Engine...
« Reply #7 on: July 07, 2008, 09:03:22 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Yeah, I was working with the menu engine, getting the basics down; I would have been bailing straw today, but it rained and you cannot move that stuff when it is wet (well, it is not that hard, but you do not want the barn to lose support by having the wood rot).  Anyway, like I said, it is a work-in-progress engine, but the basics are good.

Includes:
- Drawing a Menu of Custom Width and Length
- Drawing Text Staring on Line One or Two of Custom Width and Length

Preview:


Download: PokemonMenuWIP.gmk (35.29KB)

EDIT: I have not updated it yet, but as you can see by the screen shot, there is a gap between the text and the frame.  This is for the arrow that is drawn to indicate your position on the menu.  What I have to do is figure out how to record that position so that an arrow can be drawn there.  How do I do this?  Hypothetically, I could try put a symbol into the text line that when read indicates an arrow position to be drawn.  By doing this I would have to omit the arrow position symbol before it is read by the text drawer.  I think I know what to do.  The only thing I really have to focus on is drawing the arrow to the left or right of the text as a yes/no choice box draws it on the right, but that should be easy enough.

EDIT2: I am an idiot.  The yes/no box has the arrow on the left still, so this should be easy enough to make.

EDIT3: I tested out my hypothesis and it proved right to some degree.  I altered the way in the text and blanks were drawn; to create a blank 8x8 space for the arrows, a tilde precedes the spot in text where the arrow is drawn.  Inside the code I also record what that drawn position would have been into a variable.  However, there are issues still.  Basically, if you are the main menu and want to go to another menu, the arrow becomes hollow on the main menu and should stay like that until you get back.  I could probably fix this with a "previous" variable and by using two-dimensional arrays to store the image return value to display the arrow based on menu position and menu type.  It's a pain in the ass to work out, lol.  The menu works now by drawing the main menu, and then drawing the sub-menus over it, and rather than creating sub menu position variables.  Guh...  I did solve the menu frame and text drawing things, but the arrows are elusive.
« Last Edit: July 08, 2008, 06:40:01 am by 4Sword »
Logged
Re: Pokemon Walking Engine (With Ledge Jumping)
« Reply #8 on: July 14, 2008, 03:41:50 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I did not have the left, right, and up directions for jumping off a ledge because I mainly felt done with the concept and replicating the displacement numbers would take forever.  It is not fully done though, but yeah, it is something.

Changes:
- Reworked code to lessen dependence on step event
- "Ash" is now drawn four pixels up compared to last download to be in the correct position.

Updates:
- Ledge Jumping

Flaws:
- Shadow is not drawn directly before you jump off ledge and directly after you land
- Some redundancy in "Ash" displacement variables when drawing.

Preview:


Download: PokemonWalk2.gmk (32.10KB)
Logged
Re: Pokemon Walking Engine
« Reply #9 on: July 14, 2008, 03:48:05 am »
  • Drop down and give me 9000!
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 426
Looking good in the preview, by drawn four pixels up did you change the sprite size by +4 or did you set the y origin to 4 pixels?
Logged
I like potato.
  • My Myspace
Re: Pokemon Walking Engine
« Reply #10 on: July 14, 2008, 03:58:02 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Oh, you are right, I could have done that, but instead I just set the displacement drawing variable for "Ash" to be set to -4.  In the Draw Event, there is a condition statement to determine whether or not to draw the shadow and then a function to draw "Ash" himself with the x value set to x + image_dispx.  I will probably change this later though when I go through it again to update it for efficiency. 

Also, the reason the flaw exists is mostly because the condition that is checked to draw the shadow is true when "Ash" is overlapping the ledge object.

EDIT: There also seems to be a glitch in the engine somewhere.  Somehow if something is just right, you can walk up through a ledge, but replicating the effect is nearly impossible.
« Last Edit: July 15, 2008, 01:33:02 pm by 4Sword »
Logged
Re: Pokemon Walking Engine
« Reply #11 on: July 21, 2008, 09:17:42 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 13
Wow, good work man, i like it.
Mod Edit: You may watch your offensive tone, if you don't mind. This is a collaborating topic, have a little more respect, if you don't mind.
« Last Edit: July 21, 2008, 10:10:58 pm by Ricky »
Logged
Re: Pokemon Walking Engine
« Reply #12 on: July 21, 2008, 09:25:11 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I am currently working on redoing it again as the animation rate for the "Ash" character was twitchy when he would come to a stop.  That, and since the drawing is done at the end of each step, updating the animation has to be figured in accordingly.  My reworked engine that I might release soon if it is good enough actually does everything without the use of speed, as it now would only use x and y position updates each step.  I have fixed the animation so it is perfectly perfect now, I just have to finish the ledge jumping so that I do not go backwards in my updated engine versions in terms of functionality.
Logged
Re: Pokemon Walking Engine
« Reply #13 on: July 29, 2008, 04:38:49 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
Alright, I just got done reworking the ledge jumping and walking engine.  The only bit of code that I did not like in it is in the step event, to check for the presence of a ledge, it seems redundant, but only a little.  Also, I noticed on an emulator, the controls for Pokemon movement were simpler than I thought.

Updates/Corrections:
- There is a delay when you jump off of the ledge to draw a shadow.
- The shadow is still drawn for one step when you land.
- The step event is used over dividing it up into key presses for simplicity.
- The "solid" objects no longer have step events of themselves, this saves processing power
- Up-down-left-right hierarchy priority key setting (it looks like a step back, but this is how the Game Boy did it)
- Image transition is clean and self-correcting; since drawing is done last, image transition was set back a step.
- X and Y movement setup rather than the speed function
- Image Displacement off of ledge includes only values where displacement changes compared to last displacement value
- Directional variables have been removed in favor of setting a "snap" position and comparing the current x or y to it.

Download: PokemonWalk3.gmk (28.77KB)

Edit: I just figured out that it still is not perfect, lol, I need to tweak it so that there is a felt delay after landing.  I thought that it was fine since it still drew the shadow, but there is no real delay, sorry.

Edit2: Simple fix, it now works as perfectly as it needs to, oh and I reworked the level so that there are a series of downhills for the hell of it, lol.
« Last Edit: July 29, 2008, 08:49:59 am by 4Sword »
Logged
Re: Pokemon Walking Engine
« Reply #14 on: July 30, 2008, 08:30:36 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 29
Wow, nice engine so far, works real well.
Logged
Re: Pokemon Walking Engine
« Reply #15 on: July 30, 2008, 09:35:05 pm »
  • And if they dont dance, they're no friend of mine
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1338
Wow, this works really well. Is this building up to some lasrger project?
Logged

Art by Kyuumu, banner by me
Screw this, im off to Hogwarts...
Re: Pokemon Walking Engine
« Reply #16 on: July 30, 2008, 10:01:17 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
I plan on making it a larger project, but I cannot promise that I will have the interest to go that far; working out the way it works is where I am having the most fun right now.  I did have this odd idea that once it was done I could tweak it so that the main character is Link who has attacks like a Pokemon and Zelda creatures were in the game, lol.  The next update will have surfing and walking through tall grass; most of the effects for which are done, I just have to get the animation's timing of the water right.  The text engine is the hardest part and that is not close to being done yet.  I also have to work on a way to fade when going in and out of buildings as well as battle transitions. 
Logged
Re: Pokemon Walking Engine
« Reply #17 on: July 30, 2008, 10:11:56 pm »
  • And if they dont dance, they're no friend of mine
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1338
I plan on making it a larger project, but I cannot promise that I will have the interest to go that far; working out the way it works is where I am having the most fun right now.  I did have this odd idea that once it was done I could tweak it so that the main character is Link who has attacks like a Pokemon and Zelda creatures were in the game, lol.  The next update will have surfing and walking through tall grass; most of the effects for which are done, I just have to get the animation's timing of the water right.  The text engine is the hardest part and that is not close to being done yet.  I also have to work on a way to fade when going in and out of buildings as well as battle transitions. 

That sounds pretty damn amazing, and judging by what ive seen so far, its gonna be awesome. Also that does sound like a cool idea for a game...
Logged

Art by Kyuumu, banner by me
Screw this, im off to Hogwarts...
Re: Pokemon Walking Engine
« Reply #18 on: August 22, 2008, 12:49:21 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
This isn't an update that a lot of people who have looked into the code can appreciate because I am not done with it yet, but I made a breakthrough in regard to both the movement code (if you are off the grid, incrementing where you are is now based on your sprite_index, in a similar fashion, I got rid of the fake key presses as you cannot change your sprite anyway when you are in a delay thus you can use the sprite_index to tell the game what to do).

The reason that I am not giving out the GM7 is that the transitions, while they work effectively, they are not fully done in that objects are not made completely black before the transition goes full black.

http://crystalrook.sitesled.com/PokeProject.zip
Logged

Kingknight

SiMelon
Re: Pokemon Walking Engine
« Reply #19 on: August 22, 2008, 01:07:28 am »
  • The Hunter
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 495
wow 4sword keep it up lookin better every second :)
Logged
Pages: [1] 2 3 4   Go Up

 


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



Page created in 0.029 seconds with 76 queries.

anything