• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Elevation in an isometric world.

Hello everyone! I've been working on a map editor for a project recently using chunks and surfaces, and it works pretty well so far:
But I've recently decided I'd like to attempt to convert this project into a 3D or 2.5D world.
The idea I came up with that I thought would be the best method to do this is using textured primitives to draw my surfaces angled in an isometric fashion. So I came up with this:
GML:
IsoX(x,y) {
    return(argument0-argument1)
}

IsoY(x,y) {
    return((argument0+argument1)/2)
}

with(oChunk) {
    if(surface_exists(TerrainSurface)) {
            if(InView(x,y,x+Game_ChunkSize,y+Game_ChunkSize)) {
                //draw_surface_ext(TerrainSurface,x-camera_get_view_x(view_camera[0]),y-camera_get_view_y(view_camera[0]),Game_PixelSize,Game_PixelSize,0,c_white,1)
                var tx = surface_get_texture(TerrainSurface)
                draw_set_color(c_white)
                draw_primitive_begin_texture(pr_trianglestrip,tx)
                //top left
                var sx = IsoX(x,y)
                var sy = IsoY(x,y)
                //top right
                var sx2 = IsoX(x+Game_ChunkSize,y)
                var sy2 = IsoY(x+Game_ChunkSize,y)
                //bottom right
                var sx3 = IsoX(x+Game_ChunkSize,y+Game_ChunkSize)
                var sy3 = IsoY(x+Game_ChunkSize,y+Game_ChunkSize)
                //bottom left
                var sx4 = IsoX(x,y+Game_ChunkSize)
                var sy4 = IsoY(x,y+Game_ChunkSize)
                draw_vertex_texture(sx,sy,0,0) //top left
                draw_vertex_texture(sx4,sy4,0,1) //bottom left
                draw_vertex_texture(sx2,sy2,1,0) //top right
                draw_vertex_texture(sx3,sy3,1,1) //bottom right
                draw_primitive_end()
            }
        }
}
Which is perfect! With an exception to the lack of water, and the inaccuracy of the brush (but those would be fixed later)
The issue I'm having is I don't know how to go about adding elevation to this. It's a terrain brush, so the longer you hold down the brush the higher the terrain should go (create mountains and etc).
But with this current system it remains flat. I can't think of any performance forgiving way to add this elevation, should I even continue with this method? Should I move to actual 3D?
I'm open to any solutions with this, even if it means entire rewrites. Please any advice is helpful, thanks!

EDIT- videos aren't showing up for me, maybe this link will work? Preview/Result Videos
 
L

Lycanphoenix

Guest
It's not just you who's not seeing videos. The forum staff is probably working on it.
 
Top