Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Nymphodora), 485 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
online team shooter "Survive!" full sourcecode release #298094
11/11/09 22:10
11/11/09 22:10
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline OP
User
SchokoKeks  Offline OP
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
As I've frozen this project, I'm releasing the full source code of the last release, Version 0.57. Original thread.
The game is programmed in C-Script, but a nearly done lite-C conversion is also included. Maybe you can find the remaining bugs.

Please read the "GUIDE TO CODE.txt" file before asking questions here.
Most models are missing because I don't have the right to distribute them. Check the guide on options how to get around this.


Download

Survive! V0.57 sourcecode via rapidshare.com
alternative download mirror


Read GUIDE TO CODE (also included in the above ZIP file)

If you have questions, please ask them in this thread so others can find the answers, too.

- Schokokeks



Re: online team shooter "Survive!" full sourcecode release [Re: SchokoKeks] #298136
11/12/09 11:51
11/12/09 11:51
Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Cowabanga Offline
Expert
Cowabanga  Offline
Expert

Joined: Aug 2008
Posts: 2,838
take me down to the paradise c...
Nice, maybe I can try to translate it to Lite-C.

Re: online team shooter "Survive!" full sourcecode release [Re: Cowabanga] #298139
11/12/09 12:59
11/12/09 12:59
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline OP
User
SchokoKeks  Offline OP
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
Quote:
Nice, maybe I can try to translate it to Lite-C.

You'd only have to debug the Lite-C conversion that it included in the package. The biggest bug i can remember right now is that the weapons that the player hold in their hands don't show up or don't move with them, although the code looks perfectly right. maybe there is a problem with the you pointer.

Re: online team shooter "Survive!" full sourcecode release [Re: SchokoKeks] #308410
02/03/10 09:14
02/03/10 09:14
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
I didnt quite undrestand how you attached the guns to the players with out creating lagg. could you fill me inn ? ;P


- code monkey
Re: online team shooter "Survive!" full sourcecode release [Re: ambe] #308491
02/03/10 13:40
02/03/10 13:40
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline OP
User
SchokoKeks  Offline OP
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
sure:

it is important that the weapons are not "networked" entitys, that would be a total waste of bandwith.

on every client, create them with ent_createlocal(..) for every player.
I've used proc_local to start functions for every player entity, that is a very helpful function, look it up in the manual if you don't know it yet.

give them the following function: (through ent_createlocal of course)

Code:
function attached_wp_act()
{
	set (me, PASSABLE);
	set (me, UNTOUCHABLE);
	proc_mode = PROC_LATE;  // important part: keeps the gun from lagging one frame behind!!


	while (you)
	{
		if (you == NULL) {break;}

		vec_for_vertex(my.x, you, 5); // position at vertex 5 of player, change to fit your model!!
		vec_set (my.pan, you.pan); //  make it point into the same direction as the player


		wait(1);
	}
	ent_remove(me);
}



this is from the lite-c code, it might not work correctly, but it should tongue

Re: online team shooter "Survive!" full sourcecode release [Re: SchokoKeks] #308494
02/03/10 13:47
02/03/10 13:47
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
But how would the other players see this gun if its created locally?

I'm having my first crack at mp programing and as it is now it all seems like magic to me..


- code monkey
Re: online team shooter "Survive!" full sourcecode release [Re: ambe] #308507
02/03/10 14:19
02/03/10 14:19
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline OP
User
SchokoKeks  Offline OP
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
thats what proc_local() does. use proc_local once in the main player function that runs on the server.

proc_local starts a function for the entity it is called for on ALL clients. In that function, every client creates it own instance of the weapon. they (hopefully) all look and behave the same, and the player won't notice they are not synchronized over the network.

have you done and understood the multiplayer workshop (25) ?

Re: online team shooter "Survive!" full sourcecode release [Re: SchokoKeks] #308513
02/03/10 14:43
02/03/10 14:43
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
Edit- disregard that, all i really need to know is how did you make the different clients able to show different weapons?

Last edited by ambe; 02/04/10 17:56.

- code monkey
Re: online team shooter "Survive!" full sourcecode release [Re: ambe] #308728
02/04/10 17:57
02/04/10 17:57
Joined: Oct 2005
Posts: 196
ambe Offline
Member
ambe  Offline
Member

Joined: Oct 2005
Posts: 196
Edit-- sorry double post

Last edited by ambe; 02/04/10 17:57.

- code monkey
Re: online team shooter "Survive!" full sourcecode release [Re: ambe] #308757
02/04/10 19:49
02/04/10 19:49
Joined: Nov 2002
Posts: 913
Berlin, Germany
S
SchokoKeks Offline OP
User
SchokoKeks  Offline OP
User
S

Joined: Nov 2002
Posts: 913
Berlin, Germany
For that, you need to transfer a skill, that saves which weapon the player has.
0 = no weapon, 1 = pistol, 2 = shotgun and so on

Every time this weapons changes, send the skill with send_skill(..., SEND_ALL) from the SERVER to the clients. Its important that this is only done on the server.

in the weapon action I've posted above you can add code that changes the weapon with ent_morph depending on the values of that skill.

Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1