Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,633 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Updated Source to Locoweed's Multiplayer (Lite-C) #177969
01/15/08 07:08
01/15/08 07:08
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Hey dudes,

I wanted to get my feet wet in C-Lite since I was thinking about changing an enormous program over to C-Lite, so I decided to use the old Multiplayer Source as a test bed.

Not sure if I want to convert 250,000 lines of code from C-Script to C-Lite after this test, but here is old Multiplayer Source in C-Lite.

Not sure how stable multiplayer is in C-Lite just yet. I tested this on A7.07, not sure if it will run earlier versions.

Just the source with no documentation and I left out the starter program that was in the original tutorial also.

Locoweed's Multiplayer Tutorial Source converted to C-Lite

Enjoy,
Loco


Professional A8.30
Spoils of War - East Coast Games
Re: Updated Source to Locoweed's Multiplayer (Lite [Re: Locoweed] #177970
01/15/08 07:16
01/15/08 07:16
Joined: Aug 2005
Posts: 1,012
germany, dresden
ulf Offline
Serious User
ulf  Offline
Serious User

Joined: Aug 2005
Posts: 1,012
germany, dresden
wow nice work loco, did you came across something difficult while converting? somtething that may help us convert other code like intensePathfinding for example?

Re: Updated Source to Locoweed's Multiplayer (Lite [Re: ulf] #177971
01/15/08 07:33
01/15/08 07:33
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
It was pretty much straight forward, but time consuming. The only real issues I had were with multiplayer stuff.

The main crazy thing was creating player entity on client with
player = ent_create();
When that player's entity was ent_removed() on the server, the player pointer was not set to NULL on the client. It usually wouldn't matter much because the client wouldn't usually have it's player entity removed, but how this code was set it up, after the player died his entity would be removed, he would go back to selection menu, and then he could select from the 3 available characters again.

Other than that, you get to know what needs to be changed from C-Script to C-Lite fairly quickly. It just takes time and you will find some commands don't exist anymore or have been changed.

I guess some other things is if you have
var vecTemp[3];
you can't access it with
vecTemp.x, vecTemp.y, vecTemp.z
you have to use
vecTemp[0], vecTemp[1], vecTemp[2]

Also,
variables and flags are case-sensitive in C-Lite, so you will be finding yourself changing stuff like my.X to my.x, event_block to EVENT_BLOCK, etc.

And,
many things that used to be bmap, string, etc will now be BMAP*, STRING*, etc.

And,
effects are a bit different, you have to pass (PARTICLE *p) as a parameter, and use p.alpha, etc in the particle effect instead of my.alpha, etc.

Oh yeah, one more thing that was a bit tricky,
your on_enter = function;, on_esc = function;, etc, now need to be placed in the main() function. That was kind of weird.

You well also learn what set() and reset() are pretty quick.

But basically, it is just a time consuming process. I did however convert this in about 5-6 hours with never having used or having any knowledge of C-Lite. I could do it much quicker now. If I was converting a very large program I would go through one thing at a time, like searching the files for define and then changing all the define's to #define's, etc. That would be most efficient. For a smaller program like this though, probably just go through it from top to bottom.

Dang, it was almost 4 years ago when that tutorial was first made. Ahhh, the good old days. I am still bitter about not winning first prize, who were the judges on that contest? (Just kidding, I didn't have all the documentation quite ready by the time limit, but code was done, lucky I got a prize at all. But that documentation was darn good.)

Anyhow, back into obscurity,
Loco


Professional A8.30
Spoils of War - East Coast Games
Re: Updated Source to Locoweed's Multiplayer (Lite [Re: Locoweed] #177972
02/22/08 01:43
02/22/08 01:43
Joined: Feb 2002
Posts: 357
Florida
Zelek Offline
Senior Member
Zelek  Offline
Senior Member

Joined: Feb 2002
Posts: 357
Florida
This is an awesome contribution. Your original tutorial has basically been my multiplayer coding handbook. I was just looking around for some examples so I could get started on a lite-c multiplayer project, and I find this. Beautiful.

Re: Updated Source to Locoweed's Multiplayer (Lite [Re: Zelek] #177973
03/13/08 02:12
03/13/08 02:12
Joined: Oct 2004
Posts: 8
Thalandor Offline
Newbie
Thalandor  Offline
Newbie

Joined: Oct 2004
Posts: 8
One slight problem.

I'm running both cl/sv and cl on the one machine and everything works fine except for giving the client a weapon. In not doing so the screen just sits at "initialising player..." for the client.

This is just running the source as given on your link in post 1. Anyone else having this problem? Is it excpected if I am running 2 instances of the program on one machine?

Thanks,
Alex

Re: Updated Source to Locoweed's Multiplayer (Lite [Re: Thalandor] #177974
03/19/08 19:14
03/19/08 19:14
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Sorry, I dunno about running 2 instances on same machine. I just tested over a LAN.


Professional A8.30
Spoils of War - East Coast Games
Re: Updated Source to Locoweed's Multiplayer (Lite [Re: Locoweed] #224289
08/29/08 13:36
08/29/08 13:36
Joined: May 2008
Posts: 91
Eugene, OR. USA
ATOMIX Offline
Junior Member
ATOMIX  Offline
Junior Member

Joined: May 2008
Posts: 91
Eugene, OR. USA
I have to give you kudos on the code. The first thing I did is run multiple copies on a machine. I had a dedicated server and 5 clients running on a single 2.8GHZ dual-core Celeron, 1 GIG RAM and 128MB ATI PCI Express Video Card, very low end. It worked flawlessly and once again I say EXCELLENT!


ATOMIX Productions
ATOMIX Group LLC
http://theatomizer.com
A7 Pro 7.50
Re: Updated Source to Locoweed's Multiplayer (Lite [Re: ATOMIX] #225569
09/05/08 06:34
09/05/08 06:34
Joined: Oct 2002
Posts: 2,256
Oz
L
Locoweed Offline OP
Expert
Locoweed  Offline OP
Expert
L

Joined: Oct 2002
Posts: 2,256
Oz
Thanks Atomix,

Loco


Professional A8.30
Spoils of War - East Coast Games

Moderated by  HeelX, Spirit 

Gamestudio download | 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