Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Klofkac last won the day on February 12

Klofkac had the most liked content!

Community Reputation

102 Excellent

About Klofkac

  • Rank
    Desert Warrior

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I just added this feature! I hopefully fixed that too. Hmm, I just wonder, whether this option is available in mission ini file (where mission name, author, briefing etc. is stored). What I mean, if the game will use the given TEXT.UIB file, when that mission is started from mission launcher. If the game doesn't support this option, then it would be useless, as this could be used only if map is launched from the editor, not from mission launcher. Maybe @FunkyFr3sh could answer that. Yeah, those are the commandline parameters passed to game executable (Dune2000.exe) when running it to launch a mission. I cannot recall if there are any useful parameters, I just added this for potential future use. Anyway, I added one more small thing into the editor: Now you can directly see and edit the tileset and attributes name in Mission file: Those fields are automatically updated when you change a tileset using Tileset menu. Otherwise, when you for example load a map with unknown tileset, the editor loads graphics for default tileset (BLOXBGBS) but those fields as well as tileset information in .MIS file will remain unchanged when you save the map. And tileset name is now case insensitive when opening a map. So, those are basically the last changes I made before I officially release a new version of the editor. You still have opportunity to spot any bugs or give some ideas for (not very difficult or complicated, rather simple) new features! I also have an idea to put the AI values manual (this: https://forum.dune2k.com/topic/27803-d2k-ai-manual/ ) into the editor .zip file which will get released, so that anyone who download and uses the editor have it easily on hand. What you think?
  2. Fair explanation. I will load BLOXBGBS (the default tileset) when a map uses unknown custom tileset.
  3. I can try to improve that. Hmm, there should be no problem with the Tileset attributes editor to add editor-specific attributes. I did that myself when preparing the original tilesets. Can you try again or explain how it messes up? One more thing. You can actually do lot of cool and magic things with tileset ini file. This is exactly made for better work custom tilesets in the editor. Here you can define minimap colors, give custom names to terrain types, define presets for terrain blocks etc. Under tilesets folder there is "template.ini" file which you can use, and where all the things are explained. Heh. Actually I did not notice myself. Cannot say what is the reason for that. But I don't consider this to be any serious problem and I'll probably just leave it. I can have a look if it can be fixed You are right, this is caused by tileset name written in lowercase, and when program looks for the tileset in available tileset list, it won't find it because "Bloxbxbs" is not equal to "BLOXBGBS". I can probably make the comparison case-insensitive, as the game doesn't care about case anyway. The reason why previous version of editor did not give error message is, that it simply silently ignored the problem and the tileset, which was previously loaded, was used (the editor loaded BLOXBGBS upon start by default). Well, if I use BLOXBGBS as default tileset, then the maps using custom tileset won't display correctly anyway, so I conider this failsafe method to be rather useless, it rather encourages the user to get the tileset they needed.
  4. Hey there, another update! Download: D2kEditorv13pre3.zip Changelog: Added: Highlighting events having selected condition feature Fixed: Program now checks, if window would appear off-screen (i.e. previously opened on second monitor which is now unplugged) and resets its position Changed: Program now automatically loads all all .ini files placed into "tilesets" folder, instead of loading tileset list from "config\tilesets.ini". All tileset .ini files must now contain name of attributes file. Added: Loading tileset images directly from game's internal .R8 and .r16 files Removed: Editor is no longer distributed with tileset .bmp files Fixed: Improved auto-detection of game folder, detection of missions stored under "Data\Missions" folder The major improvement in this update is much easier work with custom tilesets. First, it is no longer needed to specify all your tilesets in editor's tileset.ini file, but instead you can just place your tileset's .ini file into tilesets folder and editor will automatically load them. Second, the editor can now directly load the tilesets in game's internal formats (.R8 and .R16)! That means no longer need to distribute those heavy .bmp files along with the editor and your custom tileset packs. (Do you remember Shai Hulud and its "Tileset extractor" thing which actually did not work properly? D2kEditor can load .R8 and .R16 files fast on the fly, and it's written in just about 30 lines od source code!). The editor first looks into game's Data folder and attempts to load .R16 first, then tries .R8 if .R16 is not present. If not found in game's folder, looks into editor's tilesets folder for .R16 or .R8, and finally tries to load for a .bmp file (i.e. BLOXBGBS.BMP, without "d2k_" prefix). As of the attribute file (TILEATR*.BIN), editor first attempts to load it from editor's tilesets folder, then looks for it in game's Data\bin folder. Note that you still need to create special TILEATR file with editor's additional attributes, otherwise editing will not work properly (i.e. it won't bo possible to draw sand, rock, dunes etc.). If you want to use a new custom tileset with the editor right away, all you must do is to copy all files into game folder, and copy tileset's ini and TILEATR file into editor's tilesets folder (if the author didn't provide those, just copy template.BIN, name it according to tileset name, and edit attribute file name on the second line). Another improvement is easier use of the editor for the first-time users. That means just download the editor, unpack it into any location on your computer, load a map from the game's maps or Missions folder, and everything will be ready and configured! And the editor should also support the case when missions are stored in Data\Missions folder. No longer need to edit or fix anything in D2kEditor.ini file manually. I would really like to ask you for thorough testing of everything what I described here, if it really works and there isn't any bug, a flaw, or an overlook. I tried hard to tune up the program and address most of the problems people complained of here on the forum. Also I do not have multiple monitors on my computer, so I could not really properly test the check for window being displayed off-screen, so please somebody who has multiple monitors, test this and let me know if program works well on multi-monitor setup. Also this is going to be the last pre-release version, as I'm going to publish official 1.3 release soon and ask for putting it on D2K+ site for download. So this is the last chance for any bug reports or feature/improvement suggestions! Heh, that's really nice analysis, I was never actually thinking of that. Althrough it's quite interesting suggestion, unfortunately I did not implement this, because I just didn't find it beneficial enough to be worth implementing it (in other words I didn't feel like doing it). For me the random tile placement editor uses is just good enough, but I'm not against adding this feature at some point.
  5. Thanks for info, that sounds reasonable. Having auto-creation of Unit spawn event will encourage people to use it. Well, not necessary to give up this feature at all. It will be there, but it will just "look ugly". I'm thinking I can make it a "hidden" feature - a setting in .ini file must be changed to enable it. You mean select multiple conditions at same time and mark all events which use any of them? There's no multiselect for events or conditions, so only select one condition at time. By the way, I'm thinking about small rework of how the editor handles tilesets. Right now all supported tilesets need to be specified in config\tilesets.ini file. I want to get rid of that, so that the program will automatically load all existing files under tilesets folder. This way you just place a new tileset under tilesets folder and won't need to modify tilesets.ini. Each tileset will require 3 files - ini file, bmp file and bin file. In tileset's ini file will be specified the name of counterpart tileatr bin file and image file.
  6. I came up with this new feature "mark events having this condition". I hope that will do what you wanted. Aah, that's too much overcomplicated feature. I feel definitely much more effort needed to put into implementation than the benefit. No. Well, when I was implementing the Events and Conditions editor, I certainly wanted to add some automation for the most commonly and repeatedly used chains of events/conditions. I was thinking about what events could be the most useful for map authors. Harvester Replacement was the most evident and useful case. Then Side Annihilated message seemed useful too - in almost all of the original missions it's really used, so I supposed map authors would use that too. If you do not want to check for Units Destroyed, you can simply delete the Units Destroyed condition after it gets created. Then the third choice was not that clear for me, and I was deciding between several possibilities. One thing I was thinking about was Mission fail when you loose all buildings and units. Or Mission win when you destroy all enemies. In the end I came up with Unit spawn. Paradoxically it's the simplest and probably least useful event/condition chain, and I'm not sure whether it's really used in custom maps. But in almost all original maps it was used, so I probably thought it would be used in custom maps a lot too. Those three event creation features are hard-coded, and implementing customizable event/condition chain templates would be probably too much difficult to implement, so I would not go for it. But still, if you think Unit spawn is just too simple ot not very useful, you can give idea for a better replacement. That would probably not be a big deal, I tried to implement this, but there are some small technical implementation issues to think about. First, there is checkbox "Structures", which selects whether you want to select terrain only, or both terrain and structures. I could make it a special three-state checkbox, where the third state means "select only structures but not terrain". That could be a bit confusing to people, especially those who are new to editor would not know what the states mean. Second, I must somehow store the selected block in memory in a way that tile value is "missing" or "unimportant", so that when I place this block on map, tiles remain unchanged and only structures are placed. I can set tile value to 0, that will mean the top-left-most tile in tileset (which is a sand tile). This tile is probably never used in original or custom maps, so that would probably not be a problem, but that tile could not be used anymore as you would not be able to place it. Also, once you select a block in structure-only mode, all the tiles will visually look like the 0th sand tile in the block you pain. Third, thechnically in the map format, spice is treated as structure (has special value - 1 is thin spice, 2 is thick spice) so even in structure-only mode you will still select spice.
  7. Hey! Another tiny update is here! Download: D2kEditorv13pre2.zip Changelog: Fixed: Editing marker (i.e. building marker, current block) not showing when Mission settings or Events/Conditions window is open and is on background or minimized Added: "MissionsPath" setting in .ini file. It can be changed in case game loads maps/mission files from different location Fixed: The UI components now should not be messed up on systems where scaling is set to different value than 100% Music can be selected from a dropdown list in the Mission settings window as well (like in Play music event). Fixed the last unit in unit selection list not shown. Thank you all for your comments and helping me making this editor better. Well, I have an idea how that can be worked around. You can create one additional Flag condition, which will be there just for temporarily disabling your events. If you want to disable an event, just add this condition into its condition list. As the condition is always evaluated false, the event will never happen. Hmm, I actually made a Red Alert tileset for Dune 2000 myself in the past: https://forum.dune2k.com/topic/27109-release-new-dune-2000-tilesets/?do=findComment&comment=391645 Not sure how popular/spread it got, and it looks like the attachment does not work anymore. I can reupload if you want. I don't think I ever downloaded or used the resource editor. About TILEDATA.BIN editor, I posted it in this thread: https://forum.dune2k.com/topic/27065-release-tiledata-editor/?tab=comments#comment-390973 but looks like attachment is broken there as well. Here's reupload: TileDataEditor.zip
  8. Hello all! It's been almost 3 years since I released the last version of the Map and Mission editor without any update. Once I made a topic (https://forum.dune2k.com/topic/27429-reviewing-map-and-mission-editor/) where I asked you for some ideas what to add to the editor. I was planning to do some updates based on your suggestions, but then unfortunately got disinderedted in development and never implemented the ideas... until now. Finally I kicked myself to finish off some missing and useful features to the editor, which I think should really be there, and the editor will feel more complete with them. It's just a small update (not having so many additions like previous releases) and it's not an official release, but just a preview. I wanted to make sure all the new features work correctly and there's not any serious bug. So I'd like to ask you to test it and give me some feedback and ideas. But I want to say that I'm not going to implement anything big, just probably some minor additions like I made in this version and bug fixes. Download (EDIT: new version from 2018-12-02): https://forum.dune2k.com/applications/core/interface/file/attachment.php?id=3885 Changelog: Fixed: Size preset buttons in Tileset window were off by one position Added: Find object feature Changed: Some options (i.e. Show grid) are now toggle buttons below minimap instead of Settings menu items Removed: Draw concrete option (now is always on) Added: Play Sound event: now provides dropdown list of sound names (loaded from samples.uib) Added: Play Music event: now provides dropdown list of music names (list of existing .AUD files in Data\Music folder) Fixed: Set Attack Building Rate event: value is named "Arrack rate" instead of "Unknown" Fixed: Casualties condition: "Flags?" value renamed to "Proportion" and changed to floating-point number type Added: When temporary TESTMAP.MAP file is saved, the map name in ini file is renamed to "TESTMAP" in order to avoid duplicate entry in mission launcher Added: Open recent files feature Fixed: Editing marker (i.e. building marker, current block) not showing when Mission settings or Events/Conditions window is open and is on background or minimized Added: "MissionsPath" setting in .ini file. It can be changed in case game loads maps/mission files from different location Fixed: The UI components now should not be messed up on systems where scaling is set to different value than 100% Here are come comments to the ideas you gave me previously: Cannot reproduce, need more information Not feasible to easily implement. Would require very significant changes in code, or some hacks. Also writing text to map (i.e. event markers) would not work. Theoretically possible, but I think drawing a shape od placed building is enough and not feeling for spending time implementing this. I'm rendering the structures how exactly they are rendered in game, and in game they are not differentiated. The structures graphics file (shipped with the editor) was made by taking screenshots from game. So if anyone from you would want to help, you could somehow modify the graphics file, like adding colored tint to walls or marking somehow modified outpost. I'm not a graphician. Theoretically possible, but probably I would need to fiddle with CIRCLES.BIN file to load what the revealed areas should be. I don't even know if format of this file was ever reverse-engineered. So not feeling for adding this feature. Uh, yes, that's a problem. For some reason (don't remember if it was originally me or Mission launcher creator) we chose "_" as line break in ini files. So this character cannot be used itself in ini file. It could be worked-around by replacing "_" to some other character before saving into ini, but we would need to choose a character to sacrifice. Also changes in Mission launcher would need to be done. So enjoy the new preview release and once again, thank you all for your support! PS: Looking forward to see what you will come up with the Play Sound feature
  9. Klofkac

    Reviewing Map and Mission editor

    Those "concrete" tiles in tileset were never indended to be placed directly to the maps by the game programmers. Those are just "technical" tiles which are rendered in game when you place a real concrete. Same with the "spice" tiles on bottom of tileset. What you basically can do is to set "Buildings can be placed" attribute to those tiles using the Tileset attributes editor. However, that will just allow you to build on them, but remember that those tiles won't behave as real concrete, so buildings will get damaged over time on them like if you place buildings without concrete. You would be able to buid a real concrete on those tiles, which would look ridiculous. Also this "fake" concrete would be indestructible. Currently it is not possible to pre-place "real" concrete using the map editor, because there is simply no in-game support for this. Similar problem here: There is unfortunately no in-game support for this. I cannot add a feature which is not technically possible. I once asked FunkyFr3sh, who is patching the game, to add such feature, but he probably never did this, since he probably hit some technical obstacles, I don't know. He could comment this. I'd really like this feature to be implemented.
  10. Klofkac

    [Release] Dune 2000 Random Map Generator

    Always when I download a new version of your map generator, for first I try it on the default settings (just run run.bat) and after that I try to modify the settings. Yes. The parts where you use your "new" method of distribution (placing spawns with autoSpaceSpawns on, and placing the spice blooms) take excessively long time. Actually, as I previously complained that the program got stuck in infinite loop, that was probably not true, your algorithm was just taking time. In comparison, all other phases of the map generation took just fractions of a second, with one or few exceptions which took a few seconds. I personally think that 1 minute and 30 seconds is way too long time. As I said, you might have a faster PC or something, but for me it was taking much more. With the two first versions of the program you released, generating a 128*128 map took something between 5 and 10 seconds, which is reasonable time. So generating a map should really take no more than 10 seconds (maybe 15), so this should be your objective. You should take care about effectivity of your algorithms, so whenever you implement something new and generating a map takes significantly more, you need to rethink or remake it. Good work, so I'm curious how well this method will go. If you get some first results, don't hesitate to post screenshots here. I just have a few ideas. I looked at the files you generated and I personally think you really do not need to write values of 0 here (as 0 is really frequent value and should be default), which will lead to much smaller and better readable files. The second idea is that you could group all "clean sand" and "clean rock" tiles together and threat all of them as a single tile index. The idea is, there are like 10 different indexes of "clean sand" tiles and 15 "clean rock" tiles, which all look very similar and can be completely randomized. So I think this could optimize your algorithm. And now some more notes. I see you removed the pictures with examples of a map generated with default settings from your first post. I don't think it was a good idea, because it's actually good practice to provide a quick demonstration of what your program can do, before anybody decides to download it. I recommend you to use some version control tool to track your development and changes in source code. The most used one is Git and you create a Git repository for free on github.com . I don't know whether you used anything like this in your life but this has actually many advantages. First, all states ("versions") of your code are tracked and archived, so you can look and compare what was changed between the previous and current version. Second, anybody is able to download your source code from github, so you do not need to always zip and upload it manually. And third, github allows collaboration of more people, so anyone else can make changes in your code and push (upload) them to your repository. Mine github repository for the map and mission editor is here: https://github.com/jkoncick/D2kEditor
  11. Klofkac

    [Release] Dune 2000 Random Map Generator

    Ok, so now I tried it out. Again, I ran into the same problem as before, the program just runs forever and never finishes and needs to be killed. I realized that it freezes even during the very first phase (place spawn points) because it did not output "Player spawns added" message. So I turned off the setting "autoSpaceSpawns" and then it got past the phase "Dunes added" and froze on addSpice phase again, same as with the previous version. So I decided to look into the source code to see what's wrong here. Well, the problem is, that this new method doesn't work. Apparently you use the exactly same method for placing spice blooms, that's why same problem is here. The problematic part is the double for-loop (one with "i" and one with "ii" variable), which just takes HUGE amount of time. What I understand, your new method works this way: When it's attempting to place a spice bloom, it tries to place it as far as possible from any existing spice blooms. So it picks randomly some coordinates and checks the largest possible surrounding area around it, whether there is any existing spice bloom in it or not. For the same area diameter, It tries several different coordinates (ii-loop), and if no success, it decreases the diameter by 1 (i-loop) and tries the same again. The worst is, that this method utilizes 4-level loop (2 levels for checking the surrounding area and 2 levels as I mentioned), leading to O(N^4) time complexity (where N is size of the map)!!!!!!! Which is really not usable in practice. Maybe your computer is faster than mine or you tried with smaller coordinates than 128*128, but for me, it would take forever to generate map using this method. So you definitely need to rework the method to be more optimal, or just use the "old" method for the time being.
  12. Klofkac

    [Release] Dune 2000 Random Map Generator

    Great! Nice to see another update so fast. I'll try it out once I get some time for it. But in the meantime, I'd like to mention two other random generation methods I was thinking of, and still I am quite curious how well would they work if I really implemented them. 1. I got inspiration for the first method from an existing project somebody is working on. The project is called "Markeen" and it is random level generator for Commander Keen, a classic and legendary 2D platformer game from early 90s. In short, this is the key idea of the random generation algorithm: You can find more information under this link. Scroll to the bottom, as the oldest posts starts at bottom and newer appear upwards. It's really interesting to read and there are good examples (screenshots) of the levels it produced. As you can see, the levels it generates are quite cluttered mess which are not playable at all and need lot of human modifications to become playable. However, it's actually improving during the time, and I'm really curious how well this method will work for Dune2000 maps, after creating probability profiles from all stock maps. 2. The second method is purely my own idea. It'd be easier to explain with visual examples, but I just try briefly describing it anyway. The map generator first generates all rock-sand and sand-sand cliffs and rock borders. After this, it fills enclosed rock areas with rock, and then generates dues and spice patches and adds some special tiles in similar way as your generator does. It starts up randomly placing several "seeds" in an empty map. A seed is any single rock-sand cliff, sand-sand cliff or rock border block. Imagine it places just one seed, which is a top-down cliff. Then it has two "connection points", one on the right side and one on the left side. The map generator randomly picks any appropriate block which can be connected to the either side of the block, then it places it, and the process repeats until no connection point is available. It is exactly same principle as how Domino game works. It can create really interesting and crazy shapes, but the biggest problem is to secure that it connects two distant connection points together, forming an enclosed area or cycle.
  13. Klofkac

    [Release] Dune 2000 Random Map Generator

    So I tried out your last version (v170317) and it does not work for me, because whenever I start the map generator, it runs forever and never finishes (like it gets stuck in an infinite loop). I tried to enable the exportAll option to see what's going on, and the last phase it exports is 23 addDunes, so it looks it gets stuck on phase 24 addSpice. So I tried to change the spice settings, first lower them, then set all numberOfBlooms, numberOfEmptyBlooms and numberOfSpiceSquares to 0, but without success. Could you please look where it might get stuck? Also I got some idea. You could log the phases into console, so that user can see what the program is actually doing (and possibly also how long each step lasts) and where it gets stuck (if it happens), without need to enable exportAll option.
  14. Klofkac

    [Release] Dune 2000 Random Map Generator

    Thank you for your reply and explanations. I got several more questions to ask: Right now it really often happens that two rock areas merge together into one big area. However, sometimes it may be undesired behavior, so are you thinking about implementing some sort of mechanism which would actively prevent two distinct rock areas from connecting together? For example enforcing minimum distance of rock tiles belonging to different areas. If set to 0, this check would be disabled and areas would be allowed to connect. As I understand, the spice always generates around a spice bloom which is placed first. But in original game there are patches of spice (sometimes really big) which do not have any spice bloom inside them and would not regenerate once exhausted. Are you going to add this as well? Generally, do you have some task list or "backlog" of what all are you going to implement? Would be interesting to share one and then strike through a task when it gets implemented.
  15. Klofkac

    [Release] Dune 2000 Random Map Generator

    Okay, so finally got some time to respond to this thread. First of all: Well Done! Your random map generator really works, and it actually produces pretty reasonable results, which could be considered serious and playable, human-made maps. Pretty outstanding achievement you made. Personally, I'm not going to utilize this program to produce my maps (simply because I do not create my own maps anyway), but I am pretty much interested in the technical solution/algorithm of the random map generation. I was even thinking about making a random generator myself and considering various algorithms to use, but never actually started. I'm lacking some kind of description/explanation of the method/algorithm you used to generate the maps. But on the other hand, I was playing around a bit with the settings, and most importantly, I let export the individual results of all the steps, which gave me some insight to what's going on. Basically it starts up with placing square-shaped areas of rock (which will later become places for building up a player's base) and then it adds more rock tiles around them to form various shapes. Then it will form the access paths and cliff borders around the rock areas, and place proper cliff tiles (which is probably the most difficult part of the map generation at all). After that it will generate spice areas, dunes areas and small rock islands, using very similar methods. So far, I think I don't fully understand what exactly some settings do - for example numberAtATimeDivisor, squareTop/BottomRight/Left. My question is - did you make everything from scratch (I mean the idea of the method of random generation) or you followed or got inspired by some articles about some random generation methods? If so, could you provide some referrences to those? Here is some list of notices and ideas I'd like to say: By default you generate 48 spice blooms. But earlier I discovered that the game supports no more than 30 blooms in a map - if there are more, then those blooms above 30 will never spawn. So it has no sense to generate more than 30. Also the default number of worm spawns seems quite high for me. The program occasionally ended up in an infinite loop and needed to be killed forcefully. That happened mostly when I set very high numbers of numberOfSpawnsToAdd and numberToAdd, it seemed like it was trying to find a new free space to place a next rock tile, but there was no more room. It would be quite nice to break up the ini settings into multiple groups. I see that there are settings releted to rock area generation, and then very similar set of settings for generation of spice and dunes. Dividing these into separate categories would make ini file more readable. You could also match up the order of the settings with order of genreration of respective entities. It would be nice to add some randomization of the settings themselves. Now the final look of the map highly depends on the settings, which is still some sort of user input which needs to be supplied. If the settings were randomized too, the generator could make purely random maps with really great degree of variation and with minimal user input. My idea is that the users would be able to decide which settings they want to specify by themselves and which settings to let be random. The best way would be to specify the settings as ranges (minimum and maximum), the program would pick a random value within this range, and if the user wants a precise value he would set both min and max the same. I looked into the source code and the biggest problem I found is that everything (tile numbers) is just hardcoded into the code. When I was developing the map editor, I externalized almost everything into configuration files and made separate files with presets for each tilesets (ini files in Tilesets folder). You could actually utilize these tileset configuration files in your program - I already defined all tileset-specific blocks (sand specials, rock specials etc.) so it could save your work on defining all of these again. I was thinking about adding a new option to my Map editor, which would fire your random generator and then open up the resulting map just when the map is created. Edit: It would be good to add option to disable appending of the unix timestamp to the output file name. Sometimes I just wish to overwrite the output map instead of keeping history of all my attempts.