Graphics questions
Posted: Fri Feb 10, 2012 8:23 pm
Hey guys! I've been reading for a couple of months, this is my first post. I've looked around for answers but these are rather specific questions.
My game is a top down space shooter/sim. Kind of like a semi-realistic asteroids-- instead of moving around the screen, you can fly around a huge battlefield scattered with asteroids, fighting other space ships. My FPS goes from 57-60 (hardware reasons I guess) on Ubuntu and Windows, but then slows down to 30 or 40 sometimes.
Right now I probably have under 10 objects at the moment, each checked by a collision detector. If I had a couple missiles with smoke trails (from a particle emitter) the frame rate slips down. I'd ideally like to have a hundred or so objects on the screen, and a hundred or so more off the screen (being updated but not drawn). I'd also love it if I could have my smoke trails stay in the world indefinitely, but that destroys my FPS.
1. I scale my whole world by .3 at 1024x768, the default resolution. Then for other resolutions, I scale as required. So I have sprites around 128x128 or 256x256 or whatever, then scale them. Is that alright, or not good for speed?
2. My background needs to cover the whole world. I use parallax on it, and it's scaled, but I used a texture that's 1024x768. Is that normal practice?
3. I use a fair number of shapes.. for the HUD, mostly. I probably draw around 200 small lines, a few rectangles, and some circles.. and I'm just starting with the hud. I read somewhere that shapes are slow with Love? Should I avoid them and use images in their place? I also have a boundary circle. It's drawn every frame, but only seen when you get close to it (ie. when it's on the screen). It's a huge circle is that bad practice?
4. I use scale to animate explosions.. so I've got a simple sprite that I blend with 'additive' and grow and shrink over a couple of seconds. Is that pretty normal? It slows down like crazy on Windows for some reason (I scale it up to about the size of the screen..)
5. Does anyone have any resources on 2D graphics effects? I'm kind of making things up as I go...
Thanks so much for any help or extra tips. I hope to be a contributor on this forum in the future. The great community around this engine was a huge draw for me to start using it!
My game is a top down space shooter/sim. Kind of like a semi-realistic asteroids-- instead of moving around the screen, you can fly around a huge battlefield scattered with asteroids, fighting other space ships. My FPS goes from 57-60 (hardware reasons I guess) on Ubuntu and Windows, but then slows down to 30 or 40 sometimes.
Right now I probably have under 10 objects at the moment, each checked by a collision detector. If I had a couple missiles with smoke trails (from a particle emitter) the frame rate slips down. I'd ideally like to have a hundred or so objects on the screen, and a hundred or so more off the screen (being updated but not drawn). I'd also love it if I could have my smoke trails stay in the world indefinitely, but that destroys my FPS.
1. I scale my whole world by .3 at 1024x768, the default resolution. Then for other resolutions, I scale as required. So I have sprites around 128x128 or 256x256 or whatever, then scale them. Is that alright, or not good for speed?
2. My background needs to cover the whole world. I use parallax on it, and it's scaled, but I used a texture that's 1024x768. Is that normal practice?
3. I use a fair number of shapes.. for the HUD, mostly. I probably draw around 200 small lines, a few rectangles, and some circles.. and I'm just starting with the hud. I read somewhere that shapes are slow with Love? Should I avoid them and use images in their place? I also have a boundary circle. It's drawn every frame, but only seen when you get close to it (ie. when it's on the screen). It's a huge circle is that bad practice?
4. I use scale to animate explosions.. so I've got a simple sprite that I blend with 'additive' and grow and shrink over a couple of seconds. Is that pretty normal? It slows down like crazy on Windows for some reason (I scale it up to about the size of the screen..)
5. Does anyone have any resources on 2D graphics effects? I'm kind of making things up as I go...
Thanks so much for any help or extra tips. I hope to be a contributor on this forum in the future. The great community around this engine was a huge draw for me to start using it!