PDA

View Full Version : a start reroller for the windows tile and ascii versions



germanjoey
01-07-2014, 11:37 PM
over the weekend I wrote a start reroller for the ADOM windows tile version. I don't know what motivated me to do this, but a fugue state kinda took over... and here it is. its kinda like adom sage, but a.) works on windows and b.) a little worse in some ways (in that it can't read the program's memory while its running, so it has to guess-and-check the generated saves instead), but a little better in others (you can require starts that have specific equipment and skills, whereas the old one could only do stats). check it out if you want to roll something weird, or something overpowered, or just whatever.

the script requires Perl to run, but the README.txt gives exact instructions on exactly what to download to get it installed properly. it should hopefully be pretty easy to set up even if you don't know a lick about any code.

the script also uses the ascii version (included in the zip) to generate characters, because the tile version takes a little longer to open and save for some reason. however, saves between the tile and ascii versions appear to be compatible and in fact store in the exact same location, so you can generate a save with this and then play it in the tile version. it also includes the starsign selector to save time on generating saves.

might be some bugs here or there; lemme know if you have any trouble!

http://www.mediafire.com/download/4pse7wxthb3bnga/adom_p20ascii_reroller_v0.0.4.zip

gut
01-08-2014, 01:39 AM
how many characters is it capable of rolling per second?

nathrakh
01-08-2014, 02:51 AM
Off topic but has anyone tried to roll PCs with scorched spear? I think I once started with one as an orcish paladin.

_Ln_
01-08-2014, 09:09 AM
how many characters is it capable of rolling per second?

Roller working without memory modification can't roll faster than 1 char per second because of random seeds (unless you modify system time externally).

Edit: although you may theoretically supply your custom time() and srand() functions (like Sage does for intercepting ADOM drawing functions) but the overall result may be kinda strange.

germanjoey
01-08-2014, 09:51 AM
it takes about 3 seconds to roll a character on my junky laptop. its a hell of a lot faster than rolling by hand, but nowhere near what adom sage could do.

zasvid
01-08-2014, 11:02 AM
Off topic but has anyone tried to roll PCs with scorched spear? I think I once started with one as an orcish paladin.

I definitely started a character with scorched spear, a drakish paladin to be exact. It was in version 0.9.9 gamma 8, so I don't know if the proper conditions for that happening haven't been removed (though I guess that would only happen by accident).

gut
01-10-2014, 02:37 AM
the reason I ask is because my old autoroller for 1.1.1 averaged about 1 pc every 1.5 seconds, but when I stuck all files in a ramdrive, it took it to 1 pc per second.
EDIT: also, if the target audience for this is windows users, consider making the distro into a single .exe.

Ln, are you sure characters are limited to 1 per second? I somehow find that hard to believe.

Alucard
01-10-2014, 03:17 AM
If you're seeding your RNG with the time of day and only to the second, more than one character per second yields identical characters.

_Ln_
01-10-2014, 10:09 AM
Ln, are you sure characters are limited to 1 per second? I somehow find that hard to believe.

What Alucard said.
Believe me, took me a while to discover this with my char generator for statistics purposes. I was happy to cut the key delays to 0.3 seconds per char or so until I've started debugging and manually checked vlg files.

Superteeth
01-14-2014, 05:19 AM
I have downloaded the auto-roller by germanjoey, but after it attempts to roll a character based on the pre-set constraints that come with the file, it only rolls one and stops running. The character that is generated does not fall within the set constraints. What am I doing wrong? Thanks in advance.

germanjoey
01-15-2014, 05:40 AM
what do you mean it only generates one character? when you load the template, it asks how many characters to roll (say, 20), and then picks the best one of those 20 based on the constraints you set. this does not mean it will keep rolling until all constraints are set.

you can have it keep more than 1 save (e.g., the top 5) by setting the "savestokeep" variable in the _statroller.cfg file.

Superteeth
01-15-2014, 05:55 AM
I guess I was wrong about the behavior of the roller when I thought it would keep rolling until the constraints are reached, but it still only rolls one character, even when I tell it to roll 20. I should see it try to roll 19 more characters, right? Also, it automatically names the first character "aaa1", but then attempts to use "aaa1" for the second character (upon re-opening the file manually, as it does not do it automatically), and then it tries to name that character "(Sy q", and stops there (it does not hit enter after that, it just hangs and waits for a command from me). This occurs even when I have the saves to keep variable set to 20 (or 10, or 5, or anything). Do you have any idea what I am doing wrong? Thanks in advance.

Sardaukar
01-15-2014, 12:27 PM
Same here...so, it's not really working as intended, I guess.

germanjoey
01-16-2014, 01:13 AM
hmmm, that's very odd. when I use it, each character generates as "aaa1", "aaa2", etc, and then it will delete all the unselected ones. it will only name a character "(Sy q" (which is the save sequence to dump a log, save, then exit the executable) if you interrupt the sequence while its running. (such as clicking on another window with your mouse) maybe I need to make it pause for longer after the character is created? let me try to upload a new version tonight that does that.

Superteeth
01-16-2014, 01:33 AM
Is it supposed to always attempt to name a character after the first one "aaa1"? Or is it supposed to immediately start naming it in sequence (aaa1, aaa2, aaa3, etc.)? I don't interrupt the sequence while it is running, so it should not be naming characters "(Sy q", right? Also, isn't the program supposed to clear away all aaa* files when you start it up again manually? Because it does not do that when I open it again.

Edit: Come to think of it, the only reason it should be naming a character "(Sy q" would be because the program keeps trying to name every character aaa1, and doesn't take into account the fact that ADOM mentioned that the name is already taken (because it is a script, after all). The program continues to run as if "aaa2" was the chosen name, and then tries to dump a log, save, and exit. Why isn't it naming the characters in sequence?

Anyways, thanks for working on the program more. I really hope to get a version that works for me soon. Thanks again.

germanjoey
01-16-2014, 08:54 AM
try this version: http://www.mediafire.com/download/7jhvo5r2b3cr9rk/adom_p20ascii_reroller_v0.0.5.zip

If this doesn't work, change the "inputdelay" variable in _statroller.cfg to something higher, e.g. 0.5 or 1

Superteeth
01-16-2014, 06:18 PM
Thanks for trying to fix it, but it still does not work. The only thing that changes when the "inputdelay" variable is changed is how slowly the program types "(Sy q". It is still trying to name characters aaa1, even after that name already exists. It is also still closing down after generating only one character, when I tell the program to generate 10, and the "savestokeep" variable is 10. It doesn't close after generating one character when you use it, does it? If so, it is not a problem with the program, but a problem with something I have on my computer. Any idea what it could be? Thanks in advance.

germanjoey
01-17-2014, 09:17 AM
yes, it works for me when I use it. I'm completely baffled as to why it doesn't work for you. you updated the sgdir and everything? are you on windows 7 or windows 8?

Superteeth
01-17-2014, 10:53 PM
Yes, if by sgdir you mean savegame directory in the statrollercfg file. I tried on Windows 8 first, but it doesn't work on my Windows 7 virtual OS either. It must be something wrong on my end anyways, since it works for you. Thanks for trying, though.

Sardaukar
01-18-2014, 02:06 PM
It's not working for me either. Win 7 (64 bit) Home Premium.

It creates one character and then this:

http://i232.photobucket.com/albums/ee102/Sardaukar67/adomroller_zps3bd1a8a9.jpg

It certainly does not save anything to location given in .cfg file and certainly not saving (or even making) 10 characters, it gets stuck to making second.

germanjoey
01-18-2014, 05:49 PM
are you sure that's where your save game directory actually is? I think you're both setting it wrong. on windows 7 at least, it won't be in the same directory as the roller, but in your user home directory's document folder. (e.g. My Documents). the best way to check this is to create a character manually, hit '(' to create a short log file is, and then find where that .slg file was generated. that's the directory you want. it'll be something like C:\Users\yourusername\Documents\ADOM ; for exmaple, the default setting had the "yourusername" part set to jfryan, because that's the username on my home computer. sorry if the README wasn't clear on this.

Superteeth
01-18-2014, 06:22 PM
It doesn't appear that the problem for me is where the saves are kept. I can load up the save on 1.2.0 after the roller runs, so it must be going to the save game directory. The problem appears to be that the roller quits after making one character, no matter what the relevant variables are set to.

Sardaukar, is the roller staying open after it creates the first character, or do you have to open it manually after it creates the first character? It just closes after making one character for me.

Sardaukar
01-18-2014, 07:56 PM
It doesn't matter what I give it as save game directory, same behaviour. E.g. ADOM saves are in \Users\user\Documents\ADOM\adom_dat\savedg\ but it makes one character there no matter what I put as save directory (doesn't matter if I use \Users\user\Documents\ADOM\adom_dat\savedg\ in cfg-file or anything else). If Aaa1 is already in use, it locks into state in previous screenshot.

If Aaa1 is not in use, it creates it (one save) and quits. If it is, it tries to create Aaa1 and locks into state in picture.) In other words, it doesn't seem to matter at all what is in .cfg file.

Superteeth
01-18-2014, 09:15 PM
Yes, that is exactly what is happening with mine. I don't see why it is working with some people, but not with others. It is supposed to be naming characters aaa1, aaa2, etc., but it is not.

germanjoey
01-19-2014, 12:15 AM
guys, you have to believe me here, the problem is that the directory is not being set correctly. there's a step in the roller script, before it starts rolling characters, that clears out all existing saves and logs named similar to Aaa*.svg and aaa*.slg. If the script did not do this, then it can't find these saves, and therefore it can't delete them. however, the ADOM executable *independently* knows where save games are supposed to go, and that's why its still able to correctly generate save game files and why it thinks there's already a character named "Aaa1." when the script's sequence is interrupted it dies, and doesn't continue onto the next iteration.

the sgdir directory should be "C:\Users\jfryan\Documents\ADOM", except with "jfryan" being changed to whatever your username is that you use to log into your computer. I have uploaded a new version here that attempts to auto-detect what this directory is, and to give more error reporting when it can't find the files it needs: http://www.mediafire.com/download/actgtuh4nanjb51/adom_p20ascii_reroller_v0.0.7.zip

so, try out this new version (you won't need to install a new version of Perl or that library you did before).I've had one friend who doesn't play ADOM confirm that this is what was happening for him; he had the same problem you did at first, and then fixed it by fixing his directory. he's able to use this new version without any configuration. so, hopefully this works for you.

Superteeth
01-19-2014, 12:20 AM
The sgdir in the statroller.cfg file, right? Because mine is set to what you say to set it at. I do not know about the other guy, though. I will try your new version, however. Thanks for the technical support, I hope we will all eventually get it to work.

Sardaukar
01-19-2014, 01:01 PM
OK, it works now as it should be! Thanks! :)

okitsgreat
01-22-2014, 07:50 PM
Is it possible to start with Wish? Just curious xD I know that even if I start with it i wont be able to cast it for a long, long time, but if it's not even possible than I don't have to let my Laptop run all night to find out :D

Sardaukar
01-26-2014, 10:13 AM
Hmm..it's still not behaving as it should.

It always selects Pious as one of the starting talents to Priest (and I don't want that). No matter what is in character template cfg. Where do I remove that one? It sure is not in any of character templates, not even those that come with roller.

germanjoey
02-07-2014, 03:28 AM
Hi Sardauker,

I was rolling some mindcrafters and discovered this problem as well. It turns out the problem was related to having incorrect prereqs for some of the talents, and so it ended up picking the wrong ones in-game. Fixed it in this latest version!

http://www.mediafire.com/download/7846kyda9b9zg1b/adom_p20ascii_reroller_v0.0.8.zip

Sardaukar
02-07-2014, 05:20 AM
Great! Thanks!

Edit....hmmm..it's still rolling Pious for my priests... And it's not anywhere in cfg-files.