A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: Isometric Tile Terrain?

  1. #1
    Senior Member
    Join Date
    Apr 2001
    Posts
    257

    Isometric Tile Terrain?

    Hi, i was wondering if there is any way to control the 4 corners of a tile to create angled tiles based on a height array with a height for each corner?

    e.g.

    height [1,1,2,2]

    that would make the x's different heights

    //in iso view not flat canot ascii draw it

    x----x would be 1,1
    |ssss| //s spacer to make it look right
    |ssss|
    x----x would be 2,2 so higher

    and could this be made to curve the tiles to give a really cool 3d look.

    cheers

  2. #2
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182
    Hey,
    It is very possible, and I made a little land-creation engine with it. Although I lost the .fla I did manage to get the an older .swf of the engine, wich I hope inspires you.

    The idea was this:
    Each tile will have a framelabel according to the height of it's corners. So each label will have a length of 4 and will look like this: 0001, 0010, 0000, 1110 etc.

    Then I placed the first tile on the upper left corner of the map and made it stop at a random frame.

    The next tile will have the same height on his left side, as the first tile has on his right side. The other 2 corners (right of the new tile) will be picked at random. This will finaly build the whole 'map'.

    Although, I had to use some tricky ways to go around this, because you can't get values from framelabels etc.

    SaphuA

    PS: .swf removed. I've posted the .fla a few posts below.
    PPS: It's better to see the technique at a mapsize of 2-4
    Last edited by SaphuA; 01-15-2005 at 11:04 AM.

  3. #3
    the thud of the body rabbitkiller's Avatar
    Join Date
    Jan 2004
    Location
    Royal Oak, Mi
    Posts
    318
    2SaphuA: good stuff!
    world[i] = new world();

  4. #4
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    Thats brill thanks. its given me a few ideas

    dont suppose it can be done dynaically tho?

  5. #5
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182
    Rabbitkiller:
    Thanks

    Veryevil:
    Thanks What do you mean with dynamical?

    Edit: A friend of mine still had an old fla that I gave him a while ago. It is unfortunatly not a very optimised version.

    The reason each framelabel starts with an f, is because Flash can't handle framelabels starting with numbers. I've commented the key-parts of the code, and I hope it's understandable.

    Hope someone is able to use it

    SaphuA

    PS: It's MX
    Last edited by SaphuA; 01-15-2005 at 09:39 AM.

  6. #6
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    Hi cheers

    By dynamically i meant have just an ordernary flat tile in the mc and the move the points of it with actionscript so for each different tile i dont need loads of frames?

    im just wonderin cos flash has all this drawin stuff in it now and if you could do stuff like that.

  7. #7
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182
    Aha...
    Well, I asume you're not just having simple vector graphic's so creating these tiles with the drawing API would be pretty difficult. I also don't think there's an easy way (if there even is a way ) to distort images like that.

    What you could do is put all different types of land (so with all the curves and stuff) into 1 MC, and then place it under an objects MC. This way your land can still be generated at random, but a tree will always stay on it's position. You should be carefull with the idea that trees can grow with an angle when standing on an angled hill, I think it's just a matter of illusion to fix this

    SaphuA

  8. #8
    Untitled-2.fla
    Join Date
    Jul 2002
    Posts
    391
    SaphuA
    here's a rebuild or your swf
    (hope you don't mind me posting it here)

  9. #9
    SaphuA SaphuA's Avatar
    Join Date
    Oct 2002
    Location
    The Netherlands
    Posts
    2,182
    Originally posted by token 3
    SaphuA
    here's a rebuild or your swf
    (hope you don't mind me posting it here)
    Hehe m8.. check a few posts above you

    Thanks for the effort though

  10. #10
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    Oh well didnt think so

    oh if you were wonderin (Plug plug) heres what im working on

    3disotile

    what you think

  11. #11
    jtnw_tmp
    Guest
    Dynamic distortion of the tiles is very possible... Demo.

    jtnw

  12. #12
    Senior Member
    Join Date
    Apr 2001
    Posts
    257
    HOW???????

  13. #13
    jtnw_tmp
    Guest
    Read this tutorial by ericlin. Basically, I just split the tiles up into 4 triangles, which can make any shape.

    jtnw

  14. #14
    CostomJunky Xploder's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    635
    wow, thats amazing the method of using triangles is really efficient, in 3DsMax they use triangles to model everything that comes to their mind. So would you be able to put a texture map on that and distort it. Like the textures you'd use for any 3D program, which are always distorted, and you need to draw an unwrapped image.

    Really good stuff. Gotta get to trying this out.

  15. #15
    jtnw_tmp
    Guest
    Xploder, if you're talking about my engine and if it can handle textures, then yes it can. Right now they're just simple vector boxes since bitmaps would slow it down quite a bit. That's kind of the reason why I stopped working on it; it's too slow. However, Since everything is based on a grid, there's many ways to optimize it with tricks, I just haven't found them all yet.

    jtnw

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center