Thread: Some qns to Bubba on MTW terrain engine

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    3

    Some qns to the gurus on MTW terrain engine

    Dear Gurus, hi!

    I have been going through your posts on game programming (especially the ones related to terrain generation) and thank you very much for your patience in explaining stuff. It is heartening to see people with hard core experience and knowledge spend n number of hours trying to explain the dark arts to the neophytes.

    I was wondering if you could comment a bit on the technicalities of the Medieval Total War terrain engine?

    *Quad tree or BSP based?

    *How come the terrain is so smooth with gentle undulations?

    *What is the field of view that they have used do you think?

    *How in the wide world did they manage to render 10000+ sprites at the same time and still have MIPS to run their AI?

    Thanks in advance.

    Best Regards
    Fred
    Last edited by Frederic; 12-19-2008 at 03:26 PM. Reason: Changing the addressing mode

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Well since this is in the open forum, I can answer one of them

    > How in the wide world did they manage to render 10000+ sprites at the same time and still have MIPS to run their AI?
    Most likely the AI is on the CPU, and rendering is on the GPU.

  3. #3
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    >Most likely the AI is on the CPU, and rendering is on the GPU.
    Possibly, but what about those of us who do not have vid cards, and everything is ran on the CPU( and stills runs relatively smoothly)?

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    It's nothing too amazing, CPUs are VERY fast in comparison how fast to how your eyes work or how fast you can process things.

  5. #5
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    Quote Originally Posted by Raigne View Post
    >Most likely the AI is on the CPU, and rendering is on the GPU.
    Possibly, but what about those of us who do not have vid cards, and everything is ran on the CPU( and stills runs relatively smoothly)?
    If you don't have a vidcard there are no graphics to render as there's nothing to display them on anyway

  6. #6
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    jwenting: so your saying that a person is required to have a video card card to render graphics to their screen. If so you are sadly mistaken.

    There is a thing called software emulation. It is slow as hell, but on modern processors it can handle it to a certain point. i am on a Toshiba laptop. Uses Intel graphics(software). it is enough to run World of Warcraft at 20+ fps, but can't use any shader/dynamic lighting. It sucks, but it works(and no video card to be heard of)

  7. #7
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    You still need a video card of some sort*, where do you think those images are sent from? Sure the "card" may be built-in to the motherboard, it's really the same thing.

    * It may even be external that converts signals from a USB wire to RCA for example.

    I think that's the point or rather the joke that jwenting was making

  8. #8
    chococoder
    Join Date
    Nov 2004
    Posts
    515
    yup. And in some environments not having a videocard can cause problems when trying to use certain functionality.

    For example to create graphical elements in Java there must be a device to output them to (which doesn't have to be a screen however), and the core library has methods to test for (and enumerate/select) the existence of graphics devices known to the JVM.

  9. #9
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I was wondering if you could comment a bit on the technicalities of the Medieval Total War terrain engine?
    I did not work on the terrain engine and as such anything I might say would be a guess. From what I can see it is either static mesh that the video hardware culls or it uses a quad tree with patches. The terrain on that game is not very complex and it appears they are using texture patches to texture specific patches of terrain. Other engines use this paradigm as well.

    *Quad tree or BSP based?
    Terrains lend themselves much better to quad trees than BSP. On that merit alone if they are using a tree it is certainly a quad tree.

    *How come the terrain is so smooth with gentle undulations?
    Bilinear interpolated terrain and/or bilinear interpolated height maps for the terrain data. The terrain does not have sharp transitions such as cliffs and so forth and is most likely using a rather small cell size which translates to an ability to model very smooth hills. Games that have large cell sizes usually have less smooth terrain. However you can create dynamic patches of terrain to smooth out areas and you can use an LOD scheme through quadtrees or something like geo-mip mapping to get smooth detailed terrain up close and less detailed less smooth terrain far away.

    *What is the field of view that they have used do you think?
    Having played the game a lot and looking at the FOV compared to what I'm used to they are probably using a 75 to 85 degree HFOV. It is not 90 b/c it does not fish eye and distort at the edges of the screen but it is wide so I would say 75 to 80 degrees is about the widest you can get without having some time of fish eye effect.

    *How in the wide world did they manage to render 10000+ sprites at the same time and still have MIPS to run their AI?
    The first Medieval War cheats and uses 2 triangles per sprite to render all of the combatants. If you look closely you will see them transition from walking north to walking northwest. They hide the fact that there are probably only 8 directions by allowing one 'direction' to cover about 30 to 60 degrees before they render a different direction sprite.

    Medieval is not so special as it's sequels Rome: Total War and Medieval 2. These are using true 3D meshes for every object on screen (except for smoke and special effects). This is an accomplishment and all I can say is they are using a clever object and scene manager with a very clever LOD scheme in order to pull it off. It's quite amazing.


    However as I said I was not on the dev team and can only comment from what is usually common practice for the genre and from my personal experience of what has worked and what definitely does not work. As a side note on an open forum it is not a good idea to directly address a member in the title of your post. All who frequent this board are knowledgeable enough to answer your questions.
    Last edited by VirtualAce; 12-19-2008 at 02:53 PM.

  10. #10
    Registered User
    Join Date
    Dec 2008
    Posts
    3
    Bubba, hi!

    I have changed the thread title and the content therein to remove any personal references. Extremely sorry if this caused any chagrin. My first here. So humble apologies.

    I am going through your detailed answers point by point. Thanks a bunch. I will post more comments once I understand fully what you have written.


    Best Regards
    Fred

  11. #11
    Registered User
    Join Date
    Dec 2008
    Posts
    3
    Quote Originally Posted by Bubba View Post
    Bilinear interpolated terrain and/or bilinear interpolated height maps for the terrain data. The terrain does not have sharp transitions such as cliffs and so forth and is most likely using a rather small cell size which translates to an ability to model very smooth hills. Games that have large cell sizes usually have less smooth terrain. However you can create dynamic patches of terrain to smooth out areas and you can use an LOD scheme through quadtrees or something like geo-mip mapping to get smooth detailed terrain up close and less detailed less smooth terrain far away.
    *Let me try to understand this.A height map that has data points wide and far will result in some cragginess. Thus in order to get smoother intermediate values, adjacent heightmap values from the nearby 2x2 datapoints are being used in the bilinear interpolation. If we use a
    3x3 grid, it would have been a trilinear interpolation. Am I going in the right direction?

    *You mentioned cell size. Let me try to understand this. A large terrain could be divided into several patches or "cells" for efficient rendering. The smaller the cells are the smoother the terrain undulations would be. Of course more cells means more geometry to manage and render. Correct me on this if I am wrong.

    *I heard the name of sphere's algo somewhere on this forum. Does this algo have anything to do with the terrain smoothing?

    *And yes, I did notice the "trick" with the sprites. I even have a hunch that they don't differentiate between right and left hands. I recall seeing the sprites with the weapon in the wrong hand.

    Again thanks in advance and best regards
    Fred

  12. #12
    Registered User
    Join Date
    Jan 2008
    Posts
    70
    Quote Originally Posted by Frederic View Post
    *You mentioned cell size. Let me try to understand this. A large terrain could be divided into several patches or "cells" for efficient rendering. The smaller the cells are the smoother the terrain undulations would be. Of course more cells means more geometry to manage and render. Correct me on this if I am wrong.
    Yeah the cell size would be the size of the leaf nodes on the quad tree.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Continous LOD Terrain Source... Released!
    By Perspective in forum Game Programming
    Replies: 13
    Last Post: 04-17-2006, 11:21 PM
  2. New terrain engine
    By VirtualAce in forum Game Programming
    Replies: 16
    Last Post: 03-16-2006, 02:47 AM
  3. Game Engine Link Prob
    By swgh in forum Game Programming
    Replies: 2
    Last Post: 01-26-2006, 12:14 AM
  4. Start of updated terrain engine
    By VirtualAce in forum Game Programming
    Replies: 7
    Last Post: 06-16-2005, 09:25 PM
  5. Terrain engine idea
    By VirtualAce in forum Game Programming
    Replies: 15
    Last Post: 04-03-2004, 01:30 AM