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

Pages: 1 [2] 3 4 ... 7
16
General / Re: When should I be using pointers?
« on: August 22, 2017, 09:36:05 am »
Firstly, a bit of theory:
https://stackoverflow.com/a/79936

Now, If the stack model is convenient for you (small size, short lifespan, etc..), use it, there's no reason not to (however,make sure you're not creating global variables just so you can use stack model. Always avoid globals). Only use heap if stack memory management is insufficient.

On top of that, when you finally use pointers, use smart pointers instead of the raw ones, as smarts are safer.

17
General discussions / Re: The Steam Direct fee is $100
« on: July 22, 2017, 07:02:30 pm »
I highly doubt it. They surely make more than $100 a game.

18
I usually despise gambling games, but man, this one is so polished and has so gripping atmosphere... Wow.

19
General discussions / The Steam Direct fee is $100
« on: June 03, 2017, 11:03:18 am »
Hi everyone!
Just wanted to let you guys know that the debate around the Steam Direct fee has finally been settled. The result is $100/project.
Viva la IndieGameDev! :D

http://steamcommunity.com/games/593110/announcements/detail/1265921510652460726

20
SFML game jam / Re: Making a Jam on Itch io with prices
« on: May 28, 2017, 03:07:37 pm »
Previous rules for the SFML jam was that others should be able to compile it. That is, you can use any library as long as it's fully public. Seems fair and reduces "huge advantages" ;D

Is there any reason why you chose the wording "public" and not "opensource" library?

21
SFML projects / Re: Remnants of Naezith is now on Greenlight!
« on: May 28, 2017, 09:20:35 am »
But soon that system will be replaced with Steam Direct. Not sure if we have more details on the price model by now.

I know this is OT, but for those who are interested - the fee for putting your game on Steam Direct is probably going to be anywhere between $100 - $5000 per game (as opposed to $100 per dev account on Steam Greenlight). See here.

22
General / Re: How to make game logic independent of fps?
« on: May 21, 2017, 03:15:30 pm »
Famous article about this topic: http://www.koonsolo.com/news/dewitters-gameloop/

23
Graphics / Re: Pixel perfect collision detection or is it needed?
« on: May 11, 2017, 04:59:40 pm »
If you're just starting out with collision detection, I would surely go for AABB first, followed by oriented bounding boxes.

24
Graphics / Re: Pixel perfect collision detection or is it needed?
« on: May 09, 2017, 07:07:33 pm »
Thanks for the reply!

That might work for most of the part. However, I was thinking of using similar environment to Worms games. So that means there will be lots of curvy shapes. As far as I know, SAT is not suitable for curvy shapes.
That's true, curvy shapes are a problem for SAT.
I was actually trying to explain what I've been thinking here but I found out that it's too difficult without using any demonstration images. Anyway, I was able to implement a semi-pixel-perfect collision detection test and by that I mean I can check if a sprite boundaries is colliding with a pixel of another sprite. So it is like one-way pixel perfect collision detection. I still have some problems and some ideas how to solve them but I'll get back into them after I've drawn some pictures to demonstrate the problems.

Again, in pixel-perfect, detecting a collision is not the hard part. What you do with it is the hard part.

25
Graphics / Re: Pixel perfect collision detection or is it needed?
« on: May 08, 2017, 03:36:56 pm »
I would actually go for AABB/SAT combo. I am pretty confident that based on what collision polygon masks you're going to use, SAT will be unnoticeable compared to pixel-perfect.

Almost every collision system is composed of 2 parts:
  • collision detection - finds out which objects collide and what are the collision points
  • collision resolution - determines what velocity/acceleration should the colliding objects be given and how should be the objects moved

26
Graphics / Re: Pixel perfect collision detection or is it needed?
« on: May 08, 2017, 02:05:57 pm »
Premature optimization is the root of all evil.

If you are more comfortable with pixel-perfect implementation, but are afraid of its performance, then implement it and go test it. There's no better advice than this.

Having said that, I have never implemented pixel-perfect collision detection. That's because even though it's easy to implement, I never really grokked how pixel-perfect collision resolution was easy to implement. IDK, maybe it's just me, maybe it's because I have stumbled upon SAT in the process.

So, if AABB/oriented AABB and pixel perfect are out of question, I suggest you to have a look at SAT. It works on any convex polygons AND it's really fun to implement. (You will need to decompose your concave polygons into convex ones though).

27
General / Re: Smart Moving Problem
« on: May 07, 2017, 11:36:04 am »
I would like to point out that ship velocity and ship rotation are 2 different things in the real world. So you should separate them in your model as well.

As you may have noticed, I am not a big fan of posting production-ready code. I will rather guide through the process, giving you hints and nudges to the right direction ;-)

Firstly, the ship rotation. You change it with Left and Right keys. For that purpose you can use for instance sf::Transformable::rotate(angle)
ship.rotate(dt*omega);
(Note that this is a bit of oversimplification, as in the real world you rotate yourself using your side thrusts or similiar, but for your purposes, I believe it suffices)

Secondly, there's ship velocity which you should store as a 2D vector. You change it with Up and Down keys. In code, this is achieved by adding the ship acceleration to its velocity every frame Up and Down keys are pressed down:
ship.velocity += ship.acceleration
I see what you're saying - how do you get ship.acceleration?
Out of the ship angle, obviously (using sf::Transformable::getRotation()).
OK, you say, but how exactly?
Well, this is when vector math kicks in. I'll leave you here with this SO post.

Note: GameBear posted de facto the same solution, I just hadn't noticed before he made me aware of it :)

28
General / Re: Smart Moving Problem
« on: May 07, 2017, 08:57:17 am »
I am a bit confused.

In your model, what happens when you press Left key for an infinitely long time? Does the ship go round in a circle or does it go parallel with the y axis?

29
General / Re: Smart Moving Problem
« on: May 06, 2017, 10:58:08 pm »
I am sorry if it sounds harsh, it wasn't meant to be harsh, just bold, because it can save you a lot of time.

As to the vector rotation, you actually may not need it. What are you trying to achieve?

30
General / Re: Smart Moving Problem
« on: May 06, 2017, 02:03:40 pm »
Ok, I've readed wolffire all 3 parts, but I don't have any how to put it in my code.I tried and atan2 but it returns 0(sprite.rotate(angle) doesn't move it, I did a cout << angle and it said 0)

I feel like I am repeating myself, but I'll tell you anyway. If you don't know the vector math, don't bother yourself with the programming.
Go through this instead: https://www.khanacademy.org/math/precalculus/vectors-precalc

Pages: 1 [2] 3 4 ... 7
anything