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.

Program Announcements / AdvancedSPRITES Plugin

Author
Message
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 3rd Oct 2007 17:05 Edited at: 3rd Oct 2007 17:07
First I used DXS BEGIN/END SPRITE RENDER on all sprites at the beginning and end of my draw function. I then used DXS DRAW SPRITE TILE just as I would PASTE SPRITE. But the end result was that my floor ended up on top of my objects even though all floors are drawn before any objects are drawn.

But thanks for pointing out that DXS DRAW SPRITE TILE have a depth parameter. I had seen it before but not realizing that I could say put in the cell row number. That would solve the problem even if DXS DRAW SPRITE TILE doesn't give me a proper draw order.

Have I found a bug that using DXS DRAW SPRITE TILE doesn't result in the same draw order as DXS DRAW SPRITE?

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 3rd Oct 2007 17:58
I've checked the commands, it seems that all work well.

The problem you got can appear when executing a code like this :



This code does not crash but display in order sprite1 then sprite2. I have ever done this error when displaying sprites in a for~next loop.
The easier way you have to check if these commands are working is to compil the "Example 1" from the help. The rotating sprite is drawn using DXS DRAW SPRITE and the background using DXS DRAW SPRITE TILE.
aluseus GOD
15
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 3rd Oct 2007 19:36
I wasnt angry, just frustrated, and not at you Mod.

Oh, ima tired, I need to drink some blood....

Anyway, I used Windows XP and I think it doesnt have to do with the hadrware.... I wouldnt know anyway.

Your signature has been deleted by a moderator because this joke is getting old.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Oct 2007 12:17
Mod:
I finally had time to code a little test to demonstrate my problem. I attach the project and media files. In the code below note the order of end sprite render, by ending boxes before ground the boxes are drawn below the ground even though they all are drawn after the ground.



[center]
CREATE games with ease! NO programming required!
WIP

Attachments

Login to view attachments
Freddix
AGK Developer
20
Years of Service
User Offline
Joined: 19th Sep 2002
Location: France
Posted: 8th Oct 2007 13:27 Edited at: 8th Oct 2007 13:28
It should be better to do that :



It should also be a little faster ...

for the priority of drawing, it's maybe the ID of the sprite that cause the draw order to not be like you want ... ?
Try to change sprites ID (reverse them)

Gandalf said: "All we have to decide is what to do with the time that is given to us"
Odyssey-Creators - X-Quad Editor - 3DMapEditor
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Oct 2007 16:20
Freddix:
You missed my whole point. Due to the way my program works it would be best if tiles where rendered in the order they where drawn. That way I only need to call the begin/end render commands once per sprite and it saves me a lot of work minimizing the render calls.

If this works as I want it to I get 8 times the speed of DBP. Otherwise it's down to 3-5 times DBP (according to some quick calculations), depending on how the users designs their maps.

This was a test to illustrate that tile draw order are based on end sprite render, contrary to what Mod claims.

If the end sprite render lines are swapped then the blocks end on top, like they are 2 separate layers. But as soon as I use multiple sprites for various objects the draw order gets all messed up unless multiple render commands are called.

[center]
CREATE games with ease! NO programming required!
WIP
aluseus GOD
15
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 8th Oct 2007 16:58
Thats my problem.



Not even a strait suit, you, caramel, the recycling bin, uber code, and chuck norris combined can keep me safe from me. Mostly cuz I exist.
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 9th Oct 2007 12:11 Edited at: 9th Oct 2007 12:11
@ Digital Awakening : I have just understood what you where saying some posts above about the DXS END SPRITE RENDER and the drawing order (I'm sometimes a bit slow...).
DXS END SPRITE RENDER is used to submit the list of drawn sprites to the render. In the case you don't use the Z parameter, DXS END SPRITE RENDER can be used to changed the drawing order. Internally, the plugin always sets the z parameter, even if you don't use it in DBPro, that's why I said DXS END SPRITE RENDER wasn't the main command for sprite drawing order. The next update of the plugin will have a new command that allow to do an intermediate render.

This will be another solution to draw in a right order the sprites :



@ aluseus GOD : Can you try to use DXS CREATE EMPTY SPRITE then say me if you still got the error ?
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 9th Oct 2007 18:51
Mod:
So, will "dxs flush sprite render" slow down the rendering or will I be able to use it often without loosing speed?

And, of course, I'm very interested to know when I will be able to use this new command, if you have an idea?

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 9th Oct 2007 22:09
I'm still doing tests, but it seems that this command does not cost a lot of FPS, at most the program lost 5~6 FPS on 1430.
When will this command be available, I don't know. Probably when I'll have finished to work on pixel perfect collision.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 10th Oct 2007 13:45
Mod:
Quote: "at most the program lost 5~6 FPS on 1430"

Does that mean 5~6 FPS on 1430 uses?

OK. Got an estimate, like will it take less or more then a month?

Seems like I'll be coding other things while I wait for it.

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 10th Oct 2007 15:12
On 1430 FPS ^^
This command is like DXS END SPRITE RENDER, but doesn't stop the sprite render, that's all. Just another way to render the sprite without using the Z parameter.


Quote: "OK. Got an estimate, like will it take less or more then a month?"


Eventually, I guess that I'll do the next release in one or two days, the time to do more tests. This flush command is ready to use, the pixel perfect ones are still under development, there's no use to make you wait if you want to use it.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 10th Oct 2007 15:45
Mod:
Ok, so using the flush command will not be a miracle cure. I'm gonna have to do the workaround I was planning on earlier. The flushing will make it easier to code though.

If you can release the flush command this week I'll be happy to code it in next week. I think I'll be doing web programming for the reminder of this week and then I'll get back to my software once my new web site is up.

[center]
CREATE games with ease! NO programming required!
WIP
Lover of games
17
Years of Service
User Offline
Joined: 17th Apr 2005
Location:
Posted: 12th Oct 2007 20:27
for some reason, I can only draw one sprite using the plug in.

function DrawPlayer()
DXS begin sprite render Player.Spr_num
DXS draw sprite Player.Spr_num,Player.Xpos,Player.Ypos
DXS end sprite render Player.Spr_num
endfunction

it draws the player but if i do this:



it doesn't draw it, any Idea why? I added both functions to the main loop and it doesn't seem to draw the enemy sprite

"Originally I was going to have a BS on it but you know how that would be. I can't walk around with the letters BS on me." More or less a qoute by Syndrome from Jack, Jack, attack
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 13th Oct 2007 10:56
Only with this code, I can't say if that's a problem from the plugin or not.

My favorite answer ^^ : have you try to execute the Example 1 from the plugin help ?
It uses two sprites : one for the background, one for a rotating sprite following the mouse.

If you have both sprites, that's probable this is not a bug from the plugin. In this case I can't really help you.

If you have only one sprite or none, I have some questions : How many memory has your graphic card ? How is created Player and Enemy sprites, using DXS CREATE SPRITE or DXS CREATE SPRITE FROM IMAGE ? And what are the image files formats ? Which 2D rendering commands from DBPro are you using ? And are you using any 3D command ?
aluseus GOD
15
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 13th Oct 2007 21:09 Edited at: 13th Oct 2007 21:09
No!! DXS create empty sprite still doesnt work!!!!!!

(note: dont reply, i melted. just kidding)

Your signature has been erased by a mod
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 16th Oct 2007 12:45
Mod:
Is there a limit to the size of sprites? I was thinking about pre-rendering like the ground and just draw a big sprite every loop. Would it be faster to split up the ground into smaller tiles and just draw a few tiles thats on the screen?

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 17th Oct 2007 12:18
The size of sprites (or textures) is only limited by the hardware. I think it wouldn't be a problem to create large sprites (2000x2000 or more)on computers that are less than five years old.
If you want to draw just one big sprite, it will be faster to draw tiles from it than the entire of it, but you'll need to find which is the best size. For example, filling a 800x600 screen with a sprite rectangle is faster than filling it with 10x10 tiles, but slower than filling it with 20x20 tiles.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 17th Oct 2007 13:27
Mod:
Ok, so 2048x2048 is probably the limit. I guess that forces me to create multiple sprites to cover a large map. I'll be leaving this for much later as it's gonna be a bit of work and yet I have limited use of it.

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 18th Oct 2007 22:33 Edited at: 14th Sep 2008 21:25
I guess this will simplify a lot your work :

New Release : AdvancedSPRITES 1.100

Added 9 new commands :


DXS CREATE SPRITE PACK
DXS ADD SPRITE TO PACK
DXS REMOVE SPRITE FROM PACK
DXS DELETE SPRITE PACK

DXS BEGIN SPRITE PACK RENDER
DXS FLUSH SPRITE PACK RENDER
DXS END SPRITE PACK RENDER

DXS USE FILTER

DXS FLUSH SPRITE RENDER

The "Sprite Pack" is a new entity that allow to render in one BEGIN/END RENDER loop multiple sprites. This increases a lot the framerate. I've updated two programs that use AS. Both displayed a map and something like 50 NPC. The first was at 580 FPS and is now at 980. The second was at 760 FPS and now at 1400.

Example :



Download pages :

English version

French version

I hope this will help ^^
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 19th Oct 2007 00:43 Edited at: 19th Oct 2007 00:44
Mod:
Will this help me with my tile draw order as well? Or will the tiles be drawn depending on the order the sprites are added to the pack?

I'm working on a new GUI for my map editor but I might run some tests tomorrow. If not then most likely next week, although I'll be a little busy with work. Downloaded anyway.

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 19th Oct 2007 14:15
There's no link between the addition order and the drawing order. This works like normal sprites : dependant to the Z parameter if you use it, else dependant to DXS END SPRITE PACK RENDER or DXS FLUSH SPRITE PACK RENDER.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 19th Oct 2007 14:53 Edited at: 19th Oct 2007 14:55
I modified my example program to use the packs and I'm very happy with the result. This will be so easy to implement

This image shows 2 tile sets drawn on top of each other using a single pack render loop. It's rendered in a 640x480 window for maximum speed. 30 tiles drawn compared to 1 black box drawn under the FPS text gives less then 1% loss of speed.



[center]
CREATE games with ease! NO programming required!
WIP

Attachments

Login to view attachments
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 20th Oct 2007 17:00
No, it's not possible. The priority used by DBPro sprites is different from the one used in AdvancedSPRITES. If you try to draw something using the two systems, DBPro sprites will always be rendered above AS ones.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Oct 2007 18:59
Wouldn't it be possible to draw DBP sprites before and after the AS render commands? At least when I started adding AS commands to my program everything AS did ended up on top because the end render command was put after all draw commands.

I did some stres tests yesterday and I was thinking about posting some shots, if that's ok? I can't right now as I'm not on my own computer. I got some really interesting speeds with thousends of tiles drawn.

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 20th Oct 2007 20:58
All have been said ^^. If you use PASTE SPRITE, that works, but there's no priority.
Currently I can't make the plugin compatible with DBPro sprites. To do this, I need to read the DBPro sprites source code, what is impossible :s.

@Digital Awakening : No problem about the screenshots
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 21st Oct 2007 20:54 Edited at: 21st Oct 2007 21:01
I don't want this shot to be the last post on the page and never get noticed so I made another post on page 3

[center]
CREATE games with ease! NO programming required!
WIP

Attachments

Login to view attachments
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 21st Oct 2007 20:55 Edited at: 21st Oct 2007 21:00
I was planning on a few shots but then I made a really good stress test today so here comes my favorite result. What can I say, it's really amazing how great the latest version is

In case anyone wonders about the 1st/2nd half thing, it's to show draw order independency.



[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 22nd Oct 2007 10:13
Waw, I've never done tests with so many tiles... Nice to see that the plugin can work so fast with this kind of hardware
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 22nd Oct 2007 11:50 Edited at: 22nd Oct 2007 11:53
And here's another shot. I redid the same thing in DBP using animated sprites and paste sprite. It's similar to my pervious tests of about 8 times speed improvement in AS. With sprite pack I get 7 times (and I've run both tests a few times, with same result) the speed



[center]
CREATE games with ease! NO programming required!
WIP

Attachments

Login to view attachments
Oneka
18
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 23rd Oct 2007 03:02
Thanks Mod for such a great plugin, It is working very fine for me, but I ask one thing, if It does not exist, a command like Flip Sprite and Mirror Sprite, It would be nice to have this command so that I dont have to use more than one image or make work arounds..


Making dreams possible, one line at a time...
aluseus GOD
15
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 23rd Oct 2007 03:14
You wont believe this (or, maybe you will...) I pressed f5 which has helped some other problems and voila! Dll was missing (darn microsoft). I got the dll and i worked! Miracle!

Hi. I am sorry for being a random n00b. I got carried away and started posting to much. Then again I am a little kid.
This has been a public announcement by John- who wants a taco.
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 24th Oct 2007 11:04
@ Oneka : There's no commands like this, I'll see if I can add these.

@ aluseus GOD : Good news
Oneka
18
Years of Service
User Offline
Joined: 24th Apr 2004
Location: Hampton,VA
Posted: 26th Oct 2007 04:05 Edited at: 26th Oct 2007 04:13
Ok, I think I have found a bug

When using Spritepacks, if you scale a sprite that belongs to a pack, all the sprites in the same pack will also be scaled or distorted, and to fix this you must do an Update on all the sprites in the back, but the downside is that the Sprites you scaled will not appear correctly, if you do not do an update on all sprites in a pack, and just update the ones you scaled then it will only show the ones you scaled.

This is really a problem that I need to find a way to solve

EDIT:
Here is what it looks like



Making dreams possible, one line at a time...

Attachments

Login to view attachments
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Oct 2007 10:59
I emailed Mod about scaling problems 2 days ago, I never tried updating all sprites (that would be quite problematic for me to do) but hopefully in the next update we will be able to scale sprites in a pack properly.

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 26th Oct 2007 16:19
That's not a bug, but the way how works the DXS UPDATE SPRITE command with sprite packs. DXS UPDATE SPRITE sometimes need to be put into a loop to work (when rotating normal sprites, for example). It's required too when using sprite packs because all sprites from it use the same render object.

It's a little annoying if this is taken like a bug... I guess I need to add drawing commands which will call automatically the update.

@ Digital Awakening : Oops, sorry, I forgot to reply to your mail.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 26th Oct 2007 18:37
Mod:
As I wrote in the email I scale and update one of the sprites in the pack and every sprite in the pack gets scaled but if the scaling and updating is done before the sprite is added to the pack then the sprite is rendered with it's original size. And I only need to scale this sprite once. If all sprites in the pack has to be updated then a command like DXS UPDATE SPRITE PACK should be added

[center]
CREATE games with ease! NO programming required!
WIP
da power pwnerer
16
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 28th Oct 2007 04:41 Edited at: 28th Oct 2007 04:41
No matter what I do, I get an error saying 'Failed to load DLL(2: AdvancedSPRITES.dll)'

This is my code:



-Dan


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 28th Oct 2007 09:52
This error doesn't come from your code but from an incompatibility between the plugin and your hardware/OS. Can you describe it, please ?
da power pwnerer
16
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 28th Oct 2007 13:21
You don't wanna see my crappy laptop specs lol


You are probably right though, I'll test it on my main computer





-Dan


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
UFO
16
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 29th Oct 2007 01:59
I love you, Mod :-P

Thanks for the great plugin! This is going to come in handy DBP sprites are waay too slow...

Your signature has been erased by a bad joke
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 29th Oct 2007 10:21
da power pwnerer:
I believe we are all interested in getting AS to run on as many systems as possible. Especially since it's for 2D games they should do fine on crappy systems.

I don't know if it may be causing it, but try downloading the latest version of DX 9.0c (there are more then one of those).

[center]
CREATE games with ease! NO programming required!
WIP
Diggsey
16
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Oct 2007 11:11
@Mod + da power pwnerer
That error happens to some people if you are using the debug version of the plugin It's worth recompiling in release mode just to make sure, as this has happened to me often! I haven't found a link between who the debug versions work for, and their specs, but I think it often depends on the commands used in the plugin as well.

da power pwnerer
16
Years of Service
User Offline
Joined: 28th Jul 2006
Location: Pittsburgh, PA
Posted: 29th Oct 2007 12:41
I'll give you my laptop specs tomorrow (I don't have my laptop with me at the moment) You're plugin works fine on my main computer though
(But I had to update my Direct3D Drivers in order for it to work)





-Dan


http://Freewebs.com/noobisoft
Come to Noobisoft's website today!
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Nov 2007 18:12
Sorry about the delay, I've been busy with other things. I have finally found the cause of the transparency "bug". If a DBP PASTE SPRITE command is called between the render pack commands the tiles drawn within these commands will loose their transparency. As I'm converting everything to use AS I am not affected by this. I'm happy to say that I will resume integrating AS into SGT on monday, finally uniting my two code branches into one

[center]
CREATE games with ease! NO programming required!
WIP
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 8th Nov 2007 12:38
Mod:
Since I can't alter sprite settings during the render I will likely be using multiple sprites with the same image, thus a command like CLONE SPRITE would probably be faster then loading the same image again.

And I was wondering if rendering to a specified sprite would be possible? Drawing on a bitmap and using GET IMAGE is quite slow.

[center]
CREATE games with ease! NO programming required!
WIP
Diggsey
16
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 18th Nov 2007 20:20
@Mod
I don't know if it's possible, but could you make it so that we can apply shaders to sprites? If it's possible, it means I found a way to have full-screen shaders only using the default camera It doesn't work with DBPs 3d objects, only with sprites

Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 19th Nov 2007 22:47
I'm a little late, sorry, I've really been busy until this day... The released day of the free DarkGDK version, nice timing (I can now reconsiderate the development of a DarkGDK version of AdvancedSPRITES ^^).

@ Digital Awakening : Rendering to a sprite is not possible yet. I've developed a complete set of rendering surface commands, but I don't know if it's faster than DBPro bitmaps or not. I have to do some tests...
There was a DXS CLONE SPRITE command in the first version of the plugin, but it was bad-thinked and buggy, due to the fact that there was one image and multiple sprites. I can rewrite it, but it implys to do a lot of change in the command set. I'll see what can be done.

@ Diggsey : I've never used shaders, so I can't say if it's possible or not, I need too to do some tests.
Digital Awakening
AGK Developer
20
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Nov 2007 22:28
Mod:
There are 2 problems with DBPs bitmaps. Slow GET IMAGE speed and the fact that they are only as big as the current resolution.

There's only a need of a CLONE SPRITE command if it's faster then actually reloading the same image.

[center]
CREATE games with ease! NO programming required!
WIP
Mod
16
Years of Service
User Offline
Joined: 8th Oct 2005
Location: France
Posted: 21st Nov 2007 09:34
A clone sprite command would be a lot faster, if I create an independant sprite texture set of commands. Without this, it would be faster too, but a little complicated to manage textures... I guess that if I add a render surface command set, a sprite texture one would be useful.

Login to post a reply

Server time is: 2022-09-25 12:58:11
Your offset time is: 2022-09-25 12:58:11