[Help Wanted] "The First King" - FPS game. PRE-ALP

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

HI, I'm happy to announce that we will be 3 developper now, working on this project. The new member will work to port to a Mac version and will surely help me in some of the coding. :)
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, just to give a small update on the current project.

I'm working now on the player/camera system. The current FPS have some feature but not all the features I would like to use.

I'm now reading, and trying to figure out the source (Irrlicht current FPS Camera source) How it was created and (with good sugestions from this forum) will try to adapt that source and create 2 new animators.

A mouse rotate animator: this will rotate the node depending on the mouse position

A keyboard move animator, this will move the node based on keyboard inputs. Movement will be relative on the node position/rotation.

I'm working also to make thoses included in files and in classes. So it will be easily usable even outside this project.

Once I have the thing working, I plan to post it on the Snippet code section of this forum.

The work will take some time, I'm still mostly beginning in C++ and math's are not my strong points. So if any would want to help me about this, it would be appreciated. But I will still work on it even if no help.

I'd have got excellent cue so far on how to proceed about this. That's a great way to learn anyway.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Yay, more programming.

I would be willing to help you with these things, as it turns out that I am also working on (not an animator) rotating the node based on the movement of the mouse.
TheQuestion = 2B || !2B
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Thanks Halifax!

Here is a good code sent by Bitplane to start a new animator using the events receiver (Thanks Bitplane!)

Code: Select all

class MyAnimator : public ISceneNodeAnimator, public IEventReceiver 
{ 
public: 
   // animator methods- 

   virtual void animateNode (ISceneNode *node, u32 timeMs) 
   { 
      if (!node || node->getType() != ESNT_CAMERA) 
         return; // only works on cameras 

      ICameraSceneNode *camera = (ICameraSceneNode*)node; 

      // do stuff with your camera here 

   } 

   virtual ESCENE_NODE_ANIMATOR_TYPE getType() const 
   { 
      // if anyone asks, this is a 'walk' animator 
      return (ESCENE_NODE_ANIMATOR_TYPE)MAKE_IRR_ID('w','a','l','k'); 
   } 

   // methods for event receiver 

   virtual bool OnEvent (const SEvent &event) 
   { 
      // respond to events here, and return true if you acted on the event 

      return false; // otherwise return false 
   } 
}; 
-----------------------------------------------------------------------------
This part comes from the FPScamera from the IRRlicht source code for 1.4. We will have to try to adapt this in the Biplane code:

This not all of the source, but that part specificaly use the mouse and keyboard to move the vector manipulation for the camera node. It seem to calculate the mouse position to affect a vector that will affect the TARGET of the camera. I'll also check how the Rotate animator is done.

Code: Select all

void CCameraFPSASceneNode::animate( u32 timeMs )
{
	const u32 camIsMe = SceneManager->getActiveCamera() == this;

	if (firstUpdate)
	{
		if (CursorControl && camIsMe)
		{
			CursorControl->setPosition(0.5f, 0.5f);
			CenterCursor = CursorControl->getRelativePosition();
		}

		LastAnimationTime = os::Timer::getTime();

		firstUpdate = false;
	}

	// get time. only operate on valid camera
	f32 timeDiff = 0.f;

	if ( camIsMe )
	{
		timeDiff = (f32) ( timeMs - LastAnimationTime );
		LastAnimationTime = timeMs;
	}


	// update position
	core::vector3df pos = getPosition();	

	// Update rotation
//	if (InputReceiverEnabled)
	{
		Target.set(0,0,1);


		if (CursorControl && InputReceiverEnabled && camIsMe )
		{
			core::position2d<f32> cursorpos = CursorControl->getRelativePosition();

			if (!core::equals(cursorpos.X, CenterCursor.X) ||
				!core::equals(cursorpos.Y, CenterCursor.Y))
			{
				RelativeRotation.X *= -1.0f;
				RelativeRotation.Y *= -1.0f;

				RelativeRotation.Y += (0.5f - cursorpos.X) * RotateSpeed;
				RelativeRotation.X = core::clamp (	RelativeRotation.X + (0.5f - cursorpos.Y) * RotateSpeed,
													-MAX_VERTICAL_ANGLE,
													+MAX_VERTICAL_ANGLE
												);

				RelativeRotation.X *= -1.0f;
				RelativeRotation.Y *= -1.0f;

				CursorControl->setPosition(0.5f, 0.5f);
				CenterCursor = CursorControl->getRelativePosition();
			}
		}

		// set target

		core::matrix4 mat;
		mat.setRotationDegrees(core::vector3df( RelativeRotation.X, RelativeRotation.Y, 0));
		mat.transformVect(Target);

		core::vector3df movedir = Target;

		if (NoVerticalMovement)
			movedir.Y = 0.f;

		movedir.normalize();

		if (InputReceiverEnabled && camIsMe)
		{
			if (CursorKeys[0])
				pos += movedir * timeDiff * MoveSpeed;

			if (CursorKeys[1])
				pos -= movedir * timeDiff * MoveSpeed;

			// strafing

			core::vector3df strafevect = Target;
			strafevect = strafevect.crossProduct(UpVector);

			if (NoVerticalMovement)
				strafevect.Y = 0.0f;

			strafevect.normalize();

			if (CursorKeys[2])
				pos += strafevect * timeDiff * MoveSpeed;

			if (CursorKeys[3])
				pos -= strafevect * timeDiff * MoveSpeed;

			// jumping ( need's a gravity , else it's a fly to the World-UpVector )
			if (CursorKeys[4])
			{
				pos += UpVector * timeDiff * JumpSpeed;
			}
		}

		// write translation

		setPosition(pos);
	}

	// write right target

	TargetVector = Target;
	Target += pos;

}
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Project update:

Had good new today. JP has started working on the AI implementation of the game. He sent me a little demo showing a character walking around random waypoints.

This system will be integrated when the AI phase will begin. Thanks JP!
I'm still working on the animators to replace the FPS Camera.
diagdave
Posts: 2
Joined: Sun Dec 02, 2007 1:26 pm

AI

Post by diagdave »

I'd love too see how your Ai works when its dun, thats wher im realy stuck.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

JP is working really hard on this. We are planning to make this system also usuable on other project.

JP is even thinking to start a project for this, because from what we see now, we'll need IRRedit to define the WAYPOINTS for the AI. It would make sense that a plugin or a technique be used with IRRedit to create those for the levels I'll create.

JP will surely come back with some news soon. For my part, I'm working on my side on 2 animators for a "player with a Camera" and not only a FPS camera.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

The latest news on the AI is that i have a pretty simple starting demo to show off the progress thus far.

I've had the last week off work to work on this and i've not made as much progress as i'd hoped but hopefully i'll still be able to work on it on weekends and some evenings (i don't usually have time though!).

What i'm going to now is do some finishing touches to it so that you folks can have a play around with it and see what we're doing here and maybe make any suggestions for how things could be done differently. So i'll be making a post with the demo hopefully today or tomorrow.
Image Image Image
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi. I finally was able to re-create the FPS Camera control. It still need some work. But now, it look and work about the same as the IRRlicht FPS one (including JUMPING).

Learned lots of things with vector math and matrix operation. This was very instructive. I wish to thank Arras for his Camera code (finally understood how matrix rotation worked from that example) and the original developper of the FPS Camera.

I've updated the project and replaced the IRRlicht FPS camera with that one. The current code is currently ugly but it work. I will be able to add more functions and/or create specific animators that I planned to do.
EDIT: Added a SHIFT function that allow the player to run and jump farther. Releasing the SHIFT and the player walk. (Jumps are smaller also)
Last edited by christianclavet on Fri Dec 14, 2007 7:38 pm, edited 1 time in total.
FuzzYspo0N
Posts: 914
Joined: Fri Aug 03, 2007 12:43 pm
Location: South Africa
Contact:

Post by FuzzYspo0N »

this is good work guys keep it up ;)

glad to see perserverence. ill get involved at a bit of a later stage when i have more time (in terms of graphics and mapping, art work etc)

:)
Ivo Georgiev
Posts: 27
Joined: Wed Dec 12, 2007 7:05 pm

Post by Ivo Georgiev »

It seems a good game, but in the moment i cant download it...upload it as a .zip file, not 3 files...I've downloaded the game exe, the Irrlicht dll, but I cant download the level file...
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Sorry, Ivo. The game is still in pre-alpha stage.

We're working extensively on the code. No level has been yet created for it. I'm using my Demo Level to test the engine for now.

Once the alpha stage will start (will start also the modeling for the level). The game will be completely downloadble.

For now, there is only the source code that is new. The modeling is the same as my level demo.
Nadro
Posts: 1648
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Post by Nadro »

Project looks very interesting:) What shaders You have added to this project?:) Graphic will be similar to realistic world, fable world etc.?
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, Nadro.

I was thinking of using yours! :) Your CG Binding look very interesting. I will need a good shader for normal and specular maps. By the way, how is the lighting defined when you use shaders (never used them before).

My first idea is to use Gile[s] to pre-render the lighting in a Lightmap. Does a shader exist that combine, lightmap, normal maps, and specular map? Or do the lighting is done "real time"? Since I've planned to have actual pyramid, they will not be clean. Theses are ruins now. Will need a lot of details, and was hoping to get the detail with normal maps and specular maps.

Yes, the planned graphic design will be based on actual pyramids (Kefren, Cheops...) and on some reconstitutions of a Sumerian City (Will mostly look like Babel). In the planning phase, I took the time to get lots of references for this. Even found a old document on the net that was draw in 1936 that show tunnels under the pyramids that interconnected themselves with the sphinx and get to the Osiris tomb... :)

I will try do the best I can so that it look realistic. The objective is that it will look even more realistic than my level demo (used only the IRRlicht basic surface there, not shader)
Ivo Georgiev
Posts: 27
Joined: Wed Dec 12, 2007 7:05 pm

Post by Ivo Georgiev »

Tip from me: Never, ever post projects in pre-alpha stage.People will know what to expect and they won't be surpised....
Post Reply