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

Pages: [1] 2   Go Down

Author Topic: Pokemon Overworld  (Read 4018 times)

0 Members and 1 Guest are viewing this topic.

Diminish

4Sword
Pokemon Overworld
« on: August 14, 2010, 05:14:04 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
I've worked on a Gameboy-styled Pokemon engine previously and decided to restart some work on it because Zelda coding was giving me slight headaches. Some of the features I was working on then haven't been integrated into this current working engine - namely having an overworld Pokemon follow Ash, animating water tiles, and going into buildings. The stuff in this one though is worth putting out now.




Download Link:
http://www.zfgc.com/index.php#?action=resources&sa=view&id=201

Current Features:
- Grid Movement
- Ledge Jumping
- NPC/Sign Text
- NPC Movement

The first two are obvious, the second two I am a little proud of. I got the text engine to animate and work correctly without relying on refreshing the screen in a for-loop, using sleep, and not using keyboard_wait. The entirety of the text can be contained in a single string. When it is drawn, it can go to the next text line, wait for z to be pressed to go to the next line, or wait for z to be pressed then "clear" the lines and keep going. All the NPCs are stopped when Ash reads a sign or talks to an NPC - if they are moving they can even be frozen mid-step appropriately.

The NPC movement is also something cool. An NPC can not move at all and never have to return to a direction (a simple sign), can not move at all and return to a direction (standing Professor Oak), can not move at all but can still change directions, can only move horizontally or vertically, or can move in all directions. The engine shows off all of those kinds of movement. It should be noted that for each NPC the value for such things much be set in the room editor, control + right clicking on the NPC instance, and then setting the creation code. Also even though the NPC movement code checks for the absolute boundaries of the room, in the actual game the rooms are fully bounded by objects so that code can be removed later.

Even though it is not in the engine, getting the menu system worked into this wouldn't be as difficult as the text engine due to the menu text not being animated. Additionally things like doors, stairs, and grass collisions would just be done through checks when Ash is on a 16 x 16 tile (something like grass would only be checked once though otherwise just standing on grass for a while would trigger something). I'll throw in more features later!
« Last Edit: August 14, 2010, 05:16:31 am by 4Sword »
Logged
Re: Pokemon Overworld
« Reply #1 on: August 26, 2010, 06:02:41 pm »
  • Oh.
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 579
I propose Zelda Classic for Pokemon-style games, wouldn't that be fun?
Logged
Hm.
Re: Pokemon Overworld
« Reply #2 on: October 30, 2010, 12:20:42 am »
  • The king of Awesome
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 198
I know this old but it crashes when opened in GM8 pro.
Logged

Diminish

4Sword
Re: Pokemon Overworld
« Reply #3 on: October 30, 2010, 12:39:31 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
That is odd I made it in Game Maker 8 Professional edition; albeit that last part was suspiciously attained. I guess I could put it out sometime in Game Maker 7 - it really doesn't require any features not found in Game Maker 7 Lite.
Logged
Re: Pokemon Overworld
« Reply #4 on: October 30, 2010, 12:52:45 am »
  • The king of Awesome
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 198
I dunno, just about anything I donload from the zfgc's database always seems broken(but downloaded from else where  seems fine)
Logged

Diminish

4Sword
Re: Pokemon Overworld
« Reply #5 on: October 30, 2010, 01:13:10 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
I just downloaded and ran the engine with no problems. I am not sure what your issue is; some of the stuff I have made for the GM Minish Cap Engine was also made in the version of Game Maker I am using and Niek reported no issues with the files being unable to be opened. Sometimes though when I use Google Chrome and click a download link, it either "freezes" or doesn't set up the connection properly (it gives highly unreasonable download times). Usually trying again fixes that.
Logged
Re: Pokemon Overworld
« Reply #6 on: October 30, 2010, 02:59:00 am »
  • The king of Awesome
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 198
I actually use chrome, would be odd if that was the problem.
I'll give it another go in 30 minutes just about done with work for today. And to start a halloween Party tomorrow(WOOT!)
Logged
Re: Pokemon Overworld
« Reply #7 on: October 30, 2010, 09:32:30 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 160
that textbox engine is everything i want !
Logged
Nubcake now uses Purebasic!

Mamoruanime

@Mamoruanime
Re: Pokemon Overworld
« Reply #8 on: October 30, 2010, 09:36:31 am »
  • ^Not actually me.
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9780
I dunno, just about anything I donload from the zfgc's database always seems broken(but downloaded from else where  seems fine)

I don't have that problem on any of the 4 machines I have access to D:... Each with different ISP's... I used to have that issue once before though; I forget what I changed to fix it though. I think it was just unstable net if I recall.
Logged


50% Game Development,
50% Crappy Art,
100% Programancy.
  • Tyler & Travis also David... Probably.

Diminish

4Sword
Re: Pokemon Overworld
« Reply #9 on: October 30, 2010, 09:42:53 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
that textbox engine is everything i want !
I forget how efficient it was when I was coding it, but the way the text draws is that it the textbox or whatever has to loop through a line each step (and each step the amount of letters displayed increases which produces the animated look). If the text string you are using is really long a good habit to get into with the engine would be to use whatever character I had it that moved the beginning position of the line to the more recent letter. It makes it so it doesn't have to loop as much. Long dialog boxes in Pokemon tend to have a similar sort of deal.
Logged
Re: Pokemon Overworld
« Reply #10 on: October 30, 2010, 09:48:27 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 160
i still haven't found out a way to not freeze the game without using a for loop/sleep ,
Logged
Nubcake now uses Purebasic!

Mamoruanime

@Mamoruanime
Re: Pokemon Overworld
« Reply #11 on: October 30, 2010, 09:50:16 am »
  • ^Not actually me.
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9780
i still haven't found out a way to not freeze the game without using a for loop/sleep ,

Loops continue until the loop says not to and don't move towards the draw phase... There's no "not freezing" the game. Sleep also.
Logged


50% Game Development,
50% Crappy Art,
100% Programancy.
  • Tyler & Travis also David... Probably.
Re: Pokemon Overworld
« Reply #12 on: November 28, 2010, 08:13:43 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 160
sorry to bump tis topic but , how do you change the text ?
Logged
Nubcake now uses Purebasic!

Diminish

4Sword
Re: Pokemon Overworld
« Reply #13 on: November 28, 2010, 10:06:14 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
It is a little confusing at first, I probably should have emphasize it more too - you have to view the creation code of the instances in the room. That is not the same as looking at their creation events under the object, but instead you have to control + right click the instance in the room and view its creation code. I included the line for the instance to have as its text there.
Logged
Re: Pokemon Overworld
« Reply #14 on: December 28, 2010, 05:22:23 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 160
I've encountered a problem after extracting parts of your engine and trying them out ; When i hold the combination of left+up,left+down,right+up,right+down or the other way , my character goes of the grid and just keeps on going . What am i doing wrong ?

Slightly Modified.
Code: [Select]
hold_d = keyboard_check(vk_down);
hold_u = keyboard_check(vk_up);
hold_l = keyboard_check(vk_left);
hold_r = keyboard_check(vk_right);

if (hold_r || hold_l || hold_d || hold_u && moveable) moving = 1 else moving = 0




if (x mod 16 == 0 && y mod 16 == 0)
 {
  if hold_r
   {
    movedelay+=1
    direction = 0
    sprite_index = sRight
    image_speed = 1/8
    if movedelay > 4
    {
     x+=movespeed  
     view_xview+=movespeed
    }
   }
  if hold_l
   {
    movedelay+=1
    direction = 180
    sprite_index = sLeft
    image_speed = 1/8
    if movedelay > 4
     {
      x-=movespeed
      view_xview-=movespeed
     }
   }
  if hold_u
   {
    movedelay+=1
    direction=90
    sprite_index = sUp
    image_speed = 1/8
    if movedelay > 4
     {
      y-=movespeed
      view_yview-=movespeed    
     }
   }
  if hold_d
   {
    movedelay+=1
    direction=270
    sprite_index = sDown
    image_speed = 1/8
    if movedelay > 4
     {
      y+=movespeed
      view_yview+=movespeed    
     }
   }
  if !moving
   {
    movedelay = 0
    image_index = 0
   }
 }
else
switch direction
 {
  case 0: x+=movespeed view_xview+=movespeed break;
  case 90: y-=movespeed view_yview-=movespeed break;
  case 180: x-=movespeed view_xview-=movespeed break;
  case 270: y+=movespeed view_yview+=movespeed break;
 }

I noticed the max value of your characters x mod 16 was 14 , mine is 15 , when i drew the text to seen what value of x mod 16 was it was 1 when i went off the grid upwards.
« Last Edit: December 28, 2010, 05:30:11 pm by Nubcake »
Logged
Nubcake now uses Purebasic!

Diminish

4Sword
Re: Pokemon Overworld
« Reply #15 on: December 28, 2010, 06:03:13 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
You don't even need to do the key combination you mentioned because the overworld I had in my example wasn't completely contained - i.e., you are fully able to walk on forever into nothingness. The Pokemon overworld in Red/Blue was contained by blocks, and I could have done something similar in the overworld if I wanted to but I didn't want to have a lot of block objects. That tile code I used for the Minish Cap Engine might replace having block objects in a later updated release of the Pokemon Engine stuff.

The code I used for Ash's movement in my example code forces grid movement by only allowing Ash to move when he is on a grid space, and then if he goes based on the key first checked. I don't know why you removed the if-else structure of that, it is kind of important (you don't need that if statement right after the hold variable setting). I don't know what you are talking about with the x mod 16 values but yeah, if the movespeed is 2, then the max value of the x mod 16 should be 14, which happens when 2 pixels away from a gridspace. This is because 14 mod 16 == 14. If your movespeed is 1, you would end up getting 15 as the highest value because you are able to get within 1 pixel away from a gridspace. But overall, the value of x mod 16 only matters when it equals 0 because that represents being on a gridspace.
Logged
Re: Pokemon Overworld
« Reply #16 on: December 28, 2010, 06:15:25 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 160
I'm still not getting 14 , it still doesn't work when i put movespeed = 2 .
Logged
Nubcake now uses Purebasic!

Diminish

4Sword
Re: Pokemon Overworld
« Reply #17 on: December 28, 2010, 06:24:08 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
Why are you running the game room at 60 frames per second? There is no need to. If you slow it down with the debug menu, you'll be able to see the x mod 16 value go through 1 and 15 incrementally, with it being 0 on the gridspace. Oh, wait, in your file if I go to negative grid spaces it'll do that thing where Ash keeps moving, however in my code I don't encounter that issue at all. You messed it up somehow.
« Last Edit: December 28, 2010, 06:28:31 pm by 4Sword »
Logged
Re: Pokemon Overworld
« Reply #18 on: December 28, 2010, 06:26:13 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 160
I only run it at 60 fps for quality , so what does that mean ?
How could i mess it up , it's quite similar to yours.
« Last Edit: December 28, 2010, 06:31:28 pm by Nubcake »
Logged
Nubcake now uses Purebasic!

Diminish

4Sword
Re: Pokemon Overworld
« Reply #19 on: December 28, 2010, 06:34:11 pm »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6582
Ah, I just edited my previous post. Anyway you don't really have to run a game with old graphics at 60 frames per second, and on older machines it wouldn't run as well. I also attempted some more stuff from your file and if you go off the grid into negative gridspace, I am not able to change direction and I keep moving. It doesn't happen in my code at all, my guess as to why it happens with your stuff is because there is no if-else structure to the code and some of the syntax doesn't have appropriate use of brackets/braces or semi-colons.
Logged
Pages: [1] 2   Go Up

 


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



Page created in 0.04 seconds with 55 queries.