Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

16x16 movement

This is for RMXP (RGSS)

I've been racking my brain trying to find out how to do this...so far no luck.

Basically I want to change the way the player and other events move. I want them to move based on 16x16 tiles, or in other words, I want to halve the size of all map aspects. I have accomplished the graphical side of things by using Sephirothspawn's Tilemap rewrite and changing @tilemap_tile_width and @tilemap_tile_height to 16 (instead of the default 32). Like I said, this accomplishes the graphical side of things nicely. However, the map is still being treated like it is normal size. I want to make it so that all characters move 16 pixels, and the default screen is essentially 40x30 (16x16 tiles).

No, I don't want to have to go to Pixel Movement...I will if I have to, but I'd rather stick with simple tile movement, just shrink it by half.

My problem? I don't know where to start. I tried fiddling around with Game_Character's Screen_X and Screen_Y methods...but I just can't seem to get it to work. Any help would be very much appreciated.

EDIT: I may have fixed it, by switching the Tilemap rewrite to zoomout instead of chane tile width, and then going into sprite_character and halving its x and y. However I am still interested in how others would have gone about this, just in case my workaround ends up being disadvantageous.
 
def move_down add "+1" to charcater @y. so try change it to "@y += 0.5"
Won't work. The movement will work fine, but there will be issues with collision checking and general problems with the events.

I tried fiddling around with Game_Character's Screen_X and Screen_Y methods...
That's quite right. You'll have to adapt those methods but there's also other problems you'll find. Game_Map has some values you'll have to change to fit the 16x16 tiles, like the screen center and other things I can't remember right now.
Sorry, I can't remember the whole scripts. I don't have RPG Maker installed here, and it's been a while since I've coded RGSS for the last time. :)

Hope this helps. Good luck!
SEE YA!!!!!
 
@Atoa - Thank you for the help, but as LegacyCrono said, I don't think that would work.

@LegacyCrono - I did have to tweak the screen centering, but I think I figured it out. I'm glad I seem to have gone about it the right way. Thank you for your help. :)
 

Atoa

Member

But that works in part, the characters will walk 16px.
As you said:
My problem? I don't know where to start. I tried fiddling around with Game_Character's Screen_X and Screen_Y methods...but I just can't seem to get it to work. Any help would be very much appreciated.
I gave you a starting point.
All you would need is to fix the passability issues.

This is the move down method
Code:
  def move_down(turn_enabled = true)

    if passable?(@x, @y + 1, 2)

      @y += 1

      increase_steps

    end

    turn_lower_left if turn_enabled

  end

try this:
Code:
  def move_down(turn_enabled = true)

    if passable?(@x, @y + 0.5, 2)

      @y += 0.5

      increase_steps

    end

    turn_lower_left if turn_enabled

  end

I'm not 100% sure if that will work perfectly. but that is an good start point. If it have any issues, just fix them.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top