PDA

View Full Version : Too many 2d/3d Libs !!!



arthurprs
10-07-2007, 03:03 AM
Im lost....

There are to many 2d/3d game libs

Im interested in one very simply(2d), fast, windowed, no external dlls, one bmp drawning onto the screen



sorry my bad english

captainproton
10-07-2007, 04:32 AM
Then you would be better off setting your

doublebuffered:=true;

for your form. I had the same problem with my Slot Machine. I was drawing a number of bitmaps one after the other (15 of them) and would get flicker at various times. When I set the doublebuffered property to true it got much better.

Also, do not use the .update or .repaint to force your bitmap to repaint. You should use the mybitmap.invalidate. My understanding is that it causes only portions of the control which have changed to be repainted rather than the entire control.

I am sure others will have better advice, but this is what has worked for me.

Craig

captainproton
10-07-2007, 04:33 AM
I forgot to mention - why 60 times a second? If it is animation you want, remember that movies are between 24 and 30 frames per second.

Craig

arthurprs
10-07-2007, 07:18 AM
I Need a 2d lib, im currently using the delphiform =/

jasonf
10-07-2007, 08:30 AM
The reason there are so many different technologies available for apparently the same thing is Evolution. As time has moved on, people have found limitations in a particular library frustrating, so they've taken it upon themselves to write a new & improved system.. The new libraries worked for a lot of new projects... then someone finds a new library's limitations frustrating and therefore write a new one.. and so it goes on.. in the meantime, some people like the older libraries and continue to use them, so they remain in the public domain, used, supported and talked about... extended, and so it goes on.

For a simple 2D (windows only) game, personally I would use DelphiX because I've used it before and it's a piece of cake to get into. I've not tried any of the alternatives, but I'm glad they exist because it would be a sad day for Pascal game Development if the only 2D library available was DelphiX, it has too many limitations (Windows Only for a start), but from the sounds of things, it's perfect for what you want to do.

My current project needed to be cross platform, DelphiX couldn't support that so I wrote my own. My engine is nowhere near as easy to use as DelphiX, but then it didn't need to be.

pstudio
10-07-2007, 02:11 PM
I would just like to add a comment about doublebuffered := true; While this may solve the problem it's terrible slow. If you were to use standard Delphi GDI I would recomend drawing on one bitmap and flip it onto an other bitmap.

But I would advise you to use something like (Un)DelphiX if you're a beginner.

WILL
10-07-2007, 02:26 PM
You know I can see how having so many options just when you are getting started can seem a bit tricky to get started.

It wasn't always like this though. Around 2000-2002 all we had was a DirectX library called DelphiX and Free Pascal was nowhere near where it is today. So it's really not such a bad thing to be where we are as a community.

However, it does bring new problems like yours; "Where on earth do I start?!"

We are getting a lot of that now from newcomers to PGD and the community so I think it's about time we put up some nice little clear and descriptive arrows for the new folks. :)

I've been polishing my Pascal Compilers guide lately and have also thought of making up a Library guide too. After reading your thread, I've decided to complete both and post them on the front page of the site for all visitors and new member's convenience. Keep an eye out for a new thread about it in the forums. :)

arthurprs
10-07-2007, 03:44 PM
Im not a total new to gamedev i already used delphix but it was in the begin.


But today i have tested unDelphiX and im very disapointed :(

http://img444.imageshack.us/img444/3408/untitled2ps1.png (http://img444.imageshack.us/img444/3408/untitled2ps1.png)

8 is the Code

if dxdraw.CanDraw then
begin
dxdraw.Surface.Canvas.Draw(0,0,boardbuffer);
dxdraw.Surface.Canvas.Release;
dxdraw.Flip;
end;


9 is the Code

buffer.Canvas.Draw(8, 51, boardbuffer);
Canvas.Draw(0, 0, buffer);



Muchhh, Muchhh more fast =/, lower mem usage, low exe size
The form is vry simple, not suitable for games, but im my case i think is the right choice.

Coments ?


Sorry my bad english :oops:
im from brazil

arthurprs
10-07-2007, 03:53 PM
You know I can see how having so many options just when you are getting started can seem a bit tricky to get started.

It wasn't always like this though. Around 2000-2002 all we had was a DirectX library called DelphiX and Free Pascal was nowhere near where it is today. So it's really not such a bad thing to be where we are as a community.

However, it does bring new problems like yours; "Where on earth do I start?!"

We are getting a lot of that now from newcomers to PGD and the community so I think it's about time we put up some nice little clear and descriptive arrows for the new folks. :)

I've been polishing my Pascal Compilers guide lately and have also thought of making up a Library guide too. After reading your thread, I've decided to complete both and post them on the front page of the site for all visitors and new member's convenience. Keep an eye out for a new thread about it in the forums. :)

:) ohh thx it will be Awesome

Traveler
10-07-2007, 07:05 PM
Coments ?

Yes, 3 infact.

1, try to reduce your screenshot size. I´ve modified your post so it will fit better and not mess up the forum layout. People can still click on the screenshot if they want to see the whole thing.

2. I think you should elaborate on your post. I'm not sure if its me, but I haven't got a clue what it is you're trying to say here.

3. Related to 2 as I'm unsure what you want to tell us with the code, but iirc, surface.canvas should not be used unless you want to use texts, lines or other shapes. For everything else use surface.draw or even surface.blitDraw.

arthurprs
10-07-2007, 07:55 PM
Coments ?

Yes, 3 infact.

1, try to reduce your screenshot size. I´ve modified your post so it will fit better and not mess up the forum layout. People can still click on the screenshot if they want to see the whole thing.

2. I think you should elaborate on your post. I'm not sure if its me, but I haven't got a clue what it is you're trying to say here.

3. Related to 2 as I'm unsure what you want to tell us with the code, but iirc, surface.canvas should not be used unless you want to use texts, lines or other shapes. For everything else use surface.draw or even surface.blitDraw.

sorry for 1, 2 :oops:

=O this forum has html enabled, sorry i haven't seen



3: i will try and post results

arthurprs
10-07-2007, 09:08 PM
http://img478.imageshack.us/img478/2606/addadalx6.png

Code:

DXImageList1.Items[0].Draw(DXDraw1.Surface,0,0,0);
DXDraw1.Flip;


6ms are good :)

WILL
10-07-2007, 09:34 PM
Just a little tip for ya. GDI sucks! Don't use it. :)

At least if you want A) performance and B) nice clean graphics.

Shortly after the release of Windows 95. Game makers couldn't make too many games 'for Windows' because of the GDI issues. It was just way too slow and not designed for high end graphics at all!

So Microsoft co-created DirectX. Actually I think they took someone else's work and made it their own, remember the beginnings of MS-DOS anyone? ;) Anyhow back on topic. The purpose of DirectX was to get past all the Windows API junk and get right down into using the graphics hardware, much like DirectX and OpenGL does today.

I don't think Vista will change much of this, but you shouldn't be using the GDI at all if you are expecting any kind of performance or nice graphics. It's just not made for that.


Glad to see you've found some comfort with DelphiX though. :)

captainproton
10-07-2007, 09:42 PM
Even though my previous reply on this was way off, I have learned something. I have learned that DanjetX exists.

Graphics programming is new to me and I have always used the GDI for drawing. DanjetX seems to be what I might have been looking for.

I previously thought that 60 FPS was overkill (TV and Movies are at 24 - 30) but I see in the DanjetX samples I am running at 132 FPS. Although setting it to a max of 30 didn't change anything.

So, even though I was wrong I am glad I replied because I may not have read the other replies otherwise.

Thanks.

arthurprs
11-07-2007, 12:07 AM
Even though my previous reply on this was way off, I have learned something. I have learned that DanjetX exists.

Graphics programming is new to me and I have always used the GDI for drawing. DanjetX seems to be what I might have been looking for.

I previously thought that 60 FPS was overkill (TV and Movies are at 24 - 30) but I see in the DanjetX samples I am running at 132 FPS. Although setting it to a max of 30 didn't change anything.

So, even though I was wrong I am glad I replied because I may not have read the other replies otherwise.

Thanks.

Some game types are possible to run at 30fps, some others not, some others its impossible

arthurprs
11-07-2007, 12:09 AM
Just a little tip for ya. GDI sucks! Don't use it. :)

At least if you want A) performance and B) nice clean graphics.

Shortly after the release of Windows 95. Game makers couldn't make too many games 'for Windows' because of the GDI issues. It was just way too slow and not designed for high end graphics at all!

So Microsoft co-created DirectX. Actually I think they took someone else's work and made it their own, remember the beginnings of MS-DOS anyone? ;) Anyhow back on topic. The purpose of DirectX was to get past all the Windows API junk and get right down into using the graphics hardware, much like DirectX and OpenGL does today.

I don't think Vista will change much of this, but you shouldn't be using the GDI at all if you are expecting any kind of performance or nice graphics. It's just not made for that.


Glad to see you've found some comfort with DelphiX though. :)

I don't liked some things of delphix, its so "default" there is another lib that deserve a try ?

Just to remember my game its a mine sweeper but so the mouse moves vry fast throught the blocks and in every block under the mouse it shows diferently so thats why i need a fast refresh.

PS: sorry again my bad english

pstudio
11-07-2007, 12:22 AM
Will is right about that GDI sucks when it comes to making games, but sometimes you just don't have an option. Besides I think many og us made some of our first game using GDI. I know I did 8 years ago.

@captainproton
I encourage you to make use of either DirectX or OpenGL. Though I've never tried DanJetX out I've heard it's good. Some othe DirectX alternatives to DanJetX would be Omega, Asphyre or (Un)DelphiX.

arthurprs
11-07-2007, 12:31 AM
Will is right about that GDI sucks when it comes to making games, but sometimes you just don't have an option. Besides I think many og us made some of our first game using GDI. I know I did 8 years ago.

@captainproton
I encourage you to make use of either DirectX or OpenGL. Though I've never tried DanJetX out I've heard it's good. Some othe DirectX alternatives to DanJetX would be Omega, Asphyre or (Un)DelphiX.

For now i don't see any advantage for me move to delphix :?

WILL
11-07-2007, 04:27 AM
You guys should look into screen refresh rates, vsync and timers and timing techniques for your games.

You can have any amount of FPS you wish depending on the hardware you are running (almost all run at about 60Hz or more --some 70 some 75 or a lot more, but they carry a price tag) and the setting/flexibility of your game timer.

DelphiX has a TDXTimer component (which is a lot like the TTimer that is standard VCL) that allows you to set the rate at which it will run your main game loop. (this is common usage for a (Un)DelphiX based game)

Your timing is the very foundation of your game's main structure, without it you get very bad performance when trying to manage the overall speed of your game. There are several tricks that different experienced game programmers use, try a few different things and stick to what works best for your game and gives you consistency over various speeds of processors/systems.

I have a feeling that your hangups over DelphiX might disappear once you get a better understanding of the TDXTimer component. It's not the best, but it'll do the trick. ;)

WILL
11-07-2007, 04:34 AM
actaully if you guys are used to the older Turbo Pascal style of doing graphics then you'll probably feel more at home with JEDI-SDL.

You're basically doing your graphics component-less anyhow... jedi-sdl.pascalgamedevelopment.com to check it out. It'll work just fine on any system and you use it just as you did back in the old TP7 days. ;)

It has a ton of examples so you can run a working set of code that you can tinker with and see how to do X,Y,Z yourself. Plus if you really get stuck, I have a tutorial series that is in the Articles section of the site here that uses pure JEDI-SDL to show beginners how to make a Scorched Earth type game.

Self promotion not so much intended but it's something else you guys can check out too. ;) Help give you an idea of what you want to be aiming for in the more graphical games.

arthurprs
11-07-2007, 05:08 AM
actaully if you guys are used to the older Turbo Pascal style of doing graphics then you'll probably feel more at home with JEDI-SDL.

You're basically doing your graphics component-less anyhow... jedi-sdl.pascalgamedevelopment.com to check it out. It'll work just fine on any system and you use it just as you did back in the old TP7 days. ;)

It has a ton of examples so you can run a working set of code that you can tinker with and see how to do X,Y,Z yourself. Plus if you really get stuck, I have a tutorial series that is in the Articles section of the site here that uses pure JEDI-SDL to show beginners how to make a Scorched Earth type game.

Self promotion not so much intended but it's something else you guys can check out too. ;) Help give you an idea of what you want to be aiming for in the more graphical games.

JEDI-SDL is vry good but it has too many things that i will not use and will overweight my app size with dlls =/ (thats not prety bad, but evade it is better)

I will have a look at asphyre right now.

arthurprs
11-07-2007, 05:22 AM
actaully if you guys are used to the older Turbo Pascal style of doing graphics then you'll probably feel more at home with JEDI-SDL.

You're basically doing your graphics component-less anyhow... jedi-sdl.pascalgamedevelopment.com to check it out. It'll work just fine on any system and you use it just as you did back in the old TP7 days. ;)

It has a ton of examples so you can run a working set of code that you can tinker with and see how to do X,Y,Z yourself. Plus if you really get stuck, I have a tutorial series that is in the Articles section of the site here that uses pure JEDI-SDL to show beginners how to make a Scorched Earth type game.

Self promotion not so much intended but it's something else you guys can check out too. ;) Help give you an idea of what you want to be aiming for in the more graphical games.

JEDI-SDL is vry good but it has too many things that i will not use and will overweight my app size with dlls =/ (thats not prety bad, but evade it is better)

I will have a look at asphyre right now.

-.- i think JEDI-SDL will be the choice

WILL
11-07-2007, 05:36 AM
JEDI-SDL is vry good but it has too many things that i will not use and will overweight my app size with dlls =/ (thats not prety bad, but evade it is better)

Thats not nessissary. You can take any part of SDL you want to use and be rid of the rest.

In fact you can have games that require only SDL.dll. ie. My tutorial game 'Scorch 2D'. However the extra libraries do help make the rest of your otherwise bloated content less... bloated. :)

ie. SDL_image allows you use PNG files rather than BMP. Which has far better compression.

arthurprs
11-07-2007, 05:43 AM
JEDI-SDL is vry good but it has too many things that i will not use and will overweight my app size with dlls =/ (thats not prety bad, but evade it is better)

Thats not nessissary. You can take any part of SDL you want to use and be rid of the rest.

In fact you can have games that require only SDL.dll. ie. My tutorial game 'Scorch 2D'. However the extra libraries do help make the rest of your otherwise bloated content less... bloated. :)

ie. SDL_image allows you use PNG files rather than BMP. Which has far better compression.

WoW i have an idea, put the bmp as resource in a dll and use PECompact that uses lzma to compress things :? i think it gonna work i will test in the morning

but for sure it will have a highter load time but nothing huge

arthurprs
11-07-2007, 05:46 AM
Shit! where are the dlls :P

they didn't come in the package =/

and i found only sdl.dll on libsdl.com site :(


Help...

Traveler
11-07-2007, 07:59 AM
I'm unsure if there are any newer versions, but you can get the dll's from the JEDI-SDL v0.5 version. (it seems to have other demos too)

jdarling
11-07-2007, 12:11 PM
Shit! where are the dlls :P
they didn't come in the package =/
and i found only sdl.dll on libsdl.com site :(
Help...

Ok, here is the really bad answer to your question:
Download my entry for this years PGD from http://www.eonclash.com/JumpStart/v4/PGD07/
Unzip it and copy the DLL's (minus the lua ones) from the bin or root folder (depends on the version you download). You will have most if not all of the SDL DLL's.

The proper answer is:
Look around on the libsdl site, the downloads are there for each component, it just takes forever to find the ones you need. You can also try using your favorite search engine to find the DLL's you need.

jasonf
11-07-2007, 01:33 PM
SDL: http://www.libsdl.org/download-1.2.php
SDL_Mixer: http://www.libsdl.org/projects/SDL_mixer/
SDL_Image: http://www.libsdl.org/projects/SDL_image/

All SDL Libraries are in the Libraries section of the LibSDL.org site (Note, use the .org URL not the .com URL.. the .com is a completely different site )

The search facility on the LibSDL site is quite good.
I would advise against looking around the net for versions of these DLL's especially if you're going to ship them to other people, unless you know that the DLL in question is genuine, you shouldn't use it. JDarling's DLL's will be fine, but you should use the ones on the SDL site.

JEDI-SDL only requires you to include sdl.dll, all other dll's are optional.
I always include mixer and image though in my work, although you could use OpenAL instead of Mixer without too much trouble I believe.

WILL
11-07-2007, 02:05 PM
I'm unsure if there are any newer versions, but you can get the dll's from the JEDI-SDL v0.5 version. (it seems to have other demos too)

I was just about to suggest the very same thing. In fact, JEDI-SDL used to include the very version of the SDL DLLs it supported. Not sure why that trend stopped, I'll have to ask him.

But I think Jason nailed it. If you want the most current ones get them from the libSDL site it's self.


btw, I've posted a WIP of the big grand master list here: Pascal Dev Guides (http://www.pascalgamedevelopment.com/viewtopic.php?p=36290#36290)