[mod] Random spawning with spawn sharing [rspawn]

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

[mod] Random spawning with spawn sharing [rspawn]

by taikedz » Post

Causes players to receive a spawn point anywhere on the map. Players will likely spawn veeery far from eachother into prisitine areas.

This is primarily intended to be a server mod, to encourage the independent creation of communities across the map - let players create their own cities, and trek across the map to find eachother!

Features
  • * Player is assigned randomized spawn point on joining
    - * Player will respawn at their spawn point if they die.
    -- * If `beds` spawning is active, then beds can be used to reset the players' spawn point.
    * Players will not spawn in spaces that are protected.
    * Players can open their spawn to be visited by all - effectively making custom spawn towns
    * Commands
    - * Players can return to their spawn point with the `/spawn` command if they have `spawn` privilege.
    - * Players can request a new spawn point by typing `/newspawn` if they have the `newspawn` privilege.
    - * Players can set their spawn point by typing `/setspawn` if they have the `setspawn` privelege.
    - * Players can assign a new random spawn for another player using `/playerspawn` if they have the `spawnadmin` privilege.
A `/spawn add <guestplayer>` command allows a player visit someone else's spawn using '/spawn visit <hostplayer>'. In this way, collaborative towns centred around spawns can arise!

A customizable levvy can be configured to optionally prevent uncontrolled gathering around a spawn. By default, the cost of inviting a player to your spawn is 10 cobblestones. Cheap-o.

A `/spawn town open` command allows players to open their spawn up to everybody (no levvy), so any player can visit their spawn. Any explicitlly invited guests can help manage town guests with `/spawn town <ban/unban> <town name>`.
  • * License: LGPLv3
    * Source: Github
    * Download ZIP: Zip download
    * Depends: optional: beds
Last edited by taikedz on Wed Jan 30, 2019 21:21, edited 14 times in total.

KCoombes
Member
Posts: 427
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: [mod] Random spawn points with /spawn support [rspawn]

by KCoombes » Post

Very nice +1

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawn points with /spawn support [rspawn]

by taikedz » Post

New feature - spawn_anywhere

New players will be assigned a spawn point somewhere in the vastness of the world... and may not meet another soul for ages.... ;-)

FaceDeer
Member
Posts: 506
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [mod] Random spawn points with /spawn support [rspawn]

by FaceDeer » Post

taikedz wrote:New feature - spawn_anywhere

New players will be assigned a spawn point somewhere in the vastness of the world... and may not meet another soul for ages.... ;-)

Excellent, I was thinking of suggesting something like that. :) How about a way to specify a list of "spawn regions" to be randomly picked from, so that for example you could set up a couple of different towns and have players randomly be citizens of a particular one?

KongarTheTerrible
Member
Posts: 28
Joined: Thu Feb 02, 2017 18:33

Re: [mod] Randomly assigned spawn with /spawn support [rspaw

by KongarTheTerrible » Post

Tons of error on install?
"Runtime error from mod 'rspawn' in callback environment_Step()
builtin/common/helpers.lua:515...
init.lua:41 'newspawn'
177: in function 'func'

etc

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Randomly assigned spawn with /spawn support [rspaw

by taikedz » Post

Hmm bizarre

Check your debug.log pls and paste the actual error text?

What version of minetest?

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Randomly assigned spawn with /spawn support [rspaw

by taikedz » Post

Line 41 is a debug line, I've turned it off in the latest code version, please try that.

If you are still getting issues, you should have a debug.txt log file in your minetest folder. Go to the end of the file to find the corresponding errors, and paste the exact messages here, or open an issue on github
Last edited by taikedz on Wed Jan 30, 2019 10:40, edited 1 time in total.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawn points with /spawn support [rspawn]

by taikedz » Post

FaceDeer wrote:
taikedz wrote:New feature - spawn_anywhere

New players will be assigned a spawn point somewhere in the vastness of the world... and may not meet another soul for ages.... ;-)

Excellent, I was thinking of suggesting something like that. :) How about a way to specify a list of "spawn regions" to be randomly picked from, so that for example you could set up a couple of different towns and have players randomly be citizens of a particular one?
That would be neat. Not sure I want to burden this version with yet another type of spawning though :-P

It would be fairly easily done though - maintain a table of position & radius pairs, pick one, then kick off the randomized spawn with that position as the target....

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Randomly assigned spawn with /spawn support [rspaw

by taikedz » Post

Updated - this is very much geared towards use on a server, so now the randomized spawns are generated in advance so that new players receive their spawn points instantaneously.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Randomly assigned spawn with /spawn support [rspaw

by taikedz » Post

Further updated to support inviting other players to your own spawn.

This should allow groups of players to start their own towns/cities far away from eachother, and encourage them to find eachother by trekking the distance...!

bell07
Member
Posts: 604
Joined: Sun Sep 04, 2016 15:15
GitHub: bell07

Re: [mod] Random spawning with /spawn + invitations [rspawn]

by bell07 » Post

Great Mod!

For reference: my startanode mod does have some similar logic but for singlenode-worlds.

Can you pls. add a settings "min_pos_x" / "max_pos_x", "min_pos_z" / "max_pos_z" or just "radius" instead of hardcoded "-30000,30000"? So the server owner can decide how far the player should spawn to each other and may leave uninhabited areas to explore.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawning with /spawn + invitations [rspawn]

by taikedz » Post

Good idea. Done. :-)

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawning with /spawn + invitations [rspawn]

by taikedz » Post

I changed things up a little.

I removed the "invite" mechanism in favour of a "guestlist" mechanism. Players now add their guests anytime, and guests can visit host spawns, whilst retaining their own.

This would in theory allow free association of players, and the creation of various towns around the server.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [mod] Random spawning with spawn sharing [rspawn]

by Sokomine » Post

taikedz wrote: I removed the "invite" mechanism in favour of a "guestlist" mechanism. Players now add their guests anytime, and guests can visit host spawns, whilst retaining their own.
Thanks!
taikedz wrote: This would in theory allow free association of players, and the creation of various towns around the server.
Is there a way to make a spawn auto-invitable for all players? And add a kick-option for other trusted players?
A list of my mods can be found here.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawning with spawn sharing [rspawn]

by taikedz » Post

Sokomine wrote:Is there a way to make a spawn auto-invitable for all players?
I'm working on that. I've added a open-towns branch which still needs testing
Sokomine wrote:And add a kick-option for other trusted players?
I've added that in the "open-towns" branch. Any explicitly added guests, who are not exiled from your spawn themselves, can kick people out of your spawn on your behalf.

You can also "/spawn exile <playername>" to get them off your turf and prevent them from '/spawn visit'-ing you again. I'm working to make it so that such players get bounced when they attempt to return.


This is quickly becoming an all-out spawn management mod :-P

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawning with spawn sharing [rspawn]

by taikedz » Post

I think, at last, I can safely say that town-spawns are done. Enjoy.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [mod] Random spawning with spawn sharing [rspawn]

by Sokomine » Post

Thank you for adding the "open to everyone" function! It feels much better to meet other players.
A list of my mods can be found here.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Random spawning with spawn sharing [rspawn]

by texmex » Post

Taikedz, the idea and development of rspawn is brilliant, something I’ve been wanting to see happen for a long time. It seems that people are catching on to more decentralized and distributed methods of in-world governance, which is great. I’ve been following the early development of a towny mod for MT, with similar ideas. Your spawn-based single-point radius based solution seem even more intuitive though (with the caveat that players can’t found a town just anywhere but based on rspawn picks).

I’m looking for ways to make this concept more visual and collective from the start. Though I haven’t tested the mod extensively and therefore might have missed something, some questions:
  • What do you think of making the list of established spawn public so that other mods may use it?
  • How about adding a callback on spawn creation that other mods can register functions to? In my case I would then be able to place some schematics at the centerpoint of the spawn, which would add to the lore of my game.I see that you emerge the area anyway, so node placement should work, right?
  • Can the spawn search function be made configurable allowing only listed biome names? No-one wants a desert spawn :)
  • What do you think of a setting for reusing spawns for new players up to a limit of a configurable number of players? This would make sure spawns are populated yet not saturated.

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawning with spawn sharing [rspawn]

by taikedz » Post

Hi texmex

Glad you like it :-)

* public listing - yes that makes sense. There's already a function to list these, so exposing it via an API call should not be an issue.
* callbacks - that would make sense too. on_spawngen (background pregeneration) and on_spawnconsume (player actually is assigned to a spawn) would be the two main ones.
* search for biome - I'm not sure how I'd do this, programmatically. I don;t think there's a minetest.identify_biome(pos) function. I could add a list of forbidden spawns, under which you could list things like "defulat:desert_sand,default:desert_sand_stone" ...?
* spawn reuse - that would conflict with guest/town functionality... how do you town-ban a player whose spawn is yours for example?

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Random spawning with spawn sharing [rspawn]

by texmex » Post

taikedz wrote:search for biome - I'm not sure how I'd do this, programmatically. I don;t think there's a minetest.identify_biome(pos) function.
Fear not! 5.0.0 is around the corner and will feature minetest.get_biome_data(pos)
taikedz wrote:I could add a list of forbidden spawns, under which you could list things like "defulat:desert_sand,default:desert_sand_stone" ...?
This would be a nice complementary feature to the one above in that it would grant more granular control of what nodes within a biome to allow/forbid.
taikedz wrote:spawn reuse - that would conflict with guest/town functionality... how do you town-ban a player whose spawn is yours for example?
Yes, this would be an alternative mechanism, more like villages/towns of players "born" into it: Some players are loony, some griefy, some responsible but they all come from the same place. This grouping would allow for building more advanced game mechanisms of co-dependance, building more types of trust. :)

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawning with spawn sharing [rspawn]

by taikedz » Post

texmex wrote: Fear not! 5.0.0 is around the corner and will feature minetest.get_biome_data(pos)
Good to know... *sigh* I guess I'm going to have to gear up for the 5.0.0 change some day...! :-p
texmex wrote: Yes, this would be an alternative mechanism, more like villages/towns of players "born" into it: Some players are loony, some griefy, some responsible but they all come from the same place. This grouping would allow for building more advanced game mechanisms of co-dependance, building more types of trust. :)
I'm not inclined to add this natively to the mod... however if I start adding event driven stuff like register_on_spawnassign(playername) I could provide a default behaviour of assigning a fresh spawn, but allow overriding the behaviour.... I have a feeling this is heading in a "rearchitecting" direction :-p

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Random spawning with spawn sharing [rspawn]

by texmex » Post

taikedz wrote:I'm not inclined to add this natively to the mod... however if I start adding event driven stuff like register_on_spawnassign(playername) I could provide a default behaviour of assigning a fresh spawn, but allow overriding the behaviour.... I have a feeling this is heading in a "rearchitecting" direction :-p
I'm okay with this of course, with the right API functions provided by the mod I'll just write the logic on my own. =)

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Random spawning with spawn sharing [rspawn]

by texmex » Post

Other logic I might want to implement is distribution of classes within a spawn, so that the population becomes diverse and versatile.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [mod] Random spawning with spawn sharing [rspawn]

by texmex » Post

One of the more crazier spawns =D

Image
Attachments
screenshot_20190531_213942.png
screenshot_20190531_213942.png (942.03 KiB) Viewed 2046 times

User avatar
taikedz
Member
Posts: 698
Joined: Sun May 15, 2016 11:11
GitHub: taikedz
IRC: DuCake
In-game: DuCake
Location: Scotland, UK
Contact:

Re: [mod] Random spawning with spawn sharing [rspawn]

by taikedz » Post

............ yeah it's pretty indiscriminate :-p

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 14 guests