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
monitor damage on mervbot?

 
Post new topic   Reply to topic Printable version
 View previous topic  mervbot / putfile Post :: Post How Many MERV's?  View next topic  
Author Message
doh
Guest


Offline

PostPosted: Wed Jun 18, 2003 4:54 am    Post subject: monitor damage on mervbot? Reply to topic Reply with quote

i would like to monitor damage on mervbot after doing !ship and !follow off...giving him watchdamage on himself in a dll didnt seem to work. also, easy way to make him not fire and set his energy? thanks.
Back to top
Doggeti
Server Help Squatter


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

PostPosted: Wed Jun 18, 2003 7:18 am    Post subject: Reply to topic Reply with quote

1.
An easy way to make him not fire is to !follow BotName.

2.a)
In player.h is the struct definition for Player. There you find
Code: Show/Hide
Uint16 energy;

Just do
Code: Show/Hide
String s = "Bot energy: ";
s += me->energy; // me is a pointer to a Player (the bot)
sendPublic(s);

on every Tick-Event.

2.b)
If you are SysOp you can also do *energy. So you will see other players energy.

3.
I don't think there is a way to set the energy of any player.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
doh
Guest


Offline

PostPosted: Wed Jun 18, 2003 7:33 am    Post subject: hmmm Reply to topic Reply with quote

thanks for the tips (:
!follow off isnt an option for what i'm trying to do to make the bot stop firing..and i meant setting the bots initial energy, when it spawns it seems to have super or something. fires at an insane rate and doesnt take damage...ideally what i want is for the bot to die when hit, but if i can monitor damage taken on the bot then i can kill it manually i spose. under player.cpp i see a constructor for Player() setting energy = 0; is this what's giving it seemingly infinite energy? in settings.h i see a struct called shipSettings, containing all of a ship's settings...are these read-only values are or they used to set the bot's ship settings? any more input would be appreciated (:
Back to top
Doggeti
Server Help Squatter


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

PostPosted: Wed Jun 18, 2003 8:20 am    Post subject: Reply to topic Reply with quote

No, thats only the normal initializing for all players.

I think ship settings are read only, but I am not sure.
Back to top
View users profile Send private message Add User to Ignore List Send email AIM Address
doh
Guest


Offline

PostPosted: Wed Jun 18, 2003 8:54 am    Post subject: well.. Reply to topic Reply with quote

well when i turn on *energy and spec the bot its energy seems to always be zero, so i guess it isnt just using default zone settings as to the energy...from what i can tell, the !ship command just calls botInfo.setArena() and passes the arena name, the ship type, the x and y res, and allowAudio. where is the code that tells the bot to continously fire, and aim at the nearest target? i cant even seem to find it, i didnt see anything else under botInfo, and i skimmed through all of the other files and didnt see anything...anyone?
Back to top
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Wed Jun 18, 2003 1:54 pm    Post subject: Reply to topic Reply with quote

Search for "// Auto-turret" in host.cpp
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
doh
Guest


Offline

PostPosted: Wed Jun 18, 2003 11:50 pm    Post subject: thanks Reply to topic Reply with quote

thanks for the tip, from looking at that code, sendPosition does most of the work, i now have it so the ship neither turns nor fires, which is what i wanted. i'm having a bit of trouble knowing when the ship is hit with a bullet, however. since its now clear to me the bot doesnt function as the normal client would when in turret mode...it just sort of sends packets ad hoc to accomplish what it wants, yes? because of this, i cant easily figure a way to detect when its hit by a bullet, like via *watchdamage or *energy. is there some built in function to do this? any suggestions if there isnt? thanks (:
Back to top
Smong
Server Help Squatter


Joined: 1043048991
Posts: 0x91E
Offline

PostPosted: Thu Jun 19, 2003 2:38 pm    Post subject: Reply to topic Reply with quote

I don't know much about merv (does it receive weapon packets all the time, or only when people fire them?), but I'm guessing you would have to add some physics code. It would have to move the projectiles based on ticks passed and the settings of the arena, then check for a collision.

This would mean storing all projectiles and removing them after bullet/bomb time is up. It shouldn't be too much of a problem as the server only sends you nearby weapons (maybe tell the server you are in a low resolution?).

So basically you need to keep track of weapons and check their position with yours.
Back to top
View users profile Send private message Add User to Ignore List Visit posters website MSN Messenger
doh
Guest


Offline

PostPosted: Thu Jun 19, 2003 10:45 pm    Post subject: yeah... Reply to topic Reply with quote

yeah i've been working on that actually, seems fairly straightforward to do weapons location prediction. couple of questions. bulletspeed, xvel yvel of player, etc, are these values in pixels/second? if so wouldnt this change depending on resolution...other question would be, is the sendPosition() data (more specifically, the weapon data, or EVENT_PlayerWeapon) sent out to everyone in arena, or do you just receive packets from those you see on radar? (i hope the former is true but i recall reading something on mine go boom's SSOS page stating that radar having a larger value uses up more bandwidth for each client, which would be indicate of position data only being sent if user is on radar). btw, thanks for the response dude. i thought this topic was gonna die icon_smile.gif
Back to top
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Thu Jun 19, 2003 11:16 pm    Post subject: Reply to topic Reply with quote

Speed is in pixels per 1/10th of a second. And no, it doesn't vary on different resolutions. Think of a pixel as a foot or a meter. An object's speed doesn't change if your looking at it normally, or using binoculars.

As for which weapons are sent to you, it doesn't depend on resolutions. The only reason the server knows that is so back in the day, Jeff and the other programmers can get stats on what type of systems people were using. As to how the server figures out if to send you a weapon or not, the template.sss tells you that:
Quote:
Routing:RadarFavor:1:7:Number of packets somebody on radar receives (1 = every packet, 3 = every fourth packet, 7 = every eighth packet)
Routing:CloseEnoughBulletAdjust:0:512:Distance off edge of screen in pixels that bullet packets will always forward to player.
Routing:CloseEnoughBombAdjust:0:4096:Distance off edge of radar in pixels that bomb packets will always forward to player. (in direction bomb is heading only)
Routing:DeathDistance:1000:16384:Distance death messages are forwarded.
Routing:DoubleSendPercent:500:900:Percentage packetloss at which server starts double sending weapon packets.
Routing:WallResendCount:0:3:Number of times a create wall packet is sent unreliably (in additional to the reliable send)


Since everyone's radar range is the same (as set in the [Radar] section), the above settings work fine for everyone.
Back to top
View users profile Send private message Add User to Ignore List Send email
doh
Guest


Offline

PostPosted: Fri Jun 20, 2003 9:48 am    Post subject: sweet Reply to topic Reply with quote

thanks mgb. pixels per 1/10th of a second eh, damn. so for example my bulletspeed is 4600, the bullets are moving at 46000 pixels per second? that seems way too fast, but i must be thinking of actual pixels and not the pixel unit ss uses. funny thing is, i asked because i thought 4600 pixels/second seemed a bit too fast tongue.gif
out of curiosity, how come you never implemented the bot having damage? i asked on ssforum.net and SOS said something like "it is not supported and never will be supported". maybe there's some major roadblock i havent foreseen that you guys know about? you'd know a hell of a lot better than i would the feasibility of such a thing, so i thought i'd ask why you hadnt done it (:
Back to top
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:41
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3615
Location: Las Vegas
Offline

PostPosted: Fri Jun 20, 2003 11:35 pm    Post subject: Reply to topic Reply with quote

My bad, it was pixels per 10 seconds. I got the 1/10th part on the wrong side. So divide the number by ten, and thats how many pixels per second its moving.

As for making bot damage, you mean to be able to calculate if it was hit by a weapon? Umm.. thats a lot of work to get that, and not very practical. Might as well make a new open source client then.

Why i havn't done it? Time. Barely have time enough to glance over grelminar's changes (rare as they are now) for the linux server, and convert some of it over to win32. Only reason i still respond to posts here is because its ~11pm and doing so before i go to sleep.
Back to top
View users profile Send private message Add User to Ignore List Send email
doh
Guest


Offline

PostPosted: Mon Jun 23, 2003 2:52 pm    Post subject: ah Reply to topic Reply with quote

well, time is a good reason not to do it (:
i'm working on it now, i have a rudimentary weapons prediction and collision detection system working, it seems 100% accurate - only works for a stationary bot atm, but that will soon change...havent dealt with bombs or prox yet either, which could be a bitch. but overall, doesnt seem very difficult, cuz i'm a total cpp noob and it seems to be coming along tongue.gif
i guess this post has long died, i was actually checking back to find your answer about speed in pixels for the time calculations to be used in adding collision detection calculation when the bot is moving..and i was hoping it was every 10 seconds, so that's music to my ears, thanks for the info, and the awesome forum, while i'm doling out appreciation.
-eric
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Bot Questions All times are GMT - 5 Hours
Page 1 of 1

 
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: 30 page(s) served in previous 5 minutes.

phpBB Created this page in 0.474069 seconds : 37 queries executed (93.4%): GZIP compression disabled