SFML community forums

General => SFML projects => Topic started by: Nexus on October 04, 2011, 02:36:31 pm

Title: Airport
Post by: Nexus on October 04, 2011, 02:36:31 pm
(http://www.bromeon.ch/games/airport/airport-logo.jpg)

Hello!

Airport is a game in which you have to guide airplanes to their airfield. New planes appear on the screen every few seconds, your job is to coordinate their routes and to prevent them from colliding. The difficulty constantly increases as the time interval between arriving planes becomes shorter and shorter. How long will you survive?

Some scenes from the game:
(http://www.bromeon.ch/games/airport/airport-scene1.png) (http://www.bromeon.ch/games/airport/airport-scene2.png) (http://www.bromeon.ch/games/airport/airport-scene3.png)

I developed this game last winter, recently I improved it and prepared it for public release. Originally, I used realistic graphics (a real landscape). Due to licenses, I had to paint my own graphics. I hope you like them :)

The game is free and can be downloaded at my homepage (http://www.bromeon.ch/games/airport). At the moment, there is only a Windows version. I am going to see if I can port the code to Linux.
Title: Airport
Post by: Disch on October 04, 2011, 04:28:43 pm
This is pretty awesome.  Surprisingly difficult!

I like the graphics, too.

EDIT:  I got to 72!
Title: Airport
Post by: Haikarainen on October 04, 2011, 05:16:18 pm
This looks really cool, bookmarking this page to try it out when I have time!

Annoying to hear about the licensing issue, damn greedy people :p Graphics looks OK tho, but i'm sure that the game would be so much cooler if it had realistic graphics, cant you find some free satellite imagery or something?
Title: Airport
Post by: Laurent on October 04, 2011, 09:52:18 pm
I tried but all I could get is a black window :P

My system has no sound, but unless you're doing something specific it shouldn't prevent the game from running.
Title: Airport
Post by: Nexus on October 04, 2011, 10:22:14 pm
Thanks for trying it! :)

Laurent, that's strange. What system are you using? Could there be a problem with a resolution of 1280x800 (even though the game starts in windowed mode)? As far as I know, I don't do anything specific, but I could try to disable sound. Or forward the console output to a log file...
Title: Airport
Post by: Laurent on October 04, 2011, 10:36:03 pm
My system is Windows 7, with a GeForce 7800 graphics card.

Quote
Could there be a problem with a resolution of 1280x800 (even though the game starts in windowed mode)?

1280 is my desktop width, so if you add the decorations your window is slightly larger. But as far as I know, there's a problem only if the height of the window is greater than the desktop.
Title: Airport
Post by: Nexus on October 04, 2011, 10:44:33 pm
I could decrease the resolution, but then it only gets more difficult for you :D

I try to write a version with a slightly smaller resolution (maybe 1024x768), no sound and some logging facility. At least if you have time to test it ;)
Title: Airport
Post by: Laurent on October 04, 2011, 10:48:12 pm
Quote
At least if you have time to test it

Sure ;)
Title: Airport
Post by: Disch on October 05, 2011, 04:12:50 am
Every once in a while the sound effects just stop and I have to restart the program to get them going again.

Also you should lower the music volume or give an option to turn it off.  I need to hear the sfx, but the music is driving me nuts.

Also got to 100!

EDIT:  also, more than a few times my planes didn't land on the runway even though they should have  =(
Title: Airport
Post by: Nexus on October 05, 2011, 10:17:41 am
Quote from: "Disch"
Every once in a while the sound effects just stop and I have to restart the program to get them going again.
I already had this bug one day, but I thought I fixed it... I think I should reimplement the sound completely, as soon as I get to it.

Quote from: "Disch"
Also you should lower the music volume or give an option to turn it off.  I need to hear the sfx, but the music is driving me nuts.
Ok :D
By the way, you can also replace music.ogg with some music you like (or just an empty file).

Quote from: "Disch"
Also got to 100!
Wow, not bad :shock:
My high score was 91.

Quote from: "Disch"
also, more than a few times my planes didn't land on the runway even though they should have
Hm, this hasn't ever happened at me. Are you sure they should have landed? The angle and alignment of the planes must match the airfield's quite exactly. And you did land the planes on the right side of the right runway? ;)
Title: Airport
Post by: Nexus on October 05, 2011, 10:53:37 pm
Quote from: "Disch"
Every once in a while the sound effects just stop and I have to restart the program to get them going again.
I think I have spotted the bug: Some elements of my std::queue<sf::Sound> have been erased while they were playing. This could have lead to an access violation or similar in OpenAL.

Presumably, I am going to release a patched version 1.2.1... Are there other requests or bug reports?

By the way, I have now compiled Airport for Linux.
Title: Airport
Post by: Tank on October 06, 2011, 08:28:07 am
Good job! The Linux version runs without a problem, reached 89 points in the first try.

I still miss the possibility to assign altitudes to separate incoming traffic vertically. But I think I'm a little bit swayed by virtual real-life ATC simulations. ;)
Title: Airport
Post by: Naufr4g0 on October 06, 2011, 04:56:52 pm
Windows version (Win7): the game doesn't work for me!

I can see the game window on the preview of the toolbar, but the window of the game won't open!
Title: Airport
Post by: Nexus on October 06, 2011, 05:13:52 pm
Quote from: "Tank"
I still miss the possibility to assign altitudes to separate incoming traffic vertically.
Wouldn't that miss the point of the game? To keep the difficulty, I would have to increase the traffic. And I think that different heights may become difficult to draw and to imagine in a 2D world ;)

Quote from: "Naufr4g0"
I can see the game window on the preview of the toolbar, but the window of the game won't open!
This seems to be a similar problem as Laurent's, apparently something with the initialization fails. I have a suspicion: The texture size of the background image and of the logo might be too big for some graphic cards. I should probably split them. By the way, this feature is a good candidate for Thor... And a good example to show the advantage of separate sf::Image and sf::Texture.

Anyway, thanks a lot for all the feedback! And sorry for the bugs, it's the first game I publish :?
Title: Airport
Post by: Laurent on October 06, 2011, 06:11:11 pm
The 1024x768 version works for me, so it was definitely a resolution problem (bigger than desktop).
Title: Airport
Post by: Nexus on October 06, 2011, 06:30:37 pm
Thanks for testing it!

I continued the discussion about high resolution textures here (http://www.sfml-dev.org/forum/viewtopic.php?p=39630#39630).
Title: Airport
Post by: greeniekin on October 07, 2011, 08:06:59 am
fantastic game. very very hard. The max i got was 84. When ever I route a plane near edge of screen it's like the game knows to spawn something that will crash with it straight away. If you did do that then your pure evil lol.

One thing is the flashing black bars on the edge of the screen telling you a plane will spawn there. I originally thought it was a rendering glitch. Maybe if it was a warning color or something it would help identify it. Like the striped black and yellow warning pattern.
Here is a picture of what I mean.
(http://tutorials.mysitemyway.com/wp-content/uploads/2009/04/grunge-stripes-300x300.jpg)

That that is nitpicking everything looks great and I actually like it in it's cartoon form rather than real images. The particle effects look really good as well.
Title: Airport
Post by: Nexus on October 07, 2011, 03:15:22 pm
Thanks a lot, greeniekin! I'm glad you like the graphics. And the idea with the edge pattern is a very good one. I wonder you even noticed the bars ;)


Airport v1.2.1 released!

Changes:
Title: Airport
Post by: keyforge on October 07, 2011, 05:29:12 pm
Hey, great looking game! I did have a lot of bugs with the windowing though.

When I opened the app the window wouldn't open up (it stayed hidden and I couldn't open it by clicking the icon on the taskbar), but hovering over the Icon (Windows 7) I could see the application running. I also could get it to work by making it fullscreen in v1.2, but this doesn't work in v1.2.1 because of the new update. Fullscreen doesn't seem to support 1366x768 resolution (which I recommend since it's a common resolution for laptops and lcd screens!) There was a large black area on right of screen, and it seemed to be cutting out some of the graphics on the top and bottom on v1.2.

I'll try this on Linux Ubuntu 64 bit, and I have an ATI Radeon Mobility 4100 if that makes a difference (I know how SFML and ATI Graphics cards sometimes have issues...)
Title: Airport
Post by: Nexus on October 07, 2011, 05:55:46 pm
Thank you!

Quote from: "keyforge"
When I opened the app the window wouldn't open up (it stayed hidden and I couldn't open it by clicking the icon on the taskbar), but hovering over the Icon (Windows 7) I could see the application running.
I have no idea what could be the reason for this. I use a frame limit such that the game doesn't waste the whole processor time, but it should be high enough to catch events (40 times per second). I first had VSync enabled, it didn't seem to work correctly though... Has anyone ever encountered a similar issue?

Quote from: "keyforge"
Fullscreen doesn't seem to support 1366x768 resolution (which I recommend since it's a common resolution for laptops and lcd screens!)
The resolution is currently fixed at 1280x800. The problem is, the difficulty varies strongly with the field size... To keep the game equally fair for different people, I would either have to stretch everything or draw a black border (but then there's no real advantage over windowed mode). Any ideas?

Quote from: "keyforge"
and I have an ATI Radeon Mobility 4100 if that makes a difference
I don't know, the computers on which I tested Airport only have NVIDIA cards. But some (all?) issues with ATI cards have been fixed in SFML.
Title: Airport
Post by: keyforge on October 07, 2011, 09:06:52 pm
Well, you could create textures for the largest screen resolution of widescreen (16:9) and normal (4:3), and then scale them down for the smaller resolutions.
Title: Airport
Post by: greeniekin on October 08, 2011, 02:49:33 am
I like the new warning bars on the sides. Originally I thought it would be good to help identify it's function. Though it also helps a lot in noticing them. I found before I would not notice some of the black bars flickering, but now I never miss them.
Title: Airport
Post by: Nexus on October 08, 2011, 02:44:18 pm
Quote from: "keyforge"
Well, you could create textures for the largest screen resolution of widescreen (16:9) and normal (4:3), and then scale them down for the smaller resolutions.
That's an idea. I could also use the current desktop resolution in fullscreen, and just set the view to the visible area. Then the graphics are not 100% sharp, but I think this is anyway hard to achieve with pixel graphics in different resolutions. Or the application renders new textures dynamically...

Concerning the windowing issue: I have compiled the SFML 2 examples with Visual Studio 2010. Do their executables (http://www.bromeon.ch/test/sfml2-examples-msvc2010.7z) work at you?


Quote from: "greeniekin"
I like the new warning bars on the sides. Originally I thought it would be good to help identify it's function. Though it also helps a lot in noticing them. I found before I would not notice some of the black bars flickering, but now I never miss them.
Indeed, I see them much more often, too.
Title: Airport
Post by: keyforge on October 08, 2011, 07:28:05 pm
They all work on my PC.
Title: Airport
Post by: Nexus on October 08, 2011, 08:11:28 pm
Thanks for testing! Then it's indeed no SFML or compilation issue. I will take a deeper look at my code...

Any ideas what might cause this issue are of course welcome! :)
Title: Airport
Post by: Naufr4g0 on October 08, 2011, 09:51:49 pm
The game still doesn't work for me! :(

If I press F2 key the game starts and I can hear sounds.
I don't think it was a texture size issue, 'cause I can see the game in the preview window of the toolbar in both versions.
Maybe it's a window initialization issue..
There's a key for fullscreen?
Title: Airport
Post by: Lee R on October 08, 2011, 09:56:39 pm
Hi,

I wasn't able to play. None of the F keys worked (i.e. nothing happened when I pressed them) and the background image wasn't displayed properly:
http://i54.tinypic.com/3eozo.png

OS : Windows XP SP3
Graphics card : NVIDIA GeForce 7600 GT
Screen resolution : 1440x900
Title: Airport
Post by: Nexus on October 08, 2011, 11:19:31 pm
Thank you both for the feedback. I think it's all connected with this windowing bug keyforge had, I still have to figure out what may cause it.

F3 would be a key for fullscreen, but in version 1.2.1 I disabled it if the resolution 1280x800 isn't supported in fullscreen mode. But I try to make this more flexible.
Title: Airport
Post by: Nexus on October 13, 2011, 01:29:17 pm
Lee R:
I don't know how why this happens. Do you have the most recent drivers and correct DLLs (for OpenAL, libsndfile and Microsoft Visual 2010 Runtime)? Are the DLLs from my homepage? And do the compiled SFML examples some posts above work at you?

keyforge and Naufr4g0:
After testing several computers, I have finally found one where I could reproduce the bug. The application appears in the taskbar, but no window pops up. And very likely, this happens because my window resolution (1280x800) is higher than the desktop resolution. Looks like all bugs are about problematic sizes :D

One more reason to allow different resolutions. I think I'm going to scale the textures for the time being, so that the game is at least playable. In the future, I can still implement more beautiful solutions... So it seems like I have to write a GUI to choose the resolution, although I originally wanted to avoid that and keep the game simple ;)
Title: Airport
Post by: Naufr4g0 on October 13, 2011, 03:35:28 pm
Quote from: "Nexus"
Lee R:
keyforge and Naufr4g0:
After testing several computers, I have finally found one where I could reproduce the bug. The application appears in the taskbar, but no window pops up. And very likely, this happens because my window resolution (1280x800) is higher than the desktop resolution. Looks like all bugs are about problematic sizes :D


I found out that I have the same bug when, in my sfml games, I tried to open a window larger than screen resolution. :)
The max resolution of my laptop is 1366x768 with an aspect ratio of 16:9.
Can't you use sfml views to zoom out the game window?
Title: Airport
Post by: Nexus on October 13, 2011, 04:55:38 pm
Quote from: "Naufr4g0"
Can't you use sfml views to zoom out the game window?
That's exactly what I meant with scaling textures ;)

What would be a good default resolution -- small enough not to evoke the size bug, yet as big as possible? 1024x768? Or should I choose the desktop resolution and start with fullscreen mode?
Title: Airport
Post by: Naufr4g0 on October 13, 2011, 06:33:27 pm
Quote from: "Nexus"
Quote from: "Naufr4g0"
Can't you use sfml views to zoom out the game window?
That's exactly what I meant with scaling textures ;)

What would be a good default resolution -- small enough not to evoke the size bug, yet as big as possible? 1024x768? Or should I choose the desktop resolution and start with fullscreen mode?


A 1024x768 window can be displayed on my screen, but the lower part of it is covered by the toolbar.
1024x768 resolution is perfect for me in fullscreen. :)
Why not a scaled 800x600 window to start? I think is the more compatible.
You could add an option to enlarge the window from title screen.
Title: Airport
Post by: Disch on October 15, 2011, 01:15:03 am
Another option:

The first time the program is launched (no saved file or whatever), run a very small window and have the user pick their desired res.  Then switch to that res and save it to the saved file so it can be auto-started in that res the next time the game is run.

Or try to autodetect based on the user's current screen resolution (does SFML have a way to check the current res?)
Title: Airport
Post by: Nexus on October 15, 2011, 03:19:33 am
Quote from: "Disch"
Or try to autodetect based on the user's current screen resolution (does SFML have a way to check the current res?)
That's also an option, I think I'll stick to that and fullscreen. SFML has sf::VideoMode::GetDesktopMode() :)
Title: Airport
Post by: Tank on October 17, 2011, 05:47:35 pm
Quote from: "Nexus"
Quote from: "Tank"
I still miss the possibility to assign altitudes to separate incoming traffic vertically.
Wouldn't that miss the point of the game? To keep the difficulty, I would have to increase the traffic. And I think that different heights may become difficult to draw and to imagine in a 2D world ;)

Absolutely not, in my opinion it will increase the game complexity to a good degree. Aircrafts come in high and can be commanded to descend the nearer they get to the runway.

I have to admit it's more related to reality than an arcade game, but I couldn't find a game that has implemented such a feature; I miss it very hard. ;)

Commanding altitudes could be reached by dragging with the right mouse button, for example. Or additionally the keyboard.

my 2ยข
Title: Airport
Post by: Nexus on October 17, 2011, 07:46:24 pm
But this would complicate the game a lot, and I'd like to keep it simple for the time being. There have also been other suggestions like power-ups, maybe I'll implement them one day. But currently I'm preparing to release a new version in order to satisfy some other requests ;)
Title: Airport
Post by: Nexus on October 18, 2011, 07:11:48 pm
Airport v1.3 released!

New features:
Title: Airport
Post by: keyforge on October 18, 2011, 07:56:06 pm
The game worked great for me in the new version! It's fun and has great graphics and the GUI is good looking. The only problem I had here was after two planes collided and the screen began getting cluttered with smoke the planes movement got choppy.
Title: Airport
Post by: Nexus on October 18, 2011, 10:41:27 pm
Thank you! And good to hear it works :)

I have also noticed a small performance drop when the sky is full of burning planes. It probably happens because too many particles have to be drawn and computed at the same time. I have to do a profiling and see if there is room for optimization...
Title: Airport
Post by: Naufr4g0 on October 18, 2011, 11:02:37 pm
Very very very nice!! The game runs perfect for me now! :D
No graphics issue, no visible reduction of fps when the screen is full of airplanes.
I also think that the game is very fun and original! :)

my Hi-Score is 52 airplanes (HARD difficulty).
Title: Airport
Post by: sbroadfoot90 on October 19, 2011, 12:21:38 am
Quote from: "Naufr4g0"
I also think that the game is very fun and original!


Maybe not as original as you think have you seen this (http://firemint.com/flight-control-choose-your-landing-platform/)?

Been playing it for a few years now
Title: Airport
Post by: Nexus on October 19, 2011, 12:53:00 am
Not Flight Control, but Airport has indeed been inspired by a game on my friend's smart phone. He said it would be cool to play this on PC with a mouse, so I had the idea to implement it ;)

Naufr4g0, I'm glad it works and you have fun! 52 is pretty good, the hard mode is quite a challenge in my opinion. Yet I prefer this difficulty because it directly becomes demanding, even if this means that you often die after a few points :D
Title: Airport
Post by: Naufr4g0 on October 20, 2011, 08:22:00 pm
Quote from: "sbroadfoot90"
Quote from: "Naufr4g0"
I also think that the game is very fun and original!


Maybe not as original as you think have you seen this (http://firemint.com/flight-control-choose-your-landing-platform/)?

Been playing it for a few years now


I never played Flight Control, so I didn't know the gameplay. :)
Anyway I'm happy to try Airport with mouse control. I haven't got an iPhone!
Title: Airport
Post by: bglaze on October 21, 2011, 06:41:06 pm
Wow, this game is epic. Nice work!
Title: Airport
Post by: Nexus on October 23, 2011, 03:06:42 am
Thank you very much! :)

What are you (all) thinking about the difficulty levels, are they okay? Which one did you choose?
Title: Airport
Post by: keyforge on October 23, 2011, 04:05:23 am
Quote from: "Nexus"
Thank you very much! :)

What are you (all) thinking about the difficulty levels, are they okay? Which one did you choose?


I tried each of the difficulty levels and I think easy is easy as it should be, hard is rather difficult (especially when you get 10 or more planes on the screen at once!), and medium is a nice balance between the two.
Title: Airport
Post by: Naufr4g0 on October 23, 2011, 05:07:35 pm
(http://dl.dropbox.com/u/4564869/airport_hiscore.png)

63 at hard! :)
Title: Airport
Post by: easy on October 24, 2011, 01:32:01 pm
Hi! I've tried to play the game but it didn't run, and I've just realised it's because it was compiled on 64 bit linux. Are you planning to compile it in 32 bits? I've also tried the windows version via wine, but I guess for the same reason, it also didn't run.
Title: Airport
Post by: Nexus on October 24, 2011, 05:22:27 pm
I have already tried to compile it for 32 Bit Linux, up to now without success (see this thread (http://www.sfml-dev.org/forum/viewtopic.php?t=6034)). The problem is, I have to install a 32 bit version of every library SFML uses, which I haven't been able to do yet.

But I try to search for the packages again. If anybody knows exactly which ones I need on Ubuntu 64 Bit, I would really appreciate that ;)
Title: Airport
Post by: easy on October 24, 2011, 06:58:21 pm
My first thought was: "Why don't you use a 32 bit Ubuntu under VirtualBox?", but I see Laurent has also suggested it. Otherwise, there must be some repos that suits your needs, but changing them might come with a lot of debris that can turn your Ubuntu into junk. I also think compiling everything on your own would be a waste of time.

I'm not using Ubuntu for a while, but here you might ask your questions:
ubuntuforums.org (http://ubuntuforums.org/)
askubuntu.com (http://askubuntu.com/)

But I still think VirtualBox is the easiest and most straightforward solution.
Title: Airport
Post by: Nexus on October 25, 2011, 06:00:28 pm
Meanwhile, I have built Airport for 32 bits. Everything compiles fine at me, but it fails to run because of an alleged std::length_error.

It doesn't seem like 32 bit executables automatically work on 64 bit Linux, as it is the case for Windows. And I haven't found an easy way to run them (please tell me if you know one without a VM), so I need other users to test it ;)
Title: Airport
Post by: easy on October 25, 2011, 07:22:46 pm
I've just downloaded and tried it, here's the output:
Code: [Select]
terminate called after throwing an instance of 'std::length_error'
  what():  vector::_M_fill_insert


Unfortunately, it does not run yet, but at least it is recognised as an executable! :)

Oh, and 32 bit applications run without any problem to my experience on 64 bit linux systems. :) (I used to have a 64 bit Ubuntu)
Title: Airport
Post by: Nexus on October 25, 2011, 07:54:21 pm
I had exactly the same error, but I thought it occurred as a result of a 64 bit incompatibility. I will try to debug it with Code::Blocks, thanks for testing!