Tag Archives: sdl

No One's Space

Commercial Free Pascal/SDL Project

The No One’s Space SDL game has been added to the SDL Project page. It is the first commercial title added and Klaus Vor der Landwehr (from Turtle-Games) has kindly provided an interview for us. Feel free to support the game in the greenlight state over at Steam. This game demonstrates that Free Pascal and SDL make games of commercial quality possible.

The installation instruction got extend by an explanation how to install and configure Lazarus.

No One’s Space

Short description

A commercial high quality space shooter by game developer Turtle-Games.

Showcase and Basic Data

Developer granted permission to use these screenshots.

  • Project name: No One’s Space
  • Author: Turtle Games
  • Latest version: Pre-alpha Version
  • First release date: Steam Early Access Release in 2016 (TBA)
  • Compiler: Free Pascal (via Lazarus)
  • SDL Version: 2.0
  • Further libraries: OpenGL, OpenAL, Ogg Vorbis
  • License: Commercial
  • Open source: no
  • Official website: http://www.NoOnesSpace.com

Interview with Klaus Vor der Landwehr from Turtle-Games

Could you please give a short description of No One’s Space for those who have never heard of it?

Klaus Vor der Landwehr: No One’s Space (NOS) is a single-player Retro 2D-Science-Fiction-Shooter with modern physics. It was created as a cross-breed of the classic games Wing Commander I and Star Control II. In NOS, the player experiences a cosmic conflict between four powerful races, taking the role of different heroes. In 54 challenging missions, reaching from manageable duels to large combats, the player controls a variety of vessels and has to go all out to improve his skills to master them all.

Why did you decide to choose Pascal as a programming language and SDL/SDL2 as a library for this project?

Klaus Vor der Landwehr: It wasn’t really a choice. I’m used to Pascal since my school days. I’m a self-taught. I like it.

What do you think is the most interesting Pascal/SDL/SDL2 project out there (besides your own, of course :-D)?

Klaus Vor der Landwehr: Hm, as far as it concerns the programming language, games are rarely tagged. But I’ve seen some impressive stuff right here: Projekt “W” – Phase 2 http://www.saschawillems.de/?page_id=829 (Although I can only assume that it uses SDL).

Are there any further steps for No One’s Space and/or are any new projects planned? What will they be?

Klaus Vor der Landwehr: If the game gets Greenlit, we want to release it on Steam this year (early access) and work further on it.

 

Colorful

Short description

A 2d shooter whose source code is free to study.

Showcase and Basic Data

Developer granted permission to use these screenshots.

  • Project name: Colorful
  • Author: suve
  • Latest version: 1.2
  • First release date: 2012-12-16
  • Compiler: FPC 2.6.2
  • SDL Version: 1.2
  • Further libraries: Originally BASS for audio handling, later replaced with SDL_mixer as to move away from proprietary library; SDL_image; Sour could probably count, too; OpenGL
  • License: zlib w/acknowledgement
  • Open source: Yep. Under zlib, as stated above.
  • Official website: http://svgames.pl

Interview with suve

Could you please give a short description of Colorful for those who have never heard of it?

suve: Colorful is a simple game where the player moves freely around a 2D world, fighting multiple enemies and trying to retrieve colourful artefacts. Originally created in 48h for Ludum Dare, the game is heavily inspired by Hero Core, featuring simplistic graphics and sounds, and a no-game-over approach balancing the overall difficulty level.

Why did you decide to choose Pascal as a programming language and SDL/SDL2 as a library for your projects?

suve: I chose Pascal mostly as it’s the language I’m most proficient and comfortable with. As for SDL, after working with a few different libraries in the past, I’ve found SDL easy to use, but nonetheless really versatile and fitting my needs. The library itself doesn’t really enforce anything on you, so you don’t have to change your habits (much), and the seemingly simplistic API is greatly extended by the supplementary SDL_XYZ libraries.

What do you think is the most interesting Pascal/SDL/SDL2 project out there (besides of your own, of course :-D)?

suve: Supraleiter seems the most awesome of them all, I think. Shame that quite probably I won’t be able to play sit, seeing as I only have an integrated GPU.

Are there any further steps for your projects or any new projects planned? What will they be?

suve: I have two projects underway right now, but one is too early in development and I don’t want to disclose it for fear of not delivering… and the other, for a change, is written in C instead of Pascal. 🙂

 

Alexland

Short description

Alexland is a 2d shooter in a classical style.

Showcase and Basic Data

Developer granted permission to use these screenshots.

  • Project name: Alexland
  • Author: suve & ZbiXs
  • Latest version: 1.3
  • First release date: 2010-01-31
  • Compiler: Free Pascal 2.4.0 (for the 1.3 release)
  • SDL Version: 1.2
  • Further libraries: BASS for audio handling, SDL_image, SDL_ttf, SDL_net
  • License: Back then we didn’t really think about licensing, and seeing how the game contains assets ripped from plenty of places without even keeping track of source… I say it’d be hard for us to claim copyright to anything apart from code and some original graphics (+edits) we created.
  • Open source: Nope. Maybe if there’s a remake one day.
  • Official website: http://svgames.pl

Interview with suve

Could you please give a short description of Alexland for those who have never heard of it?

suve: Born of RPG Maker nostalgia and the hatred for its default graphics set, Alexland is a 2D shooter where the player controls a lone hero in a fight against never-ending hordes of monsters. Featuring 12 weapons to kick ass with, 11 bonuses to enhance the gameplay, 10 monster types to kill, and 60 achievements to unlock, Alexland can provide long hours of mindless, merciless fun. Available in English, Polish, French, German and Russian.

Why did you decide to choose Pascal as a programming language and SDL/SDL2 as a library for your projects?

suve: I chose Pascal mostly as it’s the language I’m most proficient and comfortable with. As for SDL, after working with a few different libraries in the past, I’ve found SDL easy to use, but nonetheless really versatile and fitting my needs. The library itself doesn’t really enforce anything on you, so you don’t have to change your habits (much), and the seemingly simplistic API is greatly extended by the supplementary SDL_XYZ libraries.

What do you think is the most interesting Pascal/SDL/SDL2 project out there (besides of your own, of course :-D)?

suve: Supraleiter seems the most awesome of them all, I think. Shame that quite probably I won’t be able to play sit, seeing as I only have an integrated GPU.

Are there any further steps for your projects or any new projects planned? What will they be?

suve: I have two projects underway right now, but one is too early in development and I don’t want to disclose it for fear of not delivering… and the other, for a change, is written in C instead of Pascal. 🙂

 

 

 

Wallman

Pascal SDL Projects?

A new page has been set up which gives an overview of projects done in SDL with Pascal (any dialect). The projects may be games, interpreters, libraries, anything. Of course SDL should play a key role and shouldn’t be just used to set up an OpenGL window (or similar). If possible I try to have an interview with the creator of the project.

The first project listed is the famous EGSL project and its successor Pulsar2D. Both have been created by Cybermonkey who kindly gave an interview and provided a lot of screenshots to me.

Feel free to contact me to let me know about other Pascal SDL projects.

Edit: As of 09/02/2016 I added suve’s Alexland and Colorful to the project page. Thanks for the interview and the screenshots.

EGSL and Pulsar2D

Short description

EGSL and Pulsar2D are LUA script interpreters to develop games in an easy, quick and convenient way.

EGSL: Showcase and Basic Data

Developer granted permission to use these screenshots.

  • Project name: Easy Game Scripting with LUA
  • Author: Cybermonkey
  • Latest version: 1.6.0
  • Release date: 30/12/2012
  • Compiler: >= FPC 2.6.0
  • SDL Version: SDL 1.2
  • Further libraries: Vampyre Imaging Library / Lua 5.1 / Lua 5.2
  • License: zlib
  • Open source: yes
  • Official website: http://www.egsl.retrogamecoding.org

Pulsar2D: Showcase and Basic Data

Developer granted permission to use these screenshots.

  • Project name: Pulsar2d
  • Author: Cybermonkey
  • Latest version: 0.6.2
  • Release date: 31/12/2015
  • Compiler: FPC 3.0.0
  • SDL Version: SDL2
  • Further libraries: Lua 5.2
  • License: zlib
  • Open source: yes
  • Official website: http://pulsar2d.org

Interview with Cybermonkey

Could you please give a short description of EGSL and Pulsard2D for those who have never heard of it?

Cybermonkey: EGSL (Easy Game Scripting with Lua) is a Lua interpreter which allows one to code 2D games in a simple way. I could say in a “classical way” because EGSL is inspired by old BASIC dialects. The main difference between EGSL and Pulsar2D is that Pulsar2D uses now the newer SDL2 libraries (which gives us the possibility to use multiple windows). It’s as easy as that: write 10 lines of Lua code and start the script and you’ll have already a small sprite moving example. Of course it is possible to use the framework with FreePascal. Apart from that I recently ported the Pulsar2D framework to FreeBASIC. So one can code Pulsar2D games/demos whatsoever in Lua, FreePascal or FreeBASIC.

Why did you decide to choose Pascal as a programming language and SDL/SDL2 as a library for these projects?

Cybermonkey: I started programming back in the 1980s with the Commodore 64 and BASIC. I learned Turbo Pascal in school and started programming with FreePascal a few years ago. It’s the language I have the most experience with. Not to mention that the FreePascal compiler is well maintained. I chose SDL/SDL2 because of its cross platform capabilities.

What do you think is the most interesting Pascal/SDL/SDL2 project out there (besides of your own, of course :-D)?

Cybermonkey: Actually I don’t know of any other … But of course the most impressive Pascal project is Lazarus for me.

Are there any further steps for EGSL and/or Pulsar2D or any new projects planned? What will they be?

Cybermonkey: EGSL will not be developed any further. Pulsar2D wil be improved from time to time. My plans are to implement Box2D physics and easy handling of tiled based maps made with the Tiled editor. But this has no priority so it can take a long time…

At the moment I am developing a little BASIC interpreter called “AllegroBASIC”. It’s a C project, though. (The editor, however, is made with Lazarus…) Since I am using Allegro4 libs which are obsolete now, I am porting at the same time the project to SDL2 which will be named “RETROBASIC”. If there are people interested in AllegroBASIC, have a look at allegrobasic.pulsar2d.org.

 

Does SDL provide 64 bit compatibility?

Yes, SDL is 64 bit compatible.

If you experience troubles: First of all, make sure the problem is really caused by the 64 bit operating system you use. Does the program run without any problems if run it in a 32 bit operating system?

Make sure, that the Free Pascal compiler you use is the 64 bit version. There are different links on the download page of Free Pascal to different 64 bit operating systems for different architectures (Intel, AMD, PowerPC), so did you install the right 64 bit version of FPC?

If all this applies and you still get an error saying

sdlutils.pas Warning: Conversion between ordinals and pointers is not portable

and/or

sdlutils.pas Error: Typecast has different size (4 -> 8) in assignment

(or similar messages) then your problem clearly is related to 64 bit compatibility.

In the FPC reference is written about this type-checking error:

If you typecast a pointer to an ordinal type of a different size (or vice-versa), this can cause problems. This is a warning to help in finding the 32-bit specific code where cardinal/longint is used to typecast pointers to ordinals. A solution is to use the ptrint/ptruint types instead.

That is exactly what is done by sdlutils.pas and many other files and causes the errors and warnings!

In other words, the size of pointers and integers is different on 64 bit systems. They should be of same size to make conversion safe. To circumvent this problem you have to replace a conversion of UINT32(POINTER) by PTRUINT(POINTER) and INTEGER(POINTER) by PTRINT(POINTER). The PTRUINT and PTRINT integer types are always the same size as the pointer by definition. For FPC users both types are introduced since version 1.9.3. For other compilers (e.g. Delphi, Kylix, GPC, …) they are not and you have to define them yourself (see below).

Examples:

1) sdlutils.pas:

p := Pointer( Uint32( SrcSurface.pixels ) + UInt32( y ) * SrcSurface.pitch + UInt32( x ) * bpp );" gets "p := Pointer( PtrUInt( SrcSurface.pixels ) + UInt32( y ) * SrcSurface.pitch + UInt32( x ) * bpp );

2) sdlutils.pas:

Addr1 := cardinal( Pixels );" gets "Addr1 := PtrUInt( Pixels );

3) sdl_flic.pas:

line := PUint8(Integer(line) + flic.Surface.pitch);" gets "line := PUint8(PtrInt(line) + flic.Surface.pitch);

Definition of PTRUINT and PTRINT for non-FPC compilers:

{$ifndef FPC}

type

PtrInt = LongInt;

PtrUInt = LongWord;

{$endif}

There is a patch which is replacing all the questionable parts of the JEDI-SDL package, so you wouldn’t have to do it manually. Furthermore it is introducing the definition of the new types for non-FPC compilers. Link: Patch for 64 bit support. Unfortunately it is only useful if you manage your JEDI-SDL files by CVS or SVN. Nevertheless you could download the patch and check what the patch is changing and how to do it properly (the examples are generated from the patch).

More infos about this topic in the forum: Forum discussion about 64 bit compatibility. Thanks to Cybermonkey for his helpful response.

What is SDL and SDL2?

SDL is the abbreviation of Simple DirectMedia Layer.

Originally when refering to SDL, SDL 1.2 was meant. It is the predecessor of modern SDL 2.0 (sometimes SDL2). Nowadays, when refering to SDL, it depends on context if you really mean the old SDL 1.2 or the modern SDL 2.0.

The  obsolete SDL 1.2 and the modern SDL 2.0 are a set of units which provide a free, easy and platform-independent access to features needed for developing high performance games and applications. This includes easy access to graphic, sound and input handling (keyboard, mouse, joystick) for Free Pascal and other Pascal dialects.

Who made SDL and SDL2?

SDL was developed between 1998 and 2001 by Sam Lantinga, the chief programmer of the software company Loki Games. In 2002 the company got bankrupt, but Lantinga went on developing SDL. So it got updated continuously  until today.

In August 2013 the successor SDL 2.0 has been released. SDL 2.0 introduces a lot of new features which allow development of high performance applications using up-to-date technologies.

Although the original library isn’t written in Pascal, fortunately the SDL 2.0 headers got translated to Pascal by Tim Blume and others, so the SDL 2.0 library is usable for Pascal developers as well.

What is this page about?

This page is made to help you to start with the SDL and/or SDL2 (Simple Directmedia Layer) library under Free Pascal (or other Pascal dialects) and to acquaint yourself with SDL’s concepts and commands.

Be aware though that my tutorials gives just a brief overview and introduction to the SDL and SDL2 library and are far from being all-embracing.

The tutorials aim at Pascal programmers knowing the basic concepts (loops, functions, pointers) of Pascal and now like to progress to SDL and/or SDL2.