Just a bot thought!
#1

Hello,

*This is for discussion, there is no pressure on devs, admins, etc. It's just speculation.

I've seen many posts about people saying that there should be bots similar to the ones in single player. In replies to these posts, others have said that it would take too much memory and bandwidth to synchronize the bots amongst the clients.

I can agree with the memory/bandwidth usage problem, but I believe that the process of synchronizing the bots can be modified to take less bandwidth, but it would require a little more calculation, etc.

The general idea that I've seen floating about is that bots would have to be synchronized at all times, for every player. So, what if you didn't synchronize them at all times?

I look at it like this. Other on-line games, with bots roaming about seem to run smoothly, and do have sync, but there is some lag, there will always be lag. After a bit of thinking(and common sense), I realized that these games do not remember the position of every bot on the map, that would be extremely resource heavy.

Instead of remembering the position of every bot, the server uses the position of the players, and some basic spawn areas along the sides of the streets, to decide wherever bots should spawn. With the player location, and the bot spawn areas, the client will create bots at the edge of these areas(VIA a script built into the SA:MP client). So, if the player is in the road standing, not moving whatsoever, bots would only spawn about 20 units away from the player, and would walk towards the other side of the spawn radius, along the pathway determined by the bot paths in the spawn area. If a bot spawned on one side reaches the other side of the spawn area, the bot is deleted, and the client script creates another in it's place, randomly in the same fashion.

At this point, we basically have one player, roaming the map with a simulated population, when in reality, there are only 10 or so client side bots being spawned around him, depending on his position.

If another player was to join the server, he/she would also get their own set of bots. These bots would be created in the same manner as the first players' bots. This would result in 10 bots for each player, but the server would not have to worry about any. At this time, bots are completely client side. These bots have a mini script, built into the client, that basically says, once the bot exceeds the player's view radius, you are destroyed. This prevents the bots from being created over and over. Also, because of this client-side script, the server does not need to worry about the bot's positions.(Yes, client side scripts are possible, but this script should be built into the SA:MP client, that way it cannot be modded, etc)

Now, lets say that these two players meet up. To decrease the amount of bots, both of the player's spawn areas would kind-of merge. So if the players are standing next to each other, instead of having 20 bots for both , they only really need 10, because they are in the same area. As they come closer, their bot spawn radius would change. As it merges, the 20 bots that both players have slowly decreases to 10, and as this happens, bots spawned within both player's spawn radius sync for both players. These synced bots, are now managed by the server. The end result being that both players can see 10 bots, walking the streets, and see them synced correctly.

Of course, the sync would take a little bandwidth, something equal to that of player sync. But the advantage is that if a player is alone, the server doesn't need to worry about syncing that player's bots, because only he/she has to see them.

I hope this post don't tick anyone off, and please don't delete it. I just wanted to post it out there, because it was bugging me.(I felt like I had to post it)

Thanks,

CodeMatrix

Reply
#2

Quote:

Thanks For Bringing That Up By The Way!
No problem

CodeMatrix

PS: There's always a way to do something, it's just that you have to take the time to figure out how to do, and how to do it properly.
Reply
#3

Basically a bot streamer?
Reply
#4

Quote:
Originally Posted by Abernethy
Basically a bot streamer?
To an extent, thats what this looks like. I think it would be a pretty nice idea if it was eventually implemented properly.
Reply
#5

I'd rather see it that we figure out a way to spawn the bots just as in singleplayer, sync them for everyone, but instead of having 500 of them, you can set how many you want.

For example:
AddServerPED(5);
Would add five bots, going around just as in singleplayer, randomly and driving. No more than five, and you don't have to specify anything except how many you wish to add.

AddServerPED(150);
would add 150 bots going around as in singleplayer, and so on.
Reply
#6

You don't need to capitalize every first letter of the sentence, it looks annoying.
Reply
#7

I think this idea is great, it should be possible to make
Reply
#8

If one guy had ten bots on his street doing something and then another guy had ten other bots doing something on his street then they met up the server would need to sync twenty not ten dude as they are different bots doing different things.

You idea would work if you are both in LS and some bot is in SF then you goto SF as it would sync onto your client stream and not the other dudes but then when the other dude came along it would have to be sync'd by the server and it would be one bot like you said.
Reply
#9

Quote:
Originally Posted by Donny
If one guy had ten bots on his street doing something and then another guy had ten other bots doing something on his street then they met up the server would need to sync twenty not ten dude as they are different bots doing different things.

You idea would work if you are both in LS and some bot is in SF then you goto SF as it would sync onto your client stream and not the other dudes but then when the other dude came along it would have to be sync'd by the server and it would be one bot like you said.
But his idea was that bots would only be syncd when the players are at the same area
right?

so: if player 1 has 10 unsyncd bots, and player 2 also 10,
and player 1 would move to player 2, than the bots of player 2 will get loaded (syncd) in player1's screen

Edit:I think I read your post wrong, who do you mean with "then they met up"?
who are they? The players or the bots?
Reply
#10

Quote:
Originally Posted by °ғαιιοцт°
Quote:
Originally Posted by Donny
If one guy had ten bots on his street doing something and then another guy had ten other bots doing something on his street then they met up the server would need to sync twenty not ten dude as they are different bots doing different things.

You idea would work if you are both in LS and some bot is in SF then you goto SF as it would sync onto your client stream and not the other dudes but then when the other dude came along it would have to be sync'd by the server and it would be one bot like you said.
But his idea was that bots would only be syncd when the players are at the same area
right?

so: if player 1 has 10 unsyncd bots, and player 2 also 10,
and player 1 would move to player 2, than the bots of player 2 will get loaded (syncd) in player1's screen
Yes I understand what he is saying but think it through more dude. If I have ten bots on my screen and you have ten on yours then when we come into contact the bots will be doing different things so to make them sync'd you would have to sync all of them and not just half (five on both to make the ten).

If my client thinks my bot is going south on Grove street but your client has them going north then which one will it choose ? Will it just destroy my bot or your bot, who ever is closest ? Bots will warp about and suddenly disapear, all that kind of thing would happen.

Not trying to be negative here, just thinking outloud.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)