FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  


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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - conan

Pages: [1] 2
Game creators corner / Re: segmentation fault while deleting instance
« on: November 14, 2015, 10:04:10 pm »
I figured it out!!!!!!!!!!!!!!!!!!!!!!   ;D

It turned out that I had the cellRenderer.addPathVisual() on those instances and of course when the cell renderer wouldn't find them it would go on strike.

Wow, that was lucky. I'm sorry for cluttering the forum with my nagging, but believe me that by the time I decide to ask something it means that I'm in the border of despair. Hopefully my mistakes will be useful for someone in the future.

Game creators corner / segmentation fault while deleting instance
« on: November 14, 2015, 09:36:51 pm »

I have quite a tricky situation. I get a segfault every time I try to delete an instance on the map, deleting it with layer.removeInstance(instance). I am pretty sure I'm doing instance.removeActionListener() and that there is nothing else depending on it. I also tracked the problem and it doesn't happen exactly when I delete the instance but next time the engine pumps(), so it happens on the C++ side.

I'm going crazy because I can't debug this C++ side. Is there any way to get more information from the engine part, some way to run a debugger or get a more verbose explanations why it segfaults?

Thank you so much!

General discussion / Does FIFE need Guichan?
« on: November 14, 2015, 09:16:36 am »

I'm trying to install FIFE on another computer running Linux. After installing all the dependencies listed on the install guide for Linux, I try building it. However, it complains saying that guichan is not installed. I thought that fifechan would replace this component. Then I try installing guichan but it seems that it's looking for version 0.8.1 and the latest is 0.8.2. Whatsmore, I try building 0.8.1 and get some errors. I think it's really deprecated.

Is there a way to avoid installing guichan altogether? Also, I would like to know how FIFE runs in Windows.



Is there a way to delete an instance from within onInstanceActionFinished() or anywhere that is called from it? The engine crashes if I try to do this because after the call it checks for "instance" (the parameter that was passed) and can't find it anymore.

Right now I'm putting the instance in a vector and I check the vector every pump() and free it. I don't think this is a very elegant way. Is there any other way?


Help and troubleshooting / Re: Process finished with exit code 139
« on: November 11, 2015, 07:14:03 pm »
Hi Niektory,

Thank you for your response. The answer was so simple and I was thinking about such a complicated way of doing it!

I can even implement nice parabolic shots now.


Help and troubleshooting / Re: Process finished with exit code 139
« on: November 08, 2015, 06:50:31 pm »

I finally found my problem. The thing is that I was trying to delete the instance from the onInstanceActionFinished() callback. The thing is that the engine then looks for the instance right after that method is finished and as it was deleted it couldn't find it and it would crash. WOW that was a hard one to find.

I still have to figure out how to make bullets go on a straight line instead of following the grid. It looks kind of fake now but at least it works. Any idea?

Help and troubleshooting / Re: Process finished with exit code 139
« on: November 07, 2015, 08:33:44 pm »
I found something! Sorry for the monologue here, hehe!

So, there were two problems: one is the layer where the instance lives. If the layer is the normal "TechdemoMapGroundObjectLayer" where all the other instance live, then as it starts off a blocking cell (since it starts from the position the attacker is), then the movement ends right away. I tested this by starting the shot from the next cell.

Additionally, when I tried the dedicated layer "ProjectileLayer", then the instance doesn't move either. Is there something I should do so that instances can move on a layer? I check Layer.isMovable() and it is.

Finally, is there any way to bypass all layers and just make an instance move from point A to point B in a straight line regardless of blocking cells etc?


Help and troubleshooting / Re: Process finished with exit code 139
« on: November 07, 2015, 07:05:16 pm »

Apparently I found the problem. It seems that it's not very verbose when it finds some missing part or some part is wrong on the object configuration files such as the .xml . I had to clone an object that I knew it worked for sure and then slowly change the parameters one at a time till it worked like I wanted. However, I get another different error. Now, when I try to move the bullet, it doesn't work. This is my code so far:

Code: [Select]
class Projectile(fife.InstanceActionListener):
    def __init__(self, world, origin, destination):

        super(Projectile, self).__init__()

        self.start = False
        ## Show projectile
        self.layer ="TrajectoryLayer")
        object = world.model.getObject("SBT", "fallen")
        print "Attacking from: " , origin.getLayerCoordinates()
        print "To: ", destination.getLayerCoordinates()

        self.instance = self.layer.createInstance(object, origin.getExactLayerCoordinates())
        self.visual = fife.InstanceVisual.create(self.instance)
        #self.instance.move('stand', route.getEndNode(), 5)
        self.instance.move("move", destination, 1)
        #print "\n\n\nProjectile action ID: " , self.instance.getCurrentAction().getId()
        print "\n\nbullet created!"
        self.start = True

    def onInstanceActionFinished(self, instance, action):
        print action.getId()
        if action.getId() == "move" and self.start:
            print "\n\nDestroying bullet"

The result is that as soon as self.instance.move is run, the onInstanceActionFinished is triggered before even we get out of the __init()__ function! Additionally the bullet sprite appears on top of the unit and doesn't move and it never gets deleted.

I'm doing something wrong but I can't see what. I think it's quite a simple code :/ I'll look more and post the solution if I find it before someone here with a sharp eye does. Thanks!

Help and troubleshooting / Re: Process finished with exit code 139
« on: November 07, 2015, 05:39:37 pm »
Thanks for your response. Unfortunately that didn't do the trick :/

I made a workaround to avoid that problem but then later this problem happened again. What I'm trying to do is show a projectile (like a bullet or whatever) that goes from a unit to the target. For that I do:

Code: [Select]
def __init__(self, world, origin, destination):

        super(Projectile, self).__init__()

        ## Show projectile
        self.layer = origin.getLayer()
        object = world.model.getObject("projectile", "fallen")
        self.instance = self.layer.createInstance(object, origin.getExactLayerCoordinates())
        self.visual = fife.InstanceVisual.create(self.instance)
        self.instance.move("stand", destination, 1)

    def onInstanceActionFinished(self, instance, action):

        if action.getId() == "stand":

This code crashes with exit error code 139 the next time it pumps. Any ideas?

Help and troubleshooting / Process finished with exit code 139
« on: November 05, 2015, 09:16:31 pm »

I got into a situation when I get this cryptic error:
Process finished with exit code 139
That's it, nothing else, no trace... so I guess it's in the C++ side.

When I try to debug it, I go step by step until the engine pumps and then it exists with that error without any other explanation.

There are two situations that create this error:
  • One is when I manually create an object:                 
Code: [Select]
object ="dummy", "namespace")
dummyInstance = layer.createInstance(object, newlocation.getExactLayerCoordinates())
    At that point it doesn't complain but the next time it pumps, it crashes. If I just comment the createInstance line it doesn't crash.[/li]

  • So I commented that part out and did a huge code change (just refactoring), but after those seemingly neutral changes and after commenting out the previous failing line, it again fails with the same error code.

Help would be appreciated! Thank you!

General discussion / Re: Line of sight/ clear shooting trajectory
« on: November 02, 2015, 08:53:52 pm »
Wow, I think I found it.  ;D

I'm now using:
 layer.getInstancesInLine(origin, destination)

I haven't totally implemented and tested it but it looks promising. Still open for feedback.


General discussion / Line of sight/ clear shooting trajectory
« on: November 02, 2015, 08:15:21 pm »
Hi all,

I have spent few hours developing a nice little game with FIFE. I must say I really like it.

I hit a wall though, and that is getting a way to calculate if my units have clear line of fire to other units. I use a square grid.

So far what I tried is calculating two different routes from unit to target: one in the "units" layer and another one in a so called "trajectory" layer which has no blocking objects (it would take the shortest path possible). So if the paths match, then I have a clear line of sight. This works in most of the cases, but there are some exceptions when it doesn't work.

How would you do it?


Game creators corner / Re: Multiple cell objects (buildings)
« on: January 21, 2015, 12:13:39 pm »
Yeah right, I don't need this anchor property.

Game creators corner / Re: Conditional blocking (only some units)
« on: January 21, 2015, 11:44:03 am »
Thanks! Will implement it ASAP.

Game creators corner / Conditional blocking (only some units)
« on: January 20, 2015, 08:01:27 pm »
Hi guys,

How would you implement the following: I have a map with land and sea. I have land units that cannot go to water cells. However, I have "amphibious" units that can also go on the water.

If I set the cells as blocking, then none of the units can go on the water. How can I make this blocking only for ground units? Can I somehow use the "cost" property of the cells? I'm not using this property at all by the way. I don't even know what it does. I guess it's some movement cost modifier but that's just my intuition.

* Also, keep in mind that I still want units not to step on each other so I can't just put different types of units on different layers. Also, there are other harder blocks as cliffs and hills that no unit can go through.


Pages: [1] 2