Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Basic needs for FreePascal with game programming.

  1. #1

    Basic needs for FreePascal with game programming.

    Hello. I wonder if there's any way that I can start the game programming in just using the original FPC compiler(with out Lazarus).

    If there is any following for what I need:

    * The ability to hold down a key while the player is moving. (key just pressed once and holding down a key)
    * No need to distribute DLLs when distributing the game. (I don't know if SDL does that)
    * All media in one file when distributing.
    * Sound Library (Again, Jedi-SDL offers that but I don't know if there's an option to not distribute the library DLL when distributing the game, because it can be a hassle for both developer, and for anyone who just wants to play the game with out the need to look for a certain file to get the game working).

    That's all the time I have now.

  2. #2
    Legendary Member NecroDOME's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands, Eindhoven
    Posts
    1,059

    Re: Basic needs for FreePascal with game programming.

    Yes you can.

    * You can retrieve what key the user pressed with pascal.
    * Yes, if it's plane windows forms. I don't know it SDL has an dll, otherwise you can compile it inside your exe.
    * Yes, you could use package/zip files or compile it as resource inside your .exe or have an installer.
    * You could try to use a sound lib that you can distribute with your game. I know DirectX is installed on most windows pc. If you want to go cross platform, you could use FMOD (dll) or something)

    NecroSOFT - End of line -

  3. #3

    Re: Basic needs for FreePascal with game programming.

    I wonder if there's a tutorial for all of that. I like FreePascal because it's a fast programming language but too bad it's not that widley used.

    I wish more people would contribute things to it.

  4. #4

    Re: Basic needs for FreePascal with game programming.

    Why don't distribute any DLL's and data-files along with your game? I don't see why you should avoid that. Just zip/rar the whole thing. The user just downloads, unpacks the archive and all files are there, and you're ready to play.

    It's almost impossible to write a game that just works "out of the box" on all computers. Different libraries and API's for 3d/sound/input/windowing are involved and some of the might need to be installed/updated in order to run the game.

    As far as I know, there are tricks to store the DLL inside the exe. You could try to include it as a resource and write it to disk as soon as the exe is started. This might be a possible workaround.
    Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.

  5. #5

    Re: Basic needs for FreePascal with game programming.

    Like most of the people on here, I have plenty of samples on my website (http://www.eonclash.com/) including spriting using only GDI and transparent input. Even have an example game engine based around FreePascal, Lua, and SDL.

    You will have a problem trying to find sound libraries that are cross platform that don't require a DLL, SO, LIB, or other module (dependent on platform).

    - Jeremy

  6. #6

    Re: Basic needs for FreePascal with game programming.

    Quote Originally Posted by firehead
    Hello. I wonder if there's any way that I can start the game programming in just using the original FPC compiler(with out Lazarus).
    Well best to start with the (admitted pretty sad) games that come with FPC. There is a tetris and samegame clone, and both work with both graph and in textmode. I still must have an half finished chain-reaction somewhere.

    * The ability to hold down a key while the player is moving. (key just pressed once and holding down a key)
    * No need to distribute DLLs when distributing the game. (I don't know if SDL does that)
    * All media in one file when distributing.
    The first point is dependant on what lib you use, but nearly any will provide it.

    The second and third points are always possible when doing open source. But it can be quite hard, specially if you have to figure it out for yourself how to compile and initialize SDL. I hope you realize you set the bar for yourself quite high with these.

    Besides that, there might also be license limitations (e.g. when SDL is LGPL or something with similar shared library limitations)

  7. #7

    Re: Basic needs for FreePascal with game programming.

    Quote Originally Posted by chronozphere
    As far as I know, there are tricks to store the DLL inside the exe. You could try to include it as a resource and write it to disk as soon as the exe is started. This might be a possible workaround.
    I wouldn't be so sure about that. For all I know, Windows looks up for needed libraries before the app is actually executed, so it might not be possible to extract it before it's invoked by the very app. Of course I may be wrong, but that's how it works, I think.

  8. #8
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Re: Basic needs for FreePascal with game programming.

    Honestly, I fail to see the point of avoiding having any other file than the EXE in your distributed games. It's not as if you are running DOS and you have to copy each file over one by one.

    SDL distributable libraries are just that distributable. They are intended to be packaged and included in your game. These days size is not an issue either as 1 GB USB drives are pretty much a minimum that you can get in some places. (Some it's 2 GB) sdl.dll and it's friends barely reach that.

    Further compressing and packing all your textures, sound and config files into some bootstrap format is a waste of time until you have nearly completed development. Especially if you don't know how to do it. You end up putting off what you need to learn most, which is all the core fundamentals for game development, first and foremost.

    My recommendations are if you want to use Lazarus or FPC alone try using SDL since it's probably the easiest to work with. (Asphyre is also good to try, but I believe it may require Lazarus.) Don't get hung up on small things like included DLL files and the like. Learn the basics FIRST then once you have actually made something THEN work on areas to improve your skills in different areas.

    If you need help or get stuck with something feel free to post in the forums and ask about it. Sometimes it's the quickest way to get what you need, right to the point.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  9. #9
    PGD Community Manager AthenaOfDelphi's Avatar
    Join Date
    Dec 2004
    Location
    South Wales, UK
    Posts
    1,245
    Blog Entries
    2

    Re: Basic needs for FreePascal with game programming.

    Quote Originally Posted by Brainer
    I wouldn't be so sure about that. For all I know, Windows looks up for needed libraries before the app is actually executed, so it might not be possible to extract it before it's invoked by the very app. Of course I may be wrong, but that's how it works, I think.
    You can dynamically load your libraries using loadLibrary (if my memory serves), then you can stream it out to disk and load it (and I perhaps should have read the parent post properly first... I can't say for certain anything about FreePascal as I've never used it, but on Windows I'd be suprised if you can't dynamically load libraries since thats part of the Windows API and on other platforms there should be an equivalent function).

    However... I have to agree with Will. Packaging your game is a non-issue if you don't actually have a game to package. Write the game, learn what you need to along the way, and by the end of it, if you've not learned enough to package the game I'd be very suprised.

    Regardless... good luck
    :: AthenaOfDelphi :: My Blog :: My Software ::

  10. #10

    Re: Basic needs for FreePascal with game programming.

    Quote Originally Posted by AthenaOfDelphi
    You can dynamically load your libraries using loadLibrary (if my memory serves)
    Yep, that's true. To be honest, I have never tried loading a DLL during application's execution, i.e. not at start. But AFAIK existence of external dependencies is checked before an application is actually run. I've never really met any program which thrown an error saying there's a DLL missing in the middle of its execution. But like I said, I may be wrong. If anyone can dispell the doubt, please do so.

    Yep, I agree both with Athena and WILL. First make the game working, then you can think about compacting your data files or protecting them. While in development, it's easier to keep your files "raw" (not compressed/encrypted), because it's faster to edit them.

Page 1 of 2 12 LastLast

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
  •