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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - cooldog99

Pages: [1]
1
Hey again guys!
I need more help :(

I recently started playing with QT, and having ALOT of fun with it vs .Net.

however, I wanted to make a nice level editor with it, using SFML.
I tried to follow the 1.6 tutorial for SFML and QT, but with SFML 2.0 and ran into issues with an ambiguous call to create function from renderWindow, and QTWidget, so I made a small wrapper class for SFML renderwindow that called the create function with a different name. Fixed that issue, however the program doesn't run, only says: "Program exited unexpectedly".

Other than that my code is identical to SFML 1.6 QT tutorial.

Is there any sample project I can see to setup SFML with QT creator? I can't find an example project with SFML 2.0rc :/

Thanks.

2
SFML projects / Gage - Gauntlet throwback game!
« on: August 15, 2012, 04:13:57 pm »
Hello awesome peeps of SFML community!
I'm here to present the newest project of Perilous Game Studios:
"Gage"

It's an isometric 2D throwback of the popular classic game, "Gauntlet".
Yes, the REALLY old one!

Who didn't love gauntlet? :)

It will be isometric, and have more RPG elements than gauntlet did, with a nice backstory to it ^^

Here is it's most recent preview:


What it's currently got:
Working level editor, loading/saving, with a layering system.
basic Collision.
Simple lighting system.
Block hiding. (if you're under a block that is "above" the player, it'll become slightly transparent so you can see where you're going!)
basic moving, with joystick support(no reason at all xD)
working Menu/Splash screen system.
full LUA integration.
and some more stuff!

The only thing in the picture we didn't make is the player sprite, everything else is made by me(I'm not that good at pixel art :/ )

Let me know what you think!
I'll update this post with more stuff later.

3
Window / openGL issue, came with update to sfml2.
« on: July 11, 2012, 11:53:47 pm »
I had made a simple 3d engine, about a month or two before the big Graphics update for SFML2, and just recently revived it, and started working on it, when I had a problem with the openGL side..

Two variables changed since, SFML and my computer.

Basically, here is the issue.

Textures.
I know i'm supposed to call glBindTexture BEFORE glBegin, not Between glBegin/glEnd
However, if I DON'T put it in between, textures are white.
If I DO put it in between, they show...badly.

it didn't do this before I updated my computer/sfml.

is there something wrong with my code?
Setting up the window...
Code: [Select]
int main(){
sf::ContextSettings Settings;
Settings.depthBits         = 24; // Request a 24 bits depth buffer
Settings.stencilBits       = 8;  // Request a 8 bits stencil buffer
Settings.antialiasingLevel = 2;  // Request 2 levels of antialiasing

sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "PeriLib", sf::Style::Close, Settings);
Base_Controller Engine;
Engine.SetWindow(&Window);
return Engine.Run();
}
my texture variables (temporary, was testing for the problem)
Code: [Select]
GLuint skyboxfront;
GLuint skyboxback;
GLuint skyboxtop;
GLuint skyboxbottom;
GLuint skyboxright;
GLuint skyboxleft;

Loading Textures
Code: [Select]
GLuint Texture1; // UNIQUE texture number, every texture is last texturenum + 1! e.x Texture2 = 1, Texture3 = 2
sf::Image Image;
Image.loadFromFile(Path);
glGenTextures(1, &Texture1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGBA, Image.getSize().x, Image.getSize().y, GL_RGBA, GL_UNSIGNED_BYTE, Image.getPixelsPtr());
myUniqueCounter++;
myTextures.push_back(Texture1); // Add texture to vector!
std::cout << "New texture added!" << " : " << myTextures.size() - 1 << std::endl;
return Texture1;

Storing Textures
Code: [Select]
skyboxfront = Graphics.AddTexture("skybox_front.png");
skyboxleft = Graphics.AddTexture("skybox_left.png");
skyboxback = Graphics.AddTexture("skybox_back.png");
skyboxright = Graphics.AddTexture("skybox_right.png");
skyboxtop = Graphics.AddTexture("skybox_top.png");
skyboxbottom = Graphics.AddTexture("skybox_bottom.png");


Init openGL settings
Code: [Select]
void Init_OpenGL(void){
glClearDepth(1.f);
glClearColor(0.7f, 0.7f, 0.9f, 0.f);
glEnable(GL_DEPTH_TEST);
glDepthMask(GL_TRUE);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(90.f, 800.f / 600.f, 1.f, 500.f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Lets openGL render a little nicer, at the expense of CPU usage.
std::cout << "You are running openGL Version: " << glGetString(GL_VERSION) << std::endl;
}

Main Loop
Code: [Select]
while (isRunning){
sf::Event _Evn;
while (Screen->pollEvent(_Evn)){
if (_Evn.type == sf::Event::Closed)
isRunning = false;
if (_Evn.type == sf::Event::Resized)
glViewport(0, 0, _Evn.size.width, _Evn.size.height);
}

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Same as SFML clear, but with some Buffering ;)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 800.f / 600.f, 1.f, 500.f);
this->Update(); //Draw skybox is called here!
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
this->Draw(); //Other models.
Screen->display();
}
Screen->close();
}

Drawing skybox (textures are REALLY blurry)
I disable a few things here, to get the Skybox effect, that part works, but the textures do not!
Code: [Select]
       glEnable(GL_TEXTURE_2D);
        glDisable(GL_DEPTH_TEST);
        glDisable(GL_LIGHTING);
        glDisable(GL_BLEND);
float halfSize = 50.f;
        // Render the front quad
glColor3f(1.f, 1.f, 1.f);
float EndCoordinate = 1;
glBindTexture(GL_TEXTURE_2D, 1);
        glBegin(GL_QUADS);

            glTexCoord2f(0, 0); glVertex3f(  halfSize, -halfSize, -halfSize );
            glTexCoord2f(EndCoordinate, 0); glVertex3f( -halfSize, -halfSize, -halfSize );
            glTexCoord2f(EndCoordinate, EndCoordinate); glVertex3f( -halfSize,  halfSize, -halfSize );
            glTexCoord2f(0, EndCoordinate); glVertex3f(  halfSize,  halfSize, -halfSize );
        glEnd();
     
        // Render the left quad
        glBindTexture(GL_TEXTURE_2D, 2);
        glBegin(GL_QUADS);

            glTexCoord2f(0, 0); glVertex3f(  halfSize, -halfSize,  halfSize );
            glTexCoord2f(EndCoordinate, 0); glVertex3f(  halfSize, -halfSize, -halfSize );
            glTexCoord2f(EndCoordinate, EndCoordinate); glVertex3f(  halfSize,  halfSize, -halfSize );
            glTexCoord2f(0, EndCoordinate); glVertex3f(  halfSize,  halfSize,  halfSize );
        glEnd();
   
        glBindTexture(GL_TEXTURE_2D, 3);
        glBegin(GL_QUADS);

            glTexCoord2f(0, 0); glVertex3f( -halfSize, -halfSize,  halfSize );
            glTexCoord2f(EndCoordinate, 0); glVertex3f(  halfSize, -halfSize,  halfSize );
            glTexCoord2f(EndCoordinate, EndCoordinate); glVertex3f(  halfSize,  halfSize,  halfSize );
            glTexCoord2f(0, EndCoordinate); glVertex3f( -halfSize,  halfSize,  halfSize );
     
        glEnd();
     
        // Render the right quad
        glBindTexture(GL_TEXTURE_2D, 4);
        glBegin(GL_QUADS);

            glTexCoord2f(0, 0); glVertex3f( -halfSize, -halfSize, -halfSize );
            glTexCoord2f(EndCoordinate, 0); glVertex3f( -halfSize, -halfSize,  halfSize );
            glTexCoord2f(EndCoordinate, EndCoordinate); glVertex3f( -halfSize,  halfSize,  halfSize );
            glTexCoord2f(0, EndCoordinate); glVertex3f( -halfSize,  halfSize, -halfSize );
        glEnd();
     
        // Render the top quad
        glBindTexture(GL_TEXTURE_2D, 5);
        glBegin(GL_QUADS);

            glTexCoord2f(0, 0); glVertex3f( -halfSize,  halfSize, -halfSize );
            glTexCoord2f(EndCoordinate, 0); glVertex3f( -halfSize,  halfSize,  halfSize );
            glTexCoord2f(EndCoordinate, EndCoordinate); glVertex3f(  halfSize,  halfSize,  halfSize );
            glTexCoord2f(0, EndCoordinate); glVertex3f(  halfSize,  halfSize, -halfSize );
        glEnd();
     
        // Render the bottom quad
        glBindTexture(GL_TEXTURE_2D, 6);
        glBegin(GL_QUADS);

            glTexCoord2f(0, 0); glVertex3f( -halfSize, -halfSize, -halfSize );
            glTexCoord2f(EndCoordinate, 0); glVertex3f( -halfSize, -halfSize,  halfSize );
            glTexCoord2f(EndCoordinate, EndCoordinate); glVertex3f(  halfSize, -halfSize,  halfSize );
            glTexCoord2f(0, EndCoordinate); glVertex3f(  halfSize, -halfSize, -halfSize );
        glEnd();
        glEnable(GL_DEPTH_TEST);
        //glDisable(GL_LIGHTING);
       
glEnable(GL_BLEND);

I'm fairly new to openGL, so excuse any noob mistakes :p

I'm thoroughly stumped, but i'm sure it's just my fault...
I posted in the SFML window forum because i'm not 100% sure what the issue is, I just know it happened after I switched SFML versions from 1.6 -> 2.0

Did I miss a change in SFML 2 that affects openGL?

4
Graphics / Help with vertex arrays!
« on: February 15, 2012, 05:22:51 pm »
Since laurent got rid of the old shape styles and added vertex arrays (not saying this is bad, but it did help)

I've had an issue with trying to make shapes that aren't quads.

basically if I try to do anything above 3(tri), or 4(quad) vertices it gets screwy.

I have a "DrawHexagon" function that draws 6 vertices successfully, as a triangle fan, however the first vertice of this is always 0,0 with a white color.
all others are fine.
here is code

Code: [Select]
void DrawHexagon(float X, float Y, float W, float H, sf::Color Col){
sf::VertexArray Hex(sf::TrianglesFan, 6);

float HalfWidth = W / 2;
float HalfHeight = H / 2;
Hex.Append(sf::Vertex(sf::Vector2f(X, Y + HalfHeight), Col));
Hex.Append(sf::Vertex(sf::Vector2f(X + (HalfWidth / 2), Y), Col));
Hex.Append(sf::Vertex(sf::Vector2f(X + HalfWidth + (HalfWidth / 2), Y), Col));
Hex.Append(sf::Vertex(sf::Vector2f(X + W, Y + HalfHeight), Col));
Hex.Append(sf::Vertex(sf::Vector2f(X + HalfWidth + (HalfWidth / 2), Y + H), Col));
Hex.Append(sf::Vertex(sf::Vector2f(X + (HalfWidth / 2), Y + H), Col));
App.Draw(Hex);
}


Is there something wrong? O_o
Am I using wrong primitive type? :?
Why is there no Polygon primitive type, like openGL?
I'm a noob to vertex's :/

I'm trying to make a bunch of custom shape functions for a new game we're developing  :wink:

So much new stuff lately in sfml2, i'm trying to keep up!
I feel dumb, can anyone help? :(

5
General / Question about optimizing in SFML
« on: June 07, 2011, 10:12:37 pm »
Hey guys. It's been awhile, and if you know us, "XSG Team" you know we have a game out called "Paradox".
unfortunately this is cancelled until further notice due to an increase of lag.

My questions are why is it that our game drops 30 fps when we spawn 5 "zombies".

Zombies are basically a small simple class, with a few int variables and a sprite, NOT IMAGE.

The game DOES do frustrum culling, and currently runs at 40-50+ fps with over 256x256 tiled (64x64 pixel) tiles.

I've tried optimizing like crazy, but to no avail.
We are no C++/SFML masters, so that's why we're reaching out to this awesome community.

We've tried to make a "Stamp" sprite instead of a bunch of sprites, and just have it change image/location each call in a for loop, but that made it WORSE.

I don't get it, the game does NOT draw outside the view window, yet it lags with 5 entities that aren't drawn? The updating is only a for loop that iterates for each entity.

it's not just the entities that cause lag, unfortunately.

Is there any further optimization tricks for SFML you guys can share? (v1.6 currently, 2.0 is too buggy for our taste).

6
Network / Quick question, Sending Lists or Vectors through Packets
« on: April 26, 2011, 08:43:06 pm »
Hey guys, I was just wondering what's the best way to send lists or vectors through a SINGLE packet and have a list = packet contents.

Basically
Server:
Vector of enemies
Send packet of said Vector ^

Client:
Receive Packet
Enemies Vector = Packet Contents

I'm sorta ignorant to Packets, I've used them for single data but not large lists.

SFML 1.6
Windows vista btw.

7
Recently Updated! (AGAIN)

WOOHOO V0.0.80 is now released!!


Edit: Wiki now added for recipes!
http://xsgteam.net/ParadoxWiki.php

What is Paradox?
Paradox is a game based on a Zombie Apocalypse.
It is a top-down 2D shooter, with an RPG aspect.

Currently, you have one goal...Survive.

You can find Metal/Wood, and craft guns to stay alive, but you also have to craft ammo!

There is Blood, Fog/Clouds, Zombies, and Day/Night system with a Day counter.

This game is in PRE-Alpha, meaning it's no where near close to being finished, and will continue to get better!

You can craft via putting items in the crafting box in a certain pattern or "recipe". We give you 2 right away in the read_me file, so check it out.

screen shots:


Default Controls
---------------------------------
Left mouse click -- Shoot / Place Wall (or other objects)
Right mouse click -- Punch / Activate Work Bench / Open Doors
Shift -- Run/Sprint (Gains momentum overtime)
W, A, S, D -- Movement Controls (Changable)
I -- Inventory (Unchangable)
M -- Rotate Object (Placeable Object) (If in HotBar and Selected)
O -- Opens up debug information.
R -- Manual Reload (Changable / Uses current ammo)
Escape -- Exits out of any menu/game state.


How to gather resources?
---------------------------------
Move on top of an resource and press Space once.
A progression bar will be displayed over head.
Once progression bar is filled (100%), a random resource will
fall on to the ground (which you can pick up and use)

Thanks for checking it out.
To login to game, you'll have to make an account on our site, but it IS free :) (Offline mode is there though :) )


Small list of Updates from 0.0.60 - 0.0.80 (Can't fit all ;) )
-NEW! Zombie AI! (Zombies now are smarter then eever!)
-Did much optimization with views (More fps)
-New appeal to Inventory/Crafting Slots and Screens
-Added Design for Main Menu/Login Screen (more features as well)
-Added Modding system added (For weapons, which increases certain stats of a weapon)
-Added Shop system (Enables you to sell resources and gain money to buy items! (mods/weapons/rares)
-Added Currency system (for shop system!)
-New Collision system for everything (Easier to get by smaller places! And less glitches!)
-Added building system (allows you to build with blocks you either make or buy)
-More work done with profiles (Longest day survived/Most money/Total score/Total kills/etc!) (only for users logged in)
-House generation (with random houses generated with goodies inside the house!)
-More items to craft (Think floors/Walls/minor-mods/weapons/etc)
-Hunger system! (Food heals you and it can kill you if you don't eat!)
-More information sent from the game to your profile at our site! (stats!) (http://xsgteam.net)
-Fixed a bunch of bugs when you could view things in Pause/Death screen!
-Also new variable handles which gui box displays first! (So hover over health and crafting box, wont display both)
-Added sfx (when buying/selling items)
-Added sfx (when punching zombie!)
-Added sfx (when drinking drink)
-Added sfx (when eating burger)
-Added option in menu to turn off tips.
-Made some new sounds (un-used atm, for cellslots)
-Made weapons sell value depend on durability!
-Some new hints/tips added!
-Tips/hints regenerate randomly every 30 seconds
-Successfully added menu (in-game)
-FIX: In Store the weapon will display sell value (in your inventory now)
-FIX: Bunch of bugs with zombiess!
-FIX: Moved ammo to Health Bar
-FIX: If Intersection with HotBar you will not be able to shoot!
-Removed Day/Night Orb because of problems! Will work on more...
-Added a lot more! (Check ittt ooout)

New Updates from 0.0.53 to 0.0.60
-Remade crafting system!
-Fixed up some GFX
-Durability added for weapons!
-Certain key items do not stack anymore! (Weapons, etc)
-Zombie AI made (Zombies now can chase you after sight!)
-NO zombies get spawned day one! (Go gather resources, fool!)
-Console added, for when logged in (Press T!)
-Fullscreen mode added! (Not for main-menu though) (FPS may drop depending on computer)
 -Splash screen
-Save / Load fixing / tweaking (Current saves will not work :()
-Added zombie Brains (Zombie bait!) (1/20 chance dropped when kill)

New Updates from 0.0.51 to 0.0.53
Here's the changes:
-Alerted when picked up an item.
-New save/load system!
-Better Item System
-Resources now can be found in multiples!
-More solid engine
-GFX modifications for Inventory
-GFX updates in general! (icon fixes, etc)
-Fixed rifle recipe (and Winchester)
-More debugging stuffs!

New Updates from 0.0.50 to 0.0.51:
-Gathering stopped when shooting/punching
-Added Scrap Rubber!
-Added more recipes. (Changed recipes to require rubber)
-Added more gui to crafting! (And crafting button!)
-Added rifle (allows rifle/winchester!)
-Added night/day gui (orb)
-Fixed crafting bugs
-Fixed collision bugs
-Offline mode


Check out more details here:
http://xsgteam.net/
Download:
http://xsgteam.net/Paradox/Paradoxv0.0.80P.zip

BIG thanks to Laurent for making an awesome lib (SFML)!


----------------Notes---------------
Current saves from past versions will not work, due to editing of saving/loading.

Do not run Updater Manually, unless you have a bad version and you need to redownload
all old files. Thanks.

Please Note, this game is in Pre-Alpha mode and may contain
bugs and glitches. So please be aware, and you are playing this game
at your own risk. Report all bugs/glitches to us (http://xsgteam.net/ParadoxBugs/)
OR direct e-mail to (brett@xsgteam.net or james@xsgteam.net)

When sending bug report, please press "o" in game to bring up debug-display.
Then take a screenshot, and send to us,
Along with instructions on how to recreate bug. Thanks.

8
Window / Need Help limiting Key/Mouse Presses!
« on: March 07, 2011, 06:23:14 am »
Ok. So...
I'm using SFML 1.6, and need help with 1 small thing.

I need to limit the user (on certain things) on key presses. basically NOT allowing them to hold a key down, a 1 time key press if you will..
Also need same with mouse.

I understand this can be achieved with using Events, however my code is NOT directly inside main function, and I cannot for some reason transfer Event through a pointer into Game code, why?

I'm basically using this method


transferring events into functions through a pointer like such.

Game::Update(sf::Event * Event)

Any ideas?

Sorry if I'm not clear enough, ask and i'll clear anything up.
Please help!

9
General / please help!!! SFML Crash on App.Clear() and App.Display()
« on: February 17, 2011, 09:29:13 pm »
Ok, so I've been using sfml for the past 2 weeks, was awesome.
Starting making a BIG project, and all of a sudden my programs that use sfml went to sh*t.

It seems to crash at App.Clear() or App.Display()
I've used both Window and RenderWindow and before using RenderWindow works great.

I recently had a stable game, saved it. next day I go to load it and run it, it crashes on those lines, why?

Here's a sample code.
Code: [Select]

#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>


int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Test Program");
while (App.IsOpened())
{
        sf::Event Event;
        while (App.GetEvent(Event))
        {
               // Window closed
               if (Event.Type == sf::Event::Closed)
                   App.Close();

               // Escape key pressed
               if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
  App.Close();


        }

        App.Clear(sf::Color(130, 130, 255));
        App.Display();
}
    App.Close();
    return EXIT_SUCCESS;
}


I originally used CodeBlocks as my IDE, and it started crashing there.
Tried VC++ and it crashed there as well.

I am using -d libs for debugging.
and not using release for debug.

my libs are correct, and this suddenly started happening.

It's frustrating me to the point of not wanting to program anymore, please help!

//Edit if it helps any:
SFML-1.6
CodeBlocks

SFML-1.6 VC++ version, VC++2008

Windows vista, 3gb ram, dual core processor, yada-yada...

Pages: [1]