Leaderboard
Popular Content
Showing content with the highest reputation on 12/20/2017 in all areas
-
New Year's Resolution: Need Some Advice...
Dazzgracefulmoon and one other reacted to McJobless for a blog entry
I've never really followed the whole "New Years Resolution" thing before, but in getting older and running out the body clock, I've realised it might be good to start making some changes. One thing I really want to achieve next year is one of my biggest failings from this year. I'm a software developer by day, and a gamer by night. Being drained through the day with professional-level coding has made me bitter and cynical towards my own projects, to the point I've stopped doing them. While I still write game design documents as a hobby, I've completely put off physically working on any of the projects I would have once committed to. My New Year's Resolution is to produce one large-scale mod. It's something I used to do, or at least make serious attempts at, and I totally have the capability to do so now. While just making a new project from scratch gives me a lot of freedom, doing it as a mod means I get to excite an existing audience and utilise any existing content/implementations (i.e. I don't have to make my own guns or gun code, which is important as I have no visual ability whatsoever, and core stuff like weapon physics are a real pain in the knackers to do). A big problem of making a game from scratch is that any serious investment will cost me (purchasing asset packs or artists to make the game not look s***, paying for my own time and materials, paying for promotional stuff etc) and I'll want to seek return, which means a lot of legal and certification woes to deal with. I just want to build something big but relatively light that people can enjoy. My trouble is selecting a game for the specific mod I want to create. In an ideal world, my ultimate mod project would be a kind of Destiny-styled Raid, set in a breaking-down theme park. That is to say, a networked game-mode where a group of players are teleported between several small scenarios, in which they must complete a puzzle with barely any hints, while a horde of enemies attempts to gun them down. The story and aesthetics will be based on the likes of Westworld and Jurassic Park, which I've become very obsessed with recently. Ideally, players can collect audio logs, and collecting enough will change the final boss fight (or add a second one). Of course, that kind of project would be intense to produce, especially with many mod kits, so the idea is modular and flexible. Maybe it will only be solo. Maybe combat will be reduced. Maybe there will be less variety of individual puzzle mechanics and instead more reuse in creative ways of the same puzzle mechanics. The core, player surviving a collapsing attraction park, will remain the same. I'm looking for suggestions of games that have the capability to do anything along these lines. I've thought about using Blockland, but I've heard some negative things regarding the capability of the bots and having many different behaviours going at once (ideally, many people can connect to the server, group up in "fireteams" and run different parts of the course at the same time, like how a theme park ride has people in different rooms). If people can prove Blockland is capable of this kind of stuff, sure, but otherwise I'd like to know anything else I could use as a base. Another variant I've thought about (and one more relevant to RRU) is to make an overhaul for LEGO Rock Raiders that switches it up to become a time trial to find certain missing people and objects in the various tunnels underneath the park that staff used to get between attractions to perform maintenance. Any suggestions will help. A part of this is I want to make something people will actually play, as opposed to just producing crap for myself.2 points -
LDraw vs Mecabricks vs LDD for game models
eagleeyedan reacted to lol username for a topic
Let's say you're working on a model for a new Rock Raiders vehicle, or making a fan game, whatever. Often times people just use exports of LDraw models or similar things, without thinking about it too much. They'll also probably be told this isn't a very good idea, because the results will be highly inefficient. But just how inefficient? Let's find out. For those who may be new to all this: When you create a model with LDraw-based software, LDD, or Mecabricks, the saved model doesn't contain the actual geometry of the pieces. Rather, it's a list of what pieces to put where, in what colors, etc. The three systems mentioned above actually have their own libraries of 3D LEGO pieces. So, while these systems have some level of cross-compatibility (LDD can import and export LDraw models, and Mecabricks can import LDD models), this has no bearing on the brick geometry used. For example, if you build a model in LDD, then export to OBJ with an LDraw-based program, the geometry in the OBJ will be of LDraw's pieces, as if you had built it in LDraw to begin with. For these tests, I built a simple test model in LDD, which I was then able to also work with in LDraw-based programs (in this case, LeoCAD) and in Mecabricks, thanks to the cross-compatibility mentioned earlier (though Mecabricks lacked the specific window pieces I'd used, so I had to swap them out with a very similar part it did have). Option 1: LDraw LDraw is a (mostly) fan-created library of 3D LEGO pieces and software for doing things with them. Its origins go back to 1995, and the accuracy of the brick models is often hit or miss (there's an especially notable problem where all the holes in Technic bricks are at the wrong height). The brick models also aren't built with realtime rendering in mind; they favor sharing as much geometry between multiple parts as possible, but this leads to a lot of inefficiencies on exported models. It's also worth noting that studs, tubes, etc are 16 sided, and studs are 4.8 mm wide. There's a few ways of exporting LDraw models to other formats, but they generally give similar results. For this, I exported the test house to 3DS with LeoCAD. There are some issues with faces being flipped the wrong way and smoothing/normals being messy, but in the end, that's the least of your concerns: the triangle count for this simple model is 50350. Most of these tris come from the studs and tubes inside the walls and such; a complete waste. Model - Wireframe Option 2: Mecabricks Mecabricks is relatively new, web-based, and has its own unique brick library made in Blender (with occasional brick geometry borrowed from LDD, though not much, and those cases are gradually being replaced with custom geometry - more on that later). As you can read in that topic, the basic part dimensions are similar to LDraw, but additionally, the outside dimensions of the bricks are reduced slightly to leave gaps between them, like on real LEGO pieces. I exported the house to OBJ with Mecabricks, and the resulting model was 42927 tris - better than LDraw, but still not well suited to a game. Still lots of waste on hidden studs and tubes. Model - Wireframe Option 3: LDD, LXF to OBJ This method uses an old tool by bartvbl that is no longer available, however, I still have a copy and thought I'd include it in these tests. It assembles LDD's bricks together into your model and saves it as an OBJ (though it doesn't support things like flexible elements and decals). LDD's studs are 4.9 mm wide (the official LEGO measurement), but more importantly they're 12 sided rather than 16, and the bricks are generally far more optimized for realtime rendering: the resulting model is 30586 tris. There's still the major issue of hidden studs and tubes, though. Model - Wireframe Option 4: LDD, 3DVIA Printscreen capturing This method works differently than the others: It captures directly from LDD as it's running. Why does this matter? LDD has a system that automatically removes studs, tubes, etc that cannot be seen. It doesn't remove everything, but it does a lot - in fact, LEGO patented it. Capturing with 3DVIA Printscreen, then converting the resulting 3DXML to OBJ with my tool, results in the test house model only having 13548 tris, while looking identical to the previous method! (It also supports flexible elements and decals, if your model has them.) Model - Wireframe Option 5: LDD, 3DVIA Printscreen capturing, with "cap" bricks This is a strategy Hollis/cdmpants came up with. I'll write a topic with specifics later, but in short, you place bricks in your LDD model that serve no purpose but to trigger geometry removal. The bottom of the roof has many tubes that aren't covered, so LDD doesn't remove them - but, if this were in a game, the player would likely never see or care about them. So we put caps there (and on the bottom) to get rid of them. Then, once the model is converted, we delete them, leaving the more optimized bricks they were covering behind. Doing this reduces the model to 2586 tris. Model - Wireframe Option 6: Remodel it yourself The inevitable conclusion. Any model can be optimized further with some manual work; I decided to use the LDD 3DVIA Printscreen rip as a base and work from there. I was easily able to get it down to 884 tris. Model - Wireframe There's another difference between brick libraries: LDraw and Mecabricks are fan-created (well, mostly - we'll get to that in a moment), and LDD's brick geometry is owned by LEGO. So, can you use LDD geometry in game mods, fan games, or other unofficial software? Up until recently, I was under the impression that LEGO was strongly against it. The only major fan-created software (that I knew of) to contain LDD geometry - or rather, enhanced versions of it - was the LDD to POV-Ray Converter: More information was given in this Eurobricks post: In May, I contacted LEGO Customer Service to ask if there were any way for other fan-created projects (such as my own) to use LDD geometry with the official blessing of LEGO, as the LDD to POV-Ray Converter had. Here's their reply: So, using LDD geometry with direct, official approval from LEGO is unlikely to happen these days. The only exception seemed to be a collection of LDD parts that the LEGO Universe developers had shared with LDraw, to "ease up the conversion between LDraw and LEGO Digital Designer". The LU team sent part geometry to LDraw in several batches, the first in 2007, and the last in 2010. But then I found out something unexpected: From 2011 to the present day, LDraw has been adding LDD bricks to their library even beyond the ones officially given by the LU team: https://forums.ldraw.org/thread-800.html https://forums.ldraw.org/thread-1145.html https://forums.ldraw.org/thread-5310.html LDraw's files are plain text, and part files contain information on their history/authors. LDD-derived LDraw parts credit "LEGO Digital Designer" as the author, and searching for that through all files in the current LDraw parts library reveals 542 files which are sourced from LDD. Up until I found this out, I had been basing models in my game project off of LDraw geometry, to avoid using LDD geometry without approval from LEGO. But it turned out that many of the LDraw parts I'd been using were just slightly modified LDD parts, ripped by LDraw parts authors! I then checked Mecabricks, and what do you know, they also have some parts that come from LDD (the ones I specifically checked were some minifig hair pieces). It's a low amount and they're gradually being replaced with custom geometry, but it goes to show LDD ripping isn't a dark forbidden practice or anything. So both LDraw and Mecabricks (and thus their users) have been using LDD geometry, and LEGO doesn't seem to care. And LDraw has been doing this for six years as of when I write this, for hundreds and hundreds of parts. Thus, I think it's safe to say LEGO probably won't care if you were to do something similar in a mod or fan game. Just don't go running around screaming "THESE ARE LDD MODELS, I AM DISTRIBUTING OFFICIAL LDD GEOMETRY EN MASSE, HERE, DOWNLOAD THEM", and chances are you'll be fine.1 point -
The Basics Of Programming Mission Objectives
Cyrem reacted to Baz for a guide
One of the major components of Level Modification, the process of Editing the Mission Objectives can be rather complicated, as all the script has to be reverse engineered and decoded from the original encrypted NPL files. Before we get into editing the NPL files, it's important that you actually understand the script you're working in. Objective Script Files Fortunately, there are unencrypted versions of each script that are fully readable called NRN files. Both the NRN and NPL files are found in the level folder for the mission (Ex: LegoRR0/Levels/GameLevels/Level01 for Driller Night). The NRN is really a simple text file, which you can open with almost any program, even Notepad, which is the traditional program for editing scripts. Now, if you already know some programming, this should be a breeze for you, as it only seems to be a bit of modified C or C++ language. If you aren't, not to worry, that's what this tutorial is for. Before going gallivanting into the wonderful world of scripting, always remember to have a back-up for your NRN or NPL files somewhere. It is best to have a back-up of the entire LegoRR0 folder and its contents, so you don't get files mixed up with the ones in the edited folder. Example Script Let's start out by looking at a pretty basic mission script, like for Level21, Air Raiders, which is an example of a Material Collecting Objective: #include <nerpnrn.h> TRUE ? SetTutorialFlags 0 TRUE ? SetMessagePermit 1 Function(Upgrade) { TRUE ? SetToolStoreLevel 1 TRUE ? SetTeleportPadLevel 1 TRUE ? SetPowerStationLevel 1 } FuncEnd(Upgrade) // Check to see if objective is failed TRUE ? SetR1 0 GetToolstoresBuilt = 0 ? AddR1 1 GetMinifiguresOnLevel = 0 ? AddR1 1 GetR1 = 2 ? SetLevelFail // Check to see if objective is completed GetCrystalsCurrentlyStored > 39 ? SetLevelCompleted Not too big for a script; now the first thing you'll notice is in the first line you have the parameter "#include <nerpnrn.h>" This is referring back to the parent file, nerpnrn.h, located in LegoRR0/Levels. Every script that includes this reference contains the information contained the parent file. This is important to notice, as when you start looking through the encoded NPL files, it will contain all this script from the parent file, followed by the actual script contained within the NRN file. The next two lines are pretty basic, and you'll find them in almost any GameLevel NRN script, as they indicate that there are no Tutorial stops or "Flags" set up and it just has the one message at the beginning of the level, telling you the mission description (WHICH by the way can be edited in the LegoRR1/Languages/ObjectiveText.txt file). After that you have a function which is basically a set of parameters, in this case, indicating the preset upgrade level of various buildings present at the beginning of the mission. It is not entirely understood exactly how the actual "Function { } FuncEnd" part of the script is encoded in the NPL, but it's contents (the actual settings for the upgrades) are easy to see. The last bit is the important bit that designates what is required for the mission to be complete. First off, it is programmed to recognize that if there are no Tool Stores built, and no Rock Raiders present, the mission ends in failure, since it requires rock raiders to build Power Paths for the tool store to teleport more rock raiders down with. This bit is designated by the couple functions under the helpful "// Check to see if objective is failed." Note that anything written in a line following "//" is ignored by the game, allowing for helpful notations to keep track of what the purpose of some lines are. After that, there's the simple line "GetCrystalsCurrentlyStored > 39 ? SetLevelCompleted". This indicates that once the number of Energy Crystals collected is over 39, i.e. 40 or more, then the level has been completed successfully. And that's that! Other Scripts There are many scripts that follow the format shown above. The main things you have to pay attention to is the stuff around "SetLevelCompleted" and "SetLevelFail". Some scripts, like Level07, Search 'n Rescue, require you to Find a Hidden Object, in this case, a missing rock raider, lost in an undiscovered cavern. In this mission "GetHiddenObjectsFound > 0 ?" is used in order to win, which means, when 1 or more hidden objects are found, the level is completed. Others like Level06, Explosive Action, require you to travel to a certain block designated as a Tutorial Block in the level's Tuto_06.map file, in this case, you are required to bring the designated lost digger, into the rock raider base. Some early missions require that you Construct a Support Station or Other Building in order to win the mission, like Level04, A Breath of Fresh Air. Once "GetPoweredBarracksBuilt > 0 ?" i.e. one or more Powered Support Station has been built, then the level is completed. Some missions that have a depleting air supply will mark a level failure if "GetOxygenLevel < 1 ?" i.e. Oxygen levels hit 0. All the basic levels usually have one of these commands as their objective. There are many more parameters to work with, as you'll see by looking at some of the tutorial level scripts, which are much more complicated, as they designate tutorial flags which stop the mission to give a message or require you to click on something or perform some other action to move on. Other scripts include certain setups for Slimy Slug Attacks and Coordinated Monster Attacks and Intermittent Messages. Once you got a grasp of things, you can probably get a little creative changing the level goals so that instead of having to build a power station, you have to build a geology center, to complete the game. Or you could make the mission's goal to collect a certain amount of Ore, rather than crystals. Editing NPL Files The next step would be to figure out how to actually change the NPL file. Note that any changes you make in the NRN file do not change anything in the NPL file. At the moment, you have to go into the NPL file and manually change its contents to your liking. The major difficulty with this is that the NPL file is encoded into hex-computer language. It basically translates the C++ language into a language that the computer can easily understand and process. To open and edit the NPL file, you will need Hex-Editing Program. There are many good Hex-editing programs out there, such as XVI32, which is free. Upon opening it, you'll notice that it all looks like gobbledegook, nothing but numbers letters and strange symbols. Depending on what editor your using, you may see two versions of the script. One version in letters, blank spaces, and symbols, the other in nothing but numbers. For our purposes, we will be only paying attention to the numbers, which are the real "Hex-Strings". Every number, symbol, and parameter that is contained in the NRN script has a counterpart Hex-string in the NPL file. Included with this guide are several other documents which contain a list of known parameters, numbers, symbols, and their hex-string counterparts. Editing the NPL file is a slow and careful process. The best thing to do is to use the search command, which most hex-editing programs have. Search for the string that you want to edit, assuming you know what it is, and once you find it, change it. Note that in order for the NPL file to work it must be the same amount of characters, ALWAYS. This means that you should never ever ever finding yourself pasting things in with Ctrl+V or deleting things with the Delete or backspace key, as these will delete characters. To edit, just change the already existing characters, rather than inserting or deleting any. This way, it will keep the same amount of characters, and will stay functioning.1 point
