surrsurus / edgequest

Edgequest Season Two
Mozilla Public License 2.0
8 stars 1 forks source link

Segfault on Manjaro Linux #15

Closed XavilPergis closed 8 years ago

XavilPergis commented 8 years ago

There seems to be a problem with libtcod.

Why.

Pls fix m9.

surrsurus commented 8 years ago

No clue why this happens. It's most likely a problem with libtcod on your system. Libtcod needs libsdl1.2debian to run, this may be related to your issue. I'll look into it further

surrsurus commented 8 years ago

Does this help you? Why don't you try running script how he suggests? He states that it works on Ubuntu (which is very true of this game) but not on other distributions unless ran as root.

XavilPergis commented 8 years ago

Sudo does not help, nor does running it as root. I also tried setting all permissions to rwx on libtcod.py and libtcod.pyc, but that did not help either.

XavilPergis commented 8 years ago

Note: python3.5 does not seem to be segfaulting, but instead throwing a TypeError around line 711 in edgequest.py

surrsurus commented 8 years ago

That's because the library was intended to be used with Python 2. There is no backwards compatibility with Python 3 at the moment. I'll continue looking into solutions.

XavilPergis commented 8 years ago

It seems that c_char_p in python3.5 now takes bytes instead of a string. Simply changing c_char_p() to c_char_p(str.encode()) does not throw a TypeError

surrsurus commented 8 years ago

That's interesting. If you make the necessary changes to libtcodpy and if it runs can you attach the file so I can implement it?

XavilPergis commented 8 years ago

A little progress update: I have gotten the window not to crash immediately, but it displays mangled text, so I cannot figure out how to navigate the GUIs

XavilPergis commented 8 years ago

Oops, that was my fault; I removed some formatting arguments from tcod init

surrsurus commented 8 years ago

Post screenshots of any problems if you can.

XavilPergis commented 8 years ago

I have gotten it to run, but I had to convert x/y coords to ints, which is likely what causes this: screenshot5

surrsurus commented 8 years ago

Interesting. X/y coords should already be integers. Are you talking about things like (player.x, player.y)? Those are tuples and don't need to be casted to integers. I may be making the wrong assumption, but can you show what values are changed?

XavilPergis commented 8 years ago

One instance of it seems to be right here, while printing "Edgequest": (line 1951) libtcod.console_print_ex(0, SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2 - 4, libtcod.BKGND_NONE, libtcod.CENTER, 'Edgequest')

You are passing something that is being divided, so it cannot be an int.

Also, somewhere in the level rendering code, we run into the same issue after moving to certain areas.

surrsurus commented 8 years ago

Okay that makes sense. Python 2 has integer division so no extra casting is needed. Make sure to use math.floor() then in Python 3.

XavilPergis commented 8 years ago

that did not seem to fix the problem.

surrsurus commented 8 years ago

You finally installed Ubuntu I hear