FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Author Topic: About the Map Geometry  (Read 5512 times)

Fallouturama

  • Newbie
  • Posts: 22
  • ...which side would you choose ?
    • View Profile
About the Map Geometry
« on: July 25, 2009, 12:47:49 am »

Hi everybody!  :)

    There is a lot of info on internet about map geometry on 2D isometric game engines and grid types, after searching and studing about the topic, I still have some questions that I wish to ask because I dont fully understand some things,I need a more practical and less theorical point of view to apply it on my game  :) .

   I want to use the FIFE ingame map rotation feature :o , actually my tests consists on maps with a rotation of 45 degree and tilt value of -60 ,with the square grid type,I am already using rectangular ground tiles like this one:



  In fact all the ground tiles Im going to use are rectangular like the one above.

  Like the classic Fallout combat systems ;) , I want to use hexagonal battle grids with turn based combats. Im now planning the map geometry that Im going to use on my game. At first I thought  that because the geometry of my tiles I had to use square grids on all layers, but thinking that the battle grids are hexagonal, and are positioned at the object layer (layer with walls, characters and other objects),

  1) My 1st question is what type of grids I should use on each layer.

  2) My 2nd question is a simple one: On which cases is good to use square and hexagonal grids and what is the practical difference between them

  I am also planning to allow my characters to move through several layers, I made some tests but I fail to stack more than 1 building level  (building level= ground+objects+roof layers) on the same map. I managed to just edit 1 building level by asigning offsets to objects, but I want to know if there is another way to do this because when I define an object like a roof tile with an y_offset to fit into a 1st building level, and i want to use it also on a 2nd building level , I need to use another object to avoid changing again its offset value. Remember that I need to rotate the map  ingame. I also tryed the layer y_offset and x_offset values, but they dont work as I spected when rotating the map.

  3) So my 3rd question is how do I should stack more than 1 building level into the same map?
 
UPDATE: Ive just make a test and I succesfully use the z axis value of instances to raise a wall to a 2d building level and  it rotate just perfect, but i wish to still hear from someone with experience if this method is the right one if I want later to allow characters to walk on rooves and to climb ladders and such things... :)
« Last Edit: July 25, 2009, 10:05:32 am by Fallouturama »
Logged
War... war never changes... ,but  chosen ones does

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: About the Map Geometry
« Reply #1 on: July 26, 2009, 07:38:48 am »

Welcome to the dungeon, Fallouturama  :P

You now hit the most exciting part of FIFE ... *scnr*

I hope you've a mathematician at hand - because in terms of figuring out the proper geometry, you'll need one. At Zero, we switched the geometry about 5 times until we got a working one. While nearly every geometry works for "simple" images you have to be careful if it comes to tiling. Ground tiles are easy as they can overlap, but buildings are a different story to tell...

So far our experiences:

  • FIFEs 2.5D nature breaks some geometries as rounding issues come into account as soon as you need pixel precise transitions - otherwise scrolling the map will result in 1px gaps due to the mentioned rounding issues (Zero changed the geometry twice because of that - including rerendering all of our assets)
  • You can only minimize the effect of gaps between transitions by using large floats for the x_scale definition of your square layer

I'm sorry I can't write a howto on this topic - but as I'm the only python programmer @Zero, I try to outsource some things without knowing too much details about them - which is e.g. the geometry stuff. I just can summarize the problems we discovered so far.

But I'll try to answer some of your questions:

Quote
1) My 1st question is what type of grids I should use on each layer.

That's basically up to you. You can combine different grid types on your layers like square-hex-hex-square-hex (layer 1-5).

Zero uses square layers for ground tiles and hex layers for everything else.

Quote
2) My 2nd question is a simple one: On which cases is good to use square and hexagonal grids and what is the practical difference between them

I must admit - I forgot it.  :P But I remember that we choosed the hex grid because we know it worked well for Fallout. And besides that, hex grids are cool  :D

Quote
3) So my 3rd question is how do I should stack more than 1 building level into the same map?

As your question refers "how to design walls with several elevations" I'll try to answer on this issue. At Zero we are als trying to solve this one but yet found no solution. Playing around with z values didn't ever come to my mind as (IMO) the wall images itself should be ready to build several elevations without fiddling around with additional offsets or coordinates. Our current approach is to design the height of the walls in a way that they end on the same position of a hex as they started. Or in other words: walls have to cover an absolute amount of fields (not 2.4323, instead 2). This way they can be used to build several elevations.

See the attached picture for a better explanation - the red squares indicate the starting positions of the walls on the hex. The example wall is exactly 3 hexes height and therefore is tileable on the y-axes, too.
« Last Edit: July 26, 2009, 07:42:01 am by chewie »
Logged

Fallouturama

  • Newbie
  • Posts: 22
  • ...which side would you choose ?
    • View Profile
Re: About the Map Geometry
« Reply #2 on: July 27, 2009, 06:38:42 am »

Moin  Chewie  :)

  Thanks for the replay ;) , The matter with my walls is that the are graphically different to the ones @ Zero (judging by some of your Zero screenshots), I have portions of walls that should fit each base on a grid (like Fallout 1 & 2 walls)and then wall by wall (almost brick by brick  :D ), edit a building without ugly overlaps, gaps and other dirty graphicall efects, and I want to totally avoid the use of x and y offsets because I hope not to be the only one making the maps on my game  in the future :P, I hope that with a  good geometry setting, maps are going to be easier to make, and there will be no need of messing around with complex offset concepts.

 
Quote
I hope you've a mathematician at hand - because in terms of figuring out the proper geometry, you'll need one.
Lol , I dont have any mathematician, I barely have myself into this!!!  :D

 I am worried about this map-geometry planning stage because I want to avoid  later fixes  to all maps and individual object  offsets. I was thinking so much on fallout hexes, but now I give up!!! lol, yeah, This is my current plan (It may change on time  ::) ) :

   Im going to use square grids for everything, and only tiles are going to have double sized square grids,  because of this Ill have to use blocking grids to fix the holes on the walls and avoid my characters to behave like ghosts when walk through them :D. I came to this idea because It works 95% OK with my wall objects(I have a ugly overlapping on corners).The bad part of this is that grids are going to became so small that  big characters like brahmin and supermutants are going to need some sort of multicell or multigrid feature that I don know how to implement yet.... Do you have any idea about this chewie? Does anyone has info about multigrid instances?Ive noticed that someone called Agripa was trying to code this into FIFE ages ago (2008  :P ). If this have no solution... Ouch!  :'(.

   About the walls with elevations, I discover that the z value of instances do perfectly what i needed, but the bad part of this is that there is not a simple way to override all instances on the same layer with the same z value, so by the moment Im will "try" to develop a new Object Editor plugin for this job, and well , at scripting stages, all character instances will have to jump up and down with a constant step value per each stacked walking layer.

  I dont know if someone else is trying to use the 360 degree rotation of the map , or several wall and rooves elevation, It would be  nice to meet someone else trying the same objectives, to share some knowledge each other...  ;)

I think  that  FIFE is great already ;D  , that the features It has are excelent!!! I love the main 2,5D ( 2D ++  ;D) ,with rotation, and the idea that all of this works at the same time with the instance elevation capabilities is awsome!!!.  If someone is interested on my early sugestions about this topics, I would say that to implement some xml tags on layer definition to override values like z axis offsets to all instances hierarchically I think it would be really useful.
  
Cheers Fallouturama  ;) .

« Last Edit: July 28, 2009, 05:52:49 am by Fallouturama »
Logged
War... war never changes... ,but  chosen ones does

Fallouturama

  • Newbie
  • Posts: 22
  • ...which side would you choose ?
    • View Profile
Re: About the Map Geometry
« Reply #3 on: July 29, 2009, 05:29:24 pm »


 Well, here I have prepared a little multiple wall elevations test, to show + explain how I managed to do it.   ;)

 I set a z value on each instance of the same layer, and I make that value higher at upper layers. Also , as I said before Im using big grids for ground tiles and half sized grids for everything else.Here is the result:

(Srry for the size of this screenshots...  ;D)


Here an entire building layer is hidden.



Here you can see the grids







I still have to implement blocking grids, my walls remainds me the ones of Fallout 1 & 2... They need blocking grids everywhere! :D
 
« Last Edit: July 30, 2009, 02:12:49 am by Fallouturama »
Logged
War... war never changes... ,but  chosen ones does

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: About the Map Geometry
« Reply #4 on: July 29, 2009, 06:48:15 pm »

Wow, that looks pretty impressive :-)

Did you create these graphics from scratch or did you recycle any 3rd party assets?
Logged

Fallouturama

  • Newbie
  • Posts: 22
  • ...which side would you choose ?
    • View Profile
Re: About the Map Geometry
« Reply #5 on: July 30, 2009, 10:51:28 am »

Thanks mvBarracuda! :)

  They are mostly from FOT, some tiles like the grass are mine .
Logged
War... war never changes... ,but  chosen ones does