Joined: 7/2/2007
Posts: 3960
I don't know how the implementation of the RNG system calls in WINE works right now, but whatever would be used for a TAS would need to be written to be completely independent of other processes on the machine. The only way to update the RNG should be by calling RNG functions from within the game you are TASing. Anything else results in a non-reproducible movie. Edit: note that the standard RNG implementations depend solely on the starting seed and the number of times an instanced RNG is called. Thus normal RNGs are already process-independent. This is necessary for debugging of programs that include random behavior (which is, basically, very similar to TASing). For example, I wrote a little pseudo-fractal image generator which accepts an RNG seed. As long as I feed in the same seed (and don't change the code of the program), I get the same result. I had an assignment in college once where we were required to achieve the optimal number of RNG calls for an evolutionary algorithm. Reason being, if we had more calls, then we'd get slightly different (if still reasonable) results, which meant that the automated grading program wouldn't work right.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Tub
Joined: 6/25/2005
Posts: 1377
>> 1) Hack WINE to wait for user input after a system call that is made every frame (e.g. the draw-to-screen function -- though this would skip lag frames). This gives you frame advance. Since the underlying hardware isn't clearly defined by the game, we can emulate any compatible hardware we want - including a "reasonably fast" computer that never lags. D2 runs at max 25 fps anyway, lag-frames outside of shenk-kills are virtually nonexistant. Heck, my work computer can run d2 twice at 500+ fps each, getting stable 25 fps shouldn't be a problem. >> 3) Use a utility to read the memory being used by D2 and save the relevant parts to disk. This gives you save states, and is also almost certainly the hardest part of this whole thing. >> 4) Figure out how to read those saved states back into memory. If (3) isn't the hardest part, then this probably is. just memory isn't enough, there are other system resources that might change. File descriptors, audio state, uploaded textures and others. Some of those are tracked outside of the task, some in kernel, some in wineserver. See where the fun begins? >> You shouldn't otherwise mess with the RNG because that would mean you weren't playing "pure" Diablo 2 any more. I see how that can be controversial. I'll try to clarify my position: Older patches of D2 had a buildin PRNG, modifying it means modifying the game, which we mustn't do. Newer patches use the PRNG provided by the system though, and there's no clear definition or guarantee about the implementation of that. Running D2 on Win98 might give you a whole different PRNG than on Vista, and another different one on linux/wine. Since there's no guarantee about the PRNG the OS has to offer, neither do we. We can implement the PRNG any way we like - including a "smart" number generator that examines the stack, figures out what part of D2 called it, and then calculates favourable numbers - always high on player damage, always low on enemy's attack rolls, configurable on item drops, etc. It's tool assisted. We WILL use luck manipulation. We might as well do it right.
m00
Joined: 7/2/2007
Posts: 3960
Good point on the system resources. I hadn't thought of that. Maybe if you ran the whole shebang in a VM, you could just do RAM tricks. As for the RNG, I don't personally like the idea of using a special-purpose RNG that magically always gives us the values we want. If we don't have a well-defined RNG to use with the game, then we should pick some generic implementation (the Mersenne Twister is generally considered to be strong, if not overkill, for example) and just use a vanilla version of that. I can see the counter-argument, though - we're going to get the results we want anyway; why not make it easier?
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Active player (355)
Joined: 1/16/2008
Posts: 358
Location: The Netherlands
to keep the fun going, and my hopes of toolassisted d2 ever happening :D... let's discuss the best multiplayer party configuration (and perhaps strategies) for a TAS! btw funny nobody mentioned how using bots is practically TAS.... i'm sure nobody can manually do pindleskin as fast as the bots out there can :P edit: ye ye i used to use 'em as well... and i liked it too! it's fun playing with high-end gear!
TASes: [URL=http://tasvideos.org/Movies-298up-Obs.html]Mr. Nutz (SNES), Young Merlin 100% (SNES), Animaniacs 100% (SNES)[/URL]
Joined: 7/2/2007
Posts: 3960
The problem with parties is that you need characters that can keep up with each other; otherwise you end up with one character fighting enemies with enhanced HP, which just makes things slower. You can use TPs to get PCs to catch up with each other, but it's slow - both players have to have a TP scroll handy (presumably in the belt), then one has to go to town and back to the other player's TP. On an idealized computer, loading times wouldn't be much of an issue, but there's still significant delay...during which period the other player's already moving ahead, which means that even after TPing in, the slow character's fallen behind again. The main use I could see for multiple PCs would be for parallelizing efforts - for example, one runs off to get a Horadric Cube while the other goes after the Staff of Kings. This could indeed save a lot of time...but it also makes the XP gain trend tricky, since each PC would be skipping more of the game. In any event, I suspect that for the most part (edit: i.e. outside of act bosses and other unskippables like the Ancients or the Travincal Council), a party in a D2 TAS wouldn't play anything like a party in normal D2 would, and thus there's little room for PC synergies. You'd want to pick classes that stand well on their own, which basically means two sorceresses or two assassins, whichever ends up being faster.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Tub
Joined: 6/25/2005
Posts: 1377
I don't know about multiplayer-TASes. Additional technical difficulties aside (and there are lots), it'll probably be confusing for the viewer to watch. Not everyone has a monitor supporting 1600x600, and scaling the video down makes the font illegible. But: leveling both is not a problem at all. If one character manages to kill the ancients, then baal, the second character can just stay in town and will still get the baal-quest. You might combine a sorceress (for fast teleporting) and a damage char that just enters TPs and starts killing. still, I don't think a sorceress needs someone else for killing (not in a TAS, anyway), and unless you're going for all quests, there really isn't that much to do in parallel.
m00
Joined: 3/11/2008
Posts: 583
Location: USA
Just the act 2/3 assembly quests would get sped up, really, aside from whatever benefit you get from second member. (Static field, on the double.) Whee, 1680x1050 Another multiplayer pro/con is that the map layout can be rerandomized without starting character over.
Joined: 8/23/2006
Posts: 46
Levels 40 - 60 actually occur *relatively* fast when compared to the natural progression of the game in completing all the quests, which is in my opinion, a good reason to do a full-quest run. In Nightmare and Hell, if you actually do the quests, you gain levels pretty quickly. Also, would you play with the /player 8 option so that you could gain more XP, as well as have the game on highest difficulty?
Joined: 7/2/2007
Posts: 3960
Generally "hard" difficulties that just increase the health of enemies don't make runs any more entertaining, since they just amount to using the same strategies, but for longer periods of time. I'd say that's true in this case too.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Active player (355)
Joined: 1/16/2008
Posts: 358
Location: The Netherlands
Well I was thinking of an 8-player TAS :D surely some insane amount of planning would be required :) a good combination of speedy movement (some sorcs and assasins?) and dmg would obviously be useful it might even pay off to have 1 char be a full-time town player, just to speed up the movement of items (both normal and quest) (I'm assuming it wont be possible to just have any item drop off anything... this assumption might be wrong ofc)
TASes: [URL=http://tasvideos.org/Movies-298up-Obs.html]Mr. Nutz (SNES), Young Merlin 100% (SNES), Animaniacs 100% (SNES)[/URL]
Joined: 7/2/2007
Posts: 3960
While that would be technically impressive, it would be even harder to watch than the 4x Mega Man TAS, even granted that you can turn the music off in D2. And it'd be incredibly hard to make and wouldn't necessarily make things that much faster - I can't see it being worthwhile. It's not even clear that we can TAS D2 in the first place; don't go leaping off into wild flights of fancy. :)
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 4/30/2006
Posts: 480
Location: the secret cow level
I don't know how the hell you would synchronize network transmission between multiple instances of the game, especially since the tiniest change could have a butterfly effect and throw off the RNG. Next we'll have people clamoring for a 40-man WoW raid TAS.
Joined: 3/11/2008
Posts: 583
Location: USA
Except that, with WoW, you have the network transmit problem in at player 1. Besides, watching 1 character blaze through everything would be more entertaining than a full raidforce. in re: more players difficulty- You get a bonus to experience gained per monster as w ell as them becoming harder, but I think that it the HP increase is greater (but, optimally, having two players doubles your damage output, so this can be negated)
Joined: 7/2/2007
Posts: 3960
For normal play, players 8 makes the game easier for classes that have cheap damage - melee classes, classes whose spells cost less than their regen rate, and so on. That's because the increased experience means that you're at a higher level than you'd normally be, and the increased droprate means you have better gear. Put a different way, monster difficulty is not solely a matter of how many hitpoints the monster has and how much damage it deals. Later acts have more monsters and monsters with more dangerous abilities. For TAS play, I suspect that the only options that would be seen as acceptable would be players 1 or players 8, with no switching mid-game (otherwise it looks too much like cheating); given a choice between the two, players 1 is the clear winner, especially since the sorceress definitively does not have cheap damage.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Tub
Joined: 6/25/2005
Posts: 1377
thread-necromancy! \o/ I actually tried to hack into wine's RNG to see if this is possible. Turns out that my information about d2's RNG was wrong, d2 never used the system's RNG. It just removed the RNG callback from one of it's dlls, but it was replaced by an internal implementation, not by the system's RNG. As such, luck manipulation would have to be done the old-fashioned way. I'm abandoning this project right here.
m00
Player (68)
Joined: 3/11/2004
Posts: 1058
Location: Reykjaví­k, Ísland
I'm pretty sure that once a game is created in Diablo 2, the random seed is generated right then and there, and the entire world is determined from that point. Every monster, item and dungeon is derived from it and it doesn't change until you create another game. It's the same in Diablo 1.
Joined: 7/2/2007
Posts: 3960
You're right in that the dungeon and wilderness layouts seem to be fixed, but the question is if each region is generated when you first visit it, or at the beginning of the game. If the former, then getting an optimal wilderness layout is going te be ridiculously difficult. However, given that the game has to be able to reject certain map layouts, e.g. to make certain that wilderness zones don't intersect the town, I suspect that regions are generated when you first visit them -- or at least, when you first start the act they're in. Otherwise there'd be a large initial cost to starting a new character/game.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Editor, Experienced player (734)
Joined: 6/13/2006
Posts: 3300
Location: Massachussetts, USA
I've seen segmented D2 speedruns where the optimal level layout was manipulated. Surely this must mean the RNG is manipulable in a good way?
Homepage ☣ Retired
Former player
Joined: 8/1/2004
Posts: 2687
Location: Seattle, WA
Map layout is totally dependent on the seed value the RNG assigns when the character is created. You can technically set the seed with a -seed value, thereby ensuring a map that you've pre-approved, but that then locks in the RNG for everything afterwards (damage, AR, drops, etc.)
hi nitrodon streamline: cyn-chine
Joined: 7/2/2007
Posts: 3960
Mm, I just realized that generating areas as you visit them does not preclude setting their seeds at the start of the game. Carry on.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Tub
Joined: 6/25/2005
Posts: 1377
Derakon wrote:
However, given that the game has to be able to reject certain map layouts, e.g. to make certain that wilderness zones don't intersect the town
Well.. most of the time ;) http://www.authmann.de/d2/maphack.jpg
m00
Active player (279)
Joined: 4/30/2009
Posts: 791
For a players 1 TAS of D2, I would ultimately like to see a TAS of each of the 7 characters, but that is probably unlikely to happen. Assassin or Sorceress seems to be the fastest of the classes, so that would likely be the most competed on if this were every to pass. Players 8 with 1 character would only see the experience bar increase, and as the SDA runs have proven you don't necessarily need to be at a high level to beat Normal (other than the hard requirement to pass the Ancients). Enemies also have 400% more health in players 8 than players 1, so a run wouldn't necessarily be more interesting that way. If an 8 character TAS was possible, I would recommend having at least 1 of each class to show the differences in playstyles a bit, with an eight perhaps playing more of a support/item management role. Would be good to see more unique builds being used rather than the cookie cutter ones most people fall back on (lightning sorc is less used than cold/fire for example)
upthorn
He/Him
Emulator Coder, Active player (391)
Joined: 3/24/2006
Posts: 1802
Hourglass does not (yet?) support networking at all. I also would not be entirely surprised if Diablo II entirely fails to run under it. Somebody should check to see if Diablo works under hourglass before any serious TAS plans are made for it.
How fleeting are all human passions compared with the massive continuity of ducks.
Joined: 6/19/2005
Posts: 180
If you wanted to do an 8-player TAS, you could go for a concept run like 8 paladins... or 7 paladins and a necro. I've played with the concept of an 8 paladin run realtime, and it's quite scary how much damage they can put out.
Senior Moderator
Joined: 8/4/2005
Posts: 5777
Location: Away
Before the confusion gets out of hand, /players n (where n=1 is normal conditions and n=8 is the maximum) is a command that emulates the presence of multiple players in a single-player game. It affects mainly enemy HP, experience gain, and drop probabilities (so you get way more/better loot that way). For characters that have attack power advantage in early game (like Sorceress) the 400% enemy HP is not a problem, while potential exp gain rate is borderline hysterical.
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.