Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Screenway - a racing game  (Read 11968 times)

0 Members and 1 Guest are viewing this topic.

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Screenway - a racing game
« 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

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Screenway - a racing game
« Reply #1 on: April 21, 2010, 04:15:22 pm »
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. ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

pierreyoda

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://pierreyoda.pagesperso-orange.fr/
Screenway - a racing game
« Reply #2 on: April 21, 2010, 09:19:31 pm »
Can we have screens please?
And what SFML version do you use? :D
Projects:
- Open Rodent's Revenge (rewriting in progress)
- Open Advanced War (paused)

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Screenway - a racing game
« Reply #3 on: April 21, 2010, 10:11:49 pm »
It doesn't work here either.

It's probably because his texture is currently too large for your gfx cards.

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Screenway - a racing game
« Reply #4 on: April 21, 2010, 10:22:15 pm »
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.

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Screenway - a racing game
« Reply #5 on: April 21, 2010, 10:37:39 pm »
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.

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Screenway - a racing game
« Reply #6 on: April 21, 2010, 10:51:30 pm »
Quote from: "Ashenwraith"
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

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Screenway - a racing game
« Reply #7 on: April 21, 2010, 11:00:54 pm »
Anti-aliasing is not going to improve a 32bit png...

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Screenway - a racing game
« Reply #8 on: April 22, 2010, 12:47:38 am »
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...

Breakman79

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Screenway - a racing game
« Reply #9 on: April 22, 2010, 01:13:07 am »
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)

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Screenway - a racing game
« Reply #10 on: April 22, 2010, 02:18:48 am »
1024x1024 is a much more standard size and if you want old gfx cards you should do 256x256

pierreyoda

  • Full Member
  • ***
  • Posts: 186
    • View Profile
    • http://pierreyoda.pagesperso-orange.fr/
Screenway - a racing game
« Reply #11 on: April 22, 2010, 10:24:12 am »
I tried the game : very nice !  :D
I love the car's physic, with lot of inertia  :P
Projects:
- Open Rodent's Revenge (rewriting in progress)
- Open Advanced War (paused)

kolofsson

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Screenway - a racing game
« Reply #12 on: April 22, 2010, 10:57:55 am »
Quote from: "Ashenwraith"
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.

Quote from: "Breakman79"
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.

Quote from: "pierreyoda"
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.

Ashenwraith

  • Sr. Member
  • ****
  • Posts: 270
    • View Profile
Screenway - a racing game
« Reply #13 on: April 22, 2010, 11:23:44 am »
Quote from: "kolofsson"

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.

dabo

  • Sr. Member
  • ****
  • Posts: 260
    • View Profile
    • http://www.dabostudios.net
Screenway - a racing game
« Reply #14 on: April 23, 2010, 12:29:58 pm »
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.