POPULACE or 3DGS?

Posted By: cristaballa

POPULACE or 3DGS? - 01/02/07 00:31

I own 3DGS pro,im going to tryout locoweeds TUT but i was woundering if anybody has tried out POPULACE,the site dosent have a lot of info and before i drop 150$ some good revews would help.

thanks-CRISTABALLA
web page
Posted By: TWO

Re: POPULACE or 3DGS? - 01/02/07 00:38

May I ask what version you have, there are some problems with contain versions of GS and Populace.
Posted By: cristaballa

Re: POPULACE or 3DGS? - 01/02/07 00:40

a6 6.40
Posted By: PrenceOfDarkness

Re: POPULACE or 3DGS? - 01/02/07 06:30

Well my experience with populace wasn't great. They let me buy the software at a discounted price since they wanted some people to review their software. After trying it out I was having a bad time with it. Back then they didn't have any good documentation, so it was rather hard for me to figure out what to do really. Later they promised to send me a check for the amount i paid and they let me keep populace for free, which was great only problem was that I un-installed it. I never got a check in the mail for the money nor do i have a key for it. I remember even when i 1st got it, it wouldn't work right. They had to send me all this other stuff. Long story short I upgraded to commercial and that was it. I wish they would give me my populace key back at least.. I'd love to try it again. but oh well
Posted By: East_Coast_Games

Re: POPULACE or 3DGS? - 01/03/07 01:33

Prence -

Just sent you a personalized version of Populace to use. All you need to do is drop it into your project directory. You should be good to go.

ECG
Posted By: East_Coast_Games

Re: POPULACE or 3DGS? - 01/03/07 01:37

Cristabella - We have been toying with reducing the price of Populace to 50 bucks per unit. If your interested in trying that out for that price send me an email at support@ecgames.com. That goes for anyone else.

Happy NewYear.

ECG
Posted By: cristaballa

Re: POPULACE or 3DGS? - 01/04/07 00:04

Yea.........ill be in contact.........
But....its not the price i care about,its the product....
Is it just code?,is it a program with a UI?,Does it come with a manual?,stuff like that.
Even if its just a bunch of text files with just code i would still use it just fine,it would just be cool to know.

Thanks-CRISTABALLA
Posted By: PrenceOfDarkness

Re: POPULACE or 3DGS? - 01/04/07 00:58

They gave me a great manual, a sample game. Populace is a dll, so you get to use it with 3dgs. I actually liked the idea because it's basically an extension to the A6 engine's functions
Posted By: cristaballa

Re: POPULACE or 3DGS? - 01/04/07 01:15

Cool.........
Just what i was looking for.
I think ill give it a try.

-CRISTABALLA
Posted By: Locoweed

Re: POPULACE or 3DGS? - 01/04/07 03:52

Hi Cristaballa,

Here is my take on it for what it is worth.

I have not played around with the actual Populace dll yet, but I have been programming with a game specific hybrid of it for about 5 months now.

There is absolutely no comparison in efficiency.

The hybrid I have been using is so unbelievably more effecient then 3DGS multiplayer that it will make you cry.

It is set up quite a bit differently on how things work then 3DGS networking, but I am guessing the hybrid I have been using is basically the same other then additions such as pathfinding and other unique dll functions, if not it will be.

After I get done with getting the beta out for this game I working on that uses the hybrid code Populace I have told East Coast Games I will put out some tutorials of how to use it correctly and add some other missing functions that I know that would make it even more efficient. I am considering bringing in some special help to really tweak this dll.

If the Populace dll is not similar to what I have been working with, in about a month or so, it will be, with detailed tutorials on how to use it written by me.

Quote:

You can quote me, "It's no contest, the Populace is 75% more effecient than 3DGS networking over the internet!"




It will be about a month before I get involved with documentation, tutorials, and additions to the dll I think need to be done, but it will happen, and if you have already purchased the product you will receive the updates and tutorials also.

I am really not trying pimping this, the truth is, it's just not even close and if you want to do real multiplayer over the internet with 3DGS, this will be the way to go unless my friend fastlane69 has put something together that is better. The effeciency is just not even close or I would not be mentioning it and I know 3DGS networking inside and out.

Loco
Posted By: William

Re: POPULACE or 3DGS? - 01/04/07 04:40

While i've purchased Populace, i've opted to use native 3DGS. At the time I purchased, I did not know much about multiplayer, and most tutorials were centered around 3DGS commands. I've now got a sizable game with 8 players, weapons, ect. working with multiplayer, custom coded(dont use no automatic update stuff from A6). The reason I used 3DGS was due to the tutorials, there was next to nothing for Populace, and for a starter in mulitplayer logic, I needed more.

@Loco - I was wondering, does Populace just speed up the actual development, or does it affect the sending of data across a network(more efficient/faster)? If the latter, is it possible to somehow convert an existing A6 multiplayer project to Populace, just for the speed upgrade in sending information? Thats one thing I didn't understand, what did Populace do that native A6 commands couldn't? I think i've coded my multiplayer quite efficient already; but extra efficiency never hurts.
Posted By: Locoweed

Re: POPULACE or 3DGS? - 01/04/07 07:01

Hi William,

It affects the sending of data across a network, much more efficient.

I am afraid you will have to wait about a month before I can explain how I have been using the system. I have found it best to use it as more of peer system, where the computer that creates an entity actually handles it's data transfer over the network, instead of the server handling everything, but it can be used how ever you want. For multiplayer with a host the peer system seems the best fit, for a MMO having the server controlling everything would be better obviously.

Give me a month or so to get done with this project's deadline and I will show you what is possible.

Loco
Posted By: giorgi3

Re: POPULACE or 3DGS? - 01/04/07 15:14

Wow, that's some recommendation Loco. I can't wait for the tutorials! I was hoping populace would prove out, as 3DGS networking has left me frustrated to this point.

If they keep the price at $50.00, I'll be purchasing when I see some results/tutorials.
Posted By: JetpackMonkey

Re: POPULACE or 3DGS? - 01/04/07 15:53

I'd like to know more about it, but the website doesn't have a lot of info more than a couple of paragraph. How about expanding that part more?
Posted By: East_Coast_Games

Re: POPULACE or 3DGS? - 01/04/07 15:54

For reference I have upload the Populace (TM) user mainual to the ECG Site. The user document contains instructions on how to get started with Populace as well as some code snipts to get you started. I hope this is helpful.

for the document go the forum at www.ecgames.com.

Happy New Year!
Posted By: cristaballa

Re: POPULACE or 3DGS? - 01/05/07 00:43

Sound good.........
this forum been a real help.thanks
-Cristaballa
Posted By: cristaballa

Re: POPULACE or 3DGS? - 01/05/07 00:45

sound good........
this forums been a real help.thanks
-Cristaballa
Posted By: East_Coast_Games

Re: POPULACE or 3DGS? - 01/05/07 11:56

ECG is going to stick with the revised priceing.

50$ a unit.

While we update the purchasing site with the new pricing any one interested in Populace can contact us going forward at ecgbusdev@ecgames.com to purchase the software.

Thank you

Jim
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/06/07 00:19

hey.. this question goes to anyone who knows, mainly to you, Jim, I believe^^
We're thinking about buying populace. I've read through the documentary, it looks very promising.
One thing I didn't quite get... if I want the player's skill20 to be "broadcasted", or updated constantly on the other clients and the server, I don't do

dllfunction MP_TrackSkill(player, 20);

but

dllfunction MP_TrackSkill(player, 48);

right?

I think you've just sold another copy of populace ... it does look very promising. I hope it's as easy to use as it looks from the documentation... and I'm sorry you didn't have much luck with it, prence... hope that changes!

Micha
Posted By: Locoweed

Re: POPULACE or 3DGS? - 01/06/07 04:51

Hi Germanunkol,

That is correct with track skill number. It is best define everything. 0 - 28 are actually used for fields, which are 3dgs fields likes pan, tilt, roll, alpha, etc.

Define Example:
-------------------------------
DEFINE MPUC_FILENAME, 0;
DEFINE MPUC_POSITION, 1;
DEFINE MPUC_PAN, 3;
DEFINE MPUC_TILT, 4;
DEFINE MPUC_ROLL, 5;
DEFINE MPUC_SCALE_X, 6;
DEFINE MPUC_SCALE_Y, 7;
DEFINE MPUC_SCALE_Z, 8;
DEFINE MPUC_FLAGS, 9;
DEFINE MPUC_FRAME, 10;
DEFINE MPUC_NEXTFRAME, 11;
DEFINE MPUC_SKIN, 12;
DEFINE MPUC_AMBIENT, 13;
DEFINE MPUC_ALBEDO, 14;
DEFINE MPUC_ALPHA, 15;
DEFINE MPUC_LIGHTRANGE, 16;
DEFINE MPUC_BLUE, 17;
DEFINE MPUC_GREEN, 18;
DEFINE MPUC_RED, 19;
DEFINE MPUC_EMASK, 20;
DEFINE MPUC_EFLAGS, 21;
DEFINE MPUC_MIN, 22;
DEFINE MPUC_MAX, 23;
DEFINE MPUC_TRIGGER_RANGE, 24;
DEFINE MPUC_PUSH, 25;
DEFINE MPUC_FLOOR_DIST, 26;
DEFINE MPUC_SMASK 27;
DEFINE MPUC_CLIENT_ID 28;
DEFINE MPUC_SKILL_1, 29;
DEFINE MPUC_SKILL_2, 30;
DEFINE MPUC_SKILL_3, 31;
.
.
DEFINE MPUC_SKILL_98, 126;
DEFINE MPUC_SKILL_99, 127;
DEFINE MPUC_SKILL_100, 128;
-------------------------

Then you just do this,
MP_TrackSkill(my, MPUC_SKILL_20);

As of right now there in no just sending a skill once, it always tracks the skill until you turn off tracking it. Here is an example of what I do to send skills I really don't want to track forever so I track for 1 second then turn off tracking.

----------------------------------------

my = MP_EntityCreate(em_light_inf_string, vector(create_pos.x,create_pos.y,create_pos.z), "inf_action", "InfCallback");

entsCreatedByMe += 1;

//make sure to track the animation skill
MP_TrackSkill(my, MPUC_SKILL_28); //anim_state
my.anim_state = anim_stand;
MP_TrackSkill(my, MPUC_SKILL_66); //_obj_type
my._obj_type = 2004;//NumFromName("Em_Fighter","Id",unit_dbf);
MP_TrackSkill(my, MPUC_SKILL_1); // health
my.health = NumFromId(my._obj_type, "health", unit_dbf);
//make sure to track the owner_id & team until set
MP_TrackSkill(my, MPUC_SKILL_77); //team
my.team = player_team;
MP_TrackSkill(my, MPUC_SKILL_60); //owner_id
my.owner_id = player_id;
MP_TrackSkill(my, MPUC_SKILL_47); //EntityNum
my.EntityNum = player_id*EntArrayIndex+entsCreatedByMe;
MP_TrackField(my, MPUC_TILT); // Tilt
MP_TrackField(my, MPUC_ROLL); // Roll


sleep(1);
// wait until team, owner_id and obj_type set, then stop tracking
if(my)
{
MP_IgnoreSkill(my, MPUC_SKILL_77); //team
MP_IgnoreSkill(my, MPUC_SKILL_60); //owner_id
MP_IgnoreSkill(my, MPUC_SKILL_66); //_obj_type
MP_IgnoreSkill(my, MPUC_SKILL_47); //EntityNum
}

--------------------------------

In that example I track team, owner_id and obj_type, EntityNum for one second, then stop tracking with MP_IgnoreSkill(), because they don't need to be continually tracked during gameplay just set at creation.

Stuff like anim_state, health, etc I keep tracking in that example.

In the example above also wanted to track Tilt and Roll so I used
MP_TrackField(my, MPUC_TILT); // Tilt
MP_TrackField(my, MPUC_ROLL); // Roll
to have them tracked also.

Anytime you create an entity with MP_EntityCreate() the entity's Position and Pan (not tilt and roll) are automatically tracked until you turn off tracking them. So if you created a static entity you would want to turn off tracking Position and Pan after entity was created using:
MP_IgnoreField(my,MPUC_POSITION);
MP_IgnoreField(my,MPUC_PAN);

Also, unlike 3DGS networking, the computer that creates the entity handles transfering that entity's data. The action is ran on all computer's also, not just server(or creator in this case). So I generally put in some code in action to exit on computers that did not create it after any basic stuff is set up like materials and whatever else you want set up or run locally on all the computers.

Example in an action:
---------------------
// wait until owner_id set or received from computer that created entity
while(!my.owner_id)
{
wait(1);
}

// set materials, local functions you want run, etc here
// local functions like animation, healthbars, or anything
// that would be similar to Proc_Local with 3DGS would be placed here
// local events can be set up here to with enable_scan, etc

// player_id is set in main after connected using
//player_id = MP_GetPlayerIndex();
// you will have to look that up

// if action running on computer that did not create entity, exit here after basic setup
if(my.owner_id != player_id)
{
return;
}

// creator's machine continues to run the actual action from this point on
while(my.health > 0)
-----------------------

That is some basics. Later, when I have time I will making some detailed examples.

Loco
Posted By: PrenceOfDarkness

Re: POPULACE or 3DGS? - 01/06/07 06:06

I have just a few questions. I am planning on eventually making a commercial game. Do I need to do anything like give credit in the credits or anything like that if I use populace, you know.. after paying the 50$.

Another thing I wanted to mention was that, (and by this I mean no offense) after looking over the documentation for populace, I didn't really find anything that I couldn't do with 3dgamestudio's wdl language anyway. Now I don't know about speed, but since I do trust locoweed (lol what choice do we have, how many tutorials and other contributions has he made for us all?) I guess populace is faster. Now although faster = better 99% of the time, the lack of tutorials also hurt this maybe superior multiplayer expansion (i say maybe because I can't confirm it). One final problem is the simple fact that it's a DLL. The problem with a DLL is that when A6 updates or even when A7 comes out, it might cause problems. These are some of the reason I stopped bothering with populace at all. Although 3dgs multiplayer might suck ass... alot... badly.. (lol), it will remain to be supported and debugged throughout every update. If you bought a DLL for A5, it's now useless in A6, and sometimes even after some slight A5 updates.

Now I don't mean to bash Populace. In all honesty the people who are working to bring it to us for the small 50$ fee are great people. They really did try helping me a lot. I want to thank them 100% and I wish all service providers could be like them. Maybe now with locoweed coming out with a tutorial and my better understanding, I will use populace again, but I still fear the whole A6 upgrading and the DLL causing a headache in the long run. But then again I might be wrong with the DLL (I had a few bad experiences with A5 dlls)

The way i see it it's reliability vs performance.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/06/07 09:29

GREAT!
thank you very much for that very long answer!
It helped a lot...
the system seems to be pretty well thought out, I like that...
Good to know the action is run on every computer...
It'll take some getting used to... but I think it's worth it. 32 players ... even 8 would be enough for my purposes right now^^

So... we'll give it a shot:)

Micha
Posted By: PrenceOfDarkness

Re: POPULACE or 3DGS? - 01/06/07 10:00

Lol, as far as what I just said before, I just realized there is 1 thing about my method that I did forget to mention lol. I use skills to send the x,y,z,pan,tilt,roll, while populace doesn't. So that's another + to populace (unless I'm wrong)
Posted By: Drittz_Dourden

Re: POPULACE or 3DGS? - 01/06/07 15:32

This might have already been answered, but i couldnt find it

i have a6 commercial. if i buy populace can i still get 32 players online...or just the normal 4 that the commercial edition has

Daniel
Posted By: broozar

Re: POPULACE or 3DGS? - 01/06/07 18:13

the website states that populace's 32 player support works even with a6 standard.
Posted By: East_Coast_Games

Re: POPULACE or 3DGS? - 01/10/07 01:39

DaBroOzar =

That is correct. The DLL will work with all version of GameStudio.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/13/07 12:25

Hi!
since this thread has already been acting as a sort of populace-help thread I figured I could ask this here:
I want to use MP_EntityCreate to create my player. Now that doesn't work. As soon as it gets there, it gives me an error: "Crash in MP_EntityCreate"

here's my code:
Code:

function create_player()
{
vec_set(temp,spawn_points[(my_player_number -1)*3 + 0]); //get station position out of array


dll_handle = multiplayer_handle;
player = MP_EntityCreate(player_mdl, temp, player_function, null);

// player = ent_create("mp_main.mdl",temp,player_function);
}


var vCurrWarning;

//hack to remove warnings when DLL loads, as per Conitec
vCurrWarning = warn_level;
warn_level = 1;

multiplayer_handle = dll_open("Populace.dll");
breakpoint;
if ( multiplayer_handle != NULL ) //make sure the dll loaded
{
ifdef phost;
//connect locally to the multiplayer server, randomly assign to one of four teams
dll_handle = multiplayer_handle;
if (MP_ConnectServer("Host_Player", int(random(4))) == MP_NO_ERROR)
{
scroll_message(" -> Connected. <-");

my_player_number = 1; //if you're host, set starting values.
total_players = 1;


//create_station();
create_player();
}
endif;
...
...




what reasons could there be for a "crash" in MP? usually it means the wrong amount of parameters are given etc, right? But I do give the right parameters...?
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/13/07 12:29

i just narrowed down the problem. It has to do with this:
vec_set(temp,spawn_points[(my_player_number -1)*3 + 0]); //get station position out of array
player = MP_EntityCreate(player_mdl, temp, player_function, null);
Apparently it cannot create an object that is far away from the origin? Why is that?
if I use
vec_set(temp,vector(0,0,0)); instead it works just fine...?

Micha
Posted By: Samb

Re: POPULACE or 3DGS? - 01/13/07 19:45

@germanunkol
I solved the problem by set the position of the created entities after the create function:

you = MP_EntityCreate("nplatt.wmb", nullvector, null,null); // create multiplayerentite
you.x=Tilegroesse * spalte; // now move its position
you.y=(Tilegroesse/2)- Tilegroesse * reihe;
you.z=0;
wait(1);// wait one frame so the position data will be send
MP_IgnoreField(you, MPUC_PAN);
MP_IgnoreField(you, MPUC_POSITION); // now disable the tracking for those entities


another question: how do I know how much latency time my game needs? on one machine, the server and client runs fine, but over a LAN, the movement is a slower then normal.
I just tested it with a very very simple code without time or anything. I have to try it with a locked framerate etc. but it woul really help if you could see how big the packages are.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/14/07 10:01

that's the solution I came up with as well... thanks
Man, I'm sorry, I'm still getting used to this. This part works now, I can host and join, works just great. I really like how the dll connects after starting the engine, not while it is starting, that way you don't need to use the command line and you can have a main menu before joining up in any game, without having to restart the engine.
It does take a bunch of getting used to but I recommend it
Posted By: East_Coast_Games

Re: POPULACE or 3DGS? - 01/14/07 13:46

Germanunkol -

Great to hear Populace is working out for you! Can't wait to see your game.

ECG
Posted By: Samb

Re: POPULACE or 3DGS? - 01/15/07 15:20

hi east coast games team
two things
first: when a player creates a multiplayerentity the game of the player lags for 1/8 oder 1/4 seconds.
is there a way to avoid that lag?

second: the game runs faster after someone connects to the game... why?


btw. I tested the plugin successful over the internet. only the MPcreate command is really slow.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/15/07 17:07

Same problem here.
It's really annoying when I create two entities for lasers... every time I shoot it lags for that amount of time. I was gonna try it on a faster machine first before asking, but if others have the same problem, I guess it's not simply cause my computer's too slow. The dll seems to work nice and fast, as long as I don't create MP entities. But as soon as I do, it lags for about a quarter of a second. Should we create an entity using ent_create and then somehow register it after creation... or can that be done only to WED ents... ?
Is there a way to make it create faster?
Posted By: ecg_dev_dude

Re: POPULACE or 3DGS? - 01/16/07 01:06

I'm not sure this will work for you, but here's one possible solution for getting better performance:

1. Create a cache of entities via ent_create during game initialization (or during some idle time) from the server computer
2. Hide the entity (i.e. make it invisible)
3. Register the entity with MP_RegisterWED_Entity
4. Make the entity visible when you need it.

As you probably guessed, creating entities is an expensive process, especially when the entity has to be propagated to all the remote machines. I'll see what I can do to tweek this, but I'm not optimistic that I can make multiplayer entity creation significantly faster.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/16/07 14:26

Hmm, that sounds good. it'll work for all the upgrades we'll have for our spaceships. The main problem I'm having though is with laying mines, shooting rockets and lasers. I'd have to have a whole bunch of laser entities... and could only reuse them once they've hit something. Maybe for the laser entities I could just move them on one machine only, but the problem remains with the rockets, which will be visible. The good news is that the player will run out of rockets at some point, meaning that I could just create those once he buys them, and have them sitting somewhere passable and invisible. Same would work for the mines.
Thanks, in case no one finds something else, this should work...

Micha
Posted By: Samb

Re: POPULACE or 3DGS? - 01/16/07 19:33

for my game (bomberman clon) I solved the problem by creating the entities local with ent_create.

this runs on the player who creates a bomb:
pentity.skill91=bomb_pos.x; // skill91-93 are tracked
pentity.skill92=bomb_pos.y;
pentity.skill93=bomb_pos.z;
pentity.flag1=on; // also tracked.
temp_ent = ent_create("bombe.mdl", bomb_pos,null); // creates the entity local
temp_ent.passable=on; and set in on the player clientside passable
while(key_a==1){wait(1);} // wait until a-button is off
pentity.flag1=off; // send to all player that flag1 is really off. else populace wont send the a new flag1=on.


and here is the code for all other players:

while(1)
{

if(my.flag1)
{
temp.x=my.skill91; // get the position. why? it could be that the players position is on the "other client side" a little bit "slower". so the bomb would be not at the same position as it was created on the player-side... god, my english is terrible today.. and always
temp.y=my.skill92;
temp.z=my.skill93;
ent_create("bombe.mdl", temp,null); // now create the bomb
my.flag1=off; // and flagged off
}
wait(1);
}

this works for small games but not for rpgs or anything else.

oh, and we REALLY need a command to check the ping of a player.
so we can kick a slow player automatically.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/19/07 20:36

My problem is: My rockets need to move. I would need to have an action assigned to them, and their pos etc need to be sent to the dummy on all other player's computers. With your method, I believe I could only get them to sit there. Help?
Also, I don't quite get who runs the actions in your example. The player? or someone else??

Posted By: Locoweed

Re: POPULACE or 3DGS? - 01/20/07 05:02

Hi,

Instead of using MP_EntityCreate() for rockets, lasers, etc. because there is a slight lag with that function(especially noticeable in combat), I use the the MP_SendChatMessage() for these types of entities and effects, which is very effective.

The steps to do this are as follows:

1) On the computer that is firing the weapon:
a) Create the projectile like you would in single player with ent_create().
b) Encode a string with information about the projectile: start position, pan, etc.
c) Send this string to all Players.

2) Once all the other machines receive this string:
a) Decode the string and extract the information from it.
b) Use ent_create() on those machines to create a local version of it on those machines.

Sounds a bit weird, but works very well. MP_SendChatMessage() is very fast over the net. I spend countless hours testing to figure this stuff out with online test, so take my word for it please. Although someone, someday will find a better method because they didn't listen to me.

Here is an example of this method which is very effient for you to deceifer if you want. Lets say we are shooting a projectile from a spaceship.

------------------------------------------------------------------------------

string strCommand = [256];
string strCommand1 = [256];
string strCommand2 = [256];
string strTemp = [256];

// command values for local projectiles
var cmdRecID;
var cmdRecPos[3];
var cmdRecPan[3];

action SpaceShip
{
while(1)
{
.
.
// Key d flag? Shoot weapon
if(my.INPUT_FLAGS & fKeyD)
{
my.INPUT_FLAGS -= fKeyD;

// create projectile in front of ship
vec_for_angle(temp,my.pan);
vec_scale(temp,(my.max_X+35)); // create missile 35 quants in front of ship
vec_add(temp,my.x);

// create projectile locally
you = ent_create(mdlTorpedo,temp,ProjectileFunction);
vec_set(you.pan,my.pan);
you.peer_id = player_id;

// send a command string to create projectile on all other peers/clients
EncodeString(strCommand); // encode creation info into a string
MP_SendChatMessage(strCommand, "ProjectileLocal", MP_ALL_PLAYERS, 0); // send this string to all peers to create
// projectile locally on them

}
.
.
wait(1);
}

// This function sets team and peer_id
// it tracks peer_id & team long enough for them to be set
// and then stops tracking them
function SetTeamPeerID(pEnt)
{
my = pEnt;
//make sure to track the peer_id
MP_TrackSkill(my, MPUC_SKILL_39); //team
MP_TrackSkill(my, MPUC_SKILL_42); //peer
sleep(1);
if(my)
{
MP_IgnoreSkill(my, MPUC_SKILL_39); //team
MP_IgnoreSkill(my, MPUC_SKILL_42); //peer
}
}

//--------------------------------------------------------------------
// CREATE PLAYER - create player at random location
// Ran Locally
//--------------------------------------------------------------------
function CreatePlayer()
{

var temp1[3];

temp1.x =-1000 + random(2000);
temp1.y =-1000 + random(2000);
temp1.z = 0;

// Host?
if(player_team == 1)
{
player = MP_EntityCreate(mdlJFT, vector(temp1.x,temp1.y,temp1.z), "SpaceShip", "");
}
else // Client?
{
player = MP_EntityCreate(mdlFighter, vector(temp1.x,temp1.y,temp1.z), "SpaceShip", "");
}

// track pan, tilt, roll, health on peer that created entity over network
// set peer_id & team on peer that created entity over network
// track pan, tilt and roll
MP_TrackField(player, MPUC_PAN);
MP_TrackField(player, MPUC_TILT);
MP_TrackField(player, MPUC_ROLL);

//make sure to track the health
MP_TrackSkill(player, MPUC_SKILL_1); //health

player.peer_id = player_id;
player.team = player_team;
SetTeamPeerID(player);// set team and peer_id for ship
}


// ProjectileEvent function
// Runs locally on each peer/client
function ProjectileEvent()
{
// projectile hit a entity in level
if(event_type == event_entity)
{
// only do damage to hit entity on the peer that created it
// the peer that created the entity handles transmitting changes
// to that entities skills to the other players, so to keep absolute
// control of damage on all machines, we only want to do
// damage on the machine that created the entity
if(you.peer_id == player_id)
{
you.HEALTH -= my.HEALTH;
}
my.HEALTH = 0;
}

// projectile hit level geometry
if (event_type == event_block)
{
my.HEALTH = 0;
}
}


// ProjectileFunction function
// Runs locally on each Peer/Client
function ProjectileFunction()
{
var distance;

// set events
my.enable_entity = ON;
my.enable_block = ON;
my.event = ProjectileEvent;

// set poly collision stuff
c_setminmax(my);
my.narrow = on;
my.fat = on;
my.polygon = on;

my.FORCE_X = 100*time; // set speed of projectile

my.RANGE = WEAPON_RANGE;

my.push = -1;
my.passable = on; // passable until a certain distance from emntity that created it

my.health = int(random(30))+20; // set random damage of projectile

wait(1); // wait until pan set


// while haven't hit something and range not reached
while(my.HEALTH && distance<my.Range)
{
distance += c_move(my,my.FORCE_X, nullvector, ignore_passable);
// make sure not in ship - not really necessary if projectile creation correct, but left in for reference
if(distance > 10)
{
my.passable = off;
}
wait(1);
}

// hit something instead of reached range limit, so do explosion
if(my.health <= 0)
{
effect(effect_explosion,50,my.X,normal.x); // do explosion effect locally
}

wait(1); // let effect start
ent_remove(my); // remove pprojectile

}

// This function recieves string to decode to create local projectile
function ProjectileLocal(strCommand, playerId, teamId)
{
if ( playerId == player_id || playerId == MP_ALL_PLAYERS)
{
DecodeString(strCommand);
}
}

// This function encodes Projectile creation information into a command string
function EncodeString(strCommand)
{
str_cpy(strCommand,""); // clear command string

// encode owner id
str_for_num(strTemp,player_id);
str_cat(strTemp,",");
str_cat(strCommand, strTemp);

// encode position
str_for_num(strTemp,temp.x);
str_cat(strTemp,",");
str_cat(strCommand, strTemp);

str_for_num(strTemp,temp.y);
str_cat(strTemp,",");
str_cat(strCommand, strTemp);

str_for_num(strTemp,temp.z);
str_cat(strTemp,",");
str_cat(strCommand, strTemp);

// encode pan, tilt, roll
str_for_num(strTemp,my.pan);
str_cat(strTemp,",");
str_cat(strCommand, strTemp);

str_for_num(strTemp,my.tilt);
str_cat(strTemp,",");
str_cat(strCommand, strTemp);

str_for_num(strTemp,my.roll);
str_cat(strTemp,",");
str_cat(strCommand, strTemp);
}

// This function decodes Projectile information from a string
// and then creates this projectile locally on client/peer
function DecodeString(strCommand)
{
var str_pos;
var str_size;
var clip_num;

str_cpy(strCommand1, strCommand);

// Get owner_id for this Projectile
str_cpy(strTemp,strCommand1);
str_pos = str_stri(strTemp,",");
str_size = str_len(strTemp);
clip_num = str_size - str_pos + 1;
str_trunc(strTemp,clip_num);
cmdRecID = str_to_num(strTemp);
str_clip(strCommand1,str_pos);

// Get position for this Projectile
str_cpy(strTemp,strCommand1);
str_pos = str_stri(strTemp,",");
str_size = str_len(strTemp);
clip_num = str_size - str_pos + 1;
str_trunc(strTemp,clip_num);
cmdRecPos.x = str_to_num(strTemp);
str_clip(strCommand1,str_pos);

str_cpy(strTemp,strCommand1);
str_pos = str_stri(strTemp,",");
str_size = str_len(strTemp);
clip_num = str_size - str_pos + 1;
str_trunc(strTemp,clip_num);
cmdRecPos.y = str_to_num(strTemp);
str_clip(strCommand1,str_pos);

str_cpy(strTemp,strCommand1);
str_pos = str_stri(strTemp,",");
str_size = str_len(strTemp);
clip_num = str_size - str_pos + 1;
str_trunc(strTemp,clip_num);
cmdRecPos.z = str_to_num(strTemp);
str_clip(strCommand1,str_pos);

// Get pan, tilt, roll for this Projectile
str_cpy(strTemp,strCommand1);
str_pos = str_stri(strTemp,",");
str_size = str_len(strTemp);
clip_num = str_size - str_pos + 1;
str_trunc(strTemp,clip_num);
cmdRecPan.pan = str_to_num(strTemp);
str_clip(strCommand1,str_pos);

str_cpy(strTemp,strCommand1);
str_pos = str_stri(strTemp,",");
str_size = str_len(strTemp);
clip_num = str_size - str_pos + 1;
str_trunc(strTemp,clip_num);
cmdRecPan.tilt = str_to_num(strTemp);
str_clip(strCommand1,str_pos);

str_cpy(strTemp,strCommand1);
str_pos = str_stri(strTemp,",");
str_size = str_len(strTemp);
clip_num = str_size - str_pos + 1;
str_trunc(strTemp,clip_num);
cmdRecPan.roll = str_to_num(strTemp);
str_clip(strCommand1,str_pos);

// Create this projectile locally on all clients/peers based on decode string
you = ent_create(mdlTorpedo,cmdRecPos,ProjectileFunction);
vec_set(you.pan,cmdRecPan);
you.peer_id = cmdRecID;
}

------------------------------------------------------------------------

Hopes that helps some atleast.

This method is very effient like I said before. In the game I am working on there are missiles, bullets, laser effects, explosions, etc going on all over the place with no lag at all. My encoded strings and decoded string are much more complex than those shown though, I usually include in the strings the projectiles type (rocket, bullet, etc) and then take all the information and create the correct type of entity for that projectile.

Sometimes you have to think a bit outside of the box to get optimal performance with any networking code.

At some point when we get a beta out on a game using a hybrid of Populace done, I will put out some real tutorials, but it will probably be a while unfortuantely.

Loco
Posted By: Locoweed

Re: POPULACE or 3DGS? - 01/20/07 06:24

One more note here.

If you have purchased Populace and I can verify, I can get you the full SpaceHate (simple PvP space game code) example source to look at.

Unfortunately, you will have to change the dll names in code and stuff, but other then that it should be fine I think.

Let me know if you want to see the complete source of that example which uses the MP_SendChatMessage() technique for projectiles and I will see what I can do. Basically, when I first was trying to figure out how the networking worked, this was my test project. It's nothing special, but it is the foundation of where I am at now, which is a pretty sweet place as far as multiplayer with 3DGS goes.

If you are interested in doing some minor leg work to test the code with the actual Populace dll PM me or respond here and I will get in contact with you asap. (The reason I need some help with the code is that I can't install Populace because it screws up the Hybrid version of it, I will fix this soon so I can use both, but right now I don't have time to be messing around with that.)

Actually Germanunkol, PM me. I want to work with you since I can see you really want to figure out how this all works. After we figure we get the procedure down for the Populace DLL I am sure James, aka, East_Coast_Games, will get the working example up at the ecgames forum for other Populace users.

Thanks,
Loco
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/21/07 10:48

I'm starting to understand more and more about this. Thanks you so much for that code!
I'm going through it atm and changing my code to work the same way.
One thing I'm not sure about:

function ProjectileLocal(strCommand, playerId, teamId)
{
if ( playerId == player_id || playerId == MP_ALL_PLAYERS)
{
DecodeString(strCommand);
}
}

Does passing MP_ALL_PLAYERS to MP_SendChatMessage include the player that is executing the command? Because that would mean that the projectile is created on the sending machine twice. And if it's not the case, then why the line "PlayerId == player_id" ? Because that will never be true. And if it is the case, then you DON'T want the if statement to be true, because otherwise it will go on creating the projectile using the decoded message, even though it already created it on the machine before sending the message, and you end up having the projectile twice on one machine??

Micha
Posted By: Locoweed

Re: POPULACE or 3DGS? - 01/23/07 03:45

Does passing MP_ALL_PLAYERS to MP_SendChatMessage include the player that is executing the command?

No.
Posted By: Samb

Re: POPULACE or 3DGS? - 01/23/07 18:41

is it possible that a newer version of populace will feature to send a var with all arrays?
at the moment, you can only send the [0] array.
Posted By: Samb

Re: POPULACE or 3DGS? - 01/25/07 22:46

ok, now i got a real problem
lets say the server and one of four clients got an player entity. the client leaves the game. no problem. but! now I want to get the multiplayer pointer of the client-player-entity, so i can remove it with MP_killentity.
I tried many things (REALLY MANY) but nothing worked.
for example to get the multiplayer entity number with MP_GetNextEntityReference(pEntity) (NOTE TO ECG: the manual says it returns nothing, but it seems that it returns the multiplayer reference number.) but... then what?
I can't just say mp_killentity(nameofvarcontainsthenumber)
I also can't use the ptr_for_handle function (ok was a stupid idea) or anything else...
so my question: how can the server remove a entity for every client per "mp_killentity" when the server doesnt own the entity and so doesn't know the multiplayer-entity-pointer?
Posted By: Samb

Re: POPULACE or 3DGS? - 01/26/07 05:11

OH MY GOD!
mp_killentity(you); works?!?!
I need a big portion sleep...
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/27/07 16:39

Another question:

When MP_ConnectClient fails, because it can't find any server, it freezes my game...?

Micha
Posted By: Samb

Re: POPULACE or 3DGS? - 01/29/07 08:11

Quote:

Another question:

When MP_ConnectClient fails, because it can't find any server, it freezes my game...?

Micha



same here.
it would be the best if the DLL tries to connect and A6 could run without a little freeze.
so we could add a "connecting" animation etc.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 01/29/07 13:34

That's true too, yeah. More important: A "cancel" button could be implemented if it didn't freeze.
Right now it seems like the dll keeps trying to connect until it's forced to stop or succeeds.
Posted By: jigalypuff

Re: POPULACE or 3DGS? - 01/29/07 20:31

does populace allow for 32 players with commercial or does that only work with the pro version?
Posted By: Samb

Re: POPULACE or 3DGS? - 01/29/07 21:37

Quote:

does populace allow for 32 players with commercial or does that only work with the pro version?



populace even allow 32 with 3DGS standart version
Posted By: MadMark

Re: POPULACE or 3DGS? - 01/31/07 02:10

Oh man, you got me all fired up here, now. I've downloaded the SpaceFlag demo, and will be checking it out on the weekend (if the wife let's me). The price is right if it works as advertised. You are sure to sell volume at $50 a "PoP".

Cheers!
Mark
Posted By: Samb

Re: POPULACE or 3DGS? - 01/31/07 04:53

Quote:

Oh man, you got me all fired up here, now. I've downloaded the SpaceFlag demo, and will be checking it out on the weekend (if the wife let's me). The price is right if it works as advertised. You are sure to sell volume at $50 a "PoP".

Cheers!
Mark




hey madmark
the spaceflag isnt the best way to demonstrate populace.
the code looks like its have been written for the 3DGS multiplayer engine and just converted to populace.
the game doesnt work.
i think I will have my bomberman game ready to test at friday.
that will be a better reference
Posted By: MadMark

Re: POPULACE or 3DGS? - 02/01/07 01:23

NUTZ! I'm still poking around at my own spacer, and although it's FPS, I was hoping to see some relevance. I will look for your Bomberman then, and learn wherever I find knowledge. Multi-Player has been just a far off aspiration as I am but a budding scripter in a field full of blooming programmers...

Thanks samb, etal.
Mark
Posted By: D3D

Re: POPULACE or 3DGS? - 02/05/07 02:24

Hello Locoweed,

Really liked going trough the previous MP tutorial for GameStudio made by you and also reading the experiences from Ulf on this forum in the past. I don't make anything commercial. Just like to play with sth as an hobby, therefore I can't afford to buy GameStudio Professional for some extra MP features. However, when you finish the tutorials I intent to purchase Populace!

The reason I don't want to buy it right now is because of missing a good tutorial. Yes I know there are Populace Help, an extensive Populace API (ecg_mulitplay_wdl) and sample c-script file. (mPlay_sample_wdl). Plus sample game Space Flag available. Still, i'd like to learn things step by step from scratch. The way you explain things.

Thanks.

Dusty
Posted By: East_Coast_Games

Re: POPULACE or 3DGS? - 02/13/07 12:42

Dusty - No problem or explaination necessary. We appreicate your interest.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 02/19/07 14:55

East_Coast_games, 2 things.
1) MP_EntityCreate is slow. So what I'm looking for is a way to update my rockets/missiles some other way. Basically, I want to use ent_create and that way create the missile on every client. Then I want the missiles on each computer to move the same way.
I would use MP_EntityCreate, but it lags every time I do, and It's really annoying if the game stops for .25 of a second every time you shoot.
Any ideas? How could I use the normal ent_create and still update the entity?
Or would MP_TrackDefaults be enough? Would that work if I just create the entity on one client using ent_create?

2) When you join a game, and the IP address is wrong, it freezes. It would be good if you could at least exit the game or something...hmm...

Thanks,
Micha
Posted By: DARKLORD

Re: POPULACE or 3DGS? - 02/19/07 18:08

Maybe you can create some missles before game really starts, move them to an hidden place and then just change their position if you need them.
Posted By: Ran Man

Re: POPULACE or 3DGS? - 02/19/07 19:20

Yes, make a lot of missiles at 0.5 seconds after the level loads with ent_createlocal, and put them at a Z height of -70000 or some out of the way place, then make them appear when needed.

Anyways, I hope the new tutorials will include both multiplayer LAN and also multiplayer INTERNET ? Yes?
It sounds like a very nice product and I will need multiplayer in my game.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 02/19/07 22:19

Very good suggestion, and I thought about using that method at first. Then it turned out we'll have so many missiles this might not work out.
The problem is:
Every player can buy his missiles, his ammo. That means every time he buys ammo the game would have to freeze.
I guess I could use this method, but I really would prefer another one...
thx though!
Posted By: PHeMoX

Re: POPULACE or 3DGS? - 02/19/07 23:43

Don't delete missiles that exploded, just replace them again, i don't know how many players are in your game, but perhaps 'pre creating' 100 missiles would do the trick?

Cheers
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 02/20/07 08:21

Well, the goal is 16 players. (including AI, if I get it done...)
You have different types of rockets: a single rocket, or you can shoot 3 or maybe even 5 at the same time. You'll have a max of probably 20 rockets...
But since you have "reload" times in there, and you can only shoot the next rocket after about 4 secs (or even less), you can still shoot all 20 rockets before the first one explodes, 3*7 = 21, so you'd have to shoot 7 times to shoot all rockets, 7*4seconds = 28, and it takes about 40 secs for a rocket to run out of fuel and explode.
that means I could have a max of 20 rockets in the game from just one player. 20*16 is 320 rockets.
Additional to that I need the lasers + the mines (the latter don't get removed after some time)...
so it would be a lot of entities that I'd have to create. And I'd rather have more rockets than I just mentioned, not less...

I'll fiddle around with this: you create the rocket using ent_create and assign an index number to it. Then you send a command to all other players and they create a rocket with the same index number. then you can update the rocket's angle, speed vector, and position every view frames...

Not the best method, but I'll try it anyways...

Thanks!
Micha
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 02/28/07 14:40

Define health, skill44;
Define shield, skill45;

I've got a player that is created using MP_EntityCreate. He's got shield and health. When he's hit on one computer I want to reduce his health on all computers, by the same amount. That's why I tried:

MP_TrackSkill(player,MPUC_SKILL_44); //track shield and health...
MP_TrackSkill(player,MPUC_SKILL_45);

But, for some reason, the health can change on one computer while it doesn't change on the other. I could send it manually, using a string... but I don't want to do that if there already is a function for it.

Help??

Micha
Posted By: Samb

Re: POPULACE or 3DGS? - 02/28/07 17:15

@germanunkohl
please look at my bomberman example game

Quote:

2. MP_TrackSkill(pEnt, vEntitySkill); ist eine praktische Sache. Vorallem muss man folgendes beachten:
In der Spielerfigur Aktion steht:
MP_TrackSkill(my, skill1);
ALLE Clienten können den Skill1 ändern, dieser wird dann an alle gesendet.
Würde dort jedoch stehn:
MP_TrackSkill(pEntity, skill1);
Dann kann NUR der Spieler den Skill Verändern, welcher die Figur besitzt.
Da nur auf dem PC des Spielers pEntity auf die eigene Figur verweißt.
Wird dieser Skill nun vom Spieler verändert, dann wird er an alle anderen Spieler gesendet.
Verändert wer anderes den Skill, dann ist dieser Skill nur bei demjenigen verändert.




or in short english: if you use MP_TrackSkill(player,MPUC_SKILL_44); then only the player can change the skill.
but if you use MP_TrackSkill(my,MPUC_SKILL_44); everyone can change the skill of the entity.
Posted By: Germanunkol

Re: POPULACE or 3DGS? - 02/28/07 18:44

Somehow I don't like the populace doc. The tool would be so much better if ECG supplied more info!... or did I just read over this?
Thanks a lot, exactly what I need.
I never thought of checking in your script, great Idea, i'll do that next time I have a question...
thanks and happy brithday!!

Micha
Posted By: Samb

Re: POPULACE or 3DGS? - 02/28/07 19:09

Quote:

Somehow I don't like the populace doc. The tool would be so much better if ECG supplied more info!...



yes, but there is something useful in the doc.
"Execute as much locally as possible
a. Don’t send every frame of animation, rather send the animation state and let the local action determine the animation.
b. Health
c. Death & Destruction
d. When an entity changes state, pass the state and let the local action execute the state specific code (i.e. track skills)"

so,modifying the health of another player isn't the best way to do this.
why? well, maybe the player you are shooting at is on his computer 3 steps away from the position he is on your computer. that means that a guy with a slow internet connection could kill anybody with no problems. because the other player will "teleporting" their ways. they will stand still trough the lag.

oh, and thanks

- samb
© 2024 lite-C Forums