How fast is Borland delphi?

Started by
12 comments, last by PhiberOptic 20 years, 10 months ago
How much speed can you sqeez out of Borland Delphi in 3d games? Can it be compared with Visual C++? Acctually, I wrote my first game in Delphi, but that was a some years ago in Delphi 3 and it sucked, but how is it now?
----------------------------------------------Petter Nordlander"There are only 10 kinds of people in the world. They who understand binary and those who do not"
Advertisement
I wouldn't think that there would be too much difference between Delphi and VC++. The only comparison I remember is Jake's Code Efficiency Challenge, though that's not 3d specific (computationally intensive stuff like finding prime numbers, etc.). It's getting old now - most entries are for VC6 and Delphi 5. The results for the challenges put VC6 and Delphi 5 at the same speed and I seem to recall that Delphi 5 entries won one or two challenges.

As long as you know a little bit about how to optimize Delphi code then the speed should be just fine. The underlying computation won't be significantly faster or slower and most of your bottleneck will be from the 3d card itself. I would be surprised if you didn't have more than enough grunt from a Delphi game to do what you need. Hell, you could always dip into asm for your bottlenecks.

Plus, Delphi has some kick-ass 3d engines such as GLScene, a3d and GLXtreem.

I think that you'd be best asking Eric Grange or Tom Nuydens about this, since they have a heap of experience with 3d in Delphi. More to the point, though -- don't worry about performance yet. It's likely that the bottlenecks will be in small, specific places in your code. You should choose a language based on how productive you think you will be , other factors being roughly equal. If you think that you will be productive in Delphi then use it, else use something else.

[edited by - Alimonster on June 5, 2003 4:38:56 AM]
Thank you! It''s good to know such things =)

Even though I think I stick with coding 3D in VC++ I think it''s really good that other languages than C++ can take a fight with c++ specially a "fun" language like Delphi(Pascal) and not such boooring languages like Java, C# and BASIC.

My next question is:

Will there be serious commersial games developed in delphi?
----------------------------------------------Petter Nordlander"There are only 10 kinds of people in the world. They who understand binary and those who do not"
Not too many commercial games are made with Delphi, unfortunately. The trouble with Delphi is that it''s not especially portable (Windows and Linux and that''s your whack). This rules out consoles, of course, which means that many games companies aren''t interested. If you''re going for PC then it''s nice. (Incidentally, the Free Pascal Compiler supports plenty more OSs than Windows and Linux, though I''ve not tried it yet.)

There have been one or two games -- Age of Wonders 1 and 2, for example. There are also some very nice looking things out there that could be of commercial quality (e.g. this, judging from the lush screenshots). Most people using Delphi are hobbyists, though, since writing games in Delphi is pretty easy and enjoyable with all the component sets. There are a few more commercial games that I should remember but can''t -- in the meantime, note that there is some nice shareware made in Delphi (which is probably where the Delphi games market has most games).
I''ve seen some screenshots and some demos that was really good looking and made in Delphi. However, I''ve seen some cool Visual BASIC demos also, so that doesn''t tell me much.. :-/

I''m gonna try to write a 3D app in Delphi sometime..

I have a CD with Borland Delphi 6 here.. but I haven''t figured out how to set up and render a OpenGL window in Delphi..
I also tried with it''s cousin, Borland C++ Builder 5, but I cannot run that for a very long time before i crashes. It also has a lot of compiler problems since some components are written in pascal and some in C++..

Do you know of any easy way to set up such a thing in Delphi 6?

(Open GL and Direct 3D are no problems for me since I''ve used them a lot together with C++)
----------------------------------------------Petter Nordlander"There are only 10 kinds of people in the world. They who understand binary and those who do not"
If you just want a basic window then remember that NeHe has Delphi ports of his OpenGL code -- check on the left sidebar of the main page or go to one of the tutorials and find the port, if available, at the bottom of its page. Also, make sure that you take a look over at Delphi3d. The bloke who runs that site (Tom Nuydens) has a good OpenGL toolkit called DOT, which contains the most up-to-date and best gl headers you''ll find (gl.pas, glu.pas and glext.pas, I think), along with some the coolest OpenGL demos around for newer graphics cards. Delphi3d''s gl headers are much, much more comprehensive than the standard ones shipped with Delphi.

If you want to try Direct3d then you can have a look at Clootie''s conversion of the d3d headers and stuff. The advantage here is that you don''t need the SDK to develop dx apps - saving yourself a good 150megs of download time versus C++, which is nice for me (56K modem, sigh).

You''ll have to add the location of the .pas files to your library path once you''ve downloaded and extracted them. Go to the tools->environment options menu, select the library tab and press the ellipses (three dots [...]) button beside the first box, "library path". Type in the directory/directories in question and hit "add" after each one.

Once you''ve done that, just download a sample app or two and run ''em! The only other possible problem would be missing components - just install them normally (component->install component menu, hit the browse button beside the unit file name box, choose your .pas or .dcu file then okay everything away). Do this before opening the projects, if required, and only if the thing complains about not having certain components installed.

While you''re at it, think about customising the Delphi IDE (and don''t forget that you can dock stuff like the project manager and object inspector windows too!).
Thank You! =)

And I found something cool in one of the ports from NeHe =)

procedure SwapRGB(data : Pointer; Size : Integer);
asm
mov ebx, eax
mov ecx, size

@@loop :
mov al,[ebx+0]
mov ah,[ebx+2]
mov [ebx+2],al
mov [ebx+0],ah
add ebx,3
dec ecx
jnz @@loop
end;


So easy to make asm code inside Delphi!! =)

Even better than C++ ! =)

_asm { mov blah add blah2 .. }
----------------------------------------------Petter Nordlander"There are only 10 kinds of people in the world. They who understand binary and those who do not"
here is a 3d multiplayer vampire rpg i made in delphi


BloodLust
Last Half of Darkness Developerhttp://www.lasthalfofdarkness.com
Check out the Compiler & Performance page on Realworld tech. That''s a more recent benchmark, comparing the different languages/implementations.

Also, once you''ve read that, you should head on over to the Coding Challenge article, also on Realworld Tech, and you''ll see that the language/implementation isn''t as important as the choice of algorithm.
==========================================In a team, you either lead, follow or GET OUT OF THE WAY.
quote:Original post by Alimonster
Not too many commercial games are made with Delphi, unfortunately. The trouble with Delphi is that it''s not especially portable (Windows and Linux and that''s your whack). This rules out consoles, of course, which means that many games companies aren''t interested. If you''re going for PC then it''s nice. (Incidentally, the Free Pascal Compiler supports plenty more OSs than Windows and Linux, though I''ve not tried it yet.)

While this is true to a certain degree, the primary reasons that Delphi is not used for more commercial games are:
  • There are many more games developers with C/C++ experience than with Delphi experience
  • Every commercial games-oriented library is aimed at C/C++ developers
  • Development kits from the console manufacturers are targeted solely at C/C++ developers
To us, portability has only ever been an issue when it comes to compiling code for Win32, PS2, Xbox and GameCube. The commercial market for games on Linux is not financially viable. The Mac games market is not much bigger and both are probably overshadowed by the Palm and PocketPC games market.

Note that this has absolutely nothing to do with the speed you can get out of Delphi. I still love Delphi and will still continue to use it for my own hobby projects. In the commercial world it is purely a language choice based on availability for the platforms and available developer resources.
Steve 'Sly' Williams  Monkey Wrangler  Krome Studios
turbo game development with Borland compilers

This topic is closed to new replies.

Advertisement