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.

Anyone know about mode7 vertical sprites?

I've been messing with neo mode 7 (by MGC), I allowed control of the camera rotation/angle with wsad, added 8-way movement and changed the plane of movement to match the camera position (eg. if you press up, you will walk fowards in the direction the camera is pointed).
This creates a fairly believable "Pseudo-3d" effect, but I wanted to take it one step further by displaying vertical sprites along an x/y axis as well as vertically (so that you can create seemless fences/houses). I'd also like to make flat tiles appear at a certain height (different height levels on the map)..
If anyone is willing to help or offer advice, please do so.. Mode7 is a mostly dead script I know, but I don't know why nobody has used it in this way yet.. I can't find support for mode7 anywhere else
I can upload the original neo mode 7 demo which I'm using if need be, or get the link..
Thanks for your time
 
That is the problem, when you rotate the map, the vertical sprites remain still. I would like to find out how to display the sprite relative to the rotation/angle of mode7.
I am pretty sure that the sprite could be stretched to meet a point and I could come up with my own formulae to match the "camera" angle/rotation.. I'd just like a bit of assistance from a more experienced scripter.. Maybe one that knows some stuff about displaying sprites (I was never a sprite-focused scripter)

Edit: Ok, here is a few sections of neo mode 7 that draw vertical sprites.
These are in "class Sprite"
#--------------------------------------------------------------------------
# calculate x and y coordinates in mode 7 for a vertical sprite
#--------------------------------------------------------------------------
def neoM7(x_map, y_map)
x_map = 32 * x_map
y_map = 32 * y_map
y_init = $game_temp.zoom_sprites * (y_map - $game_temp.pivot - $game_map.display_y.to_i / 4)
x_init = $game_temp.zoom_sprites * (x_map - 320 - $game_map.display_x.to_i / 4)
y_intermediate = (((y_init * $game_temp.cos_theta -
x_init * $game_temp.sin_theta).to_i) >> 12)
x_intermediate = (((x_init * $game_temp.cos_theta +
y_init * $game_temp.sin_theta).to_i) >> 12)
self.y = $game_temp.pivot + ($game_temp.distance_h * y_intermediate *
$game_temp.cos_alpha) / ((($game_temp.distance_h) << 12) - y_intermediate *
$game_temp.sin_alpha)
self.x = (320 + ($game_temp.slope_value * y +
$game_temp.corrective_value) * x_intermediate)
end
#--------------------------------------------------------------------------
# calculate the zoom level in mode 7 for a vertical sprite
#--------------------------------------------------------------------------
def neoM7_zoom(x_screen, y_screen)
self.zoom_x = $game_temp.zoom_sprites * ($game_temp.slope_value * y +
$game_temp.corrective_value)
self.zoom_y = zoom_x
end
This is where it gets called:
#============================================================================
# ■ Sprite_V (Vertical Sprites)
#----------------------------------------------------------------------------
# Sprites corresponding to the vertical elements formed by tiles
#============================================================================

class Sprite_V < Sprite
attr_accessor :x_map # sprite's x_coordinates (in squares) (Float)
attr_accessor :y_map # sprite's y_coordinates (in squares) (Float)
attr_accessor :square_y # sprite's y_coordinates (in squares) (Integer)
attr_accessor :priority # sprite's priority
attr_accessor :animated # True if animated
attr_accessor :list_bitmap # list of sprite's bitmaps (Bitmap)
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
if $game_system.neoM7_loop
diff_y = ($game_player.y - y_map).to_i
offset_y = $game_map.height * (diff_y >= 0 ?
(diff_y / ($game_map.height >> 1)) :
(diff_y / ($game_map.height >> 1)) + 1)
diff_x = ($game_player.x - x_map).to_i
offset_x = $game_map.width * (diff_x >= 0 ?
(diff_x / ($game_map.width >> 1)) :
(diff_x / ($game_map.width >> 1)) + 1)
neoM7(x_map + offset_x, y_map + offset_y)
else
neoM7(x_map, y_map)
end
if !on_screen_x(x) or !on_screen_y(y)
self.opacity = 0
return
end
neoM7_zoom(x, y)
self.opacity = 255
self.z = 4 * y + 32 * priority
end
#--------------------------------------------------------------------------
# * Update bitmap for animation
# index : 0..3 : animation's index
#--------------------------------------------------------------------------
def update_animated(index)
self.bitmap = @list_bitmap[index]
end
end
And this is where it gets called in "class Tilemap_neoM7":
#--------------------------------------------------------------------------
# * Update the map sprite and the vertical sprites
#--------------------------------------------------------------------------
def update
# update map sprite
@offset_x = $game_map.display_x / 4 + @offset_x_res
@offset_y = $game_map.display_y / 4 + @offset_y_res
current_function_name = @current_function_name
if $game_system.neoM7_filter
current_function_name += (@even ? "Even" : "Odd")
@even = !@even
end
self.sprite.bitmap.neoM7(current_function_name, @map_tileset,
@bitmap_data, @width, @height, @offset_x, @offset_y)
self.sprite.zoom_x = @coeff_resolution
self.sprite.zoom_y = @coeff_resolution
# update vertical sprites
for vertical_sprite in @vertical_sprites
vertical_sprite.update
end
end
#--------------------------------------------------------------------------
# * Update animation for animated tiles
#--------------------------------------------------------------------------
def update_animated
@index_animated += 1
@index_animated %= 4
@map_tileset = tilesets_list[@index_animated]
# update vertical sprites
for vertical_sprite in @vertical_sprites_animated
vertical_sprite.update_animated(@index_animated)
end
end
I don't think those are the parts I need to modify, but maybe someone could help me find the right section.. Also, I've already scoured the internet for all instances of MGCaladtogel/MGC and only ever saw him as a "lurker" with less than 5 posts.. So help from the original creator is out of the question, but I did see a version of mode7 that Blizzard slightly modified, maybe he understands mode7 a little better..
 

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