SFML community forums

General => SFML projects => Topic started by: Evan Bowman on February 06, 2017, 09:40:37 pm

Title: FLIGHT
Post by: Evan Bowman on February 06, 2017, 09:40:37 pm
About a week ago I started a project that uses SFML, it's in its early stages but it going to involve flying planes.

I'm using SFML window, audio, network, and also the graphics module for text rendering. Most of the visuals are OpenGL. The terrain is procedurally generated with ridged fractal noise.

Video:
http://www.youtube.com/watch?v=-DnYnjPSRlw

Code:
https://github.com/evanbowman/planes
Title: Re: FLIGHT
Post by: Evan Bowman on February 07, 2017, 08:29:44 pm
Infinite terrain:

http://www.youtube.com/watch?v=F3jp-Iz25-4
Title: FLIGHT
Post by: eXpl0it3r on February 07, 2017, 09:21:20 pm
This looks quite neat! :)

What will be the general goal of the game?
Title: Re: FLIGHT
Post by: Evan Bowman on February 08, 2017, 02:02:08 am
This looks quite neat! :)

Thanks!

What will be the general goal of the game?

I'm not completely sure yet, but I think maybe an action game where where swarms of enemies appear and you survive as long as you can. One thing that I am sure of is that I want it to have a multiplayer mode. It's all very conceptual right now :)
(http://i.imgur.com/ruXG85Q.png)
Title: FLIGHT
Post by: CleverBoy on February 08, 2017, 04:32:27 am
This looks quite neat! :)

Thanks!

What will be the general goal of the game?

I'm not completely sure yet, but I think maybe an action game where where swarms of enemies appear and you survive as long as you can. One thing that I am sure of is that I want it to have a multiplayer mode. It's all very conceptual right now :)
(http://i.imgur.com/ruXG85Q.png)
It's nice. I like the shadows that get generated.. 👍



Sent from my iPhone using Tapatalk
Title: Re: FLIGHT
Post by: CleverBoy on February 08, 2017, 01:22:46 pm
I was going through the code and found that the eye vector is 3X3.. but getting a vec4. It errors during compiling. I changed to Vec 4 but then it errors out at ---   m_terrainManager.UpdateChunkLOD(eyePos, m_camera.GetViewDir());


glm::vec3 eyePos = invView * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
Title: Re: FLIGHT
Post by: Evan Bowman on February 08, 2017, 02:50:53 pm
I was going through the code and found that the eye vector is 3X3.. but getting a vec4. It errors during compiling. I changed to Vec 4 but then it errors out at ---   m_terrainManager.UpdateChunkLOD(eyePos, m_camera.GetViewDir());


glm::vec3 eyePos = invView * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);

Interesting, I don't get this error, could we be using different versions of glm? I installed glm just last week so we could have different versions. If you change the eye position vector to a vec4 that should fail to compile because TerrainManager::UpdateChunkLOD() expects a const reference to a vec3 as the first parameter.

What if you made this change:
glm::vec3 eyePos = glm::vec3(invView * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f));

By the way, what compiler are you using? Right now I only have the cmake script configured for macOS so that's another problem you may run into. I mean the linker flags will not be set of you're on a different platform.

Also libnoise in the deps folder will need to be built too because my code will try to statically link with it after you succeed in compiling all the sources.

As a sidenote, if you start up the game and get a blank blue/white screen, just give it a second, it's loading but there's no screen to tell you that yet.

I just started the project so I haven't worked a lot of this stuff out yet, especially the build steps.
Title: Re: FLIGHT
Post by: bitano on February 08, 2017, 04:52:20 pm
It looks very nice!

Here's an idea:

The player needs to get to a dropzone using the minimap to determine where to fly to. Once above the dropzone the player must drop a supply crate.
As soon as the supply crate has successfully landed in the dropzone, a new dropzone is generated for the player to fly to.

In the meantime the player is attacked by enemy planes which (s)he can shoot down.

MULTIPLAYER
Both players have to drop off a crate at the same drop zone
When a crate is dropped it slowly falls down due to its parachute. The drop is unsuccessful if the other player shoots down the crate.
The lower you get with your plane, the higher the chance of a successful crate drop, but the easier a target you become (and the harder it is to dodge mountains, etc).
A win goes to the first player to successfully drop the crate. The dropzone disappears and a new dropzone is spawned. 5 wins are required.

Just a bit of inspiration. Upto you whether you want to use it  or not :-)
Title: FLIGHT
Post by: CleverBoy on February 09, 2017, 11:37:46 pm
I was going through the code and found that the eye vector is 3X3.. but getting a vec4. It errors during compiling. I changed to Vec 4 but then it errors out at ---   m_terrainManager.UpdateChunkLOD(eyePos, m_camera.GetViewDir());


glm::vec3 eyePos = invView * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);

Interesting, I don't get this error, could we be using different versions of glm? I installed glm just last week so we could have different versions. If you change the eye position vector to a vec4 that should fail to compile because TerrainManager::UpdateChunkLOD() expects a const reference to a vec3 as the first parameter.

What if you made this change:
glm::vec3 eyePos = glm::vec3(invView * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f));

By the way, what compiler are you using? Right now I only have the cmake script configured for macOS so that's another problem you may run into. I mean the linker flags will not be set of you're on a different platform.

Also libnoise in the deps folder will need to be built too because my code will try to statically link with it after you succeed in compiling all the sources.

As a sidenote, if you start up the game and get a blank blue/white screen, just give it a second, it's loading but there's no screen to tell you that yet.

I just started the project so I haven't worked a lot of this stuff out yet, especially the build steps.
Ok Thanks.  Yes the suggestion worked and i am past that error. I am compiling on Linux (Ubutu 16.0 LTS) using code blocks. I still have to figure out the linking errors that I am getting for Open GL. The flag I set in the compiler options are not getting picked. I think because they are picked from the cmake file since I built the project using cmake. Not sure. I have to check that. Thanks for your other inputs as well. I will post once I am able to compile. I will give a try on mac as well.


Sent from my iPhone using Tapatalk
Title: Re: FLIGHT
Post by: CleverBoy on February 11, 2017, 07:45:44 am
Hi..

Sorry this is not related to the project but regarding building libnoise and libnoise utils. I actually forked from GitHub and tried building it on mac..

I am getting the below error... Can you provide any inputs on how you built it..

[  6%] Linking CXX executable Flight
clang: error: no such file or directory: '../deps/libnoise/src/libnoise.a'
clang: error: no such file or directory: '../deps/libnoise/noiseutils/libnoiseutils-static.a'
make[2]: *** [Flight] Error 1
make[1]: *** [CMakeFiles/Flight.dir/all] Error 2
make: *** [all] Error 2

Used the code base from  https://github.com/qknight/libnoise


Thanks...
Title: Re: FLIGHT
Post by: CleverBoy on February 11, 2017, 09:57:33 am
Was able to compile it. Great code. Did you read any SFML books for this ? Its all very well structured code and good for anyone to learn from it...   
Title: Re: FLIGHT
Post by: Evan Bowman on February 12, 2017, 06:03:09 am
It looks very nice!

Here's an idea:

Thanks! I don't know exactly what it's going to be yet so I'm open to ideas :)

Was able to compile it. Great code. Did you read any SFML books for this ? Its all very well structured code and good for anyone to learn from it...   

I didn't read any books on SFML specifically, mostly just the documentation on the SFML homepage. Glad you appreciate the organization of the code, because I try my best to keep my work clean and readable (although it's isn't by any means a software engineering masterpiece :))).
Title: Re: FLIGHT
Post by: Evan Bowman on February 13, 2017, 04:54:48 am
Sun, lens flares:

http://www.youtube.com/watch?v=yh9DuTRl3V8
Title: Re: FLIGHT
Post by: CleverBoy on November 08, 2018, 10:06:58 pm
Any update on this game ?
Title: Re: FLIGHT
Post by: madpl1239 on June 25, 2020, 06:06:15 pm
Hello:)))

Im new on this forum, but old programmer:))) I was compiling FLIGHT on Win7 and mingw-64-seh version. But when i run FLIGHT i have follow message and code crashed.

Warning: The created OpenGL context does not fully meet the settings that were requested
Requested: version = 3.3 ; depth bits = 24 ; stencil bits = 8 ; AA level = 2 ; core = true ; debug = true ; sRGB = false
Created: version = 3.3 ; depth bits = 24 ; stencil bits = 8 ; AA level = 2 ; core = true ; debug = true ; sRGB = false

Somebody help me? i have OpenGL (GLSL) 4.3 version :P
Title: Re: FLIGHT
Post by: madpl1239 on June 26, 2020, 07:56:46 pm
I probably found error. It is in AssetManager::LoadResources()::SetapShader.
I used to compiling mingw8.1.0seh (gcc for Windows). I think, that is something bad
with path to shaders or mingw not so good compiling function (method) to read shaders programs. I curently investigeting :D this problem.

He he - i talk to myself :P