Page 1 of 1

The most effective way design a map format

Posted: Mon Dec 27, 2010 4:47 pm
by acerookie1
ok i've been using for loops to draw everything in my map and it seems to load even slower when i draw it every round. whats the best solution to this. not to talk about adding collision. does anyone have a good quad tree tutorial?

Re: The most effective way design a map format

Posted: Mon Dec 27, 2010 9:10 pm
by EdBoon
acerookie1 wrote:ok i've been using for loops to draw everything in my map and it seems to load even slower when i draw it every round. whats the best solution to this. not to talk about adding collision. does anyone have a good quad tree tutorial?
I'm a bit unclear.. do you mean you are updating everything in loops and its slower than before when you updated everything each cycle? I think you are meaning to draw everything every cycle, or you would wan't to at least, if not it would probably flicker.


http://www.kyleschouviller.com/wsuxna/q ... -included/ - this is a great resource for quad tree theory. Source code is even included and its pretty simple to understand him (in my opinion). He also is very nice and would be happy to answer any questions you might have after reading through it.

edit --

I think i read it wrong. Are you saying that before you were calling each draw for all the objects inline manually then u threw them all into a loop to make it easier? for-loops shouldn't slow it down like that. can u paste some of the code in here for us to look at?? :)

Re: The most effective way design a map format

Posted: Mon Dec 27, 2010 9:33 pm
by acerookie1
i meant that i draw, i check collision, and move the map in different for loops which slows the game down. tho when i worked on a game with another dev it kinda still slowed down: http://code.google.com/p/dangerwave/ <-go to downloads to play the game.

what makes me mad is that i see games that are made years ago that run better than mine :(

Re: The most effective way design a map format

Posted: Tue Dec 28, 2010 3:55 pm
by ismetteren
Maybe it will be clearer what you are talking about if you post the relevant code.

Also, i don't really see what this has to do with the map format(to my understanding the "map format" is the way the map data is stored on the disk) unless you load the whole map every frame(which btw would explain the problem...)

Re: The most effective way design a map format

Posted: Tue Dec 28, 2010 11:03 pm
by acerookie1
ismetteren wrote:Maybe it will be clearer what you are talking about if you post the relevant code.

Also, i don't really see what this has to do with the map format(to my understanding the "map format" is the way the map data is stored on the disk) unless you load the whole map every frame(which btw would explain the problem...)
the question is in 2 parts. the effective "format" for maps and "displaying" the loaded elements.