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

Pages: [1] 2 3 4
1
Graphics / slow frame rate
« on: June 19, 2011, 02:49:03 pm »
Hi,
I tried to implement the water ripple effect using the image manipulation similar to shown in link
The strange thing in it is, when i use a large image like 800X600 or 1024X768 etc the processing becomes very slow.

It happens like its consuming lot of CPU!!! but I dont get the idea why is it happening since the CPU can handle good amount of
calculations at a time. If the pixels numbers are like 1024*768 = 786432 then also it can process it faster!!!!
Then why is it very slow in rendering?????

All suggestions are welcome

2
General discussions / Executable error
« on: June 18, 2011, 01:18:22 pm »
Quote from: "Laurent"
Other computers must install the "VC++ redistributables" package that can be found on the Microsoft website.


that means i need to make it as a installer so that in those system which does not have VC++ redistributables, first it will install that  and then allow them to run?

3
General discussions / Executable error
« on: June 18, 2011, 12:49:42 pm »
Hi,
      I have used sfml 1.6 and created a demo. But when i try to run the executable which is generated in release mode, in some other system for testing. It shows the error
            MSVCP100.DLL IS MISSING

I even tried to keep the msvcp100.dll inside the executable folder but still it does not run...

what can be the reason for it....as i have to make this demo running in other systems too

all suggestions are welcome

4
General / SFML and OPENGL co-ordinate
« on: June 09, 2011, 09:21:56 pm »
Quote from: "Laurent"
It must be done in a derived sf::Drawable class, otherwise you won't get the modelview and projection matrices that SFML uses to draw stuff.


Can you elaborate a little more please!!

you mean
Code: [Select]

class Block : public sf::Drawable
{
  Draw();
}

void Block::Draw()
{
       glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 1.f, 1.f, 500.f);

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

//if the particle is still alive, then draw
glPushMatrix();
glTranslatef((iter)->m_ParticlePosition.x, (iter)->m_ParticlePosition.y, -400.0f);

glRotatef((iter)->m_Angle,0,0,1);
//glScalef(1.0f, 1.0f, 1.0f);
glColor4ub((iter)->m_Color.r, (iter)->m_Color.g, (iter)->m_Color.b, (iter)->m_Color.a);
glBegin(GL_QUADS);
glTexCoord2f(texCoords.Left,  texCoords.Top); glVertex2f(-halfWidth, -halfHeight);
glTexCoord2f(texCoords.Left,  texCoords.Bottom); glVertex2f(-halfWidth, halfHeight);
glTexCoord2f(texCoords.Right, texCoords.Bottom); glVertex2f(halfWidth, halfHeight);
glTexCoord2f(texCoords.Right, texCoords.Top); glVertex2f(halfWidth, -halfHeight);
glEnd();
glColor4ub(255, 255, 255, 255);
glPopMatrix();


}


Is this what u mean???

5
General / SFML and OPENGL co-ordinate
« on: June 09, 2011, 08:22:31 pm »
Hi,
     using Sprite.SetPosition(10,10) will set the sprite at 10,10 from the left top corner.

But in the same window if i use glVertex2f(10.0,10.0)  it will get placed in some other position with reference to the centre of the screen (Opengl)


How to related it, like taking the SFML co-ordinate as reference the Opengl prmitives should also be drawn at the same place. eg

Sprite.SetPosition(10.0, 10.0);   and glVertex2f(10.0,10.0) at the same place

How to make it happen???

All suggestions are welcome

6
General / Application gets slow/stuck
« on: June 09, 2011, 12:58:19 pm »
I am making all the changes as stated and its showing little bit of improvement. I still analysing to see where to optimise the code.

7
General / Time based grid movement
« on: June 09, 2011, 04:24:05 am »
Quote from: "David"
Quote from: "vicer1234"
Quote from: "David"
Sorry, maybe I'm not making this clear

What do you mean one frame at a time, anyways? Like does the main player moves from one tile to another smoothly or does he sorta "teleport" to the tile he moves to?


it moves smoothly


Ah,

So you would move the AI to its destined tiles based just like you would with your player by calculating the direction the AI has to take.

Or you can use something similar to the tween class used in Flash and see what's there (It's doing a smooth movment from one place to another using pure code)


direction...?? suppose the grid location returned is ( 1,2)  its value in pixel will be (1*16, 2*16)    how can i get direction from it??????

8
General / Time based grid movement
« on: June 09, 2011, 03:28:40 am »
Quote from: "David"
Sorry, maybe I'm not making this clear

What do you mean one frame at a time, anyways? Like does the main player moves from one tile to another smoothly or does he sorta "teleport" to the tile he moves to?


it moves smoothly

9
General / Time based grid movement
« on: June 09, 2011, 02:51:59 am »
Quote from: "David"
Quote from: "vicer1234"
Quote from: "David"
Doesn't seem to be any frame restrictions on the AI


can you elaborate a little more on it please!!!!


I'm pretty sure you're implementing GetElapsedTime() in the movement of your main character. But for some reason, it doesn't show up at all for the AI


you mean multiplying the position of ai with the elapsed time?

mp_AiSprite->Move((float) x * 16 * elapsedTime, (float)y * 16 * elapsedTime)

but this makes the position movement incorrect...since (x,y) indicates the grid position in 0,1,2,3....etc format and '16' is the sprite size.so multiplying them i get the pixel position.

if i multiply the time factor then the sprite moves in wrong position as it gets displaced incorrectly.

Is it what you meant to say????

10
General / Time based grid movement
« on: June 09, 2011, 02:23:14 am »
Quote from: "David"
Doesn't seem to be any frame restrictions on the AI


can you elaborate a little more on it please!!!!

11
General / Time based grid movement
« on: June 09, 2011, 02:05:12 am »
Hi,
      I am trying to make a grid based game. I have a 100x100 grid, where i can control my player to move across one slot using key.
The player movement is working well and I can move across the grid ONE FRAME AT A TIME.

The main problem is with AI player movement. I am using A* algorithm to get the path for the AI component. What i am doing at present is:

1) I give the AI player position and the goal position to the A* algorithm and generate the path. ( this calculation is Inside the game Update function )
           The output of the A* algorithm is a string which gives the grid locations.
2) Then inside the draw function when I use a for loop to draw for each grid location, the AI player reaches the goal in split of a second..just within one frame


what i want is that the ai player should move slowly towards the goal ...so that there is a perfect competition between the user and ai to reach the goal.

How to control the movement of  AI player so that its playable enough?????


All suggestions are welcome......

12
General / Application gets slow/stuck
« on: June 08, 2011, 09:35:19 pm »
Does calling  the opengl primitives in between the sfml rendering ...causes any sort of performance issue?

13
General / Application gets slow/stuck
« on: June 08, 2011, 12:31:23 pm »
Quote from: "Nexus"

You have already told that in the other thread. There, I have given you a lot of advice, which you apparently ignore completely, e.g. std::list<Particle> or ++iter. So, I don't know whether suggestions are really welcome.


I haven't ignored those , I have already made those changes in my Particle engine. Sorry for been less patient  :o

14
General / Application gets slow/stuck
« on: June 08, 2011, 11:16:06 am »
'BUMP'

15
General / Application gets slow/stuck
« on: June 08, 2011, 03:50:30 am »
Hi,
     I am making a game with couple of level. each level is represented in terms of states, like we can push and pop each state.

Each level have common functions like
Initialise()->HandleEvents->Update()->Draw()

In one level i am having couple of sprite and I am using sfml functions like Sprite->Move(x,y)  etc to manipulate the entities.

In this level i tried to call function from my particle engine. In the particle engine i have tried to display the particle using opengl primitives. It will look like
Code: [Select]

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(90.f, 1.f, 1.f, 500.f);
std::list<Particle>::iterator iter;
for( iter = mL_Particle.begin(); iter != mL_Particle.end(); ++iter)
{
if((iter)->m_Energy > 0)
{
//if the particle is still alive, then draw
glPushMatrix();
glTranslatef((iter)->m_ParticlePosition.x, (iter)->m_ParticlePosition.y, -400.0f);
std::cout<<(iter)->m_ParticlePosition.y<<std::endl;
glRotatef((iter)->m_Angle,0,0,1);
//glScalef(1.0f, 1.0f, 1.0f);
glColor4ub((iter)->m_Color.r, (iter)->m_Color.g, (iter)->m_Color.b, (iter)->m_Color.a);
glBegin(GL_QUADS);
glTexCoord2f(texCoords.Left,  texCoords.Top); glVertex2f(-halfWidth, -halfHeight);
glTexCoord2f(texCoords.Left,  texCoords.Bottom); glVertex2f(-halfWidth, halfHeight);
glTexCoord2f(texCoords.Right, texCoords.Bottom); glVertex2f(halfWidth, halfHeight);
glTexCoord2f(texCoords.Right, texCoords.Top); glVertex2f(halfWidth, -halfHeight);
glEnd();
glColor4ub(255, 255, 255, 255);
glPopMatrix();
}

}


Couple of problem is happening:
1) The positioning of the particle is not correct.Since in the particle case its using the Opengl co-ordinate with origin at centre of the screen.
2) It gets slow and frame rate decreases ..I dont know why this is happening...Is it because i am using one draw() for smfl related case and another draw() is getting called  for Opengl.????

Everything runs smooth and when i click a button to generate a particle effect it get slower and slower!!!!!


All suggestions are welcome

Pages: [1] 2 3 4
anything