FIFE forums

General Category => Game creators corner => Topic started by: Niektory on March 19, 2012, 11:20:15 pm

Title: Variable height terrain
Post by: Niektory on March 19, 2012, 11:20:15 pm
I'm toying with the idea of making a Tactics Ogre-style game and I'm wondering if FIFE would be suitable for this.
One feature I'm concerned with is variable height terrain (like in the screenshot). Would it be possible to implement in FIFE relatively painlessly?

(http://static.gamesradar.com/images/mb/GamesRadar/us/Games/T/Tactics%20Ogre%20Let%20Us%20Cling%20Together/Bulk%20Viewer/PSP/2010-09-17/Tactics_Ogre02--article_image.jpg)
Title: Re: Variable height terrain
Post by: prock on March 20, 2012, 09:34:25 pm
I'm pretty sure FIFE could handle something like that but I'm not sure how easy it would be.  I'm not aware of anyone who has tried something like this before.  The biggest challenge might be content creation (the tiles themselves), map creation, and pathfinding.  I'm not sure how gameplay works and how the characters move from tile to tile.  Only thing I could suggest is to try to throw a proof of concept together and see what the roadblocks might be.
Title: Re: Variable height terrain
Post by: chewie on March 21, 2012, 04:41:17 am
I'm pretty sure FIFE could handle something like that but I'm not sure how easy it would be.  I'm not aware of anyone who has tried something like this before.  The biggest challenge might be content creation (the tiles themselves), map creation, and pathfinding.  I'm not sure how gameplay works and how the characters move from tile to tile.  Only thing I could suggest is to try to throw a proof of concept together and see what the roadblocks might be.

Helios is working on mulitlayer pathfinding in the cell_pathfinder-branch - a prototype for this kind of game might be a good test for the new features. :)
Title: Re: Variable height terrain
Post by: mvBarracuda on March 21, 2012, 01:20:46 pm
AFAIR this kind of different height is mostly a visual illusion in quite a lot of 2.5d engines.
Title: Re: Variable height terrain
Post by: Niektory on April 19, 2012, 01:47:19 pm
Thanks for the replies. I played around with FIFE a bit. The first problem is drawing order. I'm pretty sure I can't take advantage of layers here. So, with everything on one layer, the order needs to be determined by map coordinates. I think I have an algorithm that can sort everything correctly, but I don't know how to modify/override the default one. Could you give me some pointers? Is it even a good idea?

Also, could you tell me more about the new pathfinder?

My playground (rio_de_hola with my map):
http://www.mediafire.com/?pqei15p4ubdleiw
Title: Re: Variable height terrain
Post by: prock on April 19, 2012, 04:02:08 pm
Hi Niektory,

I was able to download and run your demo without any problems.  I see your problem.  Unfortunately I cannot think of an easy way to fix it.  There are a lot of special cases in your map.  I'm not aware of an easy way to override the default sorting algorithm for instances.  This could however be a good improvement to the engine and it hasn't been the first time someone has asked about it.  Perhaps we could add an interface for clients that would allow them to override the sorting algorithm.  I'll have to dig into this a bit more and get back to you again.

Come to think of it the new pathfinder should be able to handle this so you could perhaps fix this by modifying some of your assets.  You might need to split some assets into multiple images.  The top of some of the taller tiles could be split off and put on a higher layer so the player is always behind it when they walk around it.  The new pathfinder will allow an instance to switch layers so when the player moves to a higher layer he/she will always be on top of the taller tile (hope I'm making sense here).  You should check out the cell_pathfinding branch and play around.  You should stop by IRC sometime and talk to Helios about it.   He is the one doing most/all of the work on the pathfinding branch. 

Hope this helps,

prock
Title: Re: Variable height terrain
Post by: Niektory on May 18, 2012, 05:44:19 pm
The good: I made some progress. The agents jump up and down when moving around and they are properly obstructed by terrain. I didn't use layers, they would fix some problems but introduce others, I think I'm better off without them.

The bad: I used some ugly hacks. I don't even fully understand some of the code I modified. Well, hopefully I can learn and improve it later. ;)

Here's the updated demo. You'll need to use the cell_pathfinder branch and apply the included patch. Click 'About' to check the keys.
EDIT: Updated again. The previous patch was incomplete for some reason.
http://www.mediafire.com/?saw8whns6gzmmsu
Title: Re: Variable height terrain
Post by: prock on May 21, 2012, 10:17:39 am
Hey Niektory,

I checked your demo out.  Looks great.  Still some z sorting issues but still looking pretty good.  Looks like it might be possible to do what you want to do with FIFE with some work.

Prock
Title: Re: Variable height terrain
Post by: Niektory on August 06, 2012, 04:15:03 pm
Be running up that road,
Be running up that hill,
Be running up that building. ♫

http://www.youtube.com/watch?v=KwGDrBlBjE8
Title: Re: Variable height terrain
Post by: prock on August 07, 2012, 10:15:26 am
That was one of the coolest fife videos I have ever seen.. nice work!
Title: Re: Variable height terrain
Post by: vtchill on August 12, 2012, 03:24:23 pm
Congrats Niektory!!!

Awesome little demo with multi height pathing. I second prock, this is definitely one of the coolest videos of fife i have seen.

I'm not sure if it was your intention but I could see the raising and lowering of terrain leading to some really interesting game designs. I hope to see this incorporated into the final game design for sure!

Keep up the awesome work and please keep us posted with all the awesome teasers!
Title: Re: Variable height terrain
Post by: Niektory on August 19, 2012, 05:47:02 pm
Update time! Thanks to vacation I was able to do a good chunk of work. Now that it's over I'll go back to my usual snail pace...

So, stuff I managed to cram in:
- complete pathfinder rewrite
- line of sight calculation and display
- basic turn-based combat
- some shadows
- a nice-ish brick tile

http://www.youtube.com/watch?v=kT7tcCm2xs0
Title: Re: Variable height terrain
Post by: Niektory on August 24, 2012, 01:30:46 pm
The current version is here:
http://niektory.republika.pl/fife_tactics_hex1-10.7z
I don't want to decide on a license yet. But I'm fine with sharing some parts if you want them.

The engine patch is here:
http://niektory.republika.pl/fife_tactics_hex1-10.patch
Of course you're free to grab whatever you like, but most parts still need a lot of work. I don't have a working earlier version because TortoiseSVN is stupid. But I salvaged some of the old pather code:
http://niektory.republika.pl/oldpather.patch

Some notes:
Quote
math.i, iobjectloader.i
Exposed some stuff I wanted to use to Python.

route.h
Fixed an error in the comments.

cellrenderer.cpp
Changed the route rendering to display routes as lines instead of polygons.

hexgrid.cpp
I found the coordinate zigzagging annoying to work with, so I removed it. You may want to include this version as an alternative to the current grid.
Also commented some log messages that were causing me slowdowns.

instancerenderer.h, instancerenderer.i, instancerenderer.cpp
Added a way to exclude parts of an image from outline generation. Need to find a better way to do this.

maploader.cpp, mapsaver.cpp, camera.h, camera.i, camera.cpp
Added a way to control the Z axis transformation. Need to find a better way to do this.
Commenting cacheUpdate(&layer); gave me a nice speed boost and I didn't notice anything breaking... yet.

layercache.cpp
Replaced instance sorting with my version.

map editor
Added a way to move instances up and down along the Z axis, but broke undo because it was slow when moving many instances.
Changed rotation to rotate by 60 degrees instead of 90. It should check the grid type instead and choose the angle based on that.
Title: Re: Variable height terrain
Post by: helios on August 25, 2012, 10:15:50 am
Thank you for the patches :)
I'll take a deeper look at it and create Tickets for all that stuff. I can see that it is still a lot of work but I think it's worth it.
Title: Re: Variable height terrain
Post by: Niektory on September 18, 2012, 08:01:55 am
Targeting, projectiles and area effects:

http://www.youtube.com/watch?v=hvvtCSTOpQI
Title: Re: Variable height terrain
Post by: mvBarracuda on September 18, 2012, 02:45:40 pm
Looking sweet :-) Keep up the good work!
Title: Re: Variable height terrain
Post by: Niektory on May 29, 2013, 06:50:54 pm
CEGUI in action:

http://www.youtube.com/watch?v=xc3Ii9UrpGk
Title: Re: Variable height terrain
Post by: prock on May 31, 2013, 10:50:43 am
Nice work Niektory.  Your CEGUI interface looks and works great, not to mention the progress you have been making with your combat system!!!
Title: Re: Variable height terrain
Post by: Niektory on July 02, 2013, 08:00:04 pm
Why use the stairs when you can use mushrooms?

http://www.youtube.com/watch?v=iSLQ-553psY
Title: Re: Variable height terrain
Post by: prock on July 03, 2013, 07:22:51 am
haha...  very impressive!  Your project is really coming along!
Title: Re: Variable height terrain
Post by: Niektory on August 20, 2013, 08:22:10 pm
I've started implementing the AI. It's still not as smart as a brick. Getting there, though.

http://www.youtube.com/watch?v=69D2tN1UfyE
Title: Re: Variable height terrain
Post by: starportx on November 26, 2013, 06:22:43 pm
This is AWESOME, best FIFE demo I've ever seen, would you like to share your latest progress someday? cause there are so few demo present the advanced features of FIFE, e.g multilayer pathfinding, fog of war and projectiles.
Title: Re: Variable height terrain
Post by: Niektory on November 27, 2013, 10:25:44 am
It's an ambitious project for my skills (maybe too ambitious, but I'm an optimist). Plus I tend to get distracted easily. It will take some time before this gets anywhere.

I'll keep posting my progress here, of course. But I have nothing interesting to show at the moment.
Title: Re: Variable height terrain
Post by: starportx on November 27, 2013, 06:06:20 pm
FIFE code sample shortage really make my ramp up slow, I can only understand advanced functions by eating the native code, if it's well support I believe it will be more promising.