Playing with a fixed random seed


If it doesn't fit anywhere else, it belongs here. Also, come here if you just need to get hammered.

Mines Malingerer

Posts: 53

Joined: Monday, 16th May 2011, 17:21

Post Monday, 20th July 2015, 08:58

Playing with a fixed random seed

I saw that it is something that is planned for Cogmind and I wonder if it would be doable for Crawl: you fix a seed for the RNG in the beginning of the game, so that several crawlers can play on the exact same dungeon. I think that could make for some interesting competitions..?

For this message the author ventricule has received thanks:
math4jedi

Ziggurat Zagger

Posts: 8782

Joined: Sunday, 5th May 2013, 08:25

Post Monday, 20th July 2015, 15:52

Re: Playing with a fixed random seed

Actually this feature is already in crawl: there is a -seed command line option.

Ziggurat Zagger

Posts: 6399

Joined: Tuesday, 30th October 2012, 19:06

Post Monday, 20th July 2015, 16:44

Re: Playing with a fixed random seed

Note that the same rng seed doesn't guarantee the same dungeon unless you take the exact same set of actions in the exact same order (the same rng is used for all purposes including combat)

In order to generate the same dungeon independant of user actions you'd have to have the rng for dungeon generation have a separate seed/state, or like generate all levels before the game or something.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

For this message the author Siegurt has received thanks:
Arrhythmia

Tartarus Sorceror

Posts: 1667

Joined: Saturday, 11th October 2014, 06:12

Location: Brazil. RS, Santa Cruz do Sul.

Post Monday, 20th July 2015, 16:51

Re: Playing with a fixed random seed

so, the seed only generates the first floor? will it generate the same loot though, like the green potion next to the entrance will always be curing or the ring next to it will be always +3 dex...
You shall never see my color again.

Ziggurat Zagger

Posts: 8782

Joined: Sunday, 5th May 2013, 08:25

Post Monday, 20th July 2015, 17:16

Re: Playing with a fixed random seed

Yes the first floor will always be the same if you pick the same species/background combination, unless you change the rng state first by using one of the random options on the character selection screen.

Ziggurat Zagger

Posts: 6399

Joined: Tuesday, 30th October 2012, 19:06

Post Monday, 20th July 2015, 17:19

Re: Playing with a fixed random seed

dynast wrote:so, the seed only generates the first floor? will it generate the same loot though, like the green potion next to the entrance will always be curing or the ring next to it will be always +3 dex...

Think of a random number seed as the starting point in a long series of numbers. This series of numbers is treated like random numbers even though its really not random. Since the first level is generated at the beginning of game it's going to get the same series of "random" numbers to generate that first level. When you start taking actions that use "random" numbers from that list you're going to end up at a different place in the list when you generate the second level.

Note that some actions which occur before generating the first level, like starting with a character that has randomly generated equipment, may change your place in the list when you generate the 1st level.
Spoiler: show
This high quality signature has been hidden for your protection. To unlock it's secret, send 3 easy payments of $9.99 to me, by way of your nearest theta band or ley line. Complete your transmission by midnight tonight for a special free gift!

For this message the author Siegurt has received thanks:
dynast

Dungeon Master

Posts: 582

Joined: Sunday, 9th June 2013, 17:13

Post Monday, 20th July 2015, 17:23

Re: Playing with a fixed random seed

It's also worth noting that the same RNG isn't used for all purposes but rather for all gameplay-related purposes; the UI is on a separate RNG. So if you have an altar in LOS with an animated tile/glyph, hitting space a bunch of times and triggering the random animation doesn't affect the state of the RNG used to generate the next level.

For this message the author gammafunk has received thanks:
Arrhythmia

Tomb Titivator

Posts: 856

Joined: Friday, 31st October 2014, 10:03

Post Monday, 20th July 2015, 17:38

Re: Playing with a fixed random seed

I like the idea of getting the same dungeon + monsters + equipment (apart from acquirement perhaps?) from a known random seed. In theory that would be a relatively straightforward change; duplicate the generator and search/replace the dungeon-related ones to call its functions. "In theory, theory and practice are the same. In practice, they are not." --Albert "it's-always-einstein-according-to-the-internet" Einstein.
Spellcasting penalties, Armour skill, and strength
15 runes: 2x HuSk, Op(Mo,Tm,Wn,Fi,Wr,EE,AM,Wz,Ne), VSTm, DsTm, Dg(Sk,Tm), MuGl, GhMo, Fe(En,EE,Ar,Wn,IE)
3 runes: FoFi, OgSk, KoHu, SpCj, 2x DgGl, MiBe, Fe(Fi,Tm,Mo,Su)

Shoals Surfer

Posts: 293

Joined: Tuesday, 25th October 2011, 05:04

Post Monday, 20th July 2015, 18:11

Re: Playing with a fixed random seed

ThreeInvisibleDucks wrote:I like the idea of getting the same dungeon + monsters + equipment (apart from acquirement perhaps?) from a known random seed. In theory that would be a relatively straightforward change; duplicate the generator and search/replace the dungeon-related ones to call its functions. "In theory, theory and practice are the same. In practice, they are not." --Albert "it's-always-einstein-according-to-the-internet" Einstein.
The best way to implement this would probably be a separate game mode, like Dungeon Sprint. Inserting a special case like this into the main game is just opening the door for endless debates about "Balance" and "Abusable Tactics" from people who don't know that wizmode exists. Make it clear that this is a for-fun mode, and if the community thinks it's worth including in tournaments, then so be it.
User avatar

Barkeep

Posts: 4434

Joined: Tuesday, 11th January 2011, 12:28

Post Monday, 20th July 2015, 18:58

Re: Playing with a fixed random seed

Siegurt wrote:or like generate all levels before the game or something.

... which would suck for pan and abyss ...
I am not a very good player. My mouth is a foul pit of LIES. KNOW THIS.

Shoals Surfer

Posts: 293

Joined: Tuesday, 25th October 2011, 05:04

Post Monday, 20th July 2015, 19:02

Re: Playing with a fixed random seed

njvack wrote:
Siegurt wrote:or like generate all levels before the game or something.

... which would suck for pan and abyss ...
Heh, I didn't even think of that. Those would have to be taken out for this mode unless you're willing to spend an hour+ generating levels whenever you use a new seed.

Ziggurat Zagger

Posts: 5333

Joined: Friday, 25th November 2011, 07:36

Post Monday, 20th July 2015, 19:42

Re: Playing with a fixed random seed

gammafunk wrote:It's also worth noting that the same RNG isn't used for all purposes but rather for all gameplay-related purposes; the UI is on a separate RNG. So if you have an altar in LOS with an animated tile/glyph, hitting space a bunch of times and triggering the random animation doesn't affect the state of the RNG used to generate the next level.

How are we ever going to get our own turnbyturn.txt if we don't allow bumping into walls to change the gamestate? At least allowing XOM altars to do the same thing will help TAS records, plus it's thematically appropriate - XOM is shuffling your dungeon!

Return to Crazy Yiuf's Corner

Who is online

Users browsing this forum: No registered users and 11 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.