[IDEA] Random first spawn

User avatar
Fritigern
Member
 
Posts: 43
Joined: Mon Sep 29, 2014 11:01
In-game: Fritigern

[IDEA] Random first spawn

by Fritigern » Sat Jan 16, 2016 02:01

One of the things that I dislike on servers is that people spawn in, then stay close to their original spawn point, never exploring the rest of the world.
Because of this I have wished for the ability to have people spawn in at random locations on the already explored map OR within a predetermined area of a certain size (for example, a 1000x1000 area with 500,500 as the center). This would encourage exploration on servers that are intended for that, but it would also allow for people to start building where they are on a creative server, or to just set up a home. Ideally, the mod would avoid having people spawn in water or other dangerous places like 100m in the air or in lava. :-)

Of course, you can't have people spawn on a random place each time they log in, so only their very first spawn would be random, all subsequent spawns would be where they were last (which is already normal behavior).

Optionally an object could be given (like a Travelnet node or so) that when placed will provide the user with a list of destinations although that would be something for a different mod IMO.

Just a few thoughts that popped up in my head, but I would definitely use a mod like that. Even if it would only spawn new players at a random spot.

I have no Lua skills whatsoever, so I hope that this idea will inspire someone to create a thing like this.
--
This is NOT a sig.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: [IDEA] Random first spawn

by paramat » Sat Jan 16, 2016 07:13

I'll be rewriting the spawn search method so will keep it in mind, i like the idea of scattered spawning so that players have to travel to find each other.
 

BobbyBonsaimind
Member
 
Posts: 97
Joined: Tue Apr 14, 2015 19:32
GitHub: RobertZenz
IRC: Robert_Zenz
In-game: Bobby

Re: [IDEA] Random first spawn

by BobbyBonsaimind » Sat Jan 16, 2016 09:31

Spawn Usher is allowing you to do this, all you have to do is adjust the configuration...well, except the static spawns, there is no save mechanism to remember the spawn per player. You'd have to code that yourself by providing a provider and using a callback, like this:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- Should be persisted somehow.
local spawns = {}

-- Register a provider which returns the saved position. If there is no position
-- saved yet, it will return nil which means that the spawn position will not be
-- changed, and the random one will be used.
spawnusher.register_spawnpoint_provider(function(player, spawn_pos)
    return spawns[player:get_player_name()]
end)

-- Register a callback which saves the position at which the player has been
-- spawned.
spawnusher.register_after_spawn_callback(function(player, spawn_pos)
    spawns[player:get_player_name()] = spawn_pos
end)
Last edited by BobbyBonsaimind on Sun Jan 17, 2016 09:53, edited 2 times in total.
 

User avatar
Casimir
Member
 
Posts: 1101
Joined: Fri Aug 03, 2012 16:59

Re: [IDEA] Random first spawn

by Casimir » Sat Jan 16, 2016 22:17

I made this some while ago:
https://github.com/casimirkapazi/spawnarea
But you always spawn somewhere else, which to me seems more interesting.
 

User avatar
Fritigern
Member
 
Posts: 43
Joined: Mon Sep 29, 2014 11:01
In-game: Fritigern

Re: [IDEA] Random first spawn

by Fritigern » Sun Jan 17, 2016 03:33

Casimir wrote:I made this some while ago:
https://github.com/casimirkapazi/spawnarea
But you always spawn somewhere else, which to me seems more interesting.


Spawning at a random location on each login can be fun, but if you have built yourself a home and are working towards a certain set goal, like for example build a farm with all the crops in your game, then having to find your way back to your build on each login is a pain in the patootie.

The thing that I envision is that when you spawn in, it's practically telling you "this is your spot, go make something of it". Right now every first-timer spawns at the exact same spot on the server, and considering that many just walk a few meters, punch a house and a tree and then log back out, it feels like the spawning system doesn't do some of the servers justice. Especially the ones that are about exploration, or creative servers.
--
This is NOT a sig.
 

Xanthin
Member
 
Posts: 121
Joined: Fri Mar 07, 2014 14:05
GitHub: Xanthin
IRC: Xanthin
In-game: Xanthin

Re: [IDEA] Random first spawn

by Xanthin » Sun Jan 17, 2016 23:45

He, I thought about this too some days ago, but guessed it would be somehow possible already. Thanks for bringing this up Fritigern and I am looking forward for paramat's solution.
This would indeed add some more open world exploring feeling and probably lower complaints about: "there are no trees, food ..., everything is protected ...". :D
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: [IDEA] Random first spawn

by burli » Sun Feb 12, 2017 18:22

I had the same idea. Would be nice for survival server so player can discover different areas
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron