Daviyow Posted April 5, 2014 Share Posted April 5, 2014 Why are my users experiencing a huge fps drop if they enable the Paint? it drops all the way to 9-20, if its hided its 45-52 so what would be wrong, hes the method, (mine camps at 52 doesnt matter if the paint is on or off). Link to comment Share on other sites More sharing options...
Xerion Posted April 5, 2014 Share Posted April 5, 2014 I had the same problem a long time ago. Try to remove the getState() from the paint. Link to comment Share on other sites More sharing options...
Booch Posted April 5, 2014 Share Posted April 5, 2014 Organise your code a little bit more.. seems like a mess there. That being said I don't think your onPaint() is causing that but might be due to your getState() in there(Just a guess). The only time this occurred to me was when I tried to render multiple things whilst running but that's understandable. Link to comment Share on other sites More sharing options...
Extreme Scripts Posted April 5, 2014 Share Posted April 5, 2014 Should be getState().toString() buddy ^_^ Link to comment Share on other sites More sharing options...
Daviyow Posted April 5, 2014 Author Share Posted April 5, 2014 Should be getState().toString() buddy did not fix it Link to comment Share on other sites More sharing options...
NotoriousPP Posted April 5, 2014 Share Posted April 5, 2014 For one why are you even call the getState() in paint? Because if your doing that to get the status/state, that is a horrendous way of doing. Your onPaint is called every loop, so that means your calling your getState every second pretty much, for the how ever long you run your script, that will really start to add up. At the top of your script you should declare a String like: String status = ""; Then in you onLoop, inside of your switch statment, whatever state is called, add what status, so like: switch(getState()){ case ATTACK: status = "Attacking"; break; } The finally in your onPaint, take out getState, and replace it with status. See if that helps, and even if it doesn't, that still a much more efficient way of achieve the same goal. (If it still lags, most likely there's some type of error in your getState like @Booch said) 1 Link to comment Share on other sites More sharing options...
ProbsNotAssumeTb Posted April 5, 2014 Share Posted April 5, 2014 Should be getState().toString() buddy You should not be so stupid, buddy. For one why are you even call the getState() in paint? Because if your doing that to get the status/state, that is a horrendous way of doing. Your onPaint is called every loop, so that means your calling your getState every second pretty much, for the how ever long you run your script, that will really start to add up. At the top of your script you should declare a String like: String status = ""; Then in you onLoop, inside of your switch statment, whatever state is called, add what status, so like: switch(getState()){ case ATTACK: status = "Attacking"; break; } The finally in your onPaint, take out getState, and replace it with status. See if that helps, and even if it doesn't, that still a much more efficient way of achieve the same goal. (If it still lags, most likely there's some type of error in your getState like @Booch said) Even better. State state; onLoop() { state = getState(); switch(state){ case StateY: //some code break; } } then in onPaint just draw state instead of getState() 1 Link to comment Share on other sites More sharing options...
Joseph Posted April 5, 2014 Share Posted April 5, 2014 Just do it the way notoriousP said. I do that in my script all the time. Works great Link to comment Share on other sites More sharing options...
Dog_ Posted April 5, 2014 Share Posted April 5, 2014 onPaint is continuously painting, it'll keep finding the state resulting in an Fps drop, so... State state; switch (state = getState()) {...} And then in your onPaint don't use getState(), but use state. Link to comment Share on other sites More sharing options...
Joseph Posted April 5, 2014 Share Posted April 5, 2014 (edited) String status; switch(getState()){ case ATTACK: status = "Attack"; break; } why dont you simply do this. It isnt that hard. Then simply draw status Edited April 5, 2014 by josedpay Link to comment Share on other sites More sharing options...
Daviyow Posted April 5, 2014 Author Share Posted April 5, 2014 take it easy all, it works.. wow no for you guys to rage your tits off Link to comment Share on other sites More sharing options...
GOD Posted April 5, 2014 Share Posted April 5, 2014 take it easy all, it works.. wow no for you guys to rage your tits off they were just trying to help Link to comment Share on other sites More sharing options...