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 - julen26

Pages: [1]
1
SFML projects / Freerider
« on: January 23, 2013, 02:49:22 pm »
Here I come again with a new game. After releasing Rounded Soccer, I used the same framework to change it a bit and to do this game.



Description
Snowboard style game where you can ride random maps. These random maps are different from each other when selecting different zones on the mountain. Freeride, race and flag modes. After beating any race or flag mode, you can submit your highscore and view it in-game or here.

Used technology
C++ and SFML 2.0.

Platforms
Windows.
Still have to build for linux.

Controls
Move - Arrow Keys
Jump - Space (Only when going forward).
Select zone - Click anywhere on the mountain to select the place where you will ride.

Web & download
Download Freerider.zip (3.23 MB)
Web & Highscore

Videos



Thanks!

2
SFML projects / Rounded Soccer (Released)
« on: November 09, 2012, 01:03:19 pm »
Hi all,

I've been programming this project for a while and I've realised that I should test the online mode of the game.

Description
This game is like a mini-soccer game. You play maches 2 vs 2, but only the player can be controlled, not the keeper. I have created 3 modes:
 - Friendly.
 - Tournament.
 - Online mode.

The beta version only contains the online mode.

Used technology
C++ and SFML, of course. In the latest 2.0 build.

Platforms
Windows.
I still have to build it for linux.

Controls
Move - Arrow Keys
Jump - RCtrl.

Web & download


Download installer - https://dl.dropbox.com/u/45860111/roundedsoccer-installer.exe
Download zip - https://dl.dropbox.com/u/45860111/roundedsoccer.zip
Blog - http://julen26.blogspot.com.es/p/rounded-soccer.html

You can see the user ranking on the web or in game.

Important: For router/NAT users, it's recommended to open 55001 TCP port when the game creates a server automatically. Anyway, it's posible to connect to other games without doing it (if the opponent has openned the port, of course). I'll make an option to change the port soon.

Feedback
I would like to get any type of feedback. Latency in online games is a issue, and I have tu ensure that the game is well synchronized. I haven't programmed any prediction techniques, but I'll have to do in the future.

I still have a lot of things to do, but I'll try to stay online to play against new users. By the way, there is server info in the right-bar of my blog.

Videos





Images




3
Network / NAT punch-through (hole punching)
« on: October 29, 2012, 03:14:24 am »
Hi all, it has been a while...

I'm coding the network part on my soccer style game. The game goes well when playing on LAN, this is not a lantency issue anyway.

I've done simple system wich allows to find and play a match automatically. If the client doen't find any playable match, it starts a server waiting for other player. It uses a database etc...
I don't want to complicate my work on doing a virtual UDP connection, so I've used TCP.

The problem is that servers behind a router can't be reached by clients, the server owner must open ports on his router using NAT. I want to avoid this trying to implement NAT punch-through technique. I know how to do it for UDP, but I'm using TCP. Is it the same algorithm? Any ideas?

Thanks!

4
General / GTK+ vs Qt vs wxWidgets
« on: March 21, 2012, 12:31:36 am »
Has someone thought and disscused about this?
I'm trying to choose one and I would like to know wich of them can be integrated with SFML.

I've heard that GTK is simple and faster than others. But Qt or wxWidgets are OO and they provide more tools. wxWidgets seems to work on all plaftorms but Qt supports OpenGl rendering.

GTK and wxWidgets are 100% free, GPL and MIT licenses respectively. If you want to sell a Qt app, you must pay a license.

I want to know your opinions and wich would be a good option for mixing with SFML or developing a simple app.

Hope someone can convince and guide me through this issue. Thanks!

5
General / Multiple inheritance
« on: January 18, 2012, 06:17:08 pm »
I'm implementing my own collision sistem with collision shapes, and I'm using sf::ConvexShape, sf::CircleShape and own clases for this.

I use a vector to hold all shapes and then check for collision. So I use a base class type, CollisionShape.

Code: [Select]
std::vector<CollisionShape*> m_shapeList;

I have my own shape classes like Box, Circle, Polygon... and some of them inherit sf::ConvexShape and use its methods. I have something like this.



Note that there are more shapes inheriting CollisionShape class.

I have a problem when I do this:

Code: [Select]
Polygon* polygon = new Polygon();
addShape(polygon);
...
void addShape( CollisionShape* shape )
{
    shape->SetOutlineColor(...);     <----------------------
    m_shapeList.push_back(shape);
}


I can't use sf::ConvexShape 's methods, so I could change CollisionShape pointer to sf::ConvexShape pointer. But I have more shapes inheriting other classes (a.s.a sf::CircleShape).

Any OOP idea for solving this? A better design?

Hope someone can understand my problem,
Thanks!

6
Graphics / [SFML 2] Gradient rectangle
« on: January 13, 2012, 12:48:27 am »
Is any way for drawing a gradient rectangle of 2 colors using ConvexShape, like I used to do in SFML2(old api)?

Something like this, working against points with colors:
Code: [Select]

sf::Shape m_back;
m_back.AddPoint(0, 0, sf::Color(50, 250, 200));
m_back.AddPoint(800, 0, sf::Color(50, 250, 200));
m_back.AddPoint(800, 600, sf::Color(25, 80, 40));
m_back.AddPoint(0, 600, sf::Color(25, 80, 40));


Thanks.

7
Window / What's wrong with frame time in SFML 2?
« on: October 15, 2011, 12:34:59 am »
Here I am again.

This time I'm trying to manage de framerate and frametime as well. I used the code pasted in the documentation of SFML 2, but something is wrong.

Code: [Select]
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <stdio.h>

 int main()
 {
     // Create the main window
     sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    window.EnableVerticalSync(true);
    //window.SetFramerateLimit(60);

     // Start the game loop
     while (window.IsOpened())
     {
         // Process events
         sf::Event event;
         while (window.PollEvent(event))
         {
             // Close window : exit
             if (event.Type == sf::Event::Closed)
                 window.Close();
         }

         // Clear screen
         window.Clear();

         // Update the window
         window.Display();
         printf("FPS: %f FRAMETIME: %f\n", (float)(1.f / window.GetFrameTime()), (float)(window.GetFrameTime()));
     }

     return EXIT_SUCCESS;
}


I use this simple program, but I get this in the output:

Code: [Select]
FPS: 0.58824 FRAMETIME: 17.000000
FPS: 0.62500 FRAMETIME: 16.000000
FPS: 0.58824 FRAMETIME: 17.000000
FPS: 0.58824 FRAMETIME: 17.000000
FPS: 0.62500 FRAMETIME: 16.000000
...


I get strange values instead of a framerate around 60 and its respective frametime. Using SFML 1.6 all goes well.

Hope that there is a reason. Thanks.

8
Window / SFML 2 Events
« on: October 14, 2011, 04:14:25 pm »
I've always used SFML 1.6, but I recently started with SFML2. After compiling and building it, I'm trying to port my project to SFML2 but I have problems with events.

I would like to know wich is the equivalent of sf::Input class on SFML2, I want to check if a certain key is pressed at any time in the game.

Thanks.

9
General / Operator overloading
« on: September 23, 2011, 03:13:38 pm »
Hi, i'm trying to design a small physics-engine. I've been coding a Vector and a Entity class, but I get always the same error in the Entity class. Vector class compiles without any error.

Code: [Select]
/home/julen/Proyectos/soccer/physic/Entity.cpp||In member function ‘void Entity::applyForce(Vector2D&, Vector2D&)’:|
/home/julen/Proyectos/soccer/physic/Entity.cpp|32|error: no matching function for call to ‘Vector2D::Vector2D(Vector2D)’|
/home/julen/Proyectos/soccer/physic/Vector2D.h|20|note: candidates are: Vector2D::Vector2D(float, float)|
/home/julen/Proyectos/soccer/physic/Vector2D.h|19|note:                 Vector2D::Vector2D(Vector2D&)|
/home/julen/Proyectos/soccer/physic/Vector2D.h|18|note:                 Vector2D::Vector2D()|


And here is my code:

Vector2D class:
Code: [Select]

/* Constructors */
Vector2D::Vector2D()
{
    reset();
}
Vector2D::Vector2D(Vector2D & vector)
{
    m_elements[0] = vector[0];
    m_elements[1] = vector[1];
}
Vector2D::Vector2D(float x, float y)
{
    m_elements[0] = x;
    m_elements[1] = y;
}
Vector2D::~Vector2D()
{
    reset();
}
...
Vector2D & Vector2D::operator = (Vector2D & vector)
{
    setVector(vector);
    return *this;
}
...
Vector2D & Vector2D::operator += (Vector2D & vector)
{
    m_elements[0] += vector[0];
    m_elements[1] += vector[1];
    return *this;
}
...
Vector2D Vector2D::operator + (Vector2D & vector)
{
    Vector2D v(m_elements[0] + vector[0], m_elements[1] + vector[1]);
    return v;
}
Vector2D Vector2D::operator - (Vector2D & vector)
{
    Vector2D v(m_elements[0] - vector[0], m_elements[1] - vector[1]);
    return v;
}
...


Entity class:

Code: [Select]
...
void Entity::applyForce(Vector2D & force, Vector2D & pointOfContact)
{
    m_totalForce += force;
    Vector2D arm = pointOfContact - m_centerOfMass; //HERE I GET THE ERROR
    m_totalTorque += arm.perpDotProduct(force);
}
...


Hope someone can help me.
Thanks.

Pages: [1]