PDA

View Full Version : PTK vs raw DX7/OpenGL


20thCenturyBoy
11-22-2004, 06:11 PM
I realise this question may be a bit "finger in the air" but anyway...

Say I wanted to develop a side scroller platformer in the style of the old Commander Keen. You know the sort of thing, simple colourful sprites, that can be rotated, stretched etc. Say 3 layers of parallax scrolling. Would a library such as PTK be useful for that sort of game, and how much time could I save by using PTK rather than doing it all from scatch in DX or OpenGL? Assume I have the artwork :-)

I have a good knowledge of C++ and have written Windows games before (GDI based) but I have ZERO knowledge of DX or OpenGL. I have a copy of "Tricks of the Windows Game Programming Gurus" that teaches basic DirectDraw using DX7 so I could use that to get up to speed. But I don't want to waste my time if existing libraries such as PTK can do the same job easier.

20thCB

Mark Fassett
11-22-2004, 06:19 PM
I would say you could save many months. PTK is extremely easy to learn. PTK also handles sound and input, too. I'd bet you could be up and running with PTK in less than a week, where doing all that work yourself could take months.

Mike Boeh
11-22-2004, 06:58 PM
Doing it yourself in DX is more like doing it yourself in OpenGL...

If you would rather have DirectX instead of opengl, but want an easy engine, you might want to try HGE: http://hge.relishgames.com/ or Blitz Basic...

20thCenturyBoy
11-22-2004, 07:32 PM
HGE does indeed look good. Apart from the obvious difference of using DX instead of OpenGL I wonder how it compares to PTK in terms of stability, support, ongoing development etc?

These engines certainly do seem to take a lot of the drudgery out of game creation. I think if I took the "learn DX first" track I will never complete a game. Especially as I can only spend a couple of hours a day on this.

Does using one of these engines cause games to look similar? Or are they low-level enough to allow a certain amount of freedom? Can you tell if a game was made with PTK/HGE just by the game mechanics/effects etc?

20thCB

Mark Fassett
11-22-2004, 07:41 PM
No. My game, Derelict, was made using DX, initially, but switched to PTK during development. The only difference in the way they look is that I got to use alpha for the shadows and explosions.

patrox
11-22-2004, 11:51 PM
I realise this question may be a bit "finger in the air" but anyway...

Say I wanted to develop a side scroller platformer in the style of the old Commander Keen. You know the sort of thing, simple colourful sprites, that can be rotated, stretched etc. Say 3 layers of parallax scrolling. Would a library such as PTK be useful for that sort of game, and how much time could I save by using PTK rather than doing it all from scatch in DX or OpenGL? Assume I have the artwork :-)


You might want to check out helix
http://www.phelios.com/pc/helix.html

Was made with PTK, it's not really a platformer but has comparable elements.
Write to me privately i'll send you a key so you can see all the levels and effects.

pat.

Jack Norton
11-23-2004, 12:27 AM
My advice is: get PTK.
I was using Blitzbasic just 1 year ago and I didn't know ANYTHING of C.
Then I saw PTK and decided to try. Well I was surprised because the passage from a BASIC language to a C library was so easy!!
Since you aren't really a C newbie like I was at that time, I'd really suggest at least to try it.
I've tried other libs like Torque, but wasn't even able to compile the examples... :D

Rod Hyde
11-23-2004, 02:27 AM
Say I wanted to develop a side scroller platformer in the style of the old Commander Keen. You know the sort of thing, simple colourful sprites, that can be rotated, stretched etc. Say 3 layers of parallax scrolling. Would a library such as PTK be useful for that sort of game, and how much time could I save by using PTK rather than doing it all from scatch in DX or OpenGL?

Don't even think about it. Just use PTK. It has a very straightforward API and will easily do what you're asking. Plus the fact that it is free to try. If my own experience is anything to go by then you'll be up and running in a day.

--- Rod

ggambett
11-23-2004, 04:36 AM
Can someone (Patrice maybe) explain exactly what makes PTK so interesting? In terms of shareware, the PTK page doesn't sell it to me. What are the benefits over SDL? With SDL I get 2D support, OpenGL support, input, sound, networking, TrueType fonts and Linux support (which PTK doesn't have), and it's free; and just looking at the API, it doesn't look like a very high level abstraction either (I'd expect sprites, dirty rect management, texture memory management, a GUI...).

I'm not trolling and I don't mean to offend Patrice, PTK is obviously doing something right judging by the coments of other developers that use it, I just can't see what is it :confused:

patrox
11-23-2004, 04:52 AM
It's easy to use and it's not LGPL.

pat.

Jack Norton
11-23-2004, 04:59 AM
Well I would compare PTK with blitzbasic and other fast and easy development languages, not with SDL directly.
I think is made for people who want to get fast into game development: for you using SDL may be very easy but for a lot of people (including me) it isn't :(
It's only a matter of tastes (and programming skills) I think :)

ggambett
11-23-2004, 05:08 AM
OK, fair enough.
and it's not LGPL.
In practice, the only condition of the LGPL is that you dinamically link to the library and distribute it as a DLL. That's hardly a problem!

EpicBoy
11-23-2004, 05:44 AM
I'd bet you could be up and running with PTK in less than a week
Truth. I downloaded PTK and I have my game engine skeleton almost up and running and I've definitely spent less than a man week working on it. Not having to worry about Windows messaging or OpenGL set up really saves a lot of time.

A library doesn't have to do THAT much to make me happy. Just abstract me away from the hardware/OS/API and let me worry about what I care about - my game. PTK does that.

princec
11-23-2004, 06:23 AM
.. and LWJGL now :)

Cas ;)

patrox
11-23-2004, 07:02 AM
From the SDL license:
"
To comply with this license, you must give prominent notice that you use the Simple DirectMedia Layer library, and that it is included under the terms of the LGPL license. You must include a copy of the LGPL license.
You must also do one of the following:

Include the source code for the version of SDL that you link with, as well as the full source or object code to your application so that the user can relink your application,
or
Include a written offer, valid for at least three years, to provide the materials listed in option 1, charging no more than the cost of providing this distribution,
or
Make the materials listed in option 1 available from the same place that your application is available. "

So basically tomorrow i ask you the recompilable objects of Betty Beer Bar, and I can release Bob Beer bar by just changing the graphics ;)

pat.

Jack Norton
11-23-2004, 07:05 AM
I can release Bob Beer bar
THIEF!!! That was the name of my next game!!! :D

stanchat
11-23-2004, 08:19 AM
You may want to try this. It is pretty good for doing 2d games.

http://www.spritecraft.com/

ggambett
11-23-2004, 08:56 AM
Include the source code for the version of SDL that you link with, as well as the full source or object code to your application so that the user can relink your application,
By dynamically linking to SDL, all the user needs to do to "relink" my application with a modified version of SDL (that's the spirit of the LGPL) is to drop a new DLL on top of the one I distribute.

From the LGPL itself (http://www.gnu.org/copyleft/lesser.html) :
"5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.

HairyTroll
11-23-2004, 09:12 AM
The PTK documentation states that it exports a C++ API. Does anyone know if PTK also exports a C API ?

patrox
11-23-2004, 09:14 AM
By dynamically linking to SDL, all the user needs to do to "relink" my application with a modified version of SDL (that's the spirit of the LGPL) is to drop a new DLL on top of the one I distribute.

From the LGPL itself (http://www.gnu.org/copyleft/lesser.html) :

The SDL licence is a modified LGPL , read carefully ;)

pat.

ggambett
11-23-2004, 09:23 AM
OK, from the SDL Licensing page (http://www.libsdl.org/license.php) itself :
The most common way to comply with the license is to dynamically link with SDL, and then include the SDL source code and appropriate notices with your application.
From the Licensing FAQ (http://www.libsdl.org/faq.php?action=listentries&category=8) :
Q: Can I use SDL in a commercial application?
A: The simple answer is "Yes", just dynamically link with SDL and you're fine.
You do not have to include the source code to your application, since the end user can drop in a new version of the SDL shared library, which is the intent of the license.

HairyTroll
11-23-2004, 09:44 AM
From the SDL license:
"
So basically tomorrow i ask you the recompilable objects of Betty Beer Bar, and I can release Bob Beer bar by just changing the graphics ;)
pat.

That clause applies only when an application is statically linked to the SDL library. It does not apply when an application is dynamically linked.

Dingo Games
11-23-2004, 09:53 AM
Yeah, the SDL license doesn't bother me at all.

I tried out SDL for a little while before going with PTK. They are both easy to use but I think PTK is easier. The one thing that I really wanted was 3d accelerated rotation/scaling etc. PTK provides this. In SDL you would have to do it yourself in OpenGL.. or I think there was another library "glSDL" which provides an OpenGL backend for SDL, but it didn't seem ready to use yet and it was no longer in development. Perhaps by now there is a better version of this, or something built into SDL?

Also, the fact that Pat created so many games quickly with PTK is encouraging. :)

patrox
11-23-2004, 10:04 AM
We must have a different internet, that's not what i read on the SDL site in a different section.

"To comply with this license, you must give prominent notice that you use the Simple DirectMedia Layer library, and that it is included under the terms of the LGPL license. You must include a copy of the LGPL license.
You must also do one of the following:

Include the source code for the version of SDL that you link with, as well as the full source or object code to your application so that the user can relink your application,
or
Include a written offer, valid for at least three years, to provide the materials listed in option 1, charging no more than the cost of providing this distribution,
or
Make the materials listed in option 1 available from the same place that your application is available. "

"as well as the full source or object code to your application "

pat.

ggambett
11-23-2004, 10:08 AM
Same internet. The next paragraph reads
The most common way to comply with the license is to dynamically link with SDL, and then include the SDL source code and appropriate notices with your application.
Also, the FAQ couldn't be more clear. Again :
Q: Can I use SDL in a commercial application?
A: The simple answer is "Yes", just dynamically link with SDL and you're fine.
You do not have to include the source code to your application, since the end user can drop in a new version of the SDL shared library, which is the intent of the license.

My EXE is the object code. Want to relink? Put a new DLL in the directory.

patrox
11-23-2004, 10:32 AM
You know those licences stuff, paragraph 1 that cancels paragraph 2... That's one of those.

Bob Beer Bar is coming soon :)

pat.

HairyTroll
11-23-2004, 11:15 AM
You know those licences stuff, paragraph 1 that cancels paragraph 2... That's one of those.
Bob Beer Bar is coming soon :)
pat.

Paragraph 1 clearly does not contradict pararaph 2.

It states
Include the source code for the version of SDL that you link with, as well as the full source or object code to your application so that the user can relink your application,

Note the word or... full source or object code

And then ... so that the user can relink your application

The requirement is that a user shall always have the capability to relink a new version of the SDL library to the application and the author must provide the means to the user to do so. The requirement is not that the author must provide the source code. The author must only provide the source code if this is necessary to relink the library to the application. Therefore:


Statically linked: The source code or the object code to the application must be provided such that the user may relink the SDL library to the application.
Dynamically linked: The object code (the binary executable is sufficient to relink a DLL) must be provided such that the user may relink the SDL library to the application.

Mark Fassett
11-23-2004, 12:02 PM
Well - the reasons I chose PTK over SDL has to do with alpha, rotation, scaling, and SPEED. PTK is seriously faster than SDL, and I prefer the API. Patrox has also been very good about solving problems and adding features that I need, and doing it quickly. Not likely to see that happen from SDL. And before you state "SDL is open source and I can just fix it myself", think about the fact that if you do fix it yourself, you have to hope they pick it up, or you have to make the changes in any future version of SDL that you get.

By the way - this doesn't mean he adds every feature I request, but he will add anything that should be in the library.

Rod Hyde
11-23-2004, 12:51 PM
And before you state "SDL is open source and I can just fix it myself".
Apologies if this is slightly off topic, and more apologies if this comes across as a deranged rant.

I do like open source software, but I have never understood that argument (which I know isn't Mark's argument). It might be valid for a 15 year old with lots of free time, but for a 36 year old with a wife and daughter? My goal is to make something that I can sell, but my time is limited. Given the choice between using a poorly documented library that is free, but comes with source code, and one that is well documented, costs a couple of hundred pounds, and may or may not come with source code then which am I going to choose?

In other words, free isn't free. You save money, but you lose time and you don't get any nearer to your goal.

--- Rod

20thCenturyBoy
11-23-2004, 08:45 PM
I couldn't care less whether a lib is opensource or not. I don't mind spending a couple of hundred bucks on something like PTK if it saves me time and produces results. It's beer money. I do care that a lib is well documented, contains minimum cruft, and has good support.

I think it's horses for courses. SDL is not a game library, it's a multimedia library. Game related functions are only available in add-on packages that may or may not be up to the standard of quality of the core SDL.

PTK (and HGE) on the other hand are game-oriented libraries and operate at a higher level of abstraction. As long as performance doesn't suffer I don't care about how a routine has been implemented, and I certainly don't need the source code. The lib is a black box. As someone said, I certainly don't have the time to trawl through someone else's source code anyway.

I actually didn't realise there were so many libs available. It's an eyeopener. For DX only HGE looks like it has a ton of stuff, and is actively maintained. Of course it is completely non-portable. PTK has the potential to work on Macs and Linux and again is actively maintained. Which to choose? I dunno but it's a fun dilemma :-)

EpicBoy
11-24-2004, 06:20 AM
In other words, free isn't free. You save money, but you lose time and you don't get any nearer to your goal.
This is where the expression, "Free software is only free if you don't value your time", comes from.

stan
11-24-2004, 07:30 PM
I'm using SDL and OpenGL. I could port my game from AmigaOS code to SDL/Windows in 3 days, so I'd say SDL is pretty easy to learn and use.

However, here are the problems I got:

- after I installed a Radeon 9200 SE, my game simply crashed while opening the OpenGL context. Mailing the SDL ML didn't bring any help, but installing newer Radeon drivers fixed the crash. I can't tell if it would have crashed with PTK though :).

- I recently implemented fullscreen support, after spending a lot of time looking for documentation on how to do that (and not finding much), and got crashes after many window<->fullscreen switches. One of these crashes happens in SDL_SetVideoMode(). AFAIK, PTK has got a simple "togglefullscreen" function. I'm guessing it works ;). (though it might have the same problems on my config... win98+Radeon)

Mark Fassett
11-25-2004, 01:07 AM
Hehe - that toggleScreen function is one of the things I got him to add to PTK :)

wazoo
11-25-2004, 03:33 AM
Any reason why SDL is not being currently maintained/updated?

With all of the "action" it seems to bring Indies, it's kind of curious that most are now turning away from it because of lack of any kind of updates (that's one of the reasons it scared me away).

Was there a formal decision by the SDL team to stop updating it?

btw. YES PTK wraps up the OpenGL device creation, but in SDL that was accomplished with only a few lines of code. It *really* wasn't that bad.

It was a bit shorter (code length) than creating an OpenGL device context
in Windows (and that's pretty short!)

patrox
11-25-2004, 03:37 AM
Maybe they have a family to feed ?
http://www.libsdl.org/finances.php was clearly not enough to fill the fridge.

pat.

princec
11-25-2004, 04:10 AM
Strange that after so many years they only managed to scrape together $1200. We managed to get that for LWJGL in a couple of weeks.

Cas :)

mahlzeit
11-25-2004, 04:12 AM
Any reason why SDL is not being currently maintained/updated?
Says who? Latest release was 12 November. That's fairly recent. The 1.2 codebase is stable and works well, so it's unlikely it will see significant changes.

ggambett
11-25-2004, 04:35 AM
Maybe they have a family to feed ?
http://www.libsdl.org/finances.php was clearly not enough to fill the fridge.
A certain game company which makes obscure games pays the bills. Sam Lantinga, the main developer, works for them. It's some company called Blizzard. I hear they make good RTS games!

patrox
11-25-2004, 06:42 AM
A certain game company which makes obscure games pays the bills. Sam Lantinga, the main developer, works for them. It's some company called Blizzard. I hear they make good RTS games!

Hey that's neat!

pat.

milieu
11-25-2004, 11:02 AM
Given the choice between using a poorly documented library that is free, but comes with source code, and one that is well documented, costs a couple of hundred pounds, and may or may not come with source code then which am I going to choose?

In other words, free isn't free. You save money, but you lose time and you don't get any nearer to your goal.

--- Rod
What about using a well documented library with source code that is free vs a poorly documented closed source library that costs hundreds of pounds? ;)

Bear in mind that commercial libraries, whether well-documented or not, could well have serious bugs that you would never be able to debug or fix because you lack the source code. In addition, commercial companies do go out of business leaving you with a product that is no longer supported, and that you do not have the source code. This can become especially bad when you need to change platforms, and the commercial library is now holding you back (happened to me at the day job, in fact.)

This, of course, has nothing to do with PTK, as I've never used it and can't comment on it. ;)

tolik
11-25-2004, 01:55 PM
SDL was really active when LokiGames was behind it.

Rod Hyde
11-25-2004, 02:56 PM
What about using a well documented library with source code that is free vs a poorly documented closed source library that costs hundreds of pounds? ;)
I couldn't agree more. The ideal library would be well documented, well supported, with access to the source and with a licence that I can live with. My point was that there is always a price to pay, and the price of time is one that I can't afford. I think EpicBoy's quote says it all.

--- Rod

Jay_Kyburz
11-26-2004, 04:21 PM
Is anybody using a game library and C#?

Jack Norton
11-26-2004, 11:56 PM
I think some people use Torque and C#.
Bugged Out Rally (http://www.winterwolves.com/buggedoutrally.htm) was made with that (as far as I know).