Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Moving ball
Goto page 1, 2  Next
 
Post new topic   Reply to topic Printable version
 View previous topic  cred-gamble? 50% Packetloss Post :: Post ?Commands  View next topic  
Author Message
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Tue May 25, 2004 5:08 am    Post subject: Moving ball Reply to topic Reply with quote

Is it possible to move a ball without touching it ( warping the ball carrier to the new position and spec / shipchange him ) ?
_________________
Expect the worst but hope for the best.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
wEaViL
Don't make me turn this forum around!


Age:45
Gender:Gender:Male
Joined: Feb 17 2003
Posts: 829
Location: nc usa
Offline

PostPosted: Tue May 25, 2004 7:57 am    Post subject: Reply to topic Reply with quote

http://www.subspacedownloads.com/index.php?act=list&cat=22 theres 2 ball mover plugins in there. I'm not sure if this is what your looking for but they where made to move the balls if they spawn or are placed in a area outside of the map or in inclosed sections of the map.. from the description of one of them you just input the coords into the ini for the sections of the map that the bot will move the ball out of if the ball is in there.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address Yahoo Messenger MSN Messenger
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Tue May 25, 2004 8:40 am    Post subject: Reply to topic Reply with quote

I am not looking for already made plugins but I want to know what you have to code into MervBot to move it.
I am currently writing a plugin and it would help me a lot if I knew how to do that.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue May 25, 2004 11:07 am    Post subject: Reply to topic Reply with quote

Bot needs to send packet to pickup ball. This only has a chance of working if the ball is loose. Then the bot has to wait until the ball is caught by someone. If it is not itself, then it must wait until the ball is passed to try to pick it up again (another pickup packet), or spec the carrier. Even that does not guarantee a loose ball as another nearby ship may quickly pick it up.
_________________
4,691 irradiated haggis!
Back to top
View users profile Send private message Add User to Ignore List
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Tue May 25, 2004 1:02 pm    Post subject: Reply to topic Reply with quote

I don't understand this process so please forgive me if my question sounds stupid in your ears. How do I control to where the ball will be moved?
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue May 25, 2004 1:35 pm    Post subject: Reply to topic Reply with quote

Once the bot has the ball (I assume whatever core you use has some "ball has been picked up by player" event), you just need to issue a ball-pass packet. To place it unmoving at a location, use zero for dx and dy (movement vector). Sorry for the vagueess; I don't know the API's for other bot cores.
Back to top
View users profile Send private message Add User to Ignore List
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue May 25, 2004 4:02 pm    Post subject: Reply to topic Reply with quote

tell(makeShip(SHIP_Warbird));//sc to ship 1
tell(makeGrabBall(0));//the 0 is the ball's ident

me->move(512*16,512*16);//tells the bot the coords you want
tell(makeSendPosition(true));//makes the bot actually go there

You might even want to turn off some stuff when the bot goes in,

tell(makeFollowing(false));//makes the bot stop following people
tell(makeFlying(true));//makes the bot stop sending it's own position BS

if you do the avove, add in event_positionhook:
tell(makeSendPosition(false));


then at end,
tell(makeShip(SHIP_Spectator));//the ball is dropped at bot's final location
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Doggeti
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Jan 12 2003
Posts: 297
Location: Germany
Offline

PostPosted: Tue May 25, 2004 4:08 pm    Post subject: Reply to topic Reply with quote

Thank you very very much ! grav_cool-hands.gif
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue May 25, 2004 4:20 pm    Post subject: Reply to topic Reply with quote

That will not work if the bot fails to grab the ball. A bot (client) cannot forcibly take a ball from a player without putting them into spec.
Back to top
View users profile Send private message Add User to Ignore List
D1st0rt
Miss Directed Wannabe


Age:37
Gender:Gender:Male
Joined: Aug 31 2003
Posts: 2247
Location: Blacksburg, VA
Offline

PostPosted: Tue May 25, 2004 4:46 pm    Post subject: Reply to topic Reply with quote

unless you know how to forge a packet from someone else
_________________

Back to top
View users profile Send private message Add User to Ignore List Visit posters website
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue May 25, 2004 5:30 pm    Post subject: Reply to topic Reply with quote

D1st0rt wrote:
unless you know how to forge a packet from someone else


Which would cause them to be disconnected when they get out of sync with ACK's. icon_smile.gif
Back to top
View users profile Send private message Add User to Ignore List
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Tue May 25, 2004 5:31 pm    Post subject: Reply to topic Reply with quote

yah, you cant take the ball from someone else

so if(ball->carrier != 0xFFFF)
then you wont be able to get the ball. You can force a player to drop the ball by shipchanging them
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Tue May 25, 2004 10:37 pm    Post subject: Reply to topic Reply with quote

Even if ball->carrier == 0xFFFF, there's no guarantee that issuing tell(makeGrabBall(0)); will get you the ball. Someone else may grab it first.
Back to top
View users profile Send private message Add User to Ignore List
Guest



Offline

PostPosted: Wed May 26, 2004 1:19 am    Post subject: Reply to topic Reply with quote

you CAN take the ball when another player is holding it... It's a subgame bug and won't work in ASSS (unless you tell ASSS to let it work), but does work in subgame.

all the code you really need is:

int ident = ball->ident;

tell(makeShip(SHIP_Warbird));
tell(makeGrabBall(ident));
tell(makeFireBall(ident, ball->x, ball->y, ball->xvel, ball->yvel));tell(makeShip(SHIP_Spectator));

the bot might "flicker" for a second over a player but it shouldn't affect the game. You also might want to prevent disable the default mervbot turret behavior... as he might kill the player he "flickers" over if this option isn't disabled.
Back to top
VampZ
Guest


Offline

PostPosted: Wed May 26, 2004 1:20 am    Post subject: Reply to topic Reply with quote

opps... forgot to press enter

int ident = ball->ident;

tell(makeShip(SHIP_Warbird));
tell(makeGrabBall(ident));
tell(makeFireBall(ident, ball->x, ball->y, ball->xvel, ball->yvel));
tell(makeShip(SHIP_Spectator));
Back to top
VampZ
Guest


Offline

PostPosted: Wed May 26, 2004 1:31 am    Post subject: Reply to topic Reply with quote

or instead of using ball->x and ball->y you can use your position in pixels and ball->xvel and ball->yvel is in pixels / 10 seconds

Sry about the triple post
Back to top
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 26, 2004 11:11 am    Post subject: Reply to topic Reply with quote

Anonymous wrote:
you CAN take the ball when another player is holding it... It's a subgame bug and won't work in ASSS.


I don't believe you. What is the bug?
Back to top
View users profile Send private message Add User to Ignore List
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Wed May 26, 2004 11:30 am    Post subject: Reply to topic Reply with quote

It seemed to have worked, the tell(makeGrabBall(ident)); was enough to do it. Here is the code that is executed
Code: Show/Hide

h->postRR(generatePowerballRequest(pb->hosttime, id));//this is what
//happens after the tell(makegrabball(int)); Below are the functions


clientMessage *generatePowerballRequest   (Uint32 timestamp, BYTE ball)
{   clientMessage *ret = new clientMessage(6);
   if (ret == NULL) return NULL;
   char *msg = ret->msg;

   /*   Field   Length   Description
      0      1      Type byte
      1      1      Ball ident
      2      4      Timestamp
   */

   msg[0] = 0x20;
   msg[1] = ball;
   *(Uint32*)&msg[2] = timestamp;

   return ret;
}
void Host::postRR(clientMessage *cm)
{
   if (cm)
   {
      post(cm->msg, cm->len, true);
      delete cm;
      cm = NULL;
   }
}

void Host::post(char *msg, Uint32 len, bool reliable)
{
   char buffer[PACKET_MAX_LENGTH];

   if (len > CHUNK_SIZE + 12)
   {   // Chunk it
      if (len > 1000)
      {
         for (Uint32 i = 0; i < len; i += CHUNK_SIZE)
         {
            buffer[0] = 0x00;
            buffer[1] = 0x0A;
            *(Uint32*)&buffer[2] = len;

            Uint32 remaining = len - i;

            if (remaining > CHUNK_SIZE)
            {   // Chunk body
               memcpy(buffer + 6, msg + i, CHUNK_SIZE);

               post(buffer, CHUNK_SIZE + 6, true);
            }
            else
            {   // Chunk tail
               memcpy(buffer + 6, msg + i, remaining);

               post(buffer, remaining + 6, true);
            }
         }
      }
      else
      {
         buffer[0] = 0x00;
         buffer[1] = 0x08;

         for (Uint32 i = 0; i < len; i += (CHUNK_SIZE + 4))
         {
            Uint32 remaining = (len - i);

            if (remaining > (CHUNK_SIZE + 4))
            {   // Chunk body
               memcpy(buffer + 2, msg + i, CHUNK_SIZE + 4);

               post(buffer, CHUNK_SIZE + 6, true);
            }
            else
            {   // Chunk tail
               buffer[1] = 0x09;

               memcpy(buffer + 2, msg + i, remaining);

               post(buffer, remaining + 2, true);

               break;
            }
         }
      }
   }
   else
   {   // We're dealing with byte-sized messages now
      if (reliable)
      {   // Stamp reliable header
         buffer[0] = 0x00;
         buffer[1] = 0x03;
         *(Uint32*)&buffer[2] = localStep;
         memcpy(buffer + 6, msg, len);
         msg = buffer;
         len += 6;

         if (queue(msg, len) == false) return;
      }

      if (clustering)
      {   // Append to cluster list
         clusterMessage *m = new clusterMessage(msg, len);
         if (m)
            clustered.append(m);
         else
            send(msg, len);
      }
      else
      {   // Send right away
         send(msg, len);
      }
   }
}
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 26, 2004 12:55 pm    Post subject: Reply to topic Reply with quote

I know how the packets work. I don't need to see the MERV garbage.

If any client can send grab-ball packet and have it work, then clients with higher ping would be stealing the ball from other ships all the time. I don't see how this makes sense at all.
Back to top
View users profile Send private message Add User to Ignore List
-Smong-
Guest


Offline

PostPosted: Wed May 26, 2004 1:37 pm    Post subject: Reply to topic Reply with quote

Maybe because when another player gets near the ball it goes fazed so the lagged player won't even send a ball request?
Back to top
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 26, 2004 2:09 pm    Post subject: Reply to topic Reply with quote

Phasing is client-side.
Back to top
View users profile Send private message Add User to Ignore List
-Smong-
Guest


Offline

PostPosted: Wed May 26, 2004 2:31 pm    Post subject: Reply to topic Reply with quote

Which is why the bot can get the ball as it doesn't implement phasing.
Back to top
Mr Ekted
Movie Geek


Gender:Gender:Male
Joined: Feb 09 2004
Posts: 1379
Offline

PostPosted: Wed May 26, 2004 2:36 pm    Post subject: Reply to topic Reply with quote

Yes, but that means that any client that doesn't think another player should be able to grab the ball could steal it from them. I've never seen this happen, only the opposite (both clients think the other player should grab it, so neither tries, ball phases and no one gets it).
Back to top
View users profile Send private message Add User to Ignore List
VampZ
Guest


Offline

PostPosted: Thu May 27, 2004 12:20 am    Post subject: Reply to topic Reply with quote

in botdll.cpp event_ballgrab:

h->postRR(generatePowerballRequest(pb->hosttime, id));

it looks like it uses the same timestamp from the last ball event... which is probably before any player could pick it up.

The server probably takes whichever one grabbed it earlier and uses that.

In either case, I've made a bot that can "steal" the ball from players... so it can be done.
Back to top
50% Packetloss
Server Help Squatter


Age:40
Gender:Gender:Male
Joined: Sep 09 2003
Posts: 561
Location: Santa Clarita, California
Offline

PostPosted: Thu May 27, 2004 1:45 am    Post subject: Reply to topic Reply with quote

catid says that subgame inadequately checks powerball requests. I forgot his exact words.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can 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
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 15 page(s) served in previous 5 minutes.

phpBB Created this page in 0.481447 seconds : 49 queries executed (92.1%): GZIP compression disabled