Each palette inside PALETTES.DAT is essentially 0-255 as well(Sets of 3 bytes= 768)
There are 5 palettes inside the DAT file so 0-1279 locations.
Okay I am making the assumption that each pixel is it's own reference to a colour in the palette, is this correct? If so...
Is there a byte somewhere telling me an offset(since a byte can't reference inside all 5 palettes), or is it just hard coded that if I am opening BARNS.PCK it will be using palette 5. Tactical Palette.
Actually... I guess since this is a map editor I can ignore all other palettes right? All I need is the tactical palette. Could I still get question one answered, also if someone sees a reason for me not ignoring the other palettes let me know.
I seem to have my PCK file decompression algo working correctly. Where can in find the details on how to colour the pixels? I seen the palettes info page that and using 3 bytes to make a colour but I don't see where the reference is for what each byte in my PCK file means.
Here is a pic of the decompress(in hex) of the blanks.pck. You can make out the diamond(isometric?) shape in the first sprite(in hex) (floor portion of tile?)
I've noted that none of the sprites in the pck files ive look at so far are 1,280 pixels(32x40). In this included pic you can see the first sprite in the blanks.pck is 32x15. So are these all just parts of potential 32x40 tiles? I guess once i start drawing them it may make more sense.
Thanks, I did have a look but I do not read py. From what I could pick up it seemed that the code I needed to see was in some other files/structs which I could not locate.
Well WinForms is as old as Windows itself. As a shameless WPF fanboy I will say it is much easier for making custom UIs and controls like you would find in editors, rather than trying to hack around boilerplate Windows UI with Forms. It's true that the Visual Studio designer is better at WinForms than WPF, but it feels better to write WPF by hand anyways.
Sure, technology is not that important to the end-user, but it is important to the developer so these projects will actually end up somewhere besides the cutting room floor... One thing I would suggest is looking into being more cross-platform. MapEdit's biggest gripe has always been its Windows-ness, so even if you're using .NET I would suggest checking what technologies are/will be easier to port in the future as Microsoft develops .NET Core / Xamarin. Being able to make maps on the go on a tablet would be amazing.
I have to say I am really starting to enjoy the WPF, this is my first time using it and I like how flexible it is while coding up the interface. Cross-platform is on the burner, I noted here on the forum people trying to get things working on their various systems. I'd have to do some research like you say, while I know .NET is cross-platform I am not up on the details.
PCK files are super straightforward: - TAB files (if available) are just a list of offsets for each sprite. They index directly into the PCK bytes, so to load sprite 3 you just start reading from PCK[offset3] until you reach PCK[offset4] (or the end of file). The only catch is that while UFO only uses 2-byte offsets, TFTD sometimes uses 4-byte offsets, but you can just hardcode or guess it. - PCK files are just a list of pixels (compressed or otherwise). They always have the same dimensions, so you can assume they're always 32px in width. In fact if you're loading the whole file at once you don't even need the offsets, as every sprite has an explicit "end of sprite" delimiter byte.
Thanks for this, I was able to see that the pck files were one image right after the other with the FF ending each of them. I also figured out the tab file offset thing by looking at mapedits code. I probably would have been lost for a long time, sure I knew it was all in 2 or 4 byte sets but I didn't realize I had to toss these into a 16bit or 32 bit integer to see the proper numbers. This is probably from my lack of formal education on the matter. I did have a comp sci class in HS and had 1 course in UNI but this was years(many) ago lol.
For the moment I think I will continue on with just reading/decompressing the pck file and getting the sprites rendered to an on screen tile map with some tool functionality. When it comes time for the save files i'll get back to the proper formatting of files.
I was probably just inferring hostility, I don't believe anyone meant me to feel that way.
Warboy, I was going over the data files today and reading on ufopedia. I am using a hex editor to get a rough idea of things which worked great for the MCD files, they are very straight forward in each set of 62 bytes. The BAT and PCK files on the other hand I am having difficulty locking them down.
As I understand the BAT info about UFO from ufopedia, BAT files detail the start of sprite files inside the PCK files using 2 bytes of info(converted to dec/pixels?). It's not explained if the 2 byte data sets begins at the start of the file or later; I think they start right at the beginning because they each have 00 00. More importantly if the file references an uncompressed PCK file or the compressed PCK file.
The PCK file info explains decompressing by reading the first byte and skipping down the following rows, do I assume the rows are 32 bytes in length to match the sprite dimensions? Not sure how to know how large I should organize my rows so I can count downwards.
Thanks for the replies guys. I'm just a guy wanting to write a tool. You all seem kind of hostile.
Meridian. I just quickly googled WPF vs WinForms, and threw in the info here. The article had no date, though checking google the date appears as 2015. I'm aware WPF was introduced in 2010. Here is another article from 5 days ago giving good reasons for WPF over WinForms; I'm mostly interested in the databinding and enhanced visual abilities. Obviously anyone should go do their own research if they are worried about it. As to the GUI, that was a screen shot from inside the msvc2015 project. It is a rough idea I had on how the layout might go. So possibly elaborate on a realistic screenshot.
Hobbes. I am not saying anything bad about MapEdit or it's developer. I understand it has been around for a very long time. I'm just looking for feedback on what everyone thinks would be a good user interface. Which requires no functionality. Just ideas.
Like none of you have ever said oh I wish this was here or that control was over there or I wish I could do. Like or maybe I wish the whole screen was the map editor and i had 10 squares along the bottom with my most used tiles and i just have to click a tab somewhere to open the tileset view and switch them out or grab a new tile.
Hey Solarius, thanks for responding. We're a bit far from me worrying about how many people will use this software. This project will be a good learning adventure for me, especially since I have always be interested in tile maps and more importantly have loved X-Com from the day my buddy let me get a copy of his back in 94.
I was dismayed ever so slightly that all the content creators here are having to use a partially broken tool.
The one big difference, would be that the entire program will be in one window, with all the extra maps(tileset, routes) available in the smaller viewport on the left with a click of a button or hotkey. Mapedit uses WinForm, this project will use WindowsPresentationFoundation which as it sounds is better at dealing with graphics. There are pros and cons.
So as I said I am looking for feedback on the entirety of the GUI.
Spoiler Windows Presentation Foundation:
WPF is a next-generation presentation system for building Windows client applications with visually stunning user experiences. With WPF, you can create a wide range of standalone and browser-hosted applications. Although releases for WPF were stagnant for a while, Microsoft recently announced the future roadmap for WPF.
PROS
Powerful styling and skinning structure Easy to create an own look and feel It’s very flexible so you can re design your own controls without buying new controls It's newer and thereby more in tune with current standards of technology Does support Windows Forms XAML makes it easy to create and edit your GUI, and allows the work to be split between a designer (XAML) and a programmer Highly advanced data binding possible. Uses hardware acceleration for drawing the GUI, for better performance The ability to reuse existing code Declarative vs. procedural code
CONS
Requires .NET Framework 3.0 Compared to Windows Forms, still in evolving phases. Requires Dx9 compatible video card for advanced graphics
Spoiler Winforms:
WinForms applications have always been used to develop desktop applications where you want the entire processing burden to be rested on the client machine. This includes everything from drawing of graphics applications to data-entry systems to point-of-sale systems and games.
PROS
Extensive documentation can be found on the Internet Plenty of examples and tested thoroughly for years Supports WPF There are lot of 3rd party controls in the market to make the job easier The designer in Visual Studio is still, as of writing, better for WinForms than for WPF, where you will have to do more of the work yourself with WPF
CONS
Designing your own look and feel in an application is a lot of work Extra cost incurred to buy third party controls
Here is the prototype I have for the user interface. I am looking for feedback for what people think should go where and what shall be added or removed.
The area between the left upper, left lower and the right canvas I was thinking of using for the buttons, like copy, paste, delete. The rest is mostly self explanatory.
I'm not sure how it all works but I figured you would need some custom graphics tiles and load specific map types for the shot holes and dents, but instead for smaller dmg weapons could it be possible to have the ship shot down missing nav panels and shit like that, cause why would the ship crash with some holes in the hull, unless the pilot died. Though I imagine any of them could just grab the controls and fly.
Okay cool, it seems KevL has been pretty active on his fork which is nice to see. I made my own fork (https://github.com/madhatr/OpenXCOM.Tools) to get more acquainted with the code. Not going to give any illusions, this shit is above my paygrade. Especially whatever is doing all the rendering and array setup for the pictures/tiles and what not. What I am ok with is the forms part. Currently my goal is to add hotkey functionality, if you check the fork so far I've just been fixing cosmetic stuff, and some old code that doesn't seem to be needed anymore.
I do need some help here though, I got stuck. The(cut, copy, fill) buttons (toolstripbuttons) were all made manually in a separate .cs file.
/// <summary> /// Enables the paste button in each viewer after cut or copy is clicked. /// </summary> private void EnablePasteButton() { foreach (var tsb in _pasteButtons) tsb.Enabled = true; }
I am used to the designer creating the buttons and having them inside the main form class which I think of as the main program loop. In this case it would be XCMainWindow() inside this .cs file
My problem is I have/had a couple lines of code to detect keypresses in the main form file, and if a key is pressed it would trigger the .click functionality of the button. Problem is since they are in different files they are in different scopes? so when I try to trigger the buttons .click from inside the main loop (XCMainWindow()) it had no idea what I am talking about cause in its eye it does not exist.
Usually I think anyway, you could just make these functions/variables public and they would be available to the other files(classes? methods?) Though the EditButtonsFactory.cs class is declared in a way I do no understand I guess. I've not very good with classes and it gets worse when they are across different files.
I can just redo all the buttons in main cs file but I don't want to get to far away from KevL's code if he wants to merge my other smaller cosmetic fixes in. Also new to GitHub so not really sure how its controlled.
So anyway, anyone who thinks they can offer solution, feel free to do so. I spent all day yesterday messing around with this stuff. It can be fun.
Edit - Am now working on the code and asking for help on a few things, see below.
Hello,
I am attempting to figure out how to use the program mapview. I seem to have it somewhat figured out. I am curious about a few things which I consider to be bugs or just odd features. I have compiled from the latest (as of 11:00 Atlantic Time April 21) KevL git (https://github.com/kevL/OpenXCOM.Tools).
When I open the first 3 UFO's in the vanilla OXC they seem to be corrupted. (attached files)
When I have any other window open (Tile view) the selction behaviour on the main window changes to selecting of rectangular areas (think drag selection of area) while only click different tiles, thus making it impossible for me to edit maps with the tile view window open. Also I lose all control of the window, I can no longer select any buttons. (attached files)
Are there no hotkeys for the editing functions (fill, copy and cut) took me forever to realise I needed to be hitting these windows buttons up top to edit, I figured a good double click or a ctrl-v would be the way to do it. (maybe this is a bug, related to previous said behaviour)
Bug: I had a sharp guy in the workshop ready to be robbed, the project had no been started and no assigned runts. I forgot what Item sharp guy gives me so I thought I would remove it and add it back. The bug , the sharp guy was deleted.
Autosave is before, x1 save is after. The ship is returning from a mission with the sharp guy in the autosave. Once it returns you may reproduce the bug by simply adding a sharp guy robbery with no runts and then removing it and trying to add it again. The sharp guy is gone.
You followed the instructions in the xcode folder that came with the source code?
Spoiler:
To successfully build an OpenXcom OSX bundle you will need the relevant Xcode project files provided herewith as well as all the relevant dependencies installed in /usr/local/.
The dependencies you require are following: - SDL (libsdl1.2) - SDL_mixer (libsdl-mixer1.2) - SDL_gfx (libsdl-gfx1.2), version 2.0.22 or later - SDL_image (libsdl-image1.2) - yaml-cpp, version 0.5 or later
This guide assumes you listened to the previous recommendation and had your dependencies installed with brew terminal command (for Homebrew), like this: ``` $ brew install cmake yaml-cpp --with-static-lib sdl sdl_gfx sdl_image sdl_mixer --with-flac --with-libmikmod --with-libvorbis --with-static-lib ``` or port terminal command (for MacPorts), like this: ``` $ sudo port install yaml-cpp+universal libsdl+universal libsdl_gfx+universal libsdl_image+universal libsdl_mixer+universal ```
1. Open the `OpenxXcom.xcodeproj` with Xcode. Right click on the project (on the left pane) and click 'Add files to "OpenxXcom"'. Select the 'src' directory from the root of the project. Don't copy the files and do create folder groups.
1. Push the ‘Build’ button and cross your fingers. Congratulations, you have a working build! But it is still unplayable though.
1. Find your newly created bundle in ‘./Build/Products/Release’ folder or otherwise 'DerivedData' (find it within your Xcode preferences), and copy it to some place you feel comfortable keeping your games in.
If you want to use the portable bundle, then:
1. Copy the relevant original game data files you possess into the ‘UFO’ (for UFO: Enemy Unknown) and/or ‘TFTD’ (for XCOM: Terror from the Deep) folder within the bundle respectively. If asked by the system what to do with the files and folders already present there, select ‘Merge’.
Or, if you prefer to keep your build always separate from the game data files for various reasons:
1. Create the directory `/Users/Shared/OpenXcom/` and move your original xcom data files (UFO and TFTD directories) there.
Most of the errors I have seen are improper use of dependencies. Though I know nothing of xcode or osx. I know a few people have had to add YAML_CPP_DLL to the preprocessor definitions. Is there something like this in xcode? Though honestly, not sure but I don't think your error looks like a YAML error.
I literally just finished getting it working on Win10, in Visual Studio Community 2017(VS15)
Is it normal or a bug when I stun, in this example 2 reticulans, 1 a peon the other a reticulan hybrid. Both had the Sleepy time and not the blood while on the ground. Yet when I end mission, 1 is dead. I notice this happening all the time.
Also a bug report. Sorry happened a while ago in game. Was on a harvester type ship(this is my first place so I am not to up on shit) on the bridge I was shooting a beastmaster out of armor, by the control consoles. She goes down console blows up but I notice my view enemys went from 1 to 7 or more.(not sure why it showed them while the one was unconscience, maybe they were invisible at first until they moved) I looked(from afar) and the breast master was on the ground sleeping so I moved out to look for other hostiles. Well the beastmaster I guess woke up but it was really 7 of them, I had 7 or more armorless beast masters coming down from the bridge and causing all hell.
So there is a some kind of beastmaster DUPE bug.
I'm sorry I never grabbed the save, never thought of it at the time. Felt I should report it anyway.