Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   shoot2() (https://forums.graalonline.com/forums/showthread.php?t=86743)

DustyPorViva 07-07-2009 07:17 AM

shoot2()
 
shoot2(x,y,z,angle,zangle,strength,gravity,options ,ani,aniparams);

Two additions:
1) built-in gravity parameter
2) an options parameter, much like the one used in move(). For starters, I just wanted one where you could define if the projectile looked for walls, but I figured if Stefan were to add this, an options would be the best way for possible expansion in the future without adding shoot3 and so on. Right now though, only thing I can think of is an option for wall detection(because as it is, emulating default arrows with shoot gives them wall detection, when default arrows do not have), but I'm sure there are eventually more options to define one day.

Crow 07-07-2009 12:33 PM

I would like a way to change the speed of projectiles, especially because Stefan already said somewhere that he will add it at some point :p

cbk1994 07-07-2009 01:29 PM

Quote:

Originally Posted by Crow (Post 1504855)
I would like a way to change the speed of projectiles, especially because Stefan already said somewhere that he will add it at some point :p

I agree completely.

DustyPorViva 07-07-2009 06:16 PM

Ya, I forgot about speed :)
Perhaps add that in there, or maybe replace gravity with it.

CremisiSteam 07-11-2009 02:37 AM

gravity XD when it the angle hitz 0 it splats on the ground lol

fowlplay4 07-11-2009 03:59 AM

It'd be nice if there was a findprojectile() too.

12171217 07-12-2009 06:45 AM

Why bother with all this when you can just triggerclient and add bullets into a clientside array, move 'em manually via systems NPC?

fowlplay4 07-12-2009 07:13 AM

Quote:

Originally Posted by 12171217 (Post 1506289)
Why bother with all this when you can just triggerclient and add bullets into a clientside array, move 'em manually via systems NPC?

Because functions hard-coded into Graal are typically faster than scripted solutions.

12171217 07-12-2009 05:49 PM

Hardly matters. It's not exactly CPU-rape.

DustyPorViva 07-12-2009 05:52 PM

Quote:

Originally Posted by 12171217 (Post 1506370)
Hardly matters. It's not exactly CPU-rape.

It's more efficient for the players(visually) and for the CPU.

12171217 07-12-2009 05:56 PM

It's not any smoother on the player's client o.o

Both are moved clientside, both are independent from what other players see, and both are moved at 20 FPS. Except with this one you can actually grab the projectile and move it about as you will.

DustyPorViva 07-12-2009 06:00 PM

Quote:

Originally Posted by 12171217 (Post 1506372)
It's not any smoother on the player's client o.o

Both are moved clientside, both are independent from what other players see, and both are moved at 20 FPS. Except with this one you can actually grab the projectile and move it about as you will.

In that case there would be a delay between firing and actual execution, if you have to communicate it to other players. It's just not as practical, especially when you start considering maybe 50 projectiles on the screen at once and all, or when if the system NPC is handling ALL of the servers projectiles, probably up to the thousands.

12171217 07-12-2009 06:04 PM

It only handles the projectiles in the same level, no different than what Graal does with default shoot() :D!

And that delay is no different than what you get with a regular shoot, if Graal was made correctly, that is. That's called latency, and most games deal with it :)

When using shoot():
Client requests shoot() to server -> Server accepts and -> Packets are sent to clients in same level about the shoot.

Triggerclient:
Client sends a trigger to the server -> Server accepts and -> Sends trigger to client, and in the same step, bullets are spawned.

On second thought, there might be an additional .05 delay if the bullets can't be spawned in the same step the trigger is received? But that's not hard to deal with. It's one frame for Christ's sake.

DustyPorViva 07-12-2009 06:13 PM

Quote:

Originally Posted by 12171217 (Post 1506376)
And that delay is no different than what you get with a regular shoot, if Graal was made correctly, that is. That's called latency, and most games deal with it

I know what latency is. However, I don't think I've ever really experienced any noticeable delay with shoot. It's clientside, and you pretty much get a projectile instantly. But with your method I imagine a pretty large delay depending on the players connection, because they'd have to communicate to the server and then the server communicate with them again... and for myself, that communication is far from instant.

12171217 07-12-2009 06:16 PM

So why don't you manually add it into the player who shoots it's array and ignore the additional trigger? That's not hard!

I think callweapon works in GS2? There, easily done.

fowlplay4 07-12-2009 07:35 PM

Quote:

Originally Posted by 12171217 (Post 1506378)
So why don't you manually add it into the player who shoots it's array and ignore the additional trigger? That's not hard!

I think callweapon works in GS2? There, easily done.

Never said it was hard, in fact it's just as easy to use a class and store the projectile math (angle, speed) in attrs and have it move on the clientside.

But why even bother with all that if we had a function like shoot2, I can't imagine how nice it would be just use it instead of scripted projectiles.

12171217 07-12-2009 07:58 PM

Spawning classes is a waste of bandwidth, though. Triggerclient and systems NPC ftw.

fowlplay4 08-20-2010 08:06 AM

Make it happen w/ V6 Stefan, make it happen.

Admins 08-20-2010 07:57 PM

This is mainly for emulating the default arrows with shoot()? Any ideas of handling the existing parameters differently to achieve that goal? What exactly is the problem?
(btw speed=strength)

MrDunne 08-20-2010 08:05 PM

Quote:

Originally Posted by Stefan (Post 1595450)
This is mainly for emulating the default arrows with shoot()? Any ideas of handling the existing parameters differently to achieve that goal? What exactly is the problem?
(btw speed=strength)

I think this is mainly for creating realistic arrows that travel along an arc through the air. I could be mistaken though.

fowlplay4 08-20-2010 09:47 PM

Quote:

Originally Posted by MrDunne (Post 1595454)
I think this is mainly for creating realistic arrows that travel along an arc through the air. I could be mistaken though.

You are, that's what shoot already does / allows you to do.

What I'm interested in is functionality to allow projectiles to ignore walls, and being able to change the speed of projectiles that use 0 strength + zangle.

12171217 08-21-2010 02:33 AM

Bullets can easily be sync'd perfecly if they have a linear path of travel and the creation time is known. I've written bullet handling system npcs in the past that use the methods I talked about previously in this thread and by no means are they CPU-hogs, and I've used them in the past on the old, old clients with no performance detriment either. Surely you guys can do the same to satisfy your needs, no?

As if we'll see a client update anytime soon, anyway. Make do with what you have.

MrDunne 08-21-2010 03:02 PM

Quote:

Originally Posted by fowlplay4 (Post 1595462)
You are, that's what shoot already does / allows you to do.

What I'm interested in is functionality to allow projectiles to ignore walls, and being able to change the speed of projectiles that use 0 strength + zangle.

PHP Code:

shoot2(x,y,z,angle,zangle,strength,gravity,options ,ani,aniparams); 

In regards to Dusty's post: What does the gravity parameter mean then? For shooting arrows along an arc, you have to do some math, I believe.

Crow 08-21-2010 03:19 PM

Quote:

Originally Posted by MrDunne (Post 1595596)
In regards to Dusty's post: What does the gravity parameter mean then? For shooting arrows along an arc, you have to do some math, I believe.

The thing is, we already have gravity with shoot(). But we can't alter it in any way, which makes it quite unusable.

MrDunne 08-21-2010 03:21 PM

Quote:

Originally Posted by Crow (Post 1595599)
The thing is, we already have gravity with shoot(). But we can't alter it in any way, which makes it quite unusable.

Ah, I get it now. Thanks for clearing that up for me.

Tigairius 08-21-2010 09:43 PM

Example of changing speed of shoot:
PHP Code:

temp.angle getangle(vecx(player.dir), vecy(player.dir));
temp.speed 1.5;
shoot(player.xplayer.yplayer.ztemp.angle0temp.speed"gani"ganiparam); 


Example of changing gravity of shoot:
PHP Code:

temp.angle getangle(vecx(player.dir), vecy(player.dir));
temp.oldgravity gravity;
gravity 5;
shoot(player.xplayer.yplayer.ztemp.angle01"gani"ganiparam);
gravity temp.oldgravity


fowlplay4 08-22-2010 12:53 AM

Quote:

Originally Posted by Tigairius (Post 1595652)
Example of changing speed of shoot:
PHP Code:

temp.angle getangle(vecx(player.dir), vecy(player.dir));
temp.speed 1.5;
shoot(player.xplayer.yplayer.ztemp.angle0temp.speed"gani"ganiparam); 


Falls right into the ground as soon as it's shot.

DrakilorP2P 08-22-2010 01:40 AM

Quote:

Originally Posted by fowlplay4 (Post 1595684)
Falls right into the ground as soon as it's shot.

Not if gravity is 0.

fowlplay4 08-22-2010 02:00 AM

Quote:

Originally Posted by DrakilorP2P (Post 1595692)
Not if gravity is 0.

Nifty, but now they go over walls which may or may not be what I need for every situation. Looks like I'll have to go custom or shoot2 with parameters to enable wall detection.

Admins 11-05-2011 01:54 AM

I've checked the shoot command because we want to possibly replace classic arrows with projectils on Classic iPhone. It seems we can already easily emulate them with the shoot command:
- if you want the projectile to pass walls: use speed=1, zero gravity
- if you want them to hit walls but move horizontally like classic arrows: use speed=0
You can also configure npcs to let them pass projectiles (but block players) with the npc.isblockingprojectiles = true/false variable, its best to set it on both client- and server-side (because it's not synced). There is was problem with inactive npcs ignoring it on server-side but it's fixed in the latest npcserver.

ffcmike 11-05-2011 06:26 AM

Quote:

Originally Posted by Stefan (Post 1673168)
I've checked the shoot command because we want to possibly replace classic arrows with projectils on Classic iPhone. It seems we can already easily emulate them with the shoot command:
- if you want the projectile to pass walls: use speed=1, zero gravity
- if you want them to hit walls but move horizontally like classic arrows: use speed=0
You can also configure npcs to let them pass projectiles (but block players) with the npc.isblockingprojectiles = true/false variable, its best to set it on both client- and server-side (because it's not synced). There is was problem with inactive npcs ignoring it on server-side but it's fixed in the latest npcserver.

Something I don't like about default projectiles is that onActionProjectile in a player weapon seems to be inaccurate, the projectile only has to fly next to or infront of you rather than actually collide with your player.
It would be good if there was a way to assign a sensitivity to default projectiles.

When I was using default projectiles on Classic I was instead using onActionProjectile2(), with a subsequent box intersect adjusted according to the movement angle of the projectile.
This worked a lot better, but this is inefficient to be checking upon every projectile landing, and Clientside onActionProjectile2 wasn't consistent with Serverside onActionProjectile(temp.x, temp.y, etc);.

Ofcourse it's excessive to have fully scripted projectiles, but then when you have your block checking storing the collision object, that actually reduced subsequent script time.

fowlplay4 11-05-2011 06:54 AM

@Stefan:

What if I want them to move and hit walls like classic arrows but make them fly faster?

ffcmike 11-05-2011 07:04 AM

Quote:

Originally Posted by fowlplay4 (Post 1673199)
@Stefan:

What if I want them to move and hit walls like classic arrows but make them fly faster?

Classic arrows... assuming you mean similarly to default shootarrow(dir); projectiles (default is a much better word to use), fly over walls.

fowlplay4 11-05-2011 07:58 AM

Quote:

Originally Posted by ffcmike (Post 1673201)
Classic arrows... assuming you mean similarly to default shootarrow(dir); projectiles (default is a much better word to use), fly over walls.

Right well the speed = 0 (like classic arrows using Stefan's words) behavior right now, I would like to make it faster but I don't want it to fly over walls.

ffcmike 11-05-2011 08:16 AM

Quote:

Originally Posted by fowlplay4 (Post 1673202)
Right well the speed = 0 (like classic arrows using Stefan's words) behavior right now, I would like to make it faster but I don't want it to fly over walls.

Then yeah afaik this isn't possible.

Admins 11-05-2011 04:36 PM

There is a server option for letting all arrows stop at walls, only works on serverside of course.


All times are GMT +2. The time now is 07:12 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.