Sprite3d Functions

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Steve Elliott
Enthusiast
Enthusiast
Posts: 109
Joined: Sun Jan 01, 2006 9:34 pm
Location: Wales, UK

Sprite3d Functions

Post by Steve Elliott »

The Sprite3d functions are far too slow.

Sadly, functions for game production in general are either too slow or are missing. Features such as analogue joystick support and LoadAnimSprite for animation (several animation frames loaded as one sprite).

So while PureBASIC is superb for application writing, for games it's not so hot. A pity because it's a lovely language to use.
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Sprite3d functions are fast, why do you say that? I'm working on games for a while, and I have no problem!
And for joystick, you have the joystickex userlib on http://www.purearea.net/pb/english/index.htm
Steve Elliott
Enthusiast
Enthusiast
Posts: 109
Joined: Sun Jan 01, 2006 9:34 pm
Location: Wales, UK

Post by Steve Elliott »

Because I compared them to the equivalent BlitzMax command - over 3 times the speed.
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

have you used Start3D()/Stop3D() and turned the debugger off?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Steve Elliott
Enthusiast
Enthusiast
Posts: 109
Joined: Sun Jan 01, 2006 9:34 pm
Location: Wales, UK

Post by Steve Elliott »

Yes.
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post by djes »

Your needs are really extensive! Could you send us your benchmarks, it would be usefull.
Steve Elliott
Enthusiast
Enthusiast
Posts: 109
Joined: Sun Jan 01, 2006 9:34 pm
Location: Wales, UK

Post by Steve Elliott »

347 FPS - PureBASIC
1105 FPS - BlitzMax
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

in my humble opinion - if you think it's slow it's more a programmer-side error than a purebasic limitation.

when i saw what can be done by polux and his team (for example Lethal Judgment III from BGames : http://www.bgames.org/) it seems that purebasic has no speed problem when correctly coded.

but well, i don't know, maybe you're right.
we need a code sample (one for pb and another one for bb with the same visual result) to compare/benchmark.

then, from the pb sample code, polux or others guys can explain how to make the result faster with purebasic.

:idea:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Steve Elliott
Enthusiast
Enthusiast
Posts: 109
Joined: Sun Jan 01, 2006 9:34 pm
Location: Wales, UK

Post by Steve Elliott »

Lethal Judgement III uses very little Sprite3d function calls - all my sprites are alpha blended 3d sprites running at 1280 X 1024 32bit colour.

It's a chess game so I can get such high FPS - 347 FPS for PureBASIC is quite high, but obviously there is room for improvement.
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Why don't you give us the actual code for the benchmark and we can tweak it.
Steve Elliott
Enthusiast
Enthusiast
Posts: 109
Joined: Sun Jan 01, 2006 9:34 pm
Location: Wales, UK

Post by Steve Elliott »

There's no code to tweak - just a static chessboard and pieces being drawn using sprite3d commands.

PureBASIC has threads and can produce DLLs - BlitzMax can't. It is also better for writing application software than BlitzMax - but the simple fact is it's not quite as good for game related programs at this time (no language is perfect).
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
chris_b
Enthusiast
Enthusiast
Posts: 103
Joined: Sun Apr 27, 2003 1:54 am

Post by chris_b »

Steve Elliott wrote:There's no code to tweak
In Windows version of PureBasic it's possible to call Direct3D's triangle drawing functions directly in conjunction with the standard OpenScreen(), InitSprite3D(), CreateSprite3D() functions.

This can give a quite a significant performance boost especially if you have, say, a bunch of sprites on a single bitmap (eg. 16 different 64x64 sprites on a 256x256 texture).
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

I agree, it can be a little slow.
But I haven't testet it against other languages.
I like logic, hence I dislike humans but love computers.
coma
Enthusiast
Enthusiast
Posts: 164
Joined: Fri Aug 15, 2003 3:46 am
Location: Canada

Post by coma »

Steve Elliott wrote:There's no code to tweak - just a static chessboard and pieces being drawn using sprite3d commands.

PureBASIC has threads and can produce DLLs - BlitzMax can't. It is also better for writing application software than BlitzMax - but the simple fact is it's not quite as good for game related programs at this time (no language is perfect).
do you use only one start/stop3D() in your drawing loop ?
Post Reply