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

Pages: [1] 2
1
SFML projects / Ultimate Zombie Fighters
« on: September 13, 2010, 09:21:46 pm »
Thanks for the reply! I hope the source code wil help me to learn Box2D =)
Thanks again and Good Luck! =D

2
SFML projects / Matrix - Cool Slide
« on: September 07, 2010, 07:39:28 pm »
Yeah, everything works, nice stuff! =D

3
SFML projects / Matrix - Cool Slide
« on: September 07, 2010, 07:38:13 pm »
Going to try it out now =)

4
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 06, 2010, 09:17:20 pm »
To Finn
Yeah, it isn't different, just more complete, but still, this kind of movement isn't that natural... So, i hope A* looks more realistic... I've spent my free time today on Perfect Pixel Test comparing =)

Also, could you give me an exe or source code for your project, i'd like to test it on my configuration and see what is framerate in your game with Perfect Pixel Test(You can see framerate in some tests for the project i'm developing at the end of page 2). Please, post it here, or PM me, or just do not do that if your game isn't open-source.

And Good Luck =D

5
SFML projects / Matrix - Cool Slide
« on: September 06, 2010, 08:27:45 pm »
Yeah, i can not do that too.

6
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 06, 2010, 08:26:48 pm »
Tested my collision algorithm and perfect pixel test(both with 17 objects, each is made of 2 sprites) in 2 modes:

A test: only 1 object moves and collides in every possible way(constantly)
B test: 1 object moves and collides in every possible way(constantly), other ones are just rotating and several colliding a little

My collision algorithm
A test: 650 FPS
B test: 350 FPS

Perfect pixel test
A test: 320 FPS
B test:  90 FPS

So, pixel perfect collision test is more expensive, but it is very sharp!
But I'm not sure if it is good framerate(in perfect pixel test). The framerate should be faster on such games as i'm developing(tested with GeForce 9600 GT,  a little more than 3 GB RAM,  core 2 Quad 2,5 HHz processor, 1024*768 windowed) what could you say?

7
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 06, 2010, 06:49:01 pm »
That's cool thing!, may be i shall retest my algorithm with Perfect Pixel test or change it a little =)

8
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 06, 2010, 06:42:28 pm »
To Finn
So, your algorithm is:
Quote from: "Finn"
For avoiding objects just do something like:
Save the direction the sprite is moving,
Check if the enemy is colliding with any object.
(for example the sprite is colliding with an object and moved right-->)
Check if the player is higher or lower then the enemy. If the player is above move up, then right. If colliding move up again and then right. As long as you're not colliding anymore. Then you can go on normal movement

and it'll work in this case(E - Enemy, P - Player, O - Obstacle):

Code: [Select]

       P

   O
  EO  
   O
   O


but what to choose if E.Y == P.Y, how to choose what's better(faster) - to move up or down?
Code: [Select]


   O
  EO  P
   O
   O




or what to do if Enemy is surrounded? He can't move right, so he tries up or down, but if the are blocked?
Code: [Select]



  OO
  EO  P
  OO



I can suggest something like this for Enemy movement:
Code: [Select]


R) If right is not blocked
move right

A) If right is blocked
 move up(down) (choose randomly or depending on Player's position)
 then make check and select R or B

B) If chosen up(down) blocked
 try down(up)
 then make check and select R or C

C) If both up and down are blocked
 move left and move up(down)
 then make check and select R or B

Repeat it until we can use R


So it is only for "move right" check, there should be made 3 more check for the other 3 directions, i'm not so sure, but i think this code is ok for such kind of "trap"(and its variations):

Code: [Select]


   OOO
     O
     OOO
      EO  P
      OO
      O
     OO



But still it doesn't look so natural( that's why i'm going to read about A*), the Enemy would look not so smart, he should avoid this "trap", without this "research".

Should be it is hard to understand what i'm trying to say about my algorithm,but if you try to track Enemy's path yourself in your mind it could help.


To Xorlium
You said A* is good... I checked Boost.Graph link, there is enough code...so, i think first i'll read about A* in my book and try to understand if it is really good for kind of game i'm developing.

So, you tested my program(special thanks), could you tell me:
1)will A* work if different object have different sizes?
2)will the be be able to avoid each other and obstacles?
3)how many objects' pathfinding is optimal for A*?
Sorry for that many questions again =)

Thanks for the help and good luck, everyone =D

9
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 10:21:33 pm »
If you mean this algorithm:
Code: [Select]

if(X_Enemy > X_Player)
    Enemy.Move(-Speed,0);
else
   if(X_Enemy < X_Player)
    Enemy.Move(Speed,0);

if(Y_Enemy > Y_Player)
    Enemy.Move(0,-Speed);
else
    if(Y_Enemy < Y_Player)
    Enemy.Move(0,Speed);

then movement will be not so natural: Enemy will move in diagonal way and when objects' X or Y are equal it will move straight.


I think it would be better to use something like:
Code: [Select]

if(needToMoveCloser)
{
  angle=getAngle(Enemy, Player);

  Enemy.move(speed*time*cos(angle), speed*time*sin(angle));
}

Then Enemy will directly follow Player.


But still, it doesn't allow to avoid obstacles... also, do you use Perfect Pixel Collision in your RPG? Doesn't it eat too much framerate?

And thanks for support, everyone =D

10
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 10:01:26 pm »
SFML 2!?
I thought 1.6 is the latest, and i'm using 1.5 currently.

Also why did you change if to while?

An about this freezing:
I guess that if you put one of objects inside another one the program tries to move them from collision positions and goes into infinite loops, should be it is because of my collision detection idea, if one object never was inside another one he won't get there because collision won't allow.
There are some ways to solve that bug, but i'm not sure if such or similar method of object palcing will be used, so i leave it for now =)

11
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 09:09:33 pm »
Here is the source code, i hope i sent all the required files:
http://www.megaupload.com/?d=R2DK88SO

Any comments on code are welcome =)

And it looks like megaupload works only time to time, so... any suggestions on what to use for file sharing?

12
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 08:14:57 pm »
Oh, yes, it's for windows, i'm sorry... btw how can i set my MVC 2008 to make Linux builds?
And what link worked for you?
Sorry for an avalanche of questions and thank you! =D

Edit: accidentaly double posted, sorry, can i delete the post?
there was a checkbox with delete option...or no?

13
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 08:14:55 pm »
Oh, yes, it's for windows, i'm sorry... btw how can i set my MVC 2008 to make Linux builds?
And what link worked for you?
Sorry for an avalanche of questions and thank you! =D

14
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 07:40:06 pm »
Construct on the fly...hmm I'll read an article from my book about A* and then re-read your message =)
Thank you very much for reply, you gave me some inspiration! =)

Quite stragne, i uploaded the file 3 times but still it gives the same link...
http://www.megaupload.com/?d=SVXK2A31

Here is a rapidshare link, but looks like server is overloaded atm
http://rapidshare.com/files/417254555/The_First_Real_Project_v_0.0.6.rar

So, what's better for file hosting? =)

15
SFML projects / Hello, I'm new here... my first project and my questions
« on: September 05, 2010, 06:55:49 pm »
I got some material about the A* a few days ago when started to search for algorithms, started to read, but looks like it is good only for tile based environments... or no? :roll:

So will it work with continuous environment(i use such type in my project) or is it worth to make my project tile-based?
Is it good for real time game?
Is it good for kind of project i'm working on?

You can run the project if it'll help to answer, here is the link from the 2nd post:
http://www.megaupload.com/?d=SVXK2A31

Thanks in Advance =D

Pages: [1] 2