AUM77 bullit only from server/client

Posted By: GarniSoft

AUM77 bullit only from server/client - 02/11/09 07:12

Hello,

I have copy the multiplayer code from AUM77.
Evereything runs well but...
When i shoot (mouseclick) with the client-player the bullit startposition and pan is the startposition and pan from the client/server-player.

Can someone tell me whats wrong?

Thanks!
Posted By: George

Re: AUM77 bullit only from server/client - 02/11/09 07:34

Do you have the same problems running my demo from Aum77?
Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 02/11/09 07:46

???? No.

What do i wrong ???
Posted By: George

Re: AUM77 bullit only from server/client - 02/11/09 07:49

I don't know... let's see your code. Maybe it is a bit different?
Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 02/11/09 07:52

I run your multiplayer8 project first with -sv -cl
and then with -cl.

Then i got the same problem whith the bullits.

???

And when i compile/publish your multiplayer8 project and run it
with de server and client bat files i got the bullit problems also!

???

My 3dgs version A7.66 / wed v6.888 commercial
Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 02/12/09 08:22

Can somebody help?

Thanks!
Posted By: George

Re: AUM77 bullit only from server/client - 02/12/09 10:45

The code has to be published before being run. I just did that using A7.66.4 and my multiplayer8 project works fine. Did you publish using Wed? If you have several GameStudio folders installed on your computer, Sed might point to another version of the engine and publish the project using another version. Starting the proper Wed and publishing from there is the proper way of doing the things.
Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 02/13/09 07:49

I did that exactly but still got the problem.
I download the new version from the site and install it.
And publish multiplayer8 project with that version and still got the problem.

SED 7.11.1
3DGS 7.70 /WED 6.89


Project Files:
1. palette.pcx
2. multiplayer8.wmb
3. redsoldier.mdl
4. bluesoldier.mdl
5. bullet.mdl
Create Engine: (multiplayer8.exe)
1. multiplayer8.exe
Autobind:
1. Skipped: D:\Games\Documentatie 3DGS\aum77code\aum77code\multiplayer\multiplayer8\acknex.wdf
2. D:\GStudio7\d3dx9_30.dll

subdirectory created:
d:\games\documentatie 3dgs\aum77code\aum77code\multiplayer\multiplayer8\multiplayer8.cd\



Missing acknex.wdf ???


Posted By: George

Re: AUM77 bullit only from server/client - 02/13/09 10:26

Well, I don't have any problems. How big is your multiplayer8.c file? It should have 6341 bytes.
You don't need the acknex.wdf file; it's for the startup window.
Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 02/16/09 10:55

The file is also 6341 bytes.

Why must it be published before it can work?

What do i wrong... i have one version on my pc, i have the same
files 1:1 download and publish... it should be working.

Have anyone an idea why it won't work???
Posted By: George

Re: AUM77 bullit only from server/client - 02/16/09 16:33

You must publish the demo because it is run by the batch (.bat) files for the client and for the server; if you only run the executable it won't work. Do you have any problems with my demo that comes with Aum77's resources?
Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 02/17/09 14:55

No, i have no problems with the pre-published version of Aum77 multiplayer project. Only when i publish your project in my own version of 3dgs/wed/sed.

Thank you for your help... i don't spent any time for such a simple thing anymore, i got it running in XNA, i got false hope to get it run in 3dgs.

Thanks.
Posted By: cjm

Re: AUM77 bullit only from server/client - 03/08/09 20:33

George there is a definate 'funny'.

Your published version runs all ok for me.

When I re-publish using A7.70 (only change is to camera_ambient = 120; in main else everything is black as night!) I get the same problem - all bullets fire from the server soldier.

Any furthur thoughts?
Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 06/10/09 15:08

Is there an awnser for this problem?
Posted By: testDummy

Re: AUM77 bullit only from server/client - 06/10/09 16:22

Quoting George.
Quote:
The code has to be published before being run.

Maybe a full publish is necessary when using A7 and Lite-C, but it used to be possible to use a .bat file to compile and run a shared script with multi-player parameters for LAN testing / play.

Code:
sample only:
sv.bat
	ack_dir\acknex.exe project_dir\script.wdl -eq -nx 199 -diag -win -sv -cl
cl.bat
	ack_dir\acknex.exe project_dir\script.wdl -eq -nx 199 -diag -win -cl -ip ip_address

Posted By: GarniSoft

Re: AUM77 bullit only from server/client - 06/11/09 14:41

Okay thanks.

I try it.
Posted By: cjm

Re: AUM77 bullit only from server/client - 06/28/09 15:02

I have added some code to George's Multiplayer10's function main, the if (client_fired) code near the end.

This shows that the my pointer sent from the client and directed to you on the server is seen as the my of server,
so client's bullet fires from the server's gun?

George had this code working, so has a bug crept into later releases of Gamestudio?

Code:
function main() 
{
	fps_max = 60; // limit the number of data packets that are sent over the network each second to 60
	level_load ("multiplayer10.wmb");
	camera.ambient = 120;
	on_mouse_left = fire_bullets; // the player use the left mouse buttons to fire
	if (!connection) // no server could be found?
		sys_exit(NULL); // then shut down the engine
	if (connection == 2)  // this instance of the game runs as a client?
	{
		my = ent_create("redsoldier.mdl", vector (100, 50, 40), move_players); // then create the red soldier!		
		wait (-0.5); // wait until the handle is ready and valid for all the clients (this line is very important!)
		client_ent = handle(my); // now we can get a valid handle to the client entity (the player that runs on the client)
		send_var(client_ent); // and let's send the handle over the network to the server (no need to do that more than once)
		while (1) 
		{			
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			send_skill(my.skill1, SEND_VEC); // send skill1...3 to the server (skill3 is used to store player's health
			send_var(client_fired); // send client_fired to the server; even client's bullets are created on the server
			simple_camera(); // call the simple camera function
			// new code
			players_health = my.health; // display the proper player health value on the client
			wait (1);
		}
	}
	if (connection == 3) // this instance of the game runs as a server and client at the same time? (connection = 3)
	{
		my = ent_create("bluesoldier.mdl", vector (-100, -50, 40), move_players); // create the blue soldier
		VECTOR bullet_pos[3];
		while (1) 
		{
			my.skill1 = 5 * (key_w - key_s) * time_step;
			my.skill2 = 4 * (key_a - key_d) * time_step;
			simple_camera(); // call the simple camera function
			// new code
			players_health = my.health; // display the proper player health value on the server
			
			if (server_fired) // the server has fired? Then we've got everything that we need here ("my" is the player on the server)
			{
				vec_set(bullet_pos.x, vector (30, -5, 15)); // create the bullet at an offset of x = 30, y = -5, z = 15
				vec_rotate(bullet_pos.x, my.pan); // in relation to the origin of the model
				vec_add(bullet_pos.x, my.x);
				bullet_pan = my.pan; // the bullet will have the same pan angle with player's pan
				if (my.health > 0) // the server player is still alive?
					ent_create("bullet.mdl", bullet_pos.x, move_bullets); // then create the server player bullets
			}
			if (client_fired) // the client has fired? Then we need to get access to the client player
			{
				beep(); // See if client mouse left button is seen! IT IS !!!!
				
				you = ptr_for_handle(client_ent); // let's restore its handle; the client player is now "you"
				
				// We are not 'seeing' you as the client soldier's data but as the server soldier's data!!!!!!!!
				// =============================================================================================
				
				vec_set(bullet_pos.x, vector (30, -5, 15)); // we set bullet_pos to the same offset
				vec_rotate(bullet_pos.x, you.pan); // in relation to the "you" model (client's player)
				vec_add(bullet_pos.x, you.x);
				bullet_pan = you.pan; // and we use client's player pan angle for the bullet
				if (you.health > 0) // the client player is still alive?
					ent_create("bullet.mdl", bullet_pos.x, move_bullets);	// then create client's bullets (on the server as well)

				vec_set(bullet_pos.x, vector (30, -5, 15)); // we set bullet_pos to the same offset
				if (you.health  > 0) // Test Code! This adds 15 to Server, NOT Client????????????
					you.health += you.health ;
			}
			wait (1);
		}
	}
}


Posted By: maglat

Re: AUM77 bullit only from server/client - 01/10/10 03:20

Dear George,

I have the same problem with this multiplayer code from Aum 77 /78.

When i complie the code for myself, all the bullets are fired from the server model instead of the client model.
The published version from you works correct!
Can you pls find a solution how to fix this issues?
That would be very great!

Many thanks in advance.

I'm using A7 Com 7.82.3 for compiling.

Greetings

maglat!
Posted By: Spirit

Re: AUM77 bullit only from server/client - 01/10/10 08:06

This was a bug in the AUM multiplayer code, the fix was posted here on the forum some time ago. I dont remember what it was, but do a search.
Posted By: maglat

Re: AUM77 bullit only from server/client - 01/10/10 19:36

George answer me to my question!
The solution is simple!

Quote:
The solution is simple: replace "wait (-0.5);" with "wait (-5);"

Posted By: Petra

Re: AUM77 bullit only from server/client - 01/14/10 09:42

Wait(-5) is a bad method, and will still not work on many PCs.

The fix was posted here long ago:

http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=301136#Post301136
© 2024 lite-C Forums