Giter Site home page Giter Site logo

stransky / berusky2 Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 3.0 5.59 MB

Berusky 2 (Bugs Escape 3D) is a game that challenges your visual/spatial thinking and ability to find a way to resolve a logic task. Using five bugs, you'll go through an adventure full of various puzzles spread across nine episodes. Individual episodes differ in appearance and difficulty, which increases throughout the game.

Home Page: http://anakreon.cz/en/Berusky2.htm

License: GNU General Public License v3.0

C 17.13% Shell 0.18% C++ 82.47% Makefile 0.14% M4 0.09%

berusky2's People

Contributors

stransky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

berusky2's Issues

berusky2: Segfault in XSync on exit

Hi!

This is Debian bug http://bugs.debian.org/722639

At some point when existing the game it crashes with a segmentation fault.

The backtrace for that core dump is:

Core was generated by `berusky2'.
Program terminated with signal 11, Segmentation fault.
#0 XSync (dpy=0x0, discard=discard@entry=0) at ../../src/Sync.c:42

42 ../../src/Sync.c: No such file or directory.
(gdb) bt full
#0 XSync (dpy=0x0, discard=discard@entry=0) at ../../src/Sync.c:42

    rep = {type = 168 '\250', revertTo = 149 '\225', 
      sequenceNumber = 31744, length = 32546, focus = 2087582160, 
      pad1 = 32546, pad2 = 0, pad3 = 0, pad4 = 0, pad5 = 0}

#1 0x00007f227c044478 in X11_VideoQuit (this=0x1bb5dc0)

at ../../src/video/x11/SDL_x11video.c:1491

No locals.
#2 0x00007f227c036c3e in SDL_VideoQuit () at ../../src/video/SDL_video.c:1365

    video = 0x1bb5dc0
    this = 0x1bb5dc0
    ready_to_go = <optimized out>

#3 0x00007f227c0111d5 in SDL_QuitSubSystem (flags=flags@entry=65535)

at ../../src/SDL.c:196

No locals.
#4 0x00007f227c01127e in SDL_Quit () at ../../src/SDL.c:222

No locals.
#5 0x00007f227c0118bf in SDL_Parachute (sig=11) at ../../src/SDL_fatal.c:41

No locals.
#6

No locals.
#7 0x000000000055957c in ?? ()

No symbol table info available.
#8 0x00007f227ad57e0e in start_thread (arg=0x7f226ecf6700)

at pthread_create.c:311
    __res = <optimized out>
    pd = 0x7f226ecf6700
    now = <optimized out>
    unwind_buf = {cancel_jmp_buf = {{jmp_buf = {139785864701696, 
            -124161288581994295, 0, 139786066463968, 4096, 
            139785864701696, 631574938200265, 587541738236105}, 
          mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, 
        data = {prev = 0x0, cleanup = 0x0, canceltype = 0}}}
    not_first_call = 0
    pagesize_m1 = <optimized out>
    sp = <optimized out>
    freesize = <optimized out>
    __PRETTY_FUNCTION__ = "start_thread"

#9 0x00007f227a27593d in clone ()

at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

No locals.

This segfault might be related to some kind of threading issue. See also the next bug report about the "Abort in XCB code".

High resolution icon

It would be great if you could provide a higher resolution icon for berusky2, at least 128x128 pixel. The actual icon looks blurred on modern desktop environments like Gnome3.

Thanks for making the game available under a free license!

Saved games don't appear in the load/save menu

I can successfully save games and they show up in ~/.berusky2/Save but they don't appear in the load/save menu. So it is impossible to load a game again from the in-game menu.

I'm not sure if this is a well-known bug or if I made a mistake when I had to adjust the game paths to Debian specific values. Feedback welcome.

Abnormal program termination when a sound device is already in use

This is Debian bug #722146. http://bugs.debian.org/722146

Berusky2 aborts with an assertion at start up when a sound device is already in use.

adas_Set_Last_Error(): Unable to open device.
berusky2: adas/adas.c:170: adas_Set_Last_Error: Assertion `0' failed.

The music player daemon (MPD) had exclusive access to the device. Please consider to make Berusky2 failing more gracefully if the sound device is already used by another application.

Can't compile

I'm trying to complete step 1 of compiling...

Running ./autogen.sh gives **Error**: Directory `.' does not look like the top-level package directory

Running automake, autoconf, then ./configure gives config.status: error: cannot find input file: `Makefile.in'

What should I do?

Glitch in the teleport tutorial level

In the tutorial, there's a level with teleports. But it seems like this level is impossible and you can't get out.

Also, it might be cool if the levels could have names that are visible when you mouse over them. It would help with sharing videos with others

Buffer overflow Berusky3d_ini.cpp

When I run the game with the -i option and try to specify the ini-file directly with

berusky2 -i /usr/share/games/berusky2/berusky3d.ini

the game aborts with the error message: "Buffer overflow detected"

This is because Berusky2 was compiled with -D_FORTIFY_SOURCE and the buffer overflow is detected in Berusky3d_ini.cpp.

relevant part (hopefully)

void process_params(G_KONFIG * p_ber, int argc, char **argv)
{
int i;

for (i = 1; i < argc; i++) {
if (!strcasecmp(argv[i], "-h") || !strcasecmp(argv[i], "--help")) {
print_help();
}
else if (!strcasecmp(argv[i], "-i") || !strcasecmp(argv[i], "--ini-file")) {
i++;
if (i < argc) {
strcpy(ini_file, argv[i]);
}
}

It's possible to pass arbitrarily long strings to the -i option and nothing prevents that the destination array ini_file is overwritten by the source argv[i]

A solution might be to use strncpy instead of strcpy.

Show state in the top bar

Bugs can have special strength, special weight up to four pickaxes, and maybe even other stuff.

And there's four of them

That's a lot of state to keep in your head, especially if you save the game and load it

It would be nice to include these state information for each bug as a visual element on the top of the page

Missing -pthread flag

Berusky2 currently builds without the -lpthread flag which causes a FTBFS in the linker stage.

In Debian it was necessary to explicitly add -lpthread to LIBS as an option for the configure script in debian/rules to make Berusky2 compile.

I think it would be great to add it to the configure script directly.

Crash at end of level20.lv6

Program received signal SIGSEGV, Segmentation fault.
0x0000003b1247cd22 in _int_free (av=0x3b127b1740 <main_arena>, p=0xa5e4a80,
have_lock=0) at malloc.c:3982
3982 unlink(av, nextchunk, bck, fwd);
(gdb) bt
#0 0x0000003b1247cd22 in _int_free (av=0x3b127b1740 <main_arena>,

p=0xa5e4a80, have_lock=0) at malloc.c:3982

#1 0x000000000047829f in par_zrus (ph=124761712)

at komat/Berusky3d_castice.cpp:83

#2 0x00000000005133b1 in am_Do_Exit_Efects (p_Level=0x8022e0 )

at kofola/animationk.cpp:2321

#3 0x0000000000459a1a in gl_Flip (pad=pad@entry=0x92e260 ,

p_Level=p_Level@entry=0x8022e0 <Level>,
Frame_Rate_Counter=Frame_Rate_Counter@entry=0x7fffffffdbe8,
bCursor=bCursor@entry=0x7fffffffdbe3 "\001",
Cursor_Time_Out=Cursor_Time_Out@entry=0x7fffffffdbec,
p_camera=p_camera@entry=0x0,
NoKeyCounter=NoKeyCounter@entry=0x7fffffffdc10,
bBeetleAdded=bBeetleAdded@entry=0x7fffffffdbe6 "",
bLastSunuti=bLastSunuti@entry=0x7fffffffdbe5 "",
pGetCamera=pGetCamera@entry=0x7fffffffdca0,
no_Menu=no_Menu@entry=0x7fffffffdbe4 "",
act_item=act_item@entry=0x7fffffffdbf0,
iReturn=iReturn@entry=0x7fffffffdc00, demo=0 '\000',
bOvladaniBerusek1=bOvladaniBerusek1@entry=0x7fffffffdbe7 "\001\005")
at kofola/game_logic.cpp:9566

Implicit declaration adas/ogg_stream.c:548

Hello,

sorry I forgot to forward this compiler warning from gcc 4.8.

Implicit declaration adas/ogg_stream.c:548

"Implicit declaration means a function is used without being declared, which means C knows nothing about the number of arguments, types of arguments or type of the return value.

This is dangerous as it might hide issues the compiler could otherwise warn about or cause bad code."

Linux git compilation instructions/errors

Hello,

thanks for making this fun looking game foss!

Some people and I tried to compile this but it didn't quite work yet.

For example:

$ autoconf
configure.in:7: error: possibly undefined macro: AM_INIT_AUTOMAKE
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.in:8: error: possibly undefined macro: AM_CONFIG_HEADER
configure.in:9: error: possibly undefined macro: AM_MAINTAINER_MODE
configure.in:13: error: possibly undefined macro: AM_PROG_CC_STDC
configure.in:25: error: possibly undefined macro: AM_GLIB_GNU_GETTEXT
configure.in:27: error: possibly undefined macro: AM_PROG_LIBTOOL

I'm on Arch Linux 64bit

See this thread for more info: http://forum.freegamedev.net/viewtopic.php?f=20&t=1315

Fix format not a string literal error

In Debian, the attached patch was applied to achieve the following:

Avoid that Berusky2 fails to build from source. The Debian package uses gcc's hardening build flags -Wformat -Wformat-security -Werror=format-security

Quote from the gcc man page:

If -Wformat is specified, also warn about uses of format functions that represent possible security problems. At present, this warns about calls to printf and scanf functions where the format string is not a string literal and there are no format arguments, as in printf (foo);. This may be a security hole if the format string came from untrusted input and contains %n.

See also:

https://wiki.debian.org/Hardening#gcc_-Wformat_-Wformat-security

Thanks for considering the patch.

https://gist.github.com/apoleon/6356888

Crash at level exit (berusky2: kofola/Apak.cpp:34: void apakfile_from_disk(APAKFILE_DISK*, APAKFILE*): Assertion `(desc->apuLRealSizeofFile != 0 && desc->apuLSizeofFile != 0) || (desc->apuLRealSizeofFile == 0 && desc->apuLSizeofFile == 0)' failed.

berusky2: kofola/Apak.cpp:34: void apakfile_from_disk(APAKFILE_DISK_,
APAKFILE_): Assertion `(desc->apuLRealSizeofFile != 0 &&
desc->apuLSizeofFile != 0) || (desc->apuLRealSizeofFile == 0 &&
desc->apuLSizeofFile == 0)' failed.
Aborted (core dumped)
#4 0xb79e0137 in __assert_fail () from /lib/i386-linux-gnu/libc.so.6

No symbol table info available.
#5 0x08053443 in apakfile_from_disk (src=0xbfffb248, desc=0xa36fd48)

at kofola/Apak.cpp:33
    __PRETTY_FUNCTION__ = "void apakfile_from_disk(APAKFILE_DISK*, APAKFILE*)"

#6 0x080539a2 in apakCreateNode (pHandle=0xce5b800, bFirst=0 '\000',

pPrevNode=0xce5bac0, pCpyNode=0x0, bConnect=1 '\001', 
cDir=0xbfffbc0c "/home/chao/Downloads/berusky2-data-0.7/bitmap", 
bSetcwDir=1 '\001') at kofola/Apak.cpp:165
    tmp = {cName = "pismo-hnede.bmp", '\000' <repeats 240 times>, 
      tmp = 1360423404, uattFileAttribute = 0, apuLFileLocation = 48442, 
      apuLSizeofFile = 16217, apuLRealSizeofFile = 0, 
      bNotCompressed = 0 '\000', tmp1 = 3681720}
    buffer = '\000' <repeats 16 times>"\261, \000\243\267\001", '\000' <repeats 11 times>"\261, \000\243\267\000\000\000\000\020\266\377\277\003\000\000\000\261\000\243\267\250qP\bD\000\000\000\020\266\377\277\261\000\243\267\020\000\000\000\017'\000\000\020\n\000\000p\364\265\267x\364\265\267q\000\000\000\b\n\000\000`\000\000\000(\000\000\000%\000\000\000\005\000\000\000\000\000\000\000(\001\000\000\017'\000\000\b\000\000\000\061\267\242\267\360\266\377\277\314b\263\257\b\000\000\000$\000\000\000\004\000\000\000\060\001", '\000' <repeats 18 times>, "$\000\000\000\364ﵷ\240\373\260\n\b\000\000\000\001\000\000\000hŢ\267\240\373---Type <return> to continue, or q <return> to quit---

\260\n\360\266\377\277\b\000\000\000\364ﵷ@\364\265\267\274\272\345\f\030\001\000\000 \363\241\267\240\373\260\n\360\266\377\277\b\000\000\000\221xl\266\250qP\bpef\v\004\214\002"
iRet =
iLastFile =
iLastDir = 0
i =
FileNode = {iNextItem = 4, apuLfSeek = 8}
tmp = {cWDir = "{APPDIR}", '\000' <repeats 247 times>,
apuLSizeofFile = 9, tmp = 3672192, apuLSizeofDirectory = 0,
tmp1 = 0, tmp2 = 1244352, tmp3 = 0}
pNode = 0xaa74020

Recording demos doesn't work with -D_FORTIFY_SOURCE=2

Hi,

I'm filing a separate bug report for this issue.

When I record a demo and complete one of the tutorial levels, the game will crash.

This is related to the use of -D_FORTIFY_SOURCE=2 in Debian that exposes this bug.

The error message is:

berusky2: kofola/Demo.cpp:48: int demo_Check_Owner(WCHAR_, char_, WCHAR*):
Assertion `0' failed.
[1] 30819 abort (core dumped) berusky2

Specifying a wrong level name on the command line triggers an assertion

Hi,

while I was testing the latest release, I found this bug.

$ berusky2 level6.lvl6

works as intended. The game loads map level6.

$ berusky2 level6

An error message is printed to STDERR

Loading level from /usr/share/games/berusky2/game ...
Chyba na line 57 file komat/mmalloc.h
Unable to allocate 1821204736 bytes
berusky2: komat/Ddx.cpp:493: void tiskni_chybu(int, char_, char_, ...): Assertion `0' failed.
[1] 18735 abort berusky2 level6

Please explicitly link against -lpthread

Hello,

I'm filing a new bug report because this is not a Debian specific issue and also affects Fedora and other distributions.

It seems you use an older version of Fedora where ld allows the user to link indirectly against needed libraries. This behaviour is changing now:

https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

You can also learn more about this issue here:

https://wiki.debian.org/ToolChain/DSOLinking#Not_resolving_symbols_in_indirect_dependent_shared_libraries

So in short -lpthread needs to be linked in explictly in the linker stage. I'm attaching a patch that solves the problem.

https://gist.github.com/apoleon/7305027

Creating a valid desktop file

Hi,

thanks for your quick release of Berusky 0.9.1!

In Debian, the attached patch was applied to achieve the following:

  • create a valid desktop file
  • remove obsolete UTF8 Encoding key
  • add keywords to improve the search functionality of modern desktop environments like Gnome 3.

Thanks for considering the patch.

https://gist.github.com/apoleon/6356802

berusky2: Abort in XCB code

Hello,

this is Debian bug report http://bugs.debian.org/722637.

After playing the game for a while in Training mode, the game aborts when exiting the game by using the ESC key with

[…]
ap_Release_Play_List
ap_Release_Material_List
ap_Release
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
berusky2: ../../src/xcb_io.c:179: dequeue_pending_request: Assertion !xcb_xlib_unknown_req_in_deq' failed. Aborted ---

This bug might be related to the segfault in XSync on exit bug. After searching for those error messages, I have found out that it is sometimes necessary to call

XInitThreads() to make X aware that it's running in a multi-threaded application. I have also found similar backtraces that were submitted to the Fedora distribution.

http://retrace.fedoraproject.org/faf/problems/1141452/

Graphical glitches with intel driver

I'm experiencing some graphical glitches with my intel driver on Mageia 5, as shown in the screenshot:
berusky-bug

It doesn't happen when I use my nvidia GPU with proprietary nvidia driver.

Might be relevant:

  • X.org 1.16
  • Mesa 10.3.0
  • Intel 2.99.916
  • SDL 1.2.15
  • SDL_image 1.2.12
  • Gtk+2.0 2.24.24

Improving the accessibility of Berusky2's pak files

It would be nice if Berusky2's data files (*.pak) would be more accessible thus users could modify them more easily.

I'm thinking about

  1. Some sort of documentation that explains how to extract the pak files with free software tools.
  2. Getting rid of the pak files completely so that game data would only consist of editable graphic (svg, png, bmp, tga) and sound (ogg, wav) files.
  3. Making all graphics and data files extra availabe for download like this is already achieved with Berusky2's soundtrack.

undefined reference to `mmalloc' improper usage of inline functions

Hi,

during a recent rebuild of Berusky2 on Debian's mips and mipsel ports we discovered that Berusky2 fails to build from source with gcc/g++ 4.9.

https://bugs.debian.org/755561

The same issue is reproducible when compiling Berusky2 with the clang compiler.

http://clang.debian.net/status.php?version=3.4.2&key=UNDEF_REF

Dejan Latinovic investigated the issue and provided a patch which I'm attaching to this bug report.

https://gist.github.com/7cbb86b3fd8ea36dce0f.git

Here are his findings:

"I have investigated this a little bit more
This seems not to be a compile issue.

The reason for build failure on mips/mipsel is
improper usage of inline functions.

For example in a file:
src/age/graph/mesh.cpp
a functions mmalloc is used.
Declaration of mmalloc function is included from
src/age/utils/mem_alloc.h,
but a definition of the mentioned function
is in src/komat/mmalloc.h.

mmalloc.h is not visible to mesh.cpp, and during compilation of mesh.cpp
it is not possible to inline mmalloc function.
So, object file mesh.o is created, but implementation of mmalloc function is missing.
This is the reason of an error:
mesh.cpp:59: undefined reference to `mmalloc'
durign linking of berusky2on mips/mipsel with gcc-4.9.

Using gcc-4.8 on mips, in some other object file (in this case Berusky3d_light.o)
it seems that compiler decided not to inline mmalloc function.
As a result, during creating of berusky2,
linker is capable to resolve mmalloc symbol,
because Berusky3d_light.o contains implementation of mmalloc function.
In ./komat/Berusky3d_light.cpp definition of mmalloc function
is visible from src/komat/mmalloc.h

The same situation happens on amd64 with gcc-4.9,
but in other object file: Keyframe.o.

The point is that we could not guarantee that inline function
mmalloc would not be inlined in some cases.
For mesh.cpp which is not aware of mmalloc definition,
implementation of mmalloc during linking is needed.

Of course,
we could use -fno-inline flag but, this seems to be wrong solution to me.

The same usage of mmalloc function without a definition visible,
is noticed in files:
age/utils/mem_alloc.cpp
age/graph/gext.cpp
age/utils/utils.cpp

The solution could be to include mmalloc.h in mem_alloc.h,
so the definition of mmalloc function will be visible
in all files where mmalloc function is used."

Settings are not saved when exiting the settings menu

I'm running Berusky 2 on Mageia 5, and the settings can't be changed at all using the in-game menu. If I tick a box and quit the settings menu (with Esc), the box is still unticked when I reopen the settings menu. I've not tried to edit the config file directly but I guess it would work.

Here are the sources and spec files used for berusky2 and berusky2-data:
http://svnweb.mageia.org/packages/cauldron/berusky2/current/
http://svnweb.mageia.org/packages/cauldron/berusky2-data/current/

Note that I'm now installing the data in /usr/share/games/berusky2, but it wasn't working either when the data was in /usr/share/berusky2 as is the default value.

Can't start the game

Hi. I'm on Arch Linux (32bit) with an AMD Radeon HD 4650 and Catalyst 11.8. I compiled (Version 0.3 with Dataversion 0.4) the game myself and am trying to start it, but I get this:

$ berusky2
SDL Init...
Init video surface...

XIO: fatal IO error 11 (Resource temporarily unavailable) on X server "v-
&"
after 38 requests (38 known processed) with 0 events remaining.

I also get an error message with the open source driver (Radeon Gallium3D). I'll post it later.

Please install the supplied AppData file

Please consider installing this AppData file we wrote: https://raw.githubusercontent.com/hughsie/fedora-appstream/master/appdata-extra/desktop/berusky2.appdata.xml

This is used in GNOME and KDE software installers to add the application description and some screenshots. We'd love to showcase more applications, but without the extra data file we can't. The AppData file needs to be installed to /usr/share/appdata/ on Linux and the basename needs to match the .desktop basename. It would also be great if you could integrate the file with your translation system (e.g. intltool) to make the descriptions translated.

See http://people.freedesktop.org/~hughsient/appdata/ for more details; thanks!

Richard

License clarification: Bmp.cpp, Bmp.h, Tga.cpp, Tga.h

Hello,

as already mentioned at http://bugs.debian.org/673187, these files need a license clarification. I'm filing this bug report, so that the issue won't get lost.

src/komat/Bmp.cpp
src/komat/Bmp.h
src/komat/Tga.cpp
src/komat/Tga.h

If these files are not used by Berusky2, it is perhaps easier to remove them. Unfortunately a couple of functions is utilized in other files too and a Debian specific patch would become quite large. This issue is blocking the inclusion of Berusky2 for Debian at the moment.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.