Search the web
Sign In
New User? Sign Up
delphigames · Discussion of game programming in the Delphi development environment.
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Show off your group to the world. Share a photo of your group with us.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Help on 2d sprite z-order sorting   Message List  
Reply | Forward Message #7593 of 7611 |
RE: Help on 2d sprite z-order sorting

Thanks for your input Steve. I've now implemented a sort on my sprite
batch based on the y pos and height of the sprite (ie the z-order is
based on the feet position of my sprites). Just need to add some
collision detection and I can move on the the next chunk of code.



A qsort is very fast and is therefore ideal to be run every frame. In
our console games, we use a qsort on a list of hundreds of 3D objects
every frame and it doesn't rate anywhere near the top of our
most-expensive-functions list.

Steve 'Sly' Williams
Lead Programmer
Krome Studios


From: "Ian" < ian.munro@...
<mailto:ian.munro%40grosvenortechnology.com> >
<mailto:delphigames%40yahoogroups.com>

That sounds reasonable. My next problem would be when to resort the
list. As I'm not showing many sprites I guess I could sort the list
every frame but its not very efficient. I'd like to only sort the list
when required. Anyone any ideas or am I approaching this in the wrong
way ?

From: xiaorang@... <mailto:xiaorang%40263.net>
[mailto:xiaorang@... <mailto:xiaorang%40263.net> ]

the Y-coord plus the height of the sprite make the z-order.

----- Original Message -----
From: "Ian" < ian.munro@...
<mailto:ian.munro%40grosvenortechnology.com> >

I'm developing a 2d game that requires the sprites to be z-order
sorted but am not surehow to go about doing this.

.

<http://geo.yahoo.com/serv?s=97359714/grpId=406/grpspId=1705006764/msgId
=7592/stime=1223417910/nc1=4507179/nc2=3848640/nc3=5379228>


This email is intended solely for the person to whom it is addressed and may
contain confidential or legally privileged information. If you are not the
intended recipient, be advised that you have received this email in error and
that any use, dissemination, forwarding, printing or copying of this email is
strictly prohibited. Please notify the author by replying to this email and
destroying all copies of the email and attachments. Access to this email by
anyone else is unauthorised.

Email may be susceptible to data corruption, interception, unauthorised
amendment, viruses and delays or the consequences thereof. Any views or opinions
presented are solely those of the author and do not necessarily represent those
of Grosvenor Technology Ltd.

Grosvenor Technology Ltd. (incorp. Newmark Technology Ltd.) is a company
registered in England with company number 2412554.
The Grosvenor Technology Ltd. Registered Office address is Millars Three,
Southmill Road, Bishop's Stortford, Herts, CM23


[Non-text portions of this message have been removed]




Thu Oct 9, 2008 10:28 am

ianathome12345
Offline Offline
Send Email Send Email

Forward
Message #7593 of 7611 |
Expand Messages Author Sort by Date

I'm developing a 2d game that requires the sprites to be z-order sorted but am not sure how to go about doing this. Basically the sprites move around a...
Ian
ianathome12345
Offline Send Email
Oct 7, 2008
8:44 am

That sounds reasonable. My next problem would be when to resort the list. As I'm not showing many sprites I guess I could sort the list every frame but its not...
Ian Munro
ianathome12345
Offline Send Email
Oct 7, 2008
9:40 am

A qsort is very fast and is therefore ideal to be run every frame. In our console games, we use a qsort on a list of hundreds of 3D objects every frame and it...
Steve Williams
slygamer
Offline Send Email
Oct 7, 2008
10:18 pm

Thanks for your input Steve. I've now implemented a sort on my sprite batch based on the y pos and height of the sprite (ie the z-order is based on the feet...
Ian Munro
ianathome12345
Offline Send Email
Oct 9, 2008
10:28 am

Hello, This group has been a bit quiet this year so I hope 2009 will see some renewed activity. I have a few questions to ask which I hope will get some...
Ian Munro
ianathome12345
Offline Send Email
Dec 24, 2008
10:50 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help