XNA Creators Club Online
Page 1 of 1 (14 items)
Sort Posts: Previous Next

My XNA terrain (Wonderul Life Engine)

Last post 11/28/2009 1:33 PM by Craig Martin. 13 replies.
  • 11/22/2009 7:25 PM

    My XNA terrain (Wonderul Life Engine)

    Hello all, first... sorry for my english,I'm a not so young guy from italy :)

    With the release of XNA I rediscovered the pleasure of programming,
    a hobby that I had about 15 years ago and stopped for job reasons.
    Well .. now coding it's a bit different ... shaders? GPU? C#?
    So I read some tutorials (Riemer's), and I find help reading and searching in this community

    This is my little work ... nothing amazing, but I created all: Textures, models, music, code
    It's a terrain engine, with water,sky and vegetation

    I called it Wonderful Life Engine ... oh not really "Engine", It's not that good...
    just a mess of a code, but I had fun :D, and learning is always beautiful..
    For now I made it just for fun (I don't have so much time for hobbies)

    I uploaded a video on YouTube :

    http://www.youtube.com/watch?v=lcNX_FARy-Q

    A screenshot (the video quality is not very good)

    Right-click and select 'Set Image Properties'

    So thanks for the help I found here, thanks to all :)

  • 11/22/2009 10:43 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Brilliant! Love it!

    Please now add some birds, fish and some horses running around

    I would consider living there ...


  • 11/25/2009 9:46 AM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    When I'll add birds and horses you'll be welcome :)
    But I think I really need to implement a User Interface before anything else XD
  • 11/25/2009 10:16 AM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Nicely done. Its looking good. Keep up
  • 11/25/2009 10:39 AM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Would you have any advice on adding 3-dimensional trees like that all over? The resources I'm finding out there are mainly just on billboarding...
    Thanks, and your video looks awesome!
  • 11/25/2009 11:36 AM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Hey really nice I like it!
    @Darwin: the trees in the video are billboarded as well (the leafs). You can't really afford much more than billboards if you want a decent framerate with many trees and tree variety.
  • 11/25/2009 12:48 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Well.. I can't be more specific now because I'm at work at the moment XD

    I'll try to explain later ...but Darwin is almost right, the leaves are just quads crossed with a transparent texture applied, but

    not billboarded. Of course the primary goal when modeling is to keep the polycount low..

     

    See later :)

  • 11/25/2009 12:53 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Sorry, I mean ERiba is almost right :D ( I write really fast, I have a lot of work to do lol ), and it's not the only mistake
    in the title post i wrote "wonderul"....damn it's WONDERFUL, I'm an idiot lol
  • 11/25/2009 1:33 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    It's amazing, but actually Wonderul could be your name for your engine (:

    In any case, very good job. It really does seem like a place I would love to live in.
    Awesome
  • 11/25/2009 2:44 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Beautiful.  I can't see the video at work, but will check it out at home, and will probably be even more impressed.  Nicely done.
  • 11/25/2009 9:58 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    That is some really nice terrain, and I like the overall feel of the setting as well.

    Congratulations, looks like a true labour of love!

    J.

    In playtest Flite
  • 11/26/2009 3:05 AM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    I just wanted to echo everyone else and say it looks really cool. You could definitely make something out of this if you have the time. :)

    I might even enjoy that as just an interactive screensaver. :)
  • 11/28/2009 1:22 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Hello all

    @Darwin:

    I'll try to explain how I've done trees in the video.
    (sorry if I'm late, hope you'll read that)
    I didn't understand if you need to know how to create a tree or how to spread it over the terrain
    so I'll explain both XD
    Remember that my advices are the advices of an absolute beginner,
    so be careful (lol)
    Look at the picture ..

    Right-click and select 'Set Image Properties'

    As you can see the tree model is composed by a trunk(Orange) and leaves(green),
    two different models then.
    The trunk is just a simple extruded cylinder and mapped with the left texture.
    For the leaves, first you create a quad (2 triangles), then apply the leaves texture (Right).
    The quad is then cloned, crossed, rotated and scaled randomly about 30 times.
    That means just 60 triangles per tree.
    The 30 quads are merged using a boolean operation (add), that "creates" a single model for the leaves.
    In my case, textures are handpainted using simple colored pencils.
    The leaves background is not white, but transparent. I made it white in this picture cause
    it's a jpg image, but in the "engine" it's a 512x512 .png image.

    About rendering a lot of trees... there are many ways to do it.
    It depends on how your engine works.
    Mine is not a quadtree. The terrain is splitted into what i call "clusters".
    Pieces of terrain (16x16 vertices) that are culled based on camera position.
    Every cluster can have or not have a tree "over it" (it's random).
    So when I render the terrain I draw only trees that "exists" in a rendered cluster.

    The engines does :
    - is the cluster visible? yes - render it - There is a tree over it? yes - render it.
    - Is the next cluster visible? yes - render it - There is a tree over it? no - check the next cluster
    And so on (I have a strange method to explain lol)

    Since I use a 1280x1280 heightmap, I have 80x80 clusters(6400), but the engine
    only renders 100 per frame, so let's say about 40 trees per frame.
    (but you can choose the percentage, I use about 40%).
    Of course a single tree is placed with random scaling and rotation, to give the illusion of
    a different model.
    You must also check the height of the terrain when placing the tree.
    If you look at the model picture, you can notice that the base of the tree is under the "zero" plane.
    This prevent the base "come out" the terrain (not sure it's correct english lol), a bug
    that I find in many commercial games.

    OK, I know it's not really clear.. but I hope you can find it useful, or
    at least it gives you an idea.
    It was not easy for me write for so long in english and I would have been more clear :D

    As always .. sorry for my english and See you soon :)

     

  • 11/28/2009 1:33 PM In reply to

    Re: My XNA terrain (Wonderul Life Engine)

    Thats for posting. Your english is excellent and your explanation was completely clear to me.

    I also love your vid.
    Game hobbyist hell-bent on coding a diabolical Matrix
Page 1 of 1 (14 items) Previous Next