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.


Messages - Guido_Ion

Pages: [1] 2 3
1
General / Re: Migrating to SFML 3.0 - No sfml-main[-d].lib?
« on: February 17, 2025, 08:39:20 pm »
Ok, I was able to use sfml-main-s.lib in Release and for Debug I don't use it, I use a /CONSOLE system. It runs ok in Release but not in Debug, it gives me a runtime error when creating the window. See attachment.

I copied all the sfml-xxxx-d-3.dll to the x64/Debug folder, I added also the libs to the properties, everything is setup. I'm using vs2022 with v143 compiler, the error refers to v140, so that's weird, any ideas?

EDIT: UPDATING VISUAL STUDIO SOLVED IT.

2
General / [SOLVED] Migrating to SFML 3.0 - No sfml-main[-d].lib?
« on: February 17, 2025, 02:59:51 am »
Hi, I'm migrating to SFML 3.0 x64 and I'm linking dynamically, I noticed that there isn't any sfml-main.lib for linking dinamically, only sfml-main-s.lib and sfml-main-s-d.lib are in the /lib folder. This happens with the x86 version also. When I link with sfml-main-s-d.lib there is an error when creating the window, as expected.
I don't know if I'm missing something or the downloads are missing those files.

3
Graphics / Re: Problem when zooming
« on: May 02, 2023, 11:04:08 pm »
Thanks! Everything working now, it was simpler than I thought :D

4
Graphics / [SOLVED] Problem when zooming
« on: May 02, 2023, 05:41:25 pm »
Hi, I can't figure out what to do to make the text and the minimap stay in the same size when i zoom.
I zoom in the main view and the text and minimap that I'm drawing after the scene zooms also, I want them to stay the same size.
Should I create another view? As I understand the views overwrite each other, can I make a transparent View so I write the text and minimap over it and the rest is transparent so the back main view is viewed?
Or should I apply a counter-zoom to the text and the minimap?

5
Hi Raincode! I'll start working on sound and ambient soon, thanks for the suggestions!

6
SFML projects / Re: Top Down Soccer/Football game with SFML and BOX2D
« on: February 28, 2022, 07:27:02 pm »
I'm using 2D rendering, To simulate depth I calculate the height of the ball by code and I add the shadow accordingly and I added a simple shadow for the players.

7
SFML projects / Re: Top Down Soccer/Football game with SFML and BOX2D
« on: December 29, 2021, 11:45:21 pm »
Thanks Sk, no demo yet, probably in the next few months there will be one. I'm planning on releasing it on Steam, yes. Hopefully sometime in 2022. You can follow news on twitter: @guido_ion

8
SFML projects / Top Down Soccer/Football game with SFML and BOX2D
« on: December 29, 2021, 03:18:54 am »
Hey! I wanted to share with you my project, it's a soccer game with total control. I've always felt that mainstream soccer games (FIFA, PES) lack control over what you do, meaning, where you kick is approximate, your passes are approximate, etc. Also I've never found a soccer game that really does what I want it to do. Natural Soccer is good but not exactly what I want. Sensible Soccer is great but very limited.

So... I decided to try to do it myself. After 18 months of developing this is the current state. There's a lot to improve but I think it's going in the direction I want. A lot (I mean a lot) of develompment went (and still goes) to the handling of the players, it's 80% done. Art is basic, a lot to do there. AI is basic also, I will re do it, I'm still learning about AI.



Thanks! you can follow development on twitter @guido_ion

9
SFML projects / Re: Gamepad Class for SFML (using XInput and SDL database)
« on: December 22, 2021, 06:38:41 pm »
Update:
- XInput gamepad number is not always the same as the number provided by sf::Joystick, this is determined and handled properly by the Gamepad Manager.

This was an issue when connecting an XInput Gamepad and another not XInput Gamepad and the number assigned by XInput (always 0 if there is only one connected) didn't match the number provided by sf::Joystick which can be 0 or 1.

For this I added a Gamepad Manager that takes care of initializing and populating every Gamepad whether it is XInput or other and regardless of whether the XInput number matches or not the one provided by sf::Joystick.

10
Added support for events with the method "getButtonNumber(GAMEPAD_BUTTON btn)"

Code: [Select]
if (_currentEvent.type == sf::Event::EventType::JoystickButtonReleased && _currentEvent.joystickButton.joystickId == 0 && _currentEvent.joystickButton.button == _gamepadOne->getButtonNumber(Gamepad::GAMEPAD_BUTTON::btn_start))
  /// do something

This is to avoid checking many times the same button.

11
Graphics / Re: Position a sprite relative to another
« on: October 25, 2021, 08:11:46 pm »
Solved with heading and side vectors using Box2D

Code: [Select]
void FieldPlayer::draw()
{
sf::Vector2f spritePos = sf::Vector2f(Game::SCALE * m_body->GetPosition().x, Game::SCALE * m_body->GetPosition().y);
float degreesOfRotation = Game::RadiansToDegrees(m_body->GetAngle());

m_sprite.setPosition(spritePos);
m_sprite.setRotation(degreesOfRotation);
Game::GetWindow()->draw(m_sprite);

if (PlayerState.sliding) {
// 80cm to the back of the player (local y axis)
b2Vec2 headPosSliding = m_body->GetPosition() - (0.8 * getHeading());
// 24cm to the left of the player (local x axis)
headPosSliding -= 0.24f * getSide(false);
spritePos = Game::BoxVecToSfVec(headPosSliding);
// slightly to the right of the body
degreesOfRotation += 30.f;
}

head_sprite.setPosition(spritePos);
head_sprite.setRotation(degreesOfRotation);
Game::GetWindow()->draw(head_sprite);
}

 :D

12
Graphics / Re: Position a sprite relative to another
« on: October 22, 2021, 06:49:08 pm »
The values are aproximatelly, I've tested several values, later when it works I'll put the correct values.
I've made some progress with this code:

Code: [Select]
void FieldPlayer::draw()
{
m_sprite.setPosition(Game::SCALE * m_body->GetPosition().x, Game::SCALE * m_body->GetPosition().y);
m_sprite.setRotation(Game::RadiansToDegrees(m_body->GetAngle()));
Game::GetWindow()->draw(m_sprite);

sf::Vector2f offset(0.f, 0.f);
if (PlayerState.sliding) offset = sf::Vector2f(-1.4f, -0.8f);

head_sprite.setPosition(Game::SCALE * (m_body->GetPosition().x + offset.x), Game::SCALE * (m_body->GetPosition().y + offset.y));
head_sprite.setRotation(Game::RadiansToDegrees(m_body->GetAngle()));
Game::GetWindow()->draw(head_sprite);
}

The head moves but in world coordinates, I have to take into consideration rotation yet, I can't figure out how.
GIF: [https://gfycat.com/recklesssoupycollardlizard]

And about the vector overload, it won't let me do this  ???:
Code: [Select]
m_sprite.setPosition(Game::SCALE * m_body->GetPosition());

13
Graphics / [Solved] Position a sprite relative to another
« on: October 21, 2021, 10:03:22 pm »
Hi, I'm trying to position a sprite relative to another. I have 2 sprites, one for the character and one for the head. The view is top down, when he is standing the head and character are aligned but when I do a slide the head remains in the center, I need to position the head in the correct place applying and offset form the center. How can I achieve this? I leave a beautiful image discribing the problem  ;)

I have this code but the translation isn't working, I can't see the head (it might be outside the screen)
Code: [Select]
void FieldPlayer::draw()
{
m_sprite.setPosition(Game::SCALE * m_body->GetPosition().x, Game::SCALE * m_body->GetPosition().y);
m_sprite.setRotation(Game::RadiansToDegrees(m_body->GetAngle()));
Game::GetWindow()->draw(m_sprite);

head_sprite.setPosition(Game::SCALE * m_body->GetPosition().x, Game::SCALE * m_body->GetPosition().y);
head_sprite.setRotation(Game::RadiansToDegrees(m_body->GetAngle()));
// move the head back if sliding
if (PlayerState.sliding) {
sf::Transform t = head_sprite.getTransform();
t.translate(-52.f, -10.f); ???
Game::GetWindow()->draw(head_sprite, t);
}
else {
Game::GetWindow()->draw(head_sprite);
}
}

Note: I need the code to consider rotations also

14
Uploaded!

https://github.com/GuidoBisocoli/SFML_GamepadSupport

I added XInput support and other things, still some things to do and also check more gamepads. MIT license  :)

15
Window / Re: Gamepad Class that reads from SDL controller database
« on: October 09, 2021, 12:15:55 am »
Done, I made a post in the Projects section :): https://en.sfml-dev.org/forums/index.php?topic=28250.msg176807

Pages: [1] 2 3
anything