PinkDot Posted October 24, 2007 Report Posted October 24, 2007 As far as I know there's some limitation in .map file structure that makes grouping objects impossible. Recently I thought about alternative method - tagging entities instead of grouping them. Tags would be assigned just like any other spawn_args. Actually - the functionality is already there - you just write any word and it's added to the list. I'd say tag would be anything which is not a recognised as spawn_arg. The only functionality which has to be done is "Select by Tag/Spawnarg". It shouldn't be difficult to do, should it? And there's really plenty of possibilities to make selecting a group of objects easy and flexible. I mean diffrent modes of selecting etc., but these are details at this moment. Of course any object could have many tags, so you can have f.e. galleon with all stuff on it tagged with "galleon". But if you want to move only lamp on the galleon, you could select lamp and light source tagged f.e. "lamp_12" and "galleon" tag would be ignored. Another great functionality would be filtering by tags. What do you think about it? Quote
Tels Posted October 24, 2007 Report Posted October 24, 2007 As far as I know there's some limitation in .map file structure that makes grouping objects impossible. Recently I thought about alternative method - tagging entities instead of grouping them. Tags would be assigned just like any other spawn_args. Actually - the functionality is already there - you just write any word and it's added to the list. I'd say tag would be anything which is not a recognised as spawn_arg. The only functionality which has to be done is "Select by Tag/Spawnarg". It shouldn't be difficult to do, should it? And there's really plenty of possibilities to make selecting a group of objects easy and flexible. I mean diffrent modes of selecting etc., but these are details at this moment. Of course any object could have many tags, so you can have f.e. galleon with all stuff on it tagged with "galleon". But if you want to move only lamp on the galleon, you could select lamp and light source tagged f.e. "lamp_12" and "galleon" tag would be ignored. Another great functionality would be filtering by tags. What do you think about it? Couldn't you just add a spawn_arg "tags" and have the property of it be the "tags"? Just like "name" contains an arbitrary string, "tags" could do, too. Or did I misunderstood you? Quote "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950) "Remember: If the game lets you do it, it's not cheating." -- Xarax
PinkDot Posted October 24, 2007 Author Report Posted October 24, 2007 I don't mind if tags would be a string as a property of some spawn_arg or they would be unrecognised spawn args (without a need for a property to put in). It's just a matter of aesthetics and functionality (practice would tell it). The thing is if selecting objects in DR by those tags is possible or not. For me it looks quite easy to do and gives really great possibilities of organizing stuff in the scene. Quote
OrbWeaver Posted October 24, 2007 Report Posted October 24, 2007 The problem with grouping by spawnargs is that it only works for entities -- you would never be able to group a number of brushes or patches together, because they are all part of a single entity (the worldspawn). However, if this limitation was accepted it probably would not be that hard to do. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
Tels Posted October 24, 2007 Report Posted October 24, 2007 The problem with grouping by spawnargs is that it only works for entities -- you would never be able to group a number of brushes or patches together, because they are all part of a single entity (the worldspawn). However, if this limitation was accepted it probably would not be that hard to do. Is there any downside to make brushes some entity instead of just children of world_spawn? Quote "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950) "Remember: If the game lets you do it, it's not cheating." -- Xarax
OrbWeaver Posted October 24, 2007 Report Posted October 24, 2007 Is there any downside to make brushes some entity instead of just children of world_spawn? Yes, they won't participate in map compilation and will not seal the void or portal zones (they will all be func_statics, like models). Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
Tels Posted October 24, 2007 Report Posted October 24, 2007 Yes, they won't participate in map compilation and will not seal the void or portal zones (they will all be func_statics, like models). Ah. Good to know. Do patches seal these areas? (I fear not Quote "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950) "Remember: If the game lets you do it, it's not cheating." -- Xarax
OrbWeaver Posted October 24, 2007 Report Posted October 24, 2007 Do patches seal these areas? Nope. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
PinkDot Posted October 25, 2007 Author Report Posted October 25, 2007 The problem with grouping by spawnargs is that it only works for entities -- you would never be able to group a number of brushes or patches together, because they are all part of a single entity (the worldspawn).But tagging is not a grouping really - it doesn't change the structure of map objects. And you can assign some spawn_args (=tags) to brushes as well, so it should work. I added some "tag"" to one of my brushes, it was added to the list, not ignored, it was saved with a map, compiled with no problems, so actually the core functionality is there already - we CAN add "tags" to brushes or entities. But we cannot select by spawnargs (=by tags, as far as I know). It would be actually useful feature not only for tagging - you could use it by selecting all entities with f.e. "noshadows" spawn_arg etc. Missing any form of grouping feature is really bad. It takes ages to select complex group of entities - using brush for selecting usually ends up with selecting more than you need and than you have to spend some time on unclicking unwanted entities and so on... Tagging has another advantage over regular grouping - you could select f.e. only books in whole map. And together with filtering option you could hide everything except books, so you could focus on editing them only. Quote
greebo Posted October 25, 2007 Report Posted October 25, 2007 But tagging is not a grouping really - it doesn't change the structure of map objects. And you can assign some spawn_args (=tags) to brushes as well, so it should work. I added some "tag"" to one of my brushes, it was added to the list, not ignored, it was saved with a map, compiled with no problems, so actually the core functionality is there already - we CAN add "tags" to brushes or entities. But we cannot select by spawnargs (=by tags, as far as I know). It would be actually useful feature not only for tagging - you could use it by selecting all entities with f.e. "noshadows" spawn_arg etc. Missing any form of grouping feature is really bad. It takes ages to select complex group of entities - using brush for selecting usually ends up with selecting more than you need and than you have to spend some time on unclicking unwanted entities and so on... Tagging has another advantage over regular grouping - you could select f.e. only books in whole map. And together with filtering option you could hide everything except books, so you could focus on editing them only.Brushes and patches don't have spawnargs, it was the worldspawn you were assigning that tag to actually. All other world brushes carry the same spawnarg, check it out. I can perfectly see the benefits of having a grouping feature, it's just not as easy as it sounds. At least we are already allowing for a layering feature after the next scenegraph refactor, but don't hold your breath. Quote
sparhawk Posted October 25, 2007 Report Posted October 25, 2007 If we have multiple layer groups that is already a step in teh right direction. Assigning groups to individual objects and brushes would also be great, but one thing after the other. As for grouping brushes. A brush has a definite structure in the map file, and you can use comments anywhere, so this should be feasable. The only thing you need to add, would be a mechanism to allow setting such groups. Spawnargs wont work for the above mentioned reasons, but that doesn't matter. I don't have a mapfile here to check it, but even though brushes are attached to worldspawn, they still retian their own structure, otherwise it wouldn't even be possible to select them as individual objects inside the editor. And this would be metadata information for the editor only, as the mapcompiler and the game don't need that grouping information. Quote Gerhard
OrbWeaver Posted October 25, 2007 Report Posted October 25, 2007 I don't have a mapfile here to check it, but even though brushes are attached to worldspawn, they still retian their own structure, otherwise it wouldn't even be possible to select them as individual objects inside the editor. And this would be metadata information for the editor only, as the mapcompiler and the game don't need that grouping information. Brushes are stored as individual objects, yes, but I don't know of any easy way to associate arbitrary metadata with them in the map file -- I am totally against using comments for this purpose, because it screws up the entire parsing system (i.e. the DefTokeniser class which returns a list of tokens already strips out comments; if this was changed it would mean that all of the parsing systems would have to deal with comments separately, adding considerable complexity to the code). One way this could perhaps be done is to maintain brushes in a particular order in the map file, and to attach spawnargs to the worldspawn mapping brush indexes to layers, e.g. "editor_drLayerMapping1" "firstlayer""editor_drLayerMapping2" "firstlayer""editor_drLayerMapping3" "secondlayer""editor_drLayerMapping4" "myCustomLayer" which would assign each numbered brush into its correct layer when DarkRadiant loads the map file. Of course the layering could get broken if DoomEdit was used to save the map since the order might not be correct any more, but perhaps DoomEdit would ignore these unrecognised spawnargs anyway and therefore not save them with the map. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
sparhawk Posted October 25, 2007 Report Posted October 25, 2007 I think the mapfile is parsed within the SDK, yo might add additional keywords there. As for using DoomEdit, bad luck I would say. People should be aware that DoomEdit is not the way to go, but of course, until a proper renderer is available inside DarkRadiant, there is probalby not much choice. One option would be to export/import the grouping into a seperate file, so the mapper can export it, before he uses DoomEdit. It's not very elegant, but it might be a solution for now. Quote Gerhard
OrbWeaver Posted October 25, 2007 Report Posted October 25, 2007 I think the mapfile is parsed within the SDK, yo might add additional keywords there. As for using DoomEdit, bad luck I would say. People should be aware that DoomEdit is not the way to go, but of course, until a proper renderer is available inside DarkRadiant, there is probalby not much choice. If there is a possibility for inserting keywords into the map file which will not cause Doom 3 to choke, then that is fine -- we can obviously write the DarkRadiant parser any way we like, so it is just a question of what Doom 3 will accept and what will cause an error. One option would be to export/import the grouping into a seperate file, so the mapper can export it, before he uses DoomEdit. It's not very elegant, but it might be a solution for now. Yes, the separate file solution may well become necessary at some point. I don't really like using multiple files, but it may be the only way to get around limitations in the .map format once more advanced features need to be saved. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
sparhawk Posted October 25, 2007 Report Posted October 25, 2007 I have to check it, because I'm notz sure, but I seem to recall that the parser for map files is inside the SDK. Quote Gerhard
sparhawk Posted October 25, 2007 Report Posted October 25, 2007 If I'm right, the mapfile parser is in idLib/mapfile.cpp Can't check it as I only have the sourcecode here to look at, but it looks like it. It also makes sense, because the mapfile can be completely replaced in the open part of the SDK and a map can be setup in any way you would like to. You can replace it with a binary format if you want to because the loading all happens in the gamex86.dll part. Quote Gerhard
OrbWeaver Posted October 25, 2007 Report Posted October 25, 2007 That could be very good news, since it opens the possibility to arbitrarily extend the map file with whatever extra information is needed. Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
sparhawk Posted October 25, 2007 Report Posted October 25, 2007 Yup. Only the material parser is not opened, because the textures are to close to the renderengine to allow for that. With the map we should eb able to do whatever we want. I wonder if DoomEdit uses the same code to load the map, but I guess not. It has to be tested, but that would probably expecting to much. Quote Gerhard
OrbWeaver Posted October 25, 2007 Report Posted October 25, 2007 I wonder if DoomEdit uses the same code to load the map, but I guess not. It has to be tested, but that would probably expecting to much. I would think so -- after all, why would they want to write a map parser twice when they have already written it a first time? Quote DarkRadiant homepage ⋄ DarkRadiant user guide ⋄ OrbWeaver's Dark Ambients ⋄ Blender export scripts
sparhawk Posted October 25, 2007 Report Posted October 25, 2007 Well, because the map loading code from the game doesn't neccessarily need to be the same as the one from the editor. They have to write a writer also, so maybe they did it in one go. Especially since the editor is essentially a seperate app. I guess we have to test it and see if the editor chokes or not. If not, it would be great. There is still the chance that custom stuff would be erased when the map is written back though. Depends on how the editor maintains the original mapfile. Quote Gerhard
greebo Posted October 25, 2007 Report Posted October 25, 2007 I read through the SDK parser once in the past, it's obviously old code originating from Quake 3 or earlier days (there are several (old) types of brushes supported, IIRC), so there's definitely room to change something here. However, we should take care that both DarkRadiant and Doom 3 are able to parse all types of maps (native D3, and TDM-specific maps). Maybe it's enough to bump the mapfile version number from 2 to something higher - a turnout for switching map file parsers. Of course, if DoomEdit has the map parser burned in its EXE file, then we're out of luck. This would mean that DoomEdit couldn't be used anymore for adjusting DarkRadiant maps. Quote
PinkDot Posted October 25, 2007 Author Report Posted October 25, 2007 Brushes and patches don't have spawnargs, it was the worldspawn you were assigning that tag to actually. All other world brushes carry the same spawnarg, check it out.Oh, yes. Now I know what you meant... Somehow I knew it wouldn't be that easy... I think that it still would be better to have it working only with entieties rather than nothing, but hopefully you'll find a way to get around that problem. Quote
SneaksieDave Posted October 25, 2007 Report Posted October 25, 2007 My guess is breaking DoomEd compatibility would go beyond just losing the pretty renderer, and in-editor particle editor, etc.; it would probably also break changes made in-game and saved out, like speaker editing and ragdoll placement. IMO, losing the realtime lighting is bad enough, without a solution in DR at this time (I guess namespace vanished). Edit: Worldspawn brushes have identifiers, e.g., "// primitive 3". Couldn't that be used? Quote
greebo Posted October 25, 2007 Report Posted October 25, 2007 Everything after // is a comment, and despite what I suggested months ago, I have to agree with OrbWeaver that we shouldn't mess with comments unless there is absolutely no other way to go. Quote
sparhawk Posted October 25, 2007 Report Posted October 25, 2007 Yeah. Using comments is even worse then using a secondary file for now. Quote Gerhard
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.