Popular Post lol username Posted August 11, 2015 Popular Post Share Posted August 11, 2015 LEGO Island 2 is a hilariously strange beast under the hood. Here's some fun things I've noticed while poking around. First, the game is hardcoded as hell. All the assets themselves are stored in the bob/bod files, but absolutely all of the information linking them together in any way is in the exe. The exe is filled with huge lists of file paths for every asset in each bob/bod file. The exception seems to be textures - these are stripped of meaningful names and referenced by number (like, say, text420.tga instead), and all the info on what textures go on what models, where those models are located, etc is all in the exe. But each level in the game seems to be pretty much entirely isolated from the rest. There's a small amount generic assets shared around, but 99% of the time, if an asset - a texture, model, whatever - is used in multiple levels, it's just duplicated, saved in each bob/bod individually. You know all the different hats the NPCs have, and how you can swap them around in any level with NPCs? And how trees/plants/sign posts can be swapped around in the same manner? And how there's usually 3-5 levels of detail (LODs) for each of these? Those are hundreds and hundreds of models, collision files, and textures - and that's fine, but all of that is entirely duplicated for every scene that uses them. Duplicated in the bobs/bods, taking up hard drive space (and what was likely not an insignificant amount in 2001), and of course that means a lot of duplicated stuff in the exe too. This also means the game wastes a lot of time re-loading assets that already had their duplicates loaded for the previous level. But wait, there's more silly duplication of assets! There are some exceptions like the standard minifigure model, but generally, if two models are identical, but merely have different textures, the meshes and collision files are duplicated anyway. So for example, every minifigure has a unique model for their head, as they have unique face textures... And each of those has several LODs... And alllllll of those are once again duplicated per level they're used in. Minifigure heads alone account for hundreds and hundreds of duplicate files. But there's sillier examples. There's two switches you flip in the Brickster's Palace minigame - and they account for four models. Wait, what, four? Yep - switch 1 up, switch 1 down, switch 2 up, switch 2 down. Because apparently sharing a model and then changing its rotation when it's flipped is too hard. There's plenty of other silly things like this, but I think one deserves special mention... Every single asteroid in the Asteroid Belt minigame is its own 3D model. I'm serious. There are 235 3D models for asteroids, and 235 corresponding collision files. They're divided into three sets/variations - 66 copies of asteroid variation A, 70 copies of asteroid variation B, and 99 copies of asteroid variation C. But it gets better, variations B and C are identical! (Thanks to Will for using a tool of his to automatically check which of the asteroid files were identical to each other.) So instead of just having two asteroid models (with collision files) for a total of four files, there are 470 files being loaded to achieve the same result. There's also a lot of inefficiencies in the models themselves. Excess polygons, using a bunch of smaller textures instead of a larger atlas... But here's my favorite. You know that skeleton in the desert on Adventurer's Island, holding a gem? It's a pretty low poly model (though it could be lower poly and look identical), with 1416 triangles... And 3065 vertices. Wat. Let's take a look at the UV map... The face is the only part of the model that's properly UV mapped. The rest is just given the plain white texture (text027.tga if you wanna try swapping it out), and while it's UV mapped, it's done in a pretty horrible way. If you're curious about the details, read this article, originally published in 2003 (two years after LEGO Island 2 was released) but still relevant today: http://www.ericchadwick.com/examples/provost/byf1.html http://www.ericchadwick.com/examples/provost/byf2.html The bits relevant to the vertex count are explained in part 2. In short, splits/seams/breaks in UV maps split/duplicate vertices... And the UVs for the skeleton's body are doing more splits than a masochistic gym instructor. What you're seeing in the first image there are all the triangles for the body UV'd on top of each other. If you lay them out separately (and I've moved the face elsewhere as it's not relevant), it looks something like this... This is a UV map straight out of hell. Just by fixing it up I got the vertex count of the model down from 3065 to 1686. And as you might expect, that's not an isolated case... Lots of models are like this. More coming, maybe. I think the point has been made. Quisoves Potoo, McJobless, Wognif and 23 others 26 Link to comment Share on other sites More sharing options...
McJobless Posted August 11, 2015 Share Posted August 11, 2015 This write-up was perfect. Entertaining, informative and concerning. WHAT WERE THEY THINKING?! Lind Whisperer 1 Link to comment Share on other sites More sharing options...
Ben24x7 Posted August 11, 2015 Share Posted August 11, 2015 Could it be possible that the layout of the UV is what causes some minifig parts to receive odd lighting? (although its possible it has nothing to do with the UV) Lind Whisperer 1 Link to comment Share on other sites More sharing options...
lol username Posted August 11, 2015 Author Share Posted August 11, 2015 Could it be possible that the layout of the UV is what causes some minifig parts to receive odd lighting? (although its possible it has nothing to do with the UV) Probably not. It's more likely to do with weird vertex normals or just plainly bad shading. (Assuming you're talking about the stuff you were in the other topic - the weird shading here) Lind Whisperer 1 Link to comment Share on other sites More sharing options...
Ostoya Posted August 11, 2015 Share Posted August 11, 2015 Well, everyone knew already why the game loads everything for so long. But now it gets even worse, I'm getting Action 52 vibes from this. Could you post your fixed UV map for comparison? I want to learn how those things work in the first place and it's good to see how not to do them. Link to comment Share on other sites More sharing options...
McJobless Posted August 11, 2015 Share Posted August 11, 2015 Could you post your fixed UV map for comparison? I want to learn how those things work in the first place and it's good to see how not to do them. Just as a general note on UVs; they're really simple. What you're trying to do is break your model down into flat pieces, similar to when you make the net of a 3D shape like a cube or pyramid. You need to think in terms of how an artist is going to texture your model, so its best to keep similar-coloured areas together. As a general rule (not necessarily important given most engines work out lighting independent of the texture UVs), you also want to slice parts that have different lighting. Lind Whisperer 1 Link to comment Share on other sites More sharing options...
Zeb Posted August 11, 2015 Share Posted August 11, 2015 Well now I know why every time I play this game I have to wait several long and boring minutes every time I enter a world or minigame, even though this game is 13 years old. I'm glad I never tried to play this game back in 2002... Link to comment Share on other sites More sharing options...
Alcom Isst Posted August 11, 2015 Share Posted August 11, 2015 (edited) Well now I know why every time I play this game I have to wait several long and boring minutes every time I enter a world or minigame, even though this game is 13 years old. I'm glad I never tried to play this game back in 2002... It wasn't much worse back in 2002. The load lengths don't get much better with fast SSDs or worse with slow HDDs. They seem to be artificial load lengths, and have been accidentally broken by messing around with the game. I think jamesster said that he broke the loading time delays by alt-tabbing out of LEGO Island 2. Edited August 11, 2015 by Alcom1 Lind Whisperer 1 Link to comment Share on other sites More sharing options...
mumboking Posted August 11, 2015 Share Posted August 11, 2015 So... just how little space could LI2 take up if nothing was duplicated? le717 and Wognif 2 Link to comment Share on other sites More sharing options...
Zeb Posted August 11, 2015 Share Posted August 11, 2015 Well now I know why every time I play this game I have to wait several long and boring minutes every time I enter a world or minigame, even though this game is 13 years old. I'm glad I never tried to play this game back in 2002... It wasn't much worse back in 2002. The load lengths don't get much better with fast SSDs or worse with slow HDDs. They seem to be artificial load lengths, and have been accidentally broken by messing around with the game. I think jamesster said that he broke the loading time delays by alt-tabbing out of LEGO Island 2. Thanks for the tip. I'll make sure to try that next time I play. Link to comment Share on other sites More sharing options...
lol username Posted August 12, 2015 Author Share Posted August 12, 2015 So... just how little space could LI2 take up if nothing was duplicated? Will ran his tool on a completely extracted LI2 install, and it seems that there's 178.21 MB of redundant files in total. le717, noghiri, emily and 3 others 6 Link to comment Share on other sites More sharing options...
mumboking Posted August 12, 2015 Share Posted August 12, 2015 I wonder if you could remove the duplicates and edit the exe (or create a program) to redirect the file accesses to one single file. It's probably not worth doing though if that's all the drive space you'd recover... Link to comment Share on other sites More sharing options...
noghiri Posted August 12, 2015 Share Posted August 12, 2015 Ahh, but perhaps that'd change the loadtime dynamic. If combined with a loadtime fixer that disables the artificial limits on loadspeed, it might greatly speed up loading. Link to comment Share on other sites More sharing options...
Recommended Posts