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 - Roose Bolton of the Dreadfort

Pages: [1] 2 3 ... 8
1
Graphics / Re: How to go about creating a bullet class in SFML 2.0
« on: May 28, 2013, 09:40:25 am »
I think your method is wrong to begin with.. rather then checking if your just facing the enemy you should actually fire a bullet entity instead. what I mean is set up a bullet manager class so when you press SPACE it activates a bullet and every frame update its position with the direction vector its traveling multiplied by the speed you want it to travel, and then also test if its colliding with anything. If it is colliding with something, reduce its health by whatever you want.

I would provide you with an example but I am at work at the moment, I will edit this post when I am at home.

2
General / Re: Box2D - The physic body is bigger
« on: May 22, 2013, 12:40:19 pm »
Yup, using DebugDraw is a must if your implementing Box2D with SFML; I used FRex's code which he posted to me a while ago (same as above) and its works like a charm!

3
SFML projects / Re: Space Dash - A very simple space side-scroller
« on: May 21, 2013, 04:45:15 pm »
Played it and I loved it! I am working on a game very similar to this at the moment too  8)

4
Feature requests / Re: Texture ID Accessor
« on: May 21, 2013, 03:52:06 pm »
I came across this problem, the 2 line workaround is okay but I guess a texture ID accessor would be nice to have.. Laurent I will swap you a carton of orange juice for your time to implement it? I can ship it to metz np.

5
General / Re: Classes and SFML
« on: May 21, 2013, 02:01:02 pm »
You should read up a bit on C++ and pointers etc as its a critical part of the language..

but so your not frustrated..

when you pass something by value (what your doing) your making a copy of that object in the function and then when you process functions on that object etc, your applying that to the COPIED object and not the original that you passed in.

if you want to draw it to the original render window that you passed in, you have to pass by reference so;

void bullet::draw( sf::RenderWindow &window_instance ){
    window_instance.draw( bullet_shape );
}
 

This then passes the reference to object you need and doesn't make a copy.

You can also pass by pointer but this is less safe as you can also pass in NULL pointers this way.. but they both have their pro's & con's; I personally pass by pointer because references hide that you are changing data stored someplace else, where as pointers make it very obvious (->)..

it can be quite difficult to grasp when coming from other languages as in most everything is a pointer.. so you have to think less about it

6
What was the problem in the end?

7
People say not to use 'New' or 'Delete' but don't forgot to fully learn about them and about memory management including 'Memcpy' and 'Memset' etc.. as these are all used fluently in the real Games Industry, if you ever go for an assessment day for a job at EA or Sony (and I can tell you from experience) they will completely hack at your low level memory knowledge and wont even care if you know how to use unique_ptr or any of the STL library at that.

8
General / Re: Graphics memory leak
« on: March 21, 2013, 11:27:42 am »
So you generally think that after the thousands of people who used SFML and hundreds of indie games, you have noticed a memory leak no1 else has, and that it might be SFML and not you.

No, SFML doesn't have a memory leak

Your first problem is using CRT as that can cause false positives, use a proper memory detection program like IBM Rational Purify or VLD http://vld.codeplex.com/

9
General / Re: AW: Memory Debugger on SFML
« on: March 15, 2013, 01:58:36 pm »
I've linked it and run some SFML application with it, but I get quite a huge output and always some mem leaks. Not sure if one should trust this.

Maybe you have memory leaks then? ;)

I have never had problems with it and I know lots of people who use it and an indie company.. and it has 34,500 downloads with only 6 star reviews.. would be surprised if all along it didn't work.. maybe all the people are dumb dumbs. :P

http://stackoverflow.com/questions/25730/what-is-the-best-free-memory-leak-detector-for-a-c-c-program-and-its-plug-in-d

stackoverflow seem to love it too!

10
General / Re: Memory Debugger on SFML
« on: March 13, 2013, 11:35:54 am »
You are sure its running correctly?

Does it say in your console window thats its activated correctly?

11
General / Re: Memory Debugger on SFML
« on: March 10, 2013, 08:52:17 pm »
Use this

http://vld.codeplex.com/

honestly the best 1 I have ever used, not had 1 single false positive yet!

Just link it to your project and

//Include MemoryLeak Detector.
#if _DEBUG
        #include <vld.h>
#endif
 

12
General / Re: SetFrameRate/VertSync?
« on: March 05, 2013, 02:41:20 pm »
Quote
If I only Cap the game as the VertSync then different screens will run the game faster which will mess up movement and physics simulation.
Yeah... that's why I said (3rd time):

Quote
make all your logic depend on the elapsed time

And in case it's not clear, I mean the actual elapsed time, not 1/60.

By that, do you simply mean movement * ElapsedTime ?

13
General / Re: SetFrameRate/VertSync?
« on: March 05, 2013, 02:12:15 pm »
Quote
Box2D should have its own fixed timestep algorithm internally, don't worry about it.
It doesn't, you need to call step x times a second or you'll get choppy simulation.
It should work great with SFML clocks on 60 fps. I don't know what OP is doing wrong.
I mean, 60 updates a second and going for 60 fps, so even if fps drops there will be 60 updates per second. That's what box user manual says.

I am not doing anything wrong, I am just needing advice. As I said, I run FrameRateLimit and VertSync together and it runs perfectly, without VertSync my get stutters slightly which looks horrible and I need a FrameLimit just so I know the update speed...

If I only Cap the game as the VertSync then different screens will run the game faster which will mess up movement and physics simulation.


14
General / Re: SetFrameRate/VertSync?
« on: March 05, 2013, 11:44:37 am »
I don't necessarily need a completely accurate timestep.. although I am using Box2d...

So basically I am going to need to cap the updates to a fixed timepassed? A bit like this article - http://www.koonsolo.com/news/dewitters-gameloop/

So that means I am going to have to change all my draw code so it implements interpolation?

ARGH WHEN DOES IT END. haha

15
General / SetFrameRate/VertSync?
« on: March 05, 2013, 11:02:24 am »
So I was happily making my game,

I set the framerate limit to 60 which makes it easy for me to build my game around as I wanted to make it perform at a steady 60 fps on all machines so I knew what my update speed was going to be.

When I was adding Box2D and working on the new stuff, I noticed that there was a slight stutter in the movement of the player which made it look terrible.

I stuck VSync on and this fixed the problem completely and all looked amazing.

However; I have heard that using both of them together is a big 'No'.. so what should I do?

Pages: [1] 2 3 ... 8