I'm working on a 16-bit team-based game, where each player is a big icon (native) that is 64x64
To swap the 6 colors of each player takes roughly 6-12 seconds on meh slowish computer
Is there any way to improve these times?
ID:273171
Nov 18 2009, 11:04 am
|
|
In response to Garthor
|
|
mob/verb |
In response to Mista-mage123
|
|
rgb() isn't all that fast either.
|
In response to Haywire
|
|
Should have given more info, but yeah, try entering the hex of the colours directly instead of getting rgb() to convert the 3 numbers, and then check out the speed. It should speed the procedure up a bit.
Here's a converter: http://www.javascripter.net/faq/rgbtohex.htm ( Just incase you don't know how to do it by yourself, and even then I would rather get the computer to do it for me rather than doing it mentally :P ) You can represent Hex in DM by placing the "0x" prefix before the hex (e.g FFF). I haven't worked with hex much in DM so I'm not sure how many digits DM limits hex to, but from what Popisfizzy has told me it's about 3-4. Good luck! |
In response to Haywire
|
|
I've isolated the problem using ''tick tests'. The ticks arent actually lost during the SwapColor() calls, ONE ENTIRE SECOND was used just switching the icon
Should icon changes take an ENTIRE SECOND? Maybe native icons arent so good when it comes to switching them... |
In response to Mista-mage123
|
|
The problem is that, while all the datum changes are simple, it takes more CPU to take that datum and make it into an actual icon.
|
If you are making five hundred SwapColor() calls, then the solution is to not make five hundred SwapColor() calls.
Strangely enough, specific advice is not possible without seeing any code.