community attempt at multiplayer

Programming Reality Factory and Genesis3D.
Post Reply
User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

community attempt at multiplayer

Post by scott » Thu Jun 29, 2006 9:23 pm

i realy think that multiplayer would be an exelent addition to RF, RF is good but is behind in this area... as some of you may know there is simple multiplayer of viewing another person in the same level, i belive that this has been successfuly implimented into the engine but only alows for one other player to join at the moment.

so now all that needs to do is send collision of bullets and atribute change.

this is already done in other parts of code such as player i belive as there has to be colision detection for player and enemy bullets, thus i belive copying paart of code and changing part of code will successfuly intergrate multiplayer

for this reason i think people from the community would be able to do this and i would love to help in any way i can.

im no programmer but im taking an educational guess that this may be the code handeling amount of players.

Code: Select all

//	ServerClientCycle
//
//	This is the Server and Client processing
//
//	this function is called every 0.05 second from the Windows Timer
/* ------------------------------------------------------------------------------------ */
void NetPlayerMgr::ServerClientCycle()
{
	// Server for receiving and redistributing information
	if(isServer && !serverstop)
	{
		// if not full then check for new connection
		if(clientnum<(MAXPLAYERS-1))
		{
*(MAXPLAYERS-1))

change this to a higher number more players?

i think if we put our minds to it a group effort could actualy complete multiplayer as i dont think that too much hard work has to be done, it may seem hard work for us non-programmers but lets give it ago! :D

im sure many of people including yourselfs would be greatful for it and i dont think its fair relying on other people to do work for us so do it ourselfs i say.
*GD*

User avatar
LtForce
Posts: 437
Joined: Wed May 03, 2006 11:15 am
Location: Vilnius, Lithuania

Post by LtForce » Fri Jun 30, 2006 4:15 am

Yeah, multiplayer would be cool and that would be really nice for my game because it's like a MMORPG right now(there are 4 sides: Elves, dwarfs, undead and vampires) and I think it will be boring without multiplayer.
Lithuanians for Georgia!

User avatar
steven8
Posts: 1487
Joined: Wed Aug 24, 2005 9:08 am
Location: Barberton, OH

Post by steven8 » Fri Jun 30, 2006 4:27 am

I believe that bit of code reads:

If Client Number IS LESS THAN Max Number of Players MINUS One - look for a new connection.

QOD would have answer for sure, but I think it doesn't mean that maxplayers = one.

User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

Post by scott » Fri Jun 30, 2006 12:57 pm

yea sorry about that, i think so aswel, i looked at the code first time last night and then realised when thinking about it this morning, i was thinking why would there need to be a minus sign infront of the number one... i will have another proper look, i think printing it out and making notes would help aswel.
*GD*

User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

Post by scott » Sat Jul 01, 2006 12:39 am

looking at it at the moment im thinking this is the code that collects the data on the player and then checks to see if it has changed and if so it udates the server.

keep in mind it is late again but im bored and want to get multiplayer going

Code: Select all

//	BuildPlayer
//
//	put player info into buffer
/* ------------------------------------------------------------------------------------ */
void NetPlayerMgr::BuildPlayer(NetBuffer *Buff, int index, int Id)
{
	Buff->Add(Id);
	Buff->AddString(Player[index]->ActorName, strlen(Player[index]->ActorName));
	Buff->Add(Player[index]->BaseRotation);
	Buff->Add(Player[index]->localRotation);
	Buff->Add(Player[index]->localTranslation);
	Buff->AddString(Player[index]->Animation, strlen(Player[index]->Animation));
	Buff->Add(Player[index]->AnimTime);
	Buff->AddLen();
}
this seems to enter information about the player into the buffer ready for transfer


this seems to be an update for the client to send to the server but im confused to this as there was the serverclientcycle code that seems to update every 0.05... could this be the update of the buffer and then the serverclientcycle code update the client and server? im getting confused, mabe some will tell me what this code is for :D

Code: Select all



//	ClientUpdate
//
//	check if client needs to send update to server
/* ------------------------------------------------------------------------------------ */
void NetPlayerMgr::ClientUpdate()
{
	// see if client has changed from last update
	int index = GetIndexFromId(PlayerId);

	// check rotation and position against last updated info
	CCD->ActorManager()->GetRotate(CCD->Player()->GetActor(), &Player[index]->localRotation);
	CCD->ActorManager()->GetPosition(CCD->Player()->GetActor(), &Player[index]->localTranslation);
	
	bool flag1 = geVec3d_Compare(&Player[index]->localRotation, &Player[index]->oldRotation, 0.0f);
	bool flag2 = geVec3d_Compare(&Player[index]->localTranslation, &Player[index]->oldTranslation, 0.0f);
	
	// see if animation has changed
	bool flag3 = !strcmp(Player[index]->Animation, CCD->ActorManager()->GetMotion(CCD->Player()->GetActor()));
..........

my thoughts so far areto send information on weapon firing as they have the direction of fire from the player right?


i also have a question.
does the current multiplayer show deaths if suicidel? as this means that all that will need to be done is to get it to recognise weapon fire and the server can determin if it was a hit or not and then update the clients.

it seems like the major coding behind multiplayer is there it just needs some tlc from someone and it will be perfect so any help would be apreciated :D comeon you coders give a few days to this problem, mabe its easier than you thought.
*GD*

User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

Post by scott » Sun Jul 02, 2006 10:44 pm

well i havnt had a chance to look at the code since my last post but i have a theory why when multiplayer was created that only the players position was sent. this is because this is a set data name all the other data is set by variables such as name of the atributes such as helth, this called be called anything.

so due to the nature of RF where everything can be modifide the only way round this is to have it in the entities list and then in scripting tell it exactly what atributes need to be sent such as health, stamina, defence power or what ever atribute is being effected.
*GD*

User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

Post by scott » Mon Jul 17, 2006 8:26 pm

ive just got back from holliday and is wondering if anyone has looked over the code.

jonas i remember you saying that you have looked at the code and that you need a compiler, what exactly do you need to compile it, im thinking something like visual basic? or is it something else?
*GD*

User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR » Mon Jul 17, 2006 10:22 pm

Visual C++ 6 Professional or Enterprise.

User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

Post by scott » Mon Jul 17, 2006 10:28 pm

would vb.net work too? as it part c++ if i rmember corectly.
*GD*

User avatar
AndyCR
Posts: 1449
Joined: Wed Jul 06, 2005 5:08 pm
Location: Colorado, USA
Contact:

Post by AndyCR » Mon Jul 17, 2006 11:57 pm

No. Visual basic has little relation to C++ except that it is a programming language, and it is also made by microsoft. .Net also indicates that it is too new a version even if it would have worked otherwise, which it would not have.

MakerOfGames
Posts: 866
Joined: Fri Jul 08, 2005 4:27 am
Location: PA, USA

Post by MakerOfGames » Sun Sep 03, 2006 12:31 am

So what exactly works in multiplayer currently? From what I hear, you can start a game and you and others can move around and thats it.

Are any aniamtions shown by the other players?

Edit: I wonder if anyone will read this post in this dead thread... :P
Think outside the box.
To go on an adventure, one must discard the comforts and safety of the known and trusted.

User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas » Tue Sep 05, 2006 12:34 pm

I never did sit down and write code, I didn't really cherish the idea of having code I couldn't compile every 10 seconds if I wanted to. I did sit down and trace the all the functions of multiplayer. Now that the code has been cleaned up a bit I might try looking into it again.
Jonas

Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack

User avatar
federico
RF Dev Team
Posts: 443
Joined: Tue Jul 05, 2005 3:14 pm
Contact:

Post by federico » Tue Sep 05, 2006 12:48 pm

My question is: can you join a multiplayer session and see the other player moving around the level or can you only see it standing still at the level start ?
This makes a big difference. If you can have the updated player position you can have at least the three numers of the coordinates passing to the net.
(I think I could implement multiplayer of my old chess game using these numbers...).

User avatar
jonas
Posts: 779
Joined: Tue Jul 05, 2005 5:43 pm
Location: Texas, USA
Contact:

Post by jonas » Tue Sep 05, 2006 2:55 pm

See that's the thing it doesn't pass hardly any info to the other person.
we need to send accross current animation, position, current health, dead or alive(if dead what position is the dead body), ammo, weapon in hand, and ect. Which I think could be added fairly easy.
Jonas

Focused, hard work is the real key to success. Keep your eyes on the goal, and just keep taking the next step towards completing it. If you aren't sure which way to do something, do it both ways and see which works better. - John Carmack

User avatar
scott
Posts: 1151
Joined: Tue Jul 05, 2005 1:59 am
Location: United Kingdom

Post by scott » Wed Sep 06, 2006 6:07 pm

i was going to suggest making an multiplayer test but i have been realy bussy, this test was going to include if you can actusly join a game, how many if possible could join, if a player was killed, either by their own fault or an enemy if this is shown in multiplyer to see if shooting jumping and any other animation is shown also if things such as lifts are updated aswel.

now all we need is a simple 2 rooms, one with a high ledge for suiside and something such as a lift in and the other with an enemy in. and see if he can be killed and updated to the other player, this would be used in ai against team game play.

now i have a dynamic ip address and would be willing to post a current ip address to join to as it would change the next time i connect to the internet so i dont have any worry about hacking.

if anyone is interestead in doing any of these test then please leave a message below, and i may create a small arena or mabe some else could.

also any tests that could be implimented that i have missed please leave bellow aswel.
*GD*

Post Reply