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: Multicell (large) objects  (Read 3319 times)

agrippa

  • Newbie
  • Posts: 6
    • View Profile
Multicell (large) objects
« on: November 13, 2008, 05:25:01 am »

Hello.

I wonder if FIFE supports objects that occupie more than just one cell. For example, i wish to add bears in my game. Most of the agents occupie only one cell, but not bears - they take nine, and all cells occupied by a bear should be blocking. Is it possible to do with FIFE, and if it is, then how pathfinding deal with such objects?

Thank you and excuse my english
Logged

chewie

  • Developer
  • Full Member
  • *
  • Posts: 123
    • View Profile
    • zero-projekt.net
Re: Multicell (large) objects
« Reply #1 on: November 13, 2008, 10:40:58 am »

ATM fife can't do so (out of the box*)

You can do some wired stuff by moving blockers relative to your object via script, but I wouldn't recommend that...

*as fife is open source, you can change that ^^

agrippa

  • Newbie
  • Posts: 6
    • View Profile
Re: Multicell (large) objects
« Reply #2 on: November 17, 2008, 01:54:45 pm »

Hmm... i think i'll try to change that. But i would appreciate any pointer where to start looking for the required peaces of code. Fife looks quite complex inside, but i really need these bears ))
Logged

agrippa

  • Newbie
  • Posts: 6
    • View Profile
Re: Multicell (large) objects
« Reply #3 on: November 22, 2008, 12:26:58 pm »

Well, i have some progress with multicells, but still have troubles with pathfinder, i still don't understand the way it works. I've tried to make pathfinding stop with successfull code when one of the additional cells approaches the target, but it just resulted in runtime error. BTW, it would be great to make pathfinder take function pointer as a target instead of coordinates. For example, an agent must approach the closest NPC or take position from where he/she can attack someone with bow - you could write IsNearAnyNPC(instance,layer,somethingelse) or SomeoneInBowRange(instance,layer,somethingelse) function and make pathfinder stop when the function returns true. This way multicell objects can be implemented too.
______________
fixed, it works as it should, but if pathfinder can't find target, major lags appear
« Last Edit: November 22, 2008, 04:17:19 pm by agrippa »
Logged