Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Akow, degenerate_762), 1,430 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19055 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Simple Multiplayer Shooter Example #268773
05/31/09 03:45
05/31/09 03:45
Joined: Jul 2004
Posts: 74
Inside Maya
S
Sichlid Offline OP
Junior Member
Sichlid  Offline OP
Junior Member
S

Joined: Jul 2004
Posts: 74
Inside Maya
Hi ,

I have been trying to code a simple mutiplayer shooter taking Locoweed's MP code as base.

what i need in the game is simple :
1.Server and client both have one player each.
2. enemy who attacks both the players.

I have got the server side working with enemy but on the client side there are some YOU pointer errors.

I have read all forums threads and have programmed simple cooperative MP one month ago for a project.

I have tried all combinations of suggestions given to take out the YOU INVALID pointer error but the enemy just does not detect the client player ( set by player pointer ) or it detects ( when dplay_localfunction = 1) , but when the enemy fires to client an INVALID YOU pointer error comes.

It would be very helpful if anyone points me to a simple shooter working somewhere as a tutorial or demo for my deadline smile

thanks in advance for any help !

Sichlid


Best Regards, Sichlid
Re: Simple Multiplayer Shooter Example [Re: Sichlid] #268804
05/31/09 08:22
05/31/09 08:22
Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
Tobias Offline

Moderator
Tobias  Offline

Moderator

Joined: Aug 2000
Posts: 1,140
Baunatal, Germany
The official multiplayer tutorial should get you started. After you've done this you can better understand Locoweed's code. But AFAIK the Locoweed code was for A6 only and outdated?

You pointer error means that in that line in your code, you're using the you pointer without having set up it before.

Re: Simple Multiplayer Shooter Example [Re: Tobias] #268851
05/31/09 13:41
05/31/09 13:41
Joined: Nov 2007
Posts: 1,032
Croatia
croman Offline
Serious User
croman  Offline
Serious User

Joined: Nov 2007
Posts: 1,032
Croatia
i suggest you dont use 3dgs native MP system. better use ANet plugin. after setting up all of the basic stuff for starting MP with ANet, updating players is easy as just adding few lines of code.

it's much easier and more simple than 3dgs native MP system, trust me... smile



Ubi bene, ibi Patria.
Re: Simple Multiplayer Shooter Example [Re: croman] #268918
05/31/09 18:41
05/31/09 18:41
Joined: Jul 2004
Posts: 74
Inside Maya
S
Sichlid Offline OP
Junior Member
Sichlid  Offline OP
Junior Member
S

Joined: Jul 2004
Posts: 74
Inside Maya
Thanks you Tobias and Cerberi_croman , though with A7 native MP code that i am using , the server player and enemy react as expected but only when client player comes close to the enemy , the invlaid you pointer error comes.

Clearly the you pointer is being NULL when client side machine code is being run...so i think there should be some simple code error i am doing.

using ANET is a good option though learning it would take some time for me i guess ! any simple FPS shooter examples in ANET ( the pong one doesnt have such a scnario actually that my project has)....

Sichlid


Best Regards, Sichlid
Re: Simple Multiplayer Shooter Example [Re: Sichlid] #268977
06/01/09 06:46
06/01/09 06:46
Joined: Oct 2006
Posts: 175
G
Gumby22don Offline
Member
Gumby22don  Offline
Member
G

Joined: Oct 2006
Posts: 175
you pointer is local to the function it is referenced in. Can you do a debug run, and step through until it brings up the you = null error, then post that function here?

Don
Have a great day

Re: Simple Multiplayer Shooter Example [Re: Gumby22don] #269007
06/01/09 10:56
06/01/09 10:56
Joined: Jul 2004
Posts: 74
Inside Maya
S
Sichlid Offline OP
Junior Member
Sichlid  Offline OP
Junior Member
S

Joined: Jul 2004
Posts: 74
Inside Maya
Hi Gumby22don,

please find the function and where the NUll pointer error comes :

function projectile_function()
{
my.polygon = on;
c_setminmax(my);
my.enable_entity = ON;
my.enable_block = ON;
my.event = projectile_event;
my.speed = PROJECTILE_SPEED; // get speed
my.pan = you.pan; // set pan to owners pan
my.force_y = 0;
my.force_z = 0;
my.owned_by_hdl = handle(you);

.....

}

the error comes whereever the You pointer is in the code.

Also please note :

1. The code runs perfectly on SERVER
2. Only on client side does this error comes.
3. I have also put dplay_localfunction =2 so that all codes runs on client and server both.
4. I also used the handle concept to store the you pointer and retreive it in the above function but still the error comes.



I also checked the AUM magazine also they have 2 players fighting with each other. Not a single demo or example showing enemy attacking client/server player !!

I am really confused as have been using from A4 version but this is just too basic that the there had to be some simple way of making a MP shooter FPS !!

Sichlid


Best Regards, Sichlid
Re: Simple Multiplayer Shooter Example [Re: Sichlid] #270222
06/07/09 00:12
06/07/09 00:12
Joined: Oct 2006
Posts: 175
G
Gumby22don Offline
Member
Gumby22don  Offline
Member
G

Joined: Oct 2006
Posts: 175
hmm. I would really like to see the function that calls this one, so I can see where you are expecting the "you" to be set. Some functions like c_trace will set "you" (to the hit entity), but in your case it seems to not have one.

Maybe put a testVar = you.pan; in right before firing, in the parent function and see if it causes an error there too - if so, the problem is higher than you were previously looking.

Hope that helps, feel free to post the parent function if not. (and send me a PM so I don't miss it)

Don
have a great day


Moderated by  HeelX, Spirit 

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