Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Day Of Destruction!

  1. #11

    Re: Day Of Destruction!

    Well, it now compiles...

    One slightly huge issue though - I ran it in debug mode in Lazarus, and it crashed...taking out my pendrive linux at the same time!!

    I had to restore the drive image that I had luckily backed up 1/2 hour earlier!!

    I suspect it might be because I'm using

    [pascal]DataPath := ExtractFilePath(ParamStr(0)) + 'data\';[/pascal]

    in my code, and then loading stuff from here...

    I have read this is definitely not reliable in Linux

    1. Anyone know how to find an application's path from within a program under Linux?

    2. anyone have a simple SDL + OpenGL lazarus linux program with source that they could share so I could try it on my system to help me debug my SDL + OpenGL code and find where it is crashing?

    cheers,
    Paul

  2. #12

    Re: Day Of Destruction!

    Hey paul, no problem using ExtractFilePath(ParamStr(0)) just make sure that you supply /'s and not \'s. This works in windows too as an added bonus (/'s instead of \'s) thus no code changes. In linux the \ is passed directly and the underlying OS may shit itself on an \#0 sequence (thats what your sending at times).

    Anyways, here is a zip file with an SDL app that compiles and runs in both windows and linux (I actually share my laz projects folder between the two and edit in both at the same time some times). Its incomplete, kinda jumbled up, and in general a mess, but it works and it runs in both (binaries are included). It also has my slightly modified version of SDL with it (I'm running an old version and refuse to update from being too stuborn). Download at http://www.eonclash.com/PGD/mygame.zip

    Hope it helps. Right now its just setup to show a character on the screen and move them around with the arrow keys (nothing fancy). In windows I pull 200FPS in Ubuntu on Windows via VirtualBox (or PenDrive) I get about 33FPS so definite difference. Course I test on a seperate Ubuntu box anyways, just like having all my dev tools on one box

    - Jeremy

  3. #13

    Re: Day Of Destruction!

    Thanks chief!

    I will see how I go

    cheers,
    Paul

  4. #14

    Re: Day Of Destruction!

    I should add, currently its setup to force OpenGL rendering (UseOpenGL : boolean = true in common.pas and similar in renderingengine.pas). This was more accidental as I was working out some bugs and got tired of passing in the commandline option for switching LOL. You can see where the settings (commandline and ini) can be used instead. Just uncomment the line ~92:
    UseOpenGL := CompareText(Settings.Setting['DisplayMode'], 'OpenGL')=0;
    in renderingengine.pas
    and comment the line ~93:
    UseOpenGL := true;

    Of course, that version also doesn't have a separate game.pas file that wraps it all up. Was getting to that, just hadn't got there yet .

  5. #15

    Re: Day Of Destruction!

    Hi Jeremy, thanks to your program I have now found out some things (all under pendrive Linux)...

    1. using OpenGL on both mine game and yours causes the pendrive linux client to crash and I have to delete a file from within the shell to enable it to restart again.

    2. disabling OpenGL on your project makes it work without crashing (shows boy sprite) in Lazarus debug mode, but runs at around 0.2 FPS!

    There is also no animation or movement via keys - is this correct?

    3. running the same executable via konqueror makes the window appear for a few seconds (window is blank), and then it closes down again without me hitting escape.

    4. running the executable from within a terminal window like so:

    Code:
    pendrivelinux:/mnt/win/Lazarus/Projects/myprojects/mygame/bin# ./mygame
    open /dev/sequencer or /dev/snd/seq: No such file or directory
    pendrivelinux:/mnt/win/Lazarus/Projects/myprojects/mygame/bin#
    Works like just like 2 (less than 1 FPS).

    So it appears I have discovered 3things:

    a. the getting a path from within Lazarus/freepascal doesn't seem to work correctly unless it is the current directory via a shell (as I suspected it wouldn't with my prowling around the net), or possibly via a script to change to that folder prior to executing the program.

    b. OpenGL makes my pendrive linux sh*t itself, so I have definitely got a OpenGL issue with my linux - perhaps it has incorrect drivers or something?

    c. I am missing something on my linux:

    Code:
    open /dev/sequencer or /dev/snd/seq directories
    Thanks for the help so far

    cheers,
    Paul

  6. #16

    Re: Day Of Destruction!

    1. using OpenGL on both mine game and yours causes the pendrive linux client to crash and I have to delete a file from within the shell to enable it to restart again.
    - You don't have OpenGL installed mate! sudo apt-get install opengl

    2. disabling OpenGL on your project makes it work without crashing (shows boy sprite) in Lazarus debug mode, but runs at around 0.2 FPS!
    - Software rendering via SDL is SLOW, with OpenGL support you should get somewhere between 10 and 20 FPS!

    3. running the same executable via konqueror makes the window appear for a few seconds (window is blank), and then it closes down again without me hitting escape.
    - See #1

    Etc...

    Also, I've been playing with Virtualbox (http://www.virtualbox.org/) with Unbutu and Knoppix/Debian and I must say I'm loving it! Of course, you still have to install all the other crap by hand (apt-get/pakman) but hey, its worth it. Networking on the other hand doesn't quite work right. You can access anything via the IP but forget about using names (my research turns up zilch, but it seems to do with IP masking).

    Nothing is better than pure hardware for testing, if you haven't done so yet, a great tool for this is to download a disk based distro (I like Knoppix www.knoppix.net but there are others). Use that to boot from, mount your harddrive /mnt/hdsk1 (typically, not always) and run your binary that you built while in your VM. If you have the extra hardware lying around, then the best solution is to setup a linux box. Build on your dev box, deploy via a local web server, download to your "test box" and install. This has the advantage that you can figure out what libs are really needed for your app. It also lets you blow away the test box quickly and try again

    That's my 2p worth at this point. Now if only we could run MAC OSX on a VM so I didn't have to have a mini and a powerbook for MAC builds (and right now I don't have either )

    - Jeremy

  7. #17

    Re: Day Of Destruction!

    Hi Jeremy,

    EDIT: Thanks for that:

    - You don't have OpenGL installed mate! sudo apt-get install opengl
    I didn't know what I should install for OpenGL

    BTW, After reading on the net, I whipped up this little script as a test (placed in /usr/bin)

    rungame.sh

    Code:
    #!/bin/sh
    DIR=$(/usr/bin/pwd)
    cd /mnt/win/Lazarus/Projects/myprojects/mygame/bin
    ./mygame
    cd $DIR
    I can now run a game (yours ATM) from any directory, and it still works

    Maybe it will help you too...

    cheers,
    Paul

  8. #18

    Re: Day Of Destruction!

    hmm...

    I tried:

    apt-get install opengl
    but it didn't know that package

    I found a bunch of opengl packages using Synaptic, but I don't know which one (if any to install)



    cheers,
    Paul


  9. #19

    Re: Day Of Destruction!

    Rather than try and answer, here is a thread over at GD that answers your OpenGL questions http://www.gamedev.net/community/for...opic_id=482331. Short answer, there is no "one source fits all" but mesa seems to be common. For the long answer, read the thread (actually, just read the thread LOL)

    NOTE: The thread is REALLY OLD, so you want to look for latest versions and not the ones listed, but at least it gives you a starting point for package names

    - Jeremy

  10. #20

    Re: Day Of Destruction!

    I installed some mesa opengl package stuff, but I haven't gotten around to seeing if now runs my game in OpenGL mode yet

    I tried one linux game commercial game I downloaded

    an arkanoid clone (uses SDl and OpenGL)

    http://www.wegroup.org/games/arkanoi...pace-ball.html

    but it runs like a dead dog still, and doesn't respond to mouse clicks with the onscreen cursor

    I think I will give things a try with VMWare player and a Ubuntu virtual machine instead...

    cheers,
    Paul

Page 2 of 2 FirstFirst 12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •