Re: reducing lag in a bgt game?

2016-07-02 Thread AudioGames . net Forum — Developers room : Trajectory via Audiogames-reflector
Re: reducing lag in a bgt game? As Lukas said, you should have exactly one wait() call per cycle of your main game loop. In addition, here are a few other things that may or may not help you, depending on the design of your game:Turn off sounds that are too far away from the player

Re: reducing lag in a bgt game?

2016-06-30 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: reducing lag in a bgt game? My clock class actually counts frames for you, as well, so if you use that, instead of keeping your own counter for everything that needs one, you can do something like:// Enemies: enemy@[] enemies; // A tile map: tile@[][] map; // Set up the clock: clock

Re: reducing lag in a bgt game?

2016-06-30 Thread AudioGames . net Forum — Developers room : lukas via Audiogames-reflector
Re: reducing lag in a bgt game? Oh, I see. That actually sounds like a good idea. I'll have to finally force myself to try to learn and adapt the frame approach one of these days. It seems to provide quite a lot of significant advantages.Thanks for bringing this up.Lukas URL: http

Re: reducing lag in a bgt game?

2016-06-30 Thread AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
Re: reducing lag in a bgt game? What you should do, is try to avoid going through the entire array in a single irrigation in the loop. Maybe use some sort of counter, that updates every frame, and only check the entries corresponding to the counter. For example, instead of checking

Re: reducing lag in a bgt game?

2016-06-30 Thread AudioGames . net Forum — Developers room : lukas via Audiogames-reflector
Re: reducing lag in a bgt game? Ah, I see. In any case, though, having just a single wait call in the main game loop should do the trick well enough. I believe there just has to be a single loop that's driving it all and calling all other functions, I can hardly imagine a successfully

Re: reducing lag in a bgt game?

2016-06-30 Thread AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
Re: reducing lag in a bgt game? rofl, annoyingly enough, some of my classes have internal functions, others don't, so I write up a global function so the class can behave, from outside the class, which yes, might seem confusing but this person here writing this post can be a little insane

Re: reducing lag in a bgt game?

2016-06-29 Thread AudioGames . net Forum — Developers room : lukas via Audiogames-reflector
Re: reducing lag in a bgt game? Hi Omar,Sneak is pretty much right, I believe. I tend to think the 1+1 line is there just for the sake of the example, so that something else is done in the main loop besides the wait calculation.I personally would do this still a bit differently, though

Re: reducing lag in a bgt game?

2016-06-29 Thread AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
Re: reducing lag in a bgt game? Hi,I understand your example but I'm a little curious about one particular line1+1.As far as I am aware this calculation is not used since your asking the engine to wait for two ms anyway.I'm more or less just curious if there's something I'm missing

Re: reducing lag in a bgt game?

2016-06-29 Thread AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
Re: reducing lag in a bgt game? Instead of calling wait in each iteration of the loop, try setting up a timer to only wait after so many milliseconds. So something liketimer time;while(true){1+1;if(time.elapsed>=500){wait(2);time.restart();}}This is more beneficial for you because if

Re: reducing lag in a bgt game?

2016-06-29 Thread AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
Re: reducing lag in a bgt game? Instead of calling wait in each iteration of the loop, try setting up a timer to only wait after so many milliseconds. So something liketimer time;while(true){1+1;if(time.elapsed>=500){wait(2);}}This is more beneficial for you because if you tried loop

reducing lag in a bgt game?

2016-06-29 Thread AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
reducing lag in a bgt game? Hello everyone.I've come a long way with a game I'm working on, but am noticing it lags, quite a lot with lots of objects of a class on screen.I have an item system which only loops through the items every time the player takes a step.For the enemies and AI, I