Bots

Post here your suggestions for new possible features in SmartFoxServer.

Moderators: Lapo, Bax

User avatar
goodguy20k
Posts: 71
Joined: 10 Jan 2006, 23:58
Location: Texas, USA
Contact:

Bots

Postby goodguy20k » 17 Mar 2006, 18:52

Could you make a bot user? Something you can create on serverside that looks JUST LIKE a user, but isn't really a user. That way you could create bot users that show up in rooms and you can control on serverside. This would be HIGHLY useful for my program, and I'll be using an alternate means until something like this happens. I would SO love to see this!

P.S. It's not THAT hard, right Lapo? :wink: 8)
User avatar
Lapo
Site Admin
Posts: 23026
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 19 Mar 2006, 13:56

Of course you can, you can implement your bots in your Zone or Room extensions. About how hard this can be it only depends on what you expect they do...

:)
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
goodguy20k
Posts: 71
Joined: 10 Jan 2006, 23:58
Location: Texas, USA
Contact:

Postby goodguy20k » 20 Mar 2006, 01:48

If you mean totally severside, that's what I'm workin' on right now. But it would be so nice if I could do a _server.loginUser("bot"+randomId, null, null) type thing. Something that just automatically shows up in userlists and stuff. That would just be so nice... But unless you do this, I'll have to hard code it... :wink:
User avatar
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Postby Virusescu » 20 Mar 2006, 07:38

why do you need your bot to be displayed as a user?
The bots are not users. Don't confuse them with the mirc bots kind of thing.

When you want to speak with a bot you speak through the extension...
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
User avatar
goodguy20k
Posts: 71
Joined: 10 Jan 2006, 23:58
Location: Texas, USA
Contact:

Postby goodguy20k » 20 Mar 2006, 14:11

Why not consider them users? In my case, they ARE basically users. They'll have the same variables, look the same, move the same, most the stuff is the same. Only difference is, the server controlls them completely.
User avatar
Virusescu
Posts: 260
Joined: 07 Sep 2005, 09:36
Location: [RO]Bucharest
Contact:

Postby Virusescu » 20 Mar 2006, 15:15

Well my point was that as long as you want to code this properly you don't want to consider them users. Users are Clients. For a bot to work the same as your client you will need to write client code.

You can overide some of the SFS methods but... well... I don't know.

Users are identified by communications chanels. They represent a connection estabilished between the server and some swf.

This is how I would do it but maybe you are just trying to avoid writing extra code.
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}
User avatar
goodguy20k
Posts: 71
Joined: 10 Jan 2006, 23:58
Location: Texas, USA
Contact:

Postby goodguy20k » 20 Mar 2006, 15:56

Well, yes and no. (Correct me if I'm wrong, though.) Users are a data object. Yes, on serverside, it handles connection information, but clientside, you can't find it's IP, ping time, etc. For the most part, it is just a data object. Variables are stored in it, such as position, color, etc. It gets passed to everyone in the room.

For a bot to work the same as your client you will need to write client code.


Kind of. But I'm building my movement engine serverside. This is part of where I think a bot user type could be nice. My function takes in a user object, works with it, and by the end of the function, the user has been moved around, or is moving. Right now, I have to either write two seperate functions or seriously modify my code.

Also, thanks to the power of serverside, you can do MOST of the client code on serverside.

Users are identified by communications chanels. They represent a connection estabilished between the server and some swf.


So you need a "bot" user type. The server code should be smart enough to spot a flag that says "I'm a bot" and not send data anywhere. Back to the, I just want to use the user as a data object.

This is how I would do it but maybe you are just trying to avoid writing extra code.

You got it man! But the truth is, right now I have to write extra code because this ISN'T availible. But if I could find it useful now, who else could find it useful LATER?

Return to “Features Wish List”

Who is online

Users browsing this forum: No registered users and 39 guests