Announcement

Collapse
No announcement yet.

Spawn problem solution

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spawn problem solution

    Problem:

    Click image for larger version

Name:	i49^cimgpsh_orig.jpg
Views:	1
Size:	20.4 KB
ID:	115808

    This is a bug/something very annoying and takes place when there is either a paused player or an inactive player just stood by the spawn point after possibly being killed from a place where he was also maybe inactive. As soon as an active player dies and spawns depending on how many times that player has died, he will eventually end up on top of the inactive dude. This as a result gets them stuck on top of them.

    Context:

    Today this happened to me twice and saw it happen to a few people. You're probably thinking we can either teleport away or jump off them however here are a few justifications:

    - Teleporting away prevents us from collecting Armour and any other pickups we intend to take.
    - Jumping off them - I know in teleporting points and event teleporting points it is easy to simply jump off them however this is not the case with spawn points, the person in the picture was struggling to get off (Maybe to collect Armour before teleporting away but since he couldn't jump off, it ended up with him teleporting away.

    All this in my opinion is very annoying:
    - I know you can teleport to bots that roam the place however a lot of newbies are unaware of this

    What I think should be done?

    - Maybe construct a code which detects which point in the spawn point is occupied and then therefore spawns then in the available spawn spots.
    - Create more points? (I don't like this however it may help)
    - Teleport inactive players to a place elsewhere (Mentioned in another post talking about kicking afk players by LorSimon)

    Coding it to detect occupied areas in my opinion is something that'd get rid of this annoyance. I wish I could code it on a SAMP coding program however I don't know the language. Now I'm not a huge coder myself however I came up with something:

    while loop = false

    def spawnspot1():
    If spawnspot1 = not occupied:
    spawn = true
    else:
    spawn = false
    spawnspot1()

    def spawnspot2()
    if spawnspot2 = not occupied:
    spawn = true
    else:
    spawn = false
    spawnspot2()

    def spawnspot3():
    if spawnpot3 = not occupied:
    spawn = true
    else:
    spawn = false
    spawnpoint3()

    def spawnspot4():
    if spawnspot4 = not occupied:
    spawn = true
    else:
    spawn = false
    spawnpoint4()

    loop = true

    spawnspot1()
    spawnspot2()
    spawnspot3()
    spawnspot4()

    That's python language btw (The only coding program I know). Hopefully this language can be translated into Sanny Builder or whatever code is used to function GamerX.

    Nothing professional just a little knowledge I have of coding which I do a very very bit of o expect lots of errors and undefined stuff but hopefully you get the point. If there are no free places then spawn at a point with an active player although I doubt all spawn spots will be occupied.

    Hope you consider this suggestion

    Elite
    Last edited by Eliteus; 20-11-15, 08:44 AM.
    Please stop asking why I got my admin status removed. I chose to be demoted and there's no drama behind it.

  • #2
    Unfortunately you don't know the behavior in SA-MP,
    First: Paused players are not synced from players and servers sometimes, which might be impossible to detect real and accurate position of the player.
    Second: SA-MP doesn't come with native function that tracks player position movements (perhaps it was not added because it need high performance and more bandwidth). However it does indeed came with function to get player position, which have to be coded manually and more slow than native one, yet i mentioned it before that might not get synced to the player real position.
    Third: Unfortunately as players paused and went unsynced, SA-MP does not even gives function to check if player is paused, some scripters has found a tricky way to detect it manually though, but here again it's detected with slow code and inaccurate, even though it can be used, we still have to track the position, so that's roughly mean 2 slow way.
    Fourth: Yes, that's nice way to mark a player spawn point in variable, however you can never know when to remove that 'occupied' mark, because you have to detect player's position again if they have leave spawn.
    Fifth: Adding more spawn probably wouldn't solve the problem if the player count are increasing. Also i think there are many spawn points already, when each classes (there are 14 classes) can have about 5 to 10 spawn points.
    By the way, the programming language to code a server game script is called PAWN, not Sanny Builder, it's used for modding (yes i know SA-MP is also a mod, but it's what SA-MP dev team provided).

    It does possible, but overall it's not best choice to use expensive way just for a simple problem that can be solved already.

    The best solution that can be done is probably by reporting the paused players that block spawn to admins, they can move it to another virtual world for temporary (changing virtual world will still work on not paused players, because that will make the player "disappear" from other players that's "streaming" that paused player).
    Other way is what you mentioned, by teleporting, jump, or maybe even spawning a vehicle and exit.

    However, if it really still need to be programmed, i actually found a way long time ago, by "nudging" the player spawn position as defined from server with random value around radius of 1 meters, this means around 1m of spawn point should be safe to spawn (i.e. player shouldn't stuck on building or objects). You probably didn't saw the sticked thread which mention about posting any code is not allowed, but if you still wonder what i mean, i actually break this rule too:
    Code:
    float((random(20+1)/10)-1)
    That should be added to addition of player spawn point on each X, Y, Z value, so it will be x+float((random(20+1)/10)-1) for example.
    In simplified example, If one of spawn point has X,Y,Z location of: 10.0,-15.0,23.0... Then players can probably spawn in these positions:
    Code:
    Player1: 10.1, -14.3, 23.5
    Player2: 10.0, -15.6, 22.3
    Player3: 9.8, -15.0, 23.7
    Player4: 10.9, -15.2, 23.2
    Yes, it can either increase or decrease the position, or can be even zero (same as defined server spawn point location).

    Why chose 1m, well i think player skin is not that thick, so i guess that value is more convenient, thus will make a lot possibilities of difference spawn point since the nudge value is random, also in GTA:SA, a value of 0.1m difference wouldn't probably made an object glitch with each other, or even players stuck with each other.

    Just hope this suggestion can be accepted.

    EDIT: Also about tolerance that is added on Z value (+1) for event i think it should be lowered to +0.5 then with velocity z + 0.1.
    Last edited by Robo; 20-11-15, 11:16 AM.
    KVIrc User

    Comment


    • #3
      I like the nudging idea but I'm not going to make a big deal out of it for a small issue but thanks! I'll just report them as mentioned by lorsimon on the "kick all afk players"
      Last edited by Eliteus; 24-04-16, 10:52 PM.
      Please stop asking why I got my admin status removed. I chose to be demoted and there's no drama behind it.

      Comment

      There is currently 0 user online. 0 members and 0 guests.

      Most users ever online was 15,681 at 08:23 AM on 17-06-20.

      Working...
      X