Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Limitations of DarkBASIC PRO

Author
Message
Telek
17
Years of Service
User Offline
Joined: 4th Jun 2009
Location:
Posted: 15th Aug 2011 11:35
Hi, I am not that new to this forum, I have been absent for quite sometime however, i would like to know what limits DBP has in the 2D department? I mean can I actually make a game without any external libraries? I am mainly looking into creating games like late SNES style RPG's with higher rez sprints, so a tile engine with 32bit sprints, can DBP handle this or will I need to use C/C++ to accomplish this task?
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Aug 2011 12:41
DBPro should cope fine. It would cope finest if you used objects, like flat plains, a flat terrain for the map. So basically making your own 2D engine but in a 3D environment.

It would be faster, it would scale to whatever resolution you wanted, and you could have more special effects like alpha fading, shaders if you wanted, layered texturing etc etc. One major thing though is that you have proper z depth, so the characters could go behind things automatically, what would usually be a bit of a nightmare to code.

Health, Ammo, and bacon and eggs!
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 15th Aug 2011 13:05
I use the method VanB describes for my HUDs. They look 2D but are 3D plains. Like he says, the number of effects are far greater.

Regarding Z-depth, I "layer" my HUD items using an integer (1 to 10 gives me 10 layers and is more than enough). These are converted to an offset of 0.1 in the Z-axis. Because your 3D plains tend to be 600 units or more away from the camera, this value is not noticeable but gets the layering you need. (1 unit = 10 layers at a distance of 600 units)

Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 15th Aug 2011 16:22
I made a little test a few weeks ago, but the result of that was that plains were slower then sprites. However all my plains were sepparate objects. It turned out that sprites are 3 times faster.
If you want to try it too (maybe I made a stupid mistake in my test program) here is the code.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Aug 2011 16:32
Quote: "I mean can I actually make a game without any external libraries?"


You should test standard sprites as well, and let us know what the speed difference is. I don't have the DXS plugin, not even sure what that is, but I'm guessing it's a 2D plugin that is probably faster than standard sprites.

Health, Ammo, and bacon and eggs!
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 15th Aug 2011 18:01
Quote: "but I'm guessing it's a 2D plugin that is probably faster than standard sprites"
Yup it is

These are the results of the test:
Everything gets rendered 100 times, with 1000 objects/sprites
3d plains: 1773 ms
Advanced sprites: 360 ms
Advanced 2d: 678 ms
Paste Image: 671 ms
Default darkbasic sprites using paste sprite: 695 ms
Default dakrbasic sprites, recreating the sprites each frame: 54 ms!
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Aug 2011 18:12
Ohh, and one thing with standard sprites, you should disable back culling, like SET SPRITE sprno,0,0

This stops the sprite from storing it's backdrop, and should improve performance a lot. I have been using just a single sprite, then pasting the sprite to the screen, it's a very handy way to make a flexible PASTE IMAGE - to allow alpha, rotation, scaling, UV mapping. Damn there are a lot of options for 2D these days!

Now, I just wish there was a way to tilemap a sprite - does that 2D plugin support tilemaps?

Health, Ammo, and bacon and eggs!
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 15th Aug 2011 18:24
Quote: "Now, I just wish there was a way to tilemap a sprite - does that 2D plugin support tilemaps?"


You can use CREATE ANIMATED SPRITE to store all the tiles you need in a single image and sprite.

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 15th Aug 2011 18:35
Yeah, that works pretty well, but I was thinking more about tiled maps - otherwise you have to paste each tile separately, as opposed to using an object (or even a matrix).

Health, Ammo, and bacon and eggs!
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 15th Aug 2011 20:01 Edited at: 15th Aug 2011 20:03
Quote: "does that 2D plugin support tilemaps"

Yup it does
I'll see if i can find the original thread.

edit Found it:http://forum.thegamecreators.com/?m=forum_view&t=113378&b=5
If you need any help with it just say it
2Beastmode4u
15
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 20:17
@Max P
Is there a different download link, because the one on the thread doesn't work.


Cheers.

God help me, Please.
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 15th Aug 2011 21:04 Edited at: 15th Aug 2011 21:08
Don't think so... I'll upload the files
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 16th Aug 2011 00:42
Quote: "Default dakrbasic sprites, recreating the sprites each frame: 54 ms! "

Call me sceptical, but is that really the right timing for standard sprites?

Of course, if it is, I'm quite happy to take the credit for that, as I rewrote the rendering system for that plug-in

Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 16th Aug 2011 13:40
Yup it is the right time
This was the test code for that.

However when using the paste sprite the time goes up to almost 700 ms.
zenassem
23
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 16th Aug 2011 13:43
The limitations of DBpro usually come down to the interface between the chair and the keyboard.

Your signature has been erased by a mod please reduce it to 600 x 120.
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Aug 2011 13:55
Well, if you create a sprite, then delete it, and do that several times, then sync - your not actually displaying the sprites .

Health, Ammo, and bacon and eggs!
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 16th Aug 2011 13:57
Quote: "then delete it"

I'mt not deleting them, just creating
Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Aug 2011 21:47
Hmmmm, I just can't get the same results...

Paste image:5362
Sprite:2526
Plain:4317
Plain(alpha):4358

Using this test(Note that it stores the results in the clipboard):


Health, Ammo, and bacon and eggs!
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 16th Aug 2011 22:33
You'r right, I just found a problem with my code, it was recreating the same sprite instead of different ones.
Needed to change i to s.
I get around 365 ms now, same as advanced sprites. But advanced sprites can be manipulated.

Login to post a reply

Server time is: 2026-07-10 08:28:00
Your offset time is: 2026-07-10 08:28:00