Help - Search - Members - Calendar
Full Version: How Efficient Would This Be?
Sal's RuneScape Forum > Everything... Not RuneScape > Tech Talk > Programming & Web Development
Samarkov
I'm currently working on my MMO, (a long term project) and I am beginning to deal with graphics.

I want my game engine to be able to handle MANY different sprites in the viewing screen. (Upwards of 200+) I haven't gotten it into code yet, but from theory, how efficient would this be to display all the sprites?

CODE
In the painting method, a list of every button, icon, sprite, tilepiece, particle, and scenery would be sorted into lists.

Let's use this button array as an example: (May be more or less, 100 is just an example)

      public Button(100) buttons;

Each button has a certain script that the game engine interprets so that each button has an associated action.
Each button contains a link to an image in my resources.

If the paint method looked something like this psuedocode (below), would it be able to handle the many sprites that may be displayed?

public void Paint()

{
for int i= 0 to buttons.length,
{
draw(buttons(i).img);
i++;
}

This code is the first design I came up with. I DO plan to add priority to certain sprites in need of updating.

But say that the code involves priority for certain sprites, could doing a systematic 'for each' sprite be efficient?

I know this is a lot, but please read carefully. smile.gif You may even learn something. Thanks!

~~Samarkov king.gif
cjgone
Need a way to figure out what sprites to draw based on either a matrix and/or array of objects. You should definitely be able to handle 200 objects.... You don't need to redraw everything every single time I don't think. Only things that are animating/moving need to be redrawn.

I'm going to guess you're going to use a tile map + objects as it's the easiest and fairly optimal too.
Samarkov
QUOTE (cjgone @ Oct 31 2009, 06:21 PM) *
Need a way to figure out what sprites to draw based on either a matrix and/or array of objects. You should definitely be able to handle 200 objects.... You don't need to redraw everything every single time I don't think. Only things that are animating/moving need to be redrawn.

I'm going to guess you're going to use a tile map + objects as it's the easiest and fairly optimal too.

Alrighty thanks! biggrin.gif Your suggestion was basically the priority system i mentioned above. Certain things such as health need to be updated immediately whereas a non moving character doesn't. Thanks for your input. smile.gif

~~Samarkov king.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.