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: 3D Isometric  (Read 4115 times)

SteveS

  • Newbie
  • Posts: 2
    • View Profile
3D Isometric
« on: September 24, 2008, 09:06:57 am »

Hi guys,

    First I want to tell you that you are doing an awesome job so far. I have been digging into your engine for approximately one month and I'm surprised how fast I was able to do a create a workable game prototype in a short period of time starting from your Rio De Hoya demo.

    I have a question that you might help me quickly as I didn't see any related topic in your forum. I would like to extend a little bit the user experience by having a 3D Isometric world (like hills and 2-3 floors building) instead of a flat map and I was wondering if it is possible to do so with the engine? If it's not the case, are you planning to had this dimension at some point?

    I guess it could be done at the script level but I wanted to have your input before planning this task.

Thanks,
Steve
Logged

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: 3D Isometric
« Reply #1 on: September 24, 2008, 09:41:56 am »

Moin SteveSauvageau :)

Good to hear that you were able to wrap your head around FIFE to create your own little prototype . :)

About your question:

Have a look into the layer system of the map format - this also helps to create multiple elevations for the environment / buildings.

On script side, you have to take care about setting the new layer of an agent if he moves from one layer to another. (Important for pather) You also have to toggle the visibility of instances / layers to visualise the elevation change.

A simple example would be a building with one elevation and a roof. If an agent enters / leaves the door, the roof visibility should be toggled. ATM you can only toggle single instances, but there is a patch which fixes the bug for toggling layers. (Didn't test it yet, but it works for the author)

You have to simulate a trigger on your own, as FIFE doesn't provide a trigger system yet, but this can be done via world.pump, e. g. like this (untested):

Code: [Select]
(code in world __init__):
# the roof layer
self.rooflayer = self.map.getLayer("MyRoofLayerIDfromMyXMLMap")

# a simple trigger dict
self.trigger = {}
self.trigger['my_building'] = { }
self.trigger['my_building']['instance'] = self.rooflayer.getInstance('roof1')
self.trigger['my_building']['position'] = ()

(code in world pump() ):
position_coords = self.hero.agent.getLocation().getLayerCoordinates()
self.hero.position = (position_coords.x, position_coords.y)

position_coords = self.trigger['my_building']['instance'].getLocation().getLayerCoordinates()
self.trigger['my_building']['position'] = (position_coords.x, position_coords.y)

if self.hero.position == self.trigger['my_building']['position']:
    self.trigger['my_building']['instance'].get2dGfxVisual().setVisible(False)

Cheers,
chewie
« Last Edit: September 24, 2008, 12:11:55 pm by chewie »
Logged

SteveS

  • Newbie
  • Posts: 2
    • View Profile
Re: 3D Isometric
« Reply #2 on: September 26, 2008, 08:46:28 am »

Thanks Chewie,
I will definitely give a try.  :)
Logged

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: 3D Isometric
« Reply #3 on: September 26, 2008, 12:57:46 pm »

Thanks Chewie,
I will definitely give a try.  :)

I'm curious about your results :)

Btw - I applied the abeyer's patch about the layer bug to FIFE trunk. (rev 2601)