Graal Forums  

Go Back   Graal Forums > PlayerWorlds > PlayerWorlds Main Forum
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 11-09-2006, 08:29 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Movement on Clientside doesn't work. NPCs don't really co-relate clientside, besides the this.save[] arrays ( which are limited )

The direction + face look can easily be simulated by three ganis: Look straight, Look Left, and Look Right. (unless you want a forth... Look Behind! Which is just awkward )

Movement could be easily done by serverside moves... But they won't be as responsive as clientside in the early days.

Now there's a clientside-serverside portion -- I don't know if that's considered. It might be elaborate to work that out.
Reply With Quote
  #17  
Old 11-09-2006, 09:28 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
A clientside-serverside portion?

I remember back in the day, the baddies would work just fine on the first computer in the room, then screw up for everyone else...I wonder, would it be possible to have the server (or leader) handle "Wandering", then when it hits hunt-mode go off the hunted's connection? That way the one attacking you is perfectly smooth (or as smooth as Clientside ever is), and the ones wandering aren't. Makes 'em hackable I suppose, you could send a packet saying "Nope, not here", but by that point you're doubtless hacking that the arrows are missing anyway...
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #18  
Old 11-09-2006, 09:44 AM
soulwazza soulwazza is offline
Registered User
Join Date: May 2006
Posts: 46
soulwazza is on a distinguished road
Tyhm to save classic
Reply With Quote
  #19  
Old 11-09-2006, 08:43 PM
Andy0687 Andy0687 is offline
Enigma
Join Date: Feb 2002
Posts: 1,072
Andy0687 is on a distinguished road
Tyhm I have a place you can test all this stuff if you really want to give it a shot.

Ill get in contact with you if you really want, and ill even help out :P I cant find much to help anyone with these days anyways.
Reply With Quote
  #20  
Old 11-09-2006, 11:47 PM
kinetaro kinetaro is offline
Hiding under your bed.
kinetaro's Avatar
Join Date: Jun 2006
Posts: 30
kinetaro is on a distinguished road
Send a message via AIM to kinetaro Send a message via MSN to kinetaro
here is a very basic script for clientside NPC movement.
NPC Code:

//#CLIENTSIDE
function onCreated()
{
showcharacter();
headimg = "head.png";
bodyimg = "body.png";
swordimg = "sword1.png";
shieldimg = "shield1.png";
this.speed = 0.5;
setTimer(0.1);
}
function onTimeout()
{
setcharani("walk", NULL);
for(pl: players) {
this.dir = getdir(pl.x - this.x, pl.y - this.y);
this.angle = getangle(pl.x - this.x, pl.y - this.y);
this.x = this.x + (cos(this.angle) * this.speed);
this.y = this.y - (sin(this.angle) * this.speed);
}
setTimer(0.05);
}


and to make it serverside its basically the same exact thing.
NPC Code:

function onCreated()
{
showcharacter();
headimg = "head.png";
bodyimg = "body.png";
swordimg = "sword1.png";
shieldimg = "shield1.png";
this.speed = 0.5;
setTimer(0.1);
}
function onTimeout()
{
setcharani("walk", NULL);
for(pl: players) {
this.dir = getdir(pl.x - this.x, pl.y - this.y);
this.angle = getangle(pl.x - this.x, pl.y - this.y);
x = this.x + (cos(this.angle) * this.speed);
y = this.y - (sin(this.angle) * this.speed);
}
setTimer(0.05);
}

Reply With Quote
  #21  
Old 11-10-2006, 03:21 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
andy: Yes, definitely. I can develop like a madman offline, but that doesn't do anyone any good these days.

Kintearo: Thanks immensely; I do my best work when I'm modifying something that works.

I'm curious: if one were to switch between the two (let clientside movement take over for a while, transfer back when the player dies/leaves), would the second player see the movement still? Jerky, sure- it always was, even with the originals- but could he still participate even as the baddy homes in on #1?
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #22  
Old 11-10-2006, 05:13 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Baddy Experiment 1: The Frog.

Terribly simple, and that's the point.

The script (note the constant references to clientside classic-style):

NPC Code:

if (created) {
showcharacter;
dontblock;
setcharprop #3,frog.png;
setcharani tyhm_frog_baddy_rustle,;
}
if (playerenters||timeout) {
if (isleader) {
if (this.counter==1) {
setcharani tyhm_frog_baddy,;
}else if (this.counter <3) {
this.vulnerable = 1;
this.attacking = 1;
} else if (this.counter < 4){
this.vulnerable = 0;
this.attacking = 0;
} else if (this.counter < 5){
hide;
} else {
this.counter = 0;
x+=random(-5,+5);
if (x>63) x=63;
else if (x<0) x=0;
y+=random(-5,+5);
if (y>63) y=63;
else if (y<0) y=0;
show;
}
this.counter+=0.05;
}
if (this.attacking > 0) {
if(playerx in |x-2,x+2| && playery in |y-4,y+1|){
hitplayer 0,1,x,y;
}
}
timereverywhere;
timeout=0.05;
}

if((wa****||wasshot||exploded)&&this.vulnerable>0) {
this.vulnerable = 0;
this.counter=0;
setcharani baddydead,;
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay greenrupee;
else if (temp.i<6) lay bluerupee;
else if (temp.i<9) lay heart;
destroy;
}



Timing's way off, gani's smoother but not quite as Correct - point is, this is the theory.
Attached Files
File Type: gani tyhm_frog_baddy.gani (1.5 KB, 127 views)
File Type: gani tyhm_frog_baddy_rustle.gani (574 Bytes, 122 views)
File Type: gani baddydead.gani (2.9 KB, 123 views)
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #23  
Old 11-10-2006, 05:32 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Attempted translation (someone else can figure out if it even works at all):

NPC Code:

function onCreated() {
showcharacter();
dontblock();
headimg = "frog.png";
setcharani("tyhm_frog_baddy_rustle",NULL);
setTimer(0.1);
}
function onTimeout() {
if (this.counter==1) {
setcharani ("tyhm_frog_baddy",NULL);
}else if (this.counter <3) {
this.vulnerable = 1;
this.attacking = 1;
} else if (this.counter < 4){
this.vulnerable = 0;
this.attacking = 0;
} else if (this.counter < 5){
hide();
} else {
this.counter = 0;
x+=random(-5,+5);
if (x>63) x=63;
else if (x<0) x=0;
y+=random(-5,+5);
if (y>63) y=63;
else if (y<0) y=0;
show();
}
this.counter+=0.05;
if (this.attacking > 0) {
//frankly, this part needs to be customized to each damage system anyway.
}
setTimer(0.05);
}

function onWa****(){
struck();
}
function onWasShot(){
struck();
}
function onExploded(){
struck();
}

function struck(){
if(this.vulnerable>0){
setcharani("baddydead",NULL);
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay(greenrupee);
else if (temp.i<6) lay(bluerupee);
else if (temp.i<9) lay(heart);
setTimer(0);
this.revive=1;
hide();
}
}

function onPlayerEnters(){
if (this.revive>0){
setTimer(0.05);
this.revive=0;
this.counter=5;
}
}

__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #24  
Old 11-10-2006, 06:00 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Haven't bothered scripting this one yet...the next logical step. If this one does well I can start on snipe-archers, then regular Baddies, then archers/dragons.
Attached Files
File Type: gani tyhm_oct_baddy_idle.gani (1.2 KB, 120 views)
File Type: gani tyhm_oct_baddy_walkslow.gani (1.3 KB, 122 views)
File Type: gani tyhm_oct_baddy_shoot.gani (1.4 KB, 120 views)
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #25  
Old 11-10-2006, 03:40 PM
kinetaro kinetaro is offline
Hiding under your bed.
kinetaro's Avatar
Join Date: Jun 2006
Posts: 30
kinetaro is on a distinguished road
Send a message via AIM to kinetaro Send a message via MSN to kinetaro
Quote:
Originally Posted by Tyhm View Post
I'm curious: if one were to switch between the two (let clientside movement take over for a while, transfer back when the player dies/leaves), would the second player see the movement still? Jerky, sure- it always was, even with the originals- but could he still participate even as the baddy homes in on #1?
I am not sure what you mean, I think you are talking about having the baddy move clientside and serverside so other players can help fight the baddy, but this doesnt make any sense, if you wanted everyone to be able to fight the baddy just make it fully serverside. If that is not what you meant please explain in more detail.
Reply With Quote
  #26  
Old 11-11-2006, 11:04 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
A little of each.

Say Client 1 and Client 2 enter a room. Baddy A is walking around on Serverside Control, but its clientside script is also running a local timeout loop on Clients 1 and 2 to see if the baddy sees them.
Client 1 walks in front of Baddy A - this triggers his local script, and Baddy A stops moving Serverside, instead moving per the script running on Client 1's computer. It moves, it attacks, all as fluidly as a clientside script.
Client 2 runs up behind and attacks Baddy A:
Does he see Baddy A still standing where it left Serverside Movement?
Is Baddy A jumping around based on Client 1's lag?

*shrugs* Something like that.
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #27  
Old 11-11-2006, 11:32 PM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Quote:
Originally Posted by Tyhm View Post
Attempted translation (someone else can figure out if it even works at all):

[/code]
Important: Forgot right before show; or show();, should say
setcharani tyhm_frog_baddy_rustle,;

Looks really weird otherwise.

Anyone got a chance to see if this works?
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #28  
Old 11-13-2006, 01:10 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
Swampsoldier ready for conversion

NPC Code:
if (created) {
showcharacter;
dontblock;
setcharprop #3,baddygray.png;
setcharani tyhm_swamp_baddy_hide,wbow1.png;
hearts=2;
this.counter=3.6;
hide;
}
if (playerenters||timeout) {
if (isleader) {
if (this.counter==1.5) {
// putleaps 0,x,y;
setcharani tyhm_swamp_baddy_shoot,wbow1.png;
}else if (this.counter <3) {
//there's a clever way to do the following in one line.
//I don't particularly care, though.
if (abs(playerx-x)>abs(playery-y)){
if(playerx<x) dir=1;
else dir=3;
}else{
if(playery<y) dir=0;
else dir=2;
}
this.vulnerable = 1;
if (this.counter == 1.8) {
setshootparams wasshot,1;
shoot x,y+0.5,1,(dir+1)*1.57,0,-1,adv_shot,advshot1.png;
//shootarrow dir;
}
} else if (this.counter < 4.4){
this.vulnerable = 0;
hide;
} else {
this.counter = 0;
setcharani tyhm_swamp_baddy_rustle,wbow1.png;
show;
}
this.counter+=0.05;
}
timereverywhere;
timeout=0.05;
}

if((wa****||wasshot||exploded)&&this.vulnerable>0) {
hearts--;
setcharani baddyhurt,;
if (hearts<=0){
setcharani baddydead,;
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay greenrupee;
else if (temp.i<6) lay bluerupee;
else if (temp.i<9) lay heart;
destroy;
}
}


I leave the Putleaps problem to people smarter than I - I scripted it into the gani, but it doesn't seem to Go. If I gotta gani the leaves in, I will, I'd just rather not.
Attached Files
File Type: gani tyhm_swamp_baddy_rustle.gani (829 Bytes, 119 views)
File Type: gani tyhm_swamp_baddy_shoot.gani (1.9 KB, 120 views)
File Type: gani tyhm_swamp_baddy_hide.gani (1.6 KB, 116 views)
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233

Last edited by Tyhm; 11-13-2006 at 04:32 AM..
Reply With Quote
  #29  
Old 11-13-2006, 04:29 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
I wish there was a way I could go back a few posts and just edit the original Frog posting...there probably is on graal.net or something, but I never did understand that site.
Oh well, here's the most recent version in OldScript...I'll start updating the NewScript as soon as I can get on a test server.

It'd be nice if Code mode didn't doublespace too...
NPC Code:
if (created) {
showcharacter;
dontblock;
setcharprop #3,frog.png;
setcharani tyhm_frog_baddy_rustle,;
}
if (playerenters||timeout) {
timereverywhere;
timeout=0.05;
if (isleader) {
this.counter+=0.05;
if (this.counter==0) {
timeout=1;
this.counter=1;
}else if (this.counter==1) {
setcharani tyhm_frog_baddy,;
}else if (this.counter <3) {
this.vulnerable = 1;
this.attacking = 1;
} else if (this.counter < 4){
this.vulnerable = 0;
this.attacking = 0;
} else if (this.counter == 4){
hide;
timeout = 1;
} else {
this.counter = 0;
x+=random(-5,+5);
if (x>63) x=63;
else if (x<0) x=0;
y+=random(-5,+5);
if (y>63) y=63;
else if (y<0) y=0;
show;
setcharani tyhm_frog_baddy_rustle,;
}
}
if (this.attacking > 0) {
if(playerx in |x-2,x+2| && playery in |y-4,y+1|){
hitplayer 0,1,x,y;
}
}
}

if((wa****||wasshot||exploded)&&this.vulnerable>0) {
setcharani baddydead,;
sleep 1;//I know, I know, bad form but it's temporary.
temp.i=int(random(0,20));
if (temp.i<5) lay greenrupee;
else if (temp.i<6) lay bluerupee;
else if (temp.i<9) lay heart;
this.vulnerable = 0;
this.attacking = 0;
hide;
timeout = 0;
}

__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
  #30  
Old 11-20-2006, 01:57 AM
Tyhm Tyhm is offline
Psionic Youth
Tyhm's Avatar
Join Date: Mar 2001
Location: Babord, West Graal Deaths:1009 Kills:1
Posts: 5,635
Tyhm has a spectacular aura about
- so nobody thinks this project's dead -
Been retooling the baddies using the Projectile theory: If a Projectile knows when it hits something, then having the frogs just be patches of grass that fire frog-shaped projectiles towards the sun should work...

Also, code is now posted on graal.net, since I can edit my posts THERE...
__________________
"Whatever," said Bean, "I was just glad to get out of the toilet."

"Power does not corrupt. Fear corrupts, perhaps the fear of a loss of power."- John Steinbeck
"I'm only acting retarded, what's your excuse?" queried the Gord.
- My pet, the Levelup Gnome

http://forums.graalonline.com/forums...&postcount=233
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 10:15 AM.


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