SFML community forums
General => SFML projects => Topic started by: kolofsson on April 20, 2010, 11:54:40 pm
-
Hello there. I finally started my first project. It is going to be a racing game. At the moment there is only one car that can be driven over a surface with no collisions. I made it using VS 2010 and SFML 2.0 snapshot. The VC 2010 dll's are included in the package, so it should run out of the box.
Link:
http://grebocin.com/upload/screenway08.zip
Controls:
steering - arrows
gear up - A
gear down - Z
toggle vsync - F1
zoom in - NUM+
zoom out - NUM-
List of changes:
rev 8 (2010-04-24) - added rev meter and a timer
rev 7 (2010-04-22) - added zooming
-
Hi,
Your game doesn't work at me. I'm using Windows 7 (32 Bit). When I start the application, a white screen appears for one second, nothing more.
However, the provided image looks quite nice. ;)
-
Can we have screens please?
And what SFML version do you use? :D
-
It doesn't work here either.
It's probably because his texture is currently too large for your gfx cards.
-
Yes guys, the track is too large, and SFML supports only sprites as big as the largest texture your graphics card supports.
I have GeForce GTX 260, which supports textures up to 8192x8192, so the game works for me. I will try to find a way to make it work.
And, as I wrote, I am using SFML 2.0.
Most graphics cards support textures of 2048x2048, so if you crop the image montmelo.jpg to this size, the game should work.
-
Scaling your images in game is tricky to make them look good and best avoided in a simple game (there is a certain pattern of resolution created by evenly divided by 100).
The track looks too blurry, I wouldn't scale it.
The car should be scaled beforehand so it's smooth.
I would also try picking a car that doesn't look like it's covered in pebbles.
-
Scaling your images in game is tricky to make them look good and best avoided in a simple game (there is a certain pattern of resolution created by evenly divided by 100).
The track looks too blurry, I wouldn't scale it.
The car should be scaled beforehand so it's smooth.
I would also try picking a car that doesn't look like it's covered in pebbles.
Dear Ashenwraith
I only scaled the image to make the road big enough for the car, to test how it behaves.
The car is bigger, because later on i will add speed dependent zooming, like it was in GTA 1 (you drive slow, the car is bigger, you drive fast, you see more of the track).
Besides, if I enable anti-aliasing the quality will improve a lot.
And finally, the textures aren't what matters now. I only chose this track and this car, cause I didn't have to make them myself. When I work out the physics, I will take care of the graphic side
Any way, thanks for the input :D
-
Anti-aliasing is not going to improve a 32bit png...
-
OK guys, I cut the image into pieces of 2048x2048. Hopefully, everyone will be able to run it now.
I also added zooming, NUM+ and NUM- are responsible for it.
http://grebocin.com/upload/screenway_r7.zip
I really hope it works now! However, now you can find these black lines between the tiles. I don't know why they appear, as the tiles are perfectly matched...
-
Have you tried disabling the bi-linear filtering on the background images? It seems to be a very common issue that people have when first starting out.
image.SetSmooth(false)
-
1024x1024 is a much more standard size and if you want old gfx cards you should do 256x256
-
I tried the game : very nice ! :D
I love the car's physic, with lot of inertia :P
-
1024x1024 is a much more standard size and if you want old gfx cards you should do 256x256
um, so youre saying I should slice my track image into:
(6 500 * 2 400) / (256 * 256) = 238.037109
about 238 pieces? hmm... maybe you know some library that could load big images to memory and then extract only parts of the image, so I could feed the sf::Image::LoadFromMemory or LoadFromPixels.
this is complex stuff, I'm quite surprised that it isn't covered by the library.
Have you tried disabling the bi-linear filtering on the background images? It seems to be a very common issue that people have when first starting out.
image.SetSmooth(false)
yes, it worked! thank you! however, now the track does not look so nice when it is upscaled.
I tried the game : very nice !
I love the car's physic, with lot of inertia
thanks. Remember, this is just the first thing I decided is worth showing. It will see many improvements, like drifting for example.
-
um, so youre saying I should slice my track image into:
(6 500 * 2 400) / (256 * 256) = 238.037109
The extra is loaded with a bg color or transparency.
-
The game just closes when I try to start it; I can see the window showing up for a second. Perhaps it is because of my crappy integrated Intel graphics.
The images look great, was looking forward to trying it out.
-
Hey, just a question : how do you get that zoom effect? :D
-
Hey, just a question : how do you get that zoom effect? :D
dt = window.GetFrameTime();
if (window.GetInput().IsKeyDown(sf::Key::Add)) view.Zoom(1.f - dt);
if (window.GetInput().IsKeyDown(sf::Key::Subtract)) view.Zoom(1.f + dt);
-
I uploaded revision 8. Now you can race against time. The timer starts when you start moving. It stops when you cross the finish line. My record time without going out of track was 64.0 seconds. Try to beat that! 8)