ZDaemon Forum Index ZDaemon
Client/Server DOOM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[ACS] Please add some commands support to multiplayer game

 
Post new topic   Reply to topic    ZDaemon Forum Index -> Implemented Requests
View previous topic :: View next topic  
Author Message
Miami_vice
has entered the game!


Joined: 06 Sep 2008
Location: Lithuania, Vilnius

PostPosted: Tue Sep 20, 2016 2:31 am    Post subject: [ACS] Please add some commands support to multiplayer game Reply with quote

I'm trying to create good and interesting things in Doom. ZDaemon is the most visited old Doom port online.

For online game I would like to add systems of rotating projectiles for instance Sphere. I started with it long ago. But not long ago I've learned to fully control rotations. For example if long ago I was able to rotate only horizontally now I can rotate at all 3D angles. The player can choose how to set the rotation axis. Main work is already done in ZDoom. Watch IT
I've rearranged code so it would be compatible in zdaemon. It works differently but is similar to original performance. I have tried part of all performance inside Zdaemon:

Single player performance: Watch this

Multiplayer performance: Watch this

Dear Zdaemon development team members please add support for multiplayer game for the following ACS commands:

Spawn - it can spawn monsters and ammo and all things that have mass but it cannot spawn projectiles. Thing ID must be set to spawned thing. SpawnProjectile - this ACS command specifically for projectiles works in zdaemon but only in single player game. Thing_projectile2 - old command to spawn and give velocity to projectile. It can also set TID to projectile. But it doesn't work in multiplayer. The only command that works online is Thing_Projectile.

SectorSound
FixedDiv FixedMul
Sin Cos
SetActorVelocity
SetActorPosition


P.S. One more thing - spawned projectiles must do damage to all actors. Currently under colision it doesn't disappear and you can cross them without damage.


Last edited by Miami_vice on Wed Sep 21, 2016 6:47 pm; edited 4 times in total
Back to top
View user's profile Send private message
Aeyesx
Dominating!


Joined: 13 Oct 2012

PostPosted: Tue Sep 20, 2016 11:04 am    Post subject: Reply with quote

Hey Miami_Vice

Its Medis!
Looks like your still working on your spheres Very Happy
Strange enough, i had to read it twice to imagine/understand what you really wanted.
Nice to see that you tried to remain compatible though.

Now, I am total dumb when it comes on ACS but ill know a little around.
So let's see~

Spawn
Works as we need (That may be important for a workaround!) which sounds good even though we cannot use it for projectiles.
(Thing_Spawn, SpawnSpot, SpawnForced, Thing_SpawnNoFog = non of those are suitable~)

SpawnProjectile (Is that what you ment? Since I could not find refference to ProjectileSpawn)
So this one suits for us ... but apparently it has some sort of missing netcode here. Which causes the it not to work in C/S mode as expected.
+ And as you mentioned Thing_projectile2 seems to have some missing netcode here either
(The Thing_Projectile seems not suitable for your needs so lets ignore it)

The workaround

Sometimes in ZDaemon one does have to be creative to achieve his goals.
Since the "Spawn fuction works properly". We can just make it spawn "spawner actor" which will be dummy and only spawns the projectile you need. This will reguire some DeHackEd / DehSUPP code work here.

The rest

SectorSound
Unsure here if related to older soundpart of the engine, but instead you can use many workarounds...

FixedDiv FixedMul
Lets describe it here... Is that a missing ACS functions?

Sin Cos
~ as above ~ (but i though these works as someone keeps using it) Confused

SetActorVelocity
~ description needed

SetActorPosition
~ description needed

Thing_remove
I though for eternity i used this bazzilion times and it always seemed to work ? Confused

Quote:
P.S. One more thing - spawned projectiles must do damage to all actors. Currently it doesn't disappear ander colision and you can cross them without damage.

*Imagination breaks*,
-Projectiles explodes when you touch them. (So who are "all" actors?). Shocked
-It doesn't disappear (what?), under collision and you can cross them without damage.(so you walked through BFG ball?) This needs a some test wad for sure cuz I cannot really imagine it. Shocked

More informations with test-wads always make it easier for developers to work on it.
Btw. what are the spheres for?
Back to top
View user's profile Send private message Send e-mail
Miami_vice
has entered the game!


Joined: 06 Sep 2008
Location: Lithuania, Vilnius

PostPosted: Tue Sep 20, 2016 2:11 pm    Post subject: Answer to Medis, the Aeyesx Reply with quote

Hello Aeyes. You seem to be very active in ZD forums.
I'm going to explain what you missed to understand:

Spawn - The command works fine for most things (actors) but cannot spawn projectiles and some other things. I haven't tested it online with absolutely all things. But I think it must spawn everything. Not only in single player but in multiplayer too.

Yes I was meaning the SpawnProjectile. Fulfill the missing netcode.
The Thing_projectile does not suit for my needs. Because it cannot set TID to spawned thing. It makes noise. When in loop you spawn 16 projectiles the sound is sixteen times stronger. Smile It is very useful in Flunky's LA-spacestation megawads.

Quote:
Since the "Spawn fuction works properly"
- It doesn't work properly. It's a fact. If it would work properly then everything you spawn in single player would work in multiplayer. It works the way you (ZD developers) programmed.

SectorSound - works in single player game but not in multiplayer. When you press a "button" - when you press a linedef which calls the script where the button texture is changed and sector sound propagate to the direction where sidedef is pointing. "SectorSound("switches/normbutn", 127);" It's not very important. But would be appreciated to feel realistic as you press smth.

FixedDiv FixedMul I believe that these works. I've written it just in case if creator didn't bothered to make it work in MP.

Sin Cos Maybe these work. But I think because it is used so rarely that the creator might forgot to add multiplayer support for it. But it is crucial to measure positions.

Link to SetActorVelocity It's similar to Spawn. The command is very important to give velocity to projectiles when it has to fly in measured circle orbits. I haven't testet yet nor in SP nor in MP. But I think it works in single player and again fails in multiplayer.

Link to SetActorPosition Very similar to SetActorVelocity. Instead of giving velocity to a thing it just set it's location.

Thing_remove - I believe it works. You used it millions of times. I've just typed it in case the creator forgot it.

If your imagination breaks I'm giving you the link to this example testing wad: Press to download In console type fly and try to fly into projectiles. See that nothing is happening. It cannot harm you. Something bad is done here. It is spawned using Spawn. But everything is ok when we spawn everything else.

Sphere is a beautiful stereometric shape. Since I'm able (and all you too are able) to spawn line of things then we can spawn any shape. It can be an ellipse, a pyramid, a triangle, a cube. In mathworld you can find formulas for almost all 2D and 3D shapes / figures. Use it in ACS via Spawn/SpawnProjectile and you can see it inside this program.

Why? Well it's an art. It's beautiful. Players would be impressed (or not?). It can be used for skybox. Or for all purposes you imagine. For example to represent atoms - Hydrogen Helium Litium ... Uranium with 238 compressed projectiles nucleus (as compressed sphere) and 238 flying around electrons in various orbits >> fast rotation near nucleus and slow far away etc.
For example you can create Serpent King - boss from Shadow Warrior. Skull granades rotate around this boss: Watch this So using Whacked4 or Decorate one can create such craeture inside Doom. Smile

I would pay to ZD Developer 50-200 Euros(via paypal or bank transfer) if he would enable all this in multiplayer and everything would work fine. If in Flunky's LA - ArchiInvasion game engine can handle 1000 demons then why the engine cannot support rotations of less projectiles?


Last edited by Miami_vice on Tue Sep 20, 2016 5:04 pm; edited 1 time in total
Back to top
View user's profile Send private message
Aeyesx
Dominating!


Joined: 13 Oct 2012

PostPosted: Tue Sep 20, 2016 3:24 pm    Post subject: Reply with quote

Hey,
I am Medis from irc ya know Very Happy .

So to remain clear, lets re-capitualte it.

What works
Aka what works both in SP and C/S mode.

Thing_projectile
Thing_remove
Spawn
- can be used for workaround i mentioned earlier.
- If by nature is able to spawn projectiles, but not in multiplayer... Try spawn rocket. By nature you cannot spawn projectile with zero velocity/speed in C/S mode.

What we do not know that it works
Aka we know it works in SP but we are unsure if works in C/S mode

FixedDiv
FixedMul
Sin Cos
SetActorVelocity
SetActorPosition

It would be nice to have a test-wad for each function to remove this "unknown" category to help it.

What does not work
Aka works in SP but misses netcode in C/S mode:

SpawnProjectile
SectorSound

The reason why projectiles does not hurt us is related to Spawn.
Projectiles with zero velocity/speed are considered as a dead/lagged entities and are ignored/removed.

Quote:
I would pay to ZD Developer 50-200 Euros

Heck i would too! The problem is in licence which makes us not having donate button!
Back to top
View user's profile Send private message Send e-mail
Aeyesx
Dominating!


Joined: 13 Oct 2012

PostPosted: Tue Sep 20, 2016 6:11 pm    Post subject: Reply with quote

Update projectiles you need with this flag.
Test online and update this topic please.

Code:
#This is comment
#There is also comment in the ()
 
Thing 35 (plasma ball)
Bits = NOSPEEDCHECK
 
#This makes sure that plasma ball will never get halted
Back to top
View user's profile Send private message Send e-mail
Miami_vice
has entered the game!


Joined: 06 Sep 2008
Location: Lithuania, Vilnius

PostPosted: Wed Sep 21, 2016 6:29 pm    Post subject: Kilgore's and Medis's help worked Reply with quote

Hi again.
Thank you Aeyesx. Your workaround worked. That Dehacked information for zd really changed smth.
Perhaps it doesn't check speed of a projectile and if it's zero in this case Zd doesn't ignore it. Without dehacked info zero velocity projectiles are ignored and disappear.

So, Bits=NOSPEEDCHECK helped in this case.

However the Spawn still doesn't work online with projectiles. Nor SpwanSpot. All ACS commands where projectiles spawn without specified velocity doesn't work online. For instance: Spawn("DoomImpBall", GetActorX(1), GetActorY(1), GetActorZ(1), getVariable(tag), angle+0.25>>8Cool)

I used Thing_projectile2 to spawn a projectile with some speed. Then with SetActorVelocity changed it's velocity to zero. I'm afraid that after this use the projectiles become unstable. For example some of them (like plasma rifle bolt) cannot be touched. Instead we can cross them without any damage. But as you see in my following video arachnotron plasma bolts do damage. So I'm not sure if SetActorVelocity does smth. Maybe there is another explanation for this. Maybe some projectiles are treated abnormal.
In next step I use SetActorPosition to relocate spawned projectiles from mapspot position to calculated position. It's a shame to use Thing_projectile2 instead of Spawn because with Thing_projectile2 player can hear loud spawning sound. This is because it is intended to shoot the projectile.

Then using rotation matrix theorem I calculate rotation axis equation and acoording it all projectiles new positions depending on changing angle.
All data is saved in arrays. The difference of two calculated nearby points gives a vector which is then used inside SetActorVelocity as X Y or Z velocity component. Till button is pressed a new loop is rotating whole system of projectiles - Sphere.

I don't know how hard Zd memory and engine is used but I hope that it has to work online and many clients should see it.
I will not be suprised if ZD would crash. Such thing is rare and is used in special ready for such load applications.

Video: Click to see

Some my used ACS Commands that work online:

Thing_projectile (perhaps also with non-zero speed)
Thing_projectile2 (when velocity is non-zero)
FixedDiv FixedMul
Sin Cos
SetActorVelocity
SetActorPosition
Spawn (without projectiles)

Commands that doesn't work online (multiplayer):

SectorSound

There is one more thing. ZD doesn't understand scripts with many variables. With 5-6 it's ok. But when there are more then nothing happens.
In this case you must write(assign) your varibales to outer array. That's right "outer" or that is defined outside above the script. In ZDoom you can already use arrays inside same script.

That's all.
Thank you Kilgore for assitance to Aeyes and thank you Aeyes aka Medis.


Last edited by Miami_vice on Tue Sep 27, 2016 11:04 am; edited 2 times in total
Back to top
View user's profile Send private message
Miami_vice
has entered the game!


Joined: 06 Sep 2008
Location: Lithuania, Vilnius

PostPosted: Thu Sep 22, 2016 11:17 pm    Post subject: Some insight Reply with quote

I would like to add that none of motionless projectiles do damage and you can cross them. But all of them do damage if it moves. In Dehacked Bits=NOSPEEDCHECK makes sure that after using SetActorVelocity (tid, 0,0,0 ,false, false) or SetActorPosition projectiles do not disappear. Is it good or bad thing decide for yourself.

But I think that it shouldn't disappear by deault after using a script if speed is zero. It should disappear after collision. Also projectiles must do damage always. No matter whether they move or not.
Back to top
View user's profile Send private message
Aeyesx
Dominating!


Joined: 13 Oct 2012

PostPosted: Fri Sep 23, 2016 2:14 pm    Post subject: Reply with quote

There is a good reason for this behaviour and existence of NOSPEEDCHECK.

Ï tried multiple things, but none yet told me why no damage is gained.
I will try figure out later.

You can always use dirty dehacked workaround to make projectile hurt you.

Edit: SPAWNSPOT works online, we kept using it in zdaemon wars
Back to top
View user's profile Send private message Send e-mail
Miami_vice
has entered the game!


Joined: 06 Sep 2008
Location: Lithuania, Vilnius

PostPosted: Sun Sep 25, 2016 3:35 pm    Post subject: Reply with quote

Aeyesx wrote:

Edit: SPAWNSPOT works online, we kept using it in zdaemon wars


Yes - for other things except motionless projectiles it works.
I was just obsessed with zero speed projectiles. You understood me.
So:

Spawn
SpawnSpot
-- works online for all things except projectiles. In commands' options there is no speed. So it is assumed to be zero.

void SpawnProjectile (int tid, string type, int angle, int speed, int vspeed, int gravity, int newtid);
The SpawnProjectile also works online for projectiles if and only if speed or vspeed is non-zero.

Same with Thing_Projectile, Thing_Projectile2 etc.

The case can be considered and closed.
Back to top
View user's profile Send private message
Krawa
There is a limit


Joined: 23 Nov 2008
Location: #SDA

PostPosted: Sun Jul 29, 2018 6:16 pm    Post subject: Reply with quote

Only SectorSound does not work online.
Everything else works meanwhile.

SectorSound_demo.wad
Back to top
View user's profile Send private message Visit poster's website
Krawa
There is a limit


Joined: 23 Nov 2008
Location: #SDA

PostPosted: Sun Nov 11, 2018 10:20 pm    Post subject: Reply with quote

Added for 1.10.06.
Back to top
View user's profile Send private message Visit poster's website
Miami_vice
has entered the game!


Joined: 06 Sep 2008
Location: Lithuania, Vilnius

PostPosted: Mon Nov 12, 2018 1:49 pm    Post subject: Reply with quote

Krawa wrote:
Added for 1.10.06.


Good Job.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ZDaemon Forum Index -> Implemented Requests All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group