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

Pages: [1]
1
General / Re: Screen not drawing on some computers?
« on: September 10, 2014, 08:05:07 pm »
it's working very nice here, and hey, i loved it. The art reminds me of isaac too, but you made a very original gameplay, it was very fun.

2
General / Re: Is it an inefficient way of making collisions?
« on: September 10, 2014, 02:25:35 am »
Thank you ixrec and jesper, with your help i was able to implement the fixed timestep and it is working very well. I've made a little recording to see if it was really working =).



on the left it's rendering without fps limit and at the right, i've limited it to 10fps.

3
General / Re: Is it an inefficient way of making collisions?
« on: September 07, 2014, 06:51:14 pm »
Thank you guys. I will surely read Glenn Fiedler's articticle and about rect methods again.

Concerning the shape sizes listing, this was just an lazy example code that i did for this post, i'm not really using it in my game like this, i made a function and a template for that one.

About the center coordinate and the "pre-collision-check", hey, good tip, haven't tought about that, thank you!

4
General / Is it an inefficient way of making collisions?
« on: September 07, 2014, 06:18:49 pm »
Let's say we have 2 rectangle shapes: shape1 and shape2, i want to test the collision between them and do different things when each side of shape1 touch the other side of shape2.

i was thinking in an easy way of doing it, and ended with something like this:

    sf::RectangleShape shape;
        sf::RectangleShape shape2;
        shape1.setSize(Vector2f(50,100));
        shape2.setSize(Vector2f(500,50));
        (. . .)

        in the game loop:

        //shapes bottom
                s1b = shape1.getPosition().y + 100;
                s2b = shape2.getPosition().y + 50;
                //shapes top
                s1t = shape1.getPosition().y;
                s2t = shape2.getPosition().y;
                //shapes right
                s1r = shape1.getPosition().x + 50;
                s2r = shape2.getPosition().x + 500;
                //shapes left
                s1l = shape1.getPosition().x;
                s2l = shape2.getPosition().x;

                //shapes are coliding?
                if(s1l <= s2r && s1r >= s2l && s1t <= s2b && s1b >= s2t){isColiding = true;}else{isColiding = false;}

                if(isColiding)
                {
                        if(s1b <= s2t + 10)//is shape1 on top of shape2?
                        {
                                spd.y = 0;
                                shape1.setPosition(shape1.getPosition().x, shape2.getPosition().y - 100);
                                std::cout<<"is on top" << std::endl;
                        }
                        else if(s1t >= s2b - 10)//is shape1 top hitting shape2 bot?
                        {
                                spd.y = speed;
                                shape1.setPosition(shape1.getPosition().x, shape2.getPosition().y + 50);
                                std::cout<<"is touching bottom" << std::endl;
                        }
                        else if(s1l >= s2r - 10)//does shape1 left collide with shape2 right?
                        {
                                spd.x = 0;
                                shape1.setPosition(shape2.getPosition().x + shape2.getSize().x, shape.getPosition().y);
                                std::cout<<"is touching right" << std::endl;
                        }
                        else if(s1r <= s2l + 10)//does shape1 right collide with shape2 left?
                        {
                                spd.x = 0;
                                shape1.setPosition(shape2.getPosition().x - shape1.getSize().x, shape1.getPosition().y);
                                std::cout<<"is touching left" << std::endl;
                        }

                }

It works, but i think that maybe this is really inefficient, because if shape1 move in a really fast speed for some reason (fps drops,etc), it will most probably miss the collisions. since it depends in a tiny 10 pixels collision check system, won't it?

5
General / Re: Help on Game Peformance
« on: September 04, 2014, 03:50:12 pm »
Quote
You're being rude for no reason

Not rude, just calling it how it is.

Quote
i'm clearly saying that i want to learn it, if i don't use it, i will never learn.

Apparently you didn't get the screwdriver example. To make it clearer, binary1248 said the same thing in different terms.

Quote
Learning is a good thing. Learning the wrong way is bad.

I got your example and i can associate it with binary1248 aswell. It doesn't mean that i'll follow it straight, but i respect it as an superior programmer friendly advice and will alway keep it in my mind. Personally, i've learned guitar the wrong way, painting the wrong way, animation the wrong way, music composition the wrong way, piano the wrong way (english the wrong way, lol) and i will most likely to learn programming the wrong way, because it's my nature to study and try everything by myself. Still, today i can make animation, music and painting, i've made a lot of mistakes, but now i don't repeat them, because i've seen them, and now i know how to handle them.

If i try to put a nail with a screwdriver at the wall, i'll probably see that this is not a good idea, but it is in my nature to give it a try first and see the problems in first hand. I'm stubborn. I hope i wasn't, but i'm.
 
Even if i read all yours and binary1248's arguments, understand and agree with it, i am still going to try multithreading at the game and learn, the hardest way, why it isn't a good idea. ( and i'll probably post my bad experiences here, so you guys can say "see, i told you!" ;) )
You'll probably think that this is a waste of time and it is really stupid by my part, and you're most likely to be right, but, as i said, it's my nature ;D.

I really appreciate your advices, i'm sorry if i'm a bit confusing or missunderstood something, my first language is not english, i speak portuguese. i needed to read binary post 3 times to fully understand it, lol;

6
General / Re: Help on Game Peformance
« on: September 04, 2014, 12:33:54 pm »
Thank you binary1248, very enlightening information.

You see, i'm really trying my best to learn, since i didn't take any courses, of course that i'll make a lot of mistakes, but i have no restrictions in exploring and i'll surely give it a try on this list.

7
General / Re: Help on Game Peformance
« on: September 04, 2014, 04:45:04 am »
Whatever... do as you wish.... the person that has no multithreading experience knows better than everyone else... because we obviously know nothing when we tell you something.....  good luck learning anything when you use personal choice as a reason to blatantly ignore advice from people.

Quote
the second loop thread was running at full speed, i just slowed it down and now everybody is getting 60fps.

It is highly unlikely the true nature of the problem was because the other thread wasn't yielding processor time, this most likely is just a fix of the manifested issue, not the root cause.

Quote
Personally, i think multi-threading are amazing tools and i don't see a reason to avoid it.

And screwdrivers are also amazing for putting a nail into a piece of wood.

You're being rude for no reason, i'm clearly saying that i want to learn it, if i don't use it, i will never learn.
If you think that i'll be better without it, you're probably right, but i still want to use it and learn. I'm not saying that i know better than everyone else, i'm saying that use it is my personal choice, and i think that multithreading is a good tool, i want to learn it, excuse me and please don't take it wrongly.

8
General / Re: Help on Game Peformance
« on: September 03, 2014, 10:41:20 pm »
Well, i wanted to use 2 loops as a personal choise, one for animations and other for the game. I think it's better for me to use it and its a good threading training. Personally, i think multi-threading are amazing tools and i don't see a reason to avoid it.

I found the solution, the second loop thread was running at full speed, i just slowed it down and now everybody is getting 60fps.

Thank you guys for the profiler tips, it helped a lot.

9
General / Help on Game Peformance
« on: September 02, 2014, 09:54:25 pm »
Hello!

I'm relatively new in c++ and SFML, last week i've studied a lot and managed to make this simple megaman-like platformer engine, but my friends are having a little issue with the FPS and the game doesn't have almost nothing, just animations, gravity and collisions. The game is set to run at 60fps, but my friend is getting 25~30 fps at his pc, i get 63 fps in mine, but the game is so simple that i can't understand why would someone get 30fps...

the game have only 2 threads at this stage, one for animations, and other for the rest. is this too few for a game?

I've uploaded the source code (with VS2012 build), there's an .exe at the release folder too, so you can test it. would you guys be kind to take a look and give me some advices?

commands are, for now: arrows to move, space to jump, "A" to shoot, "F1" to see the coordinates grid and player hitbox.

https://dl.dropboxusercontent.com/u/9264421/SFML.zip

10
General / Re: Use SFML_STATIC with /MT runtime lib linking
« on: August 27, 2014, 10:19:05 pm »
I could do that in a final release version, but for now, its just for my friends to test an simple executable.

But well.... if there's no alteranative, i can send them the redist installer.
Thank you.

11
General / Use SFML_STATIC with /MT runtime lib linking
« on: August 27, 2014, 08:33:47 pm »
Hello!
I'm making a megaman-like platformer game. It's all doing fine, i have sprites animations, collisions and projectiles and coordinates.
I'm really enjoying SFML!

I'm using visual studio 2012 and everything looks fine...but...

Well, problem is, that when i send the game for my friends to test, they usually miss the MSVCP110.dll because they don't have the C++ redistributable package.

I would like to know if there is any way that i can include the dll to my ".EXE" with "Multi-Thread DLL (/MT)", and still use the static dll's from SFML. i have conflicts when i try to build with the static dll, but it runs fine without it.

12
General / Re: VS2010 Crash with SFML2.1
« on: August 19, 2014, 03:04:07 pm »
Another thing, is there any SFML.net tutorials?

Follow the official tutorials, sure there are a few minor code changes, but everything written there still applies to the binding (that is why it is a binding and not a port ;) ).
Got it! I'll give it a try. Thank you. I'm sorry about the lame questions, slowly i'll be getting the hang of it.

13
General / Re: VS2010 Crash with SFML2.1
« on: August 19, 2014, 02:33:53 pm »
You should probably reinstall Visual Studio.
Yeah i'm doing it right now. I know it was an lame post, but thanks for your support.

Another thing, is there any SFML.net tutorials? I've been using C# a lot and i'm not really excited to getting back to C++ right now.

14
General / Re: VS2010 Crash with SFML2.1
« on: August 19, 2014, 02:16:05 pm »
Oh man, u're right. it's been a while since i've used it with c++. i'm sorry. Anyway, any idea why?

15
General / VS2010 Crash with SFML2.1
« on: August 19, 2014, 01:59:30 pm »
Hi,
I'm using SFML2.1 32bit for VS2010 version (redownloaded it 2 times to make sure).
I've tried both Static and Dinamic versions of the libs.
I've correctly configured it on VS2010 and have no clue of what is happening.
I've recorded an video of the crash to show it.

The program only crashes when i'm writing codes.
I'm also having an "Out of date" warning even on my first build of the project.
Anyone?

Pages: [1]