Can't start sdl version

Stuck at a level? Need help with R'n'D or anything R'n'D related? Post here!

Moderators: Flumminator, Zomis

Pajarico
Posts: 6
Joined: Sat Jan 29, 2005 2:39 pm

Post by Pajarico »

Flumminator wrote:Obvious errors like this one can (and should) easily be detected during compilation.

Why not set a breakpoint on 'Error'?
The problem is that i don't know how to set a breakpoint. Can you tell me how to do it?

:wink:
Pajarico
Posts: 6
Joined: Sat Jan 29, 2005 2:39 pm

Post by Pajarico »

Code: Select all

lxuser@localhost lxuser $ rocksndiamonds.sdl -v
rocksndiamonds.sdl: warning: cannot open configuration file '/home/lxuser/.rocksndiamonds/editorsetup.conf'
rocksndiamonds.sdl: gadget incomplete (missing Bitmap)
rocksndiamonds.sdl: aborting
There is no editorsetup.conf on my entire hd.

:wink:
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

[No idea why I posted my last post as "Guest". Probably I logged out without noticing... ;-) ]

> Obvious errors like this one can (and should) easily be detected during compilation.

Yes, that's right of course. But I think it should only generate a warning, but not an error, as it is a semantical error, but not a syntactical error. (And strictly speaking not even a semantical error...) But compiler creators probably know better -- until now, it was just an easy way to get a stack trace if the target audience may have no deeper knowledge on debugger handling...

> Why not set a breakpoint on 'Error'?

For developers, this would be the obvious thing to do, yes. :-)

> There is no editorsetup.conf on my entire hd.

That's no problem -- if there's no editorsetup, then reliable defaults are used. Therefore, only a warning is generated. (Probably this should better be "info" log level rather than "warning" ...)
Pajarico
Posts: 6
Joined: Sat Jan 29, 2005 2:39 pm

Post by Pajarico »

> Why not set a breakpoint on 'Error'?

For developers, this would be the obvious thing to do, yes. :-)
Tell me how to set a breakpoint.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> Tell me how to set a breakpoint.

First make sure that R'n'D was compiled with the "-g" switch to include debugging symbols in the program binary. To achieve this, go to the R'n'D base directory and change the line "# DEBUG = -DDEBUG -g" in "src/Makefile" to "DEBUG = -DDEBUG -g". Then type "make clean; make sdl". This should recompile the game, but now with debugging symbols.

Run R'n'D in "gdb", the GNU debugger, by starting it with "gdb ./rocksndiamonds" in the R'n'D directory. Set the breakpoint by typing the following: "break gadgets.c:992". Then run the game, by typing "run -v". (The "-v" is just the R'n'D "verbose messages" switch.)

Instead of terminating, the debugger should stop at that line. Now you can type "bt" to get the program stack backtrace.
Pajarico
Posts: 6
Joined: Sat Jan 29, 2005 2:39 pm

Post by Pajarico »

This is weird, now i compile without uncommentig the debug line and it works, don't know what i did.
At least i've learnt how to set a breakpoint. :D
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> This is weird, now i compile without uncommentig the debug line and it works, don't know
> what i did.

So you haven't changed the "src/Makefile" at all, but just recompiled by "make clean; make sdl"?

That's strange -- but I'm glad to hear that it works now.

> At least i've learnt how to set a breakpoint.

:-)
Pajarico
Posts: 6
Joined: Sat Jan 29, 2005 2:39 pm

Post by Pajarico »

So you haven't changed the "src/Makefile" at all, but just recompiled by "make clean; make sdl"?
Yes, exactly. Me start to think that sdl libs and rocksndiamoonds were compiled with differents versions of gcc, maybe was that.
Guest

Post by Guest »

I can't strat too. WINDOWS Version 3.10, unpacked from zip archive. If I try to start it, i got this:

C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: cannot open configuration file 'C:\My Documents/Rocks'n'Diamonds/setup.conf'
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: using default setup values
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: SDL_DisplayFormat() failed: Out of memory
C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: aborting

HOW TO START???
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: cannot open
> configuration file 'C:\My Documents/Rocks'n'Diamonds/setup.conf'
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: warning: using default setup values

These warnings can safely be ignored.

> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: SDL_DisplayFormat() failed: Out of memory
> C:\My Documents\Rocks'n'Diamonds\rocksndiamonds.exe: aborting

Here we have the reason why you cannot start R'n'D: You ran out of free memory!

How much memory (RAM) have you installed on your computer?
Guest

Post by Guest »

64 MB RAM have I full.
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

How much free memory did you have available when you tried to start R'n'D?

(R'n'D is quite a bit memory-hungry, probably more than it should be, but 64 MB physical RAM should be sufficient. But of course it depends on the amount of *free* memory when starting the game.)
Guest

Post by Guest »

FREE??? But where I can see free memory, not full?
User avatar
Holger
Site Admin
Posts: 4073
Joined: Fri Jun 18, 2004 4:13 pm
Location: Germany
Contact:

Post by Holger »

> FREE??? But where I can see free memory, not full?

You mean there is no way to view the currently used and free memory under Windows???

What about the task manager? I think it also shows the memory usage of each process...

Besides that, the SDL version of R'n'D (and therefore the Windows version) seems to eat up quite some memory -- when loading the BD2K3 level set, it uses nearly 100 MB memory (which is also strange to me). When not loading sets with custom artwork, it needs something around 30-40 MB, which should work fine on your system.

You can make R'n'D use less memory for graphics by using 16 bit color depth instead of 32 bit color depth on the desktop, btw...

But it seems that I should further investigate the memory hunger of R'n'D...
Post Reply