Other > Offtopic

Programming Thread!

<< < (3/4) > >>

Ganado:
Working on a simple .fomap viewer, I realize this is basically just reinventing the wheel, but it's just for practice. Gonna look into how to read .frm files or a script for converting it to .png. I'm sure people have already done things like that on NMA, so gonna search there.

JovankaB:
Here you can find articles about all Fallout 2 formats:

http://falloutmods.wikia.com/wiki/Category:Fallout_and_Fallout_2_file_formats

Some of them are difficult like the video or sound, but DAT2, PAL and FRM are
pretty straightforward if you are familiar with reading binary files.

What language do you use?

Ghosthack:
I wrote some C# code for loading and drawing fomaps a few months ago. Originally the idea was to create an interactive map generator with sliders for different kinds of parameters, but I lost interest in it.

It also loads DAT files (via https://github.com/rotators/tools/tree/master/DATLib) for FRM resources and converts them to .NET bitmaps using some code that Wipe ported: https://github.com/rotators/FOCommon/blob/master/Graphic/FalloutFrm.cs

Source is available at https://github.com/rotators/fonline-mapgen however it's very alpha, so you need to setup paths directly in https://github.com/rotators/fonline-mapgen/blob/master/fonline-mapgen/UGLY.cs right now. Also rendering is pretty slow since it uses GDI+. Position logic is in https://github.com/rotators/FOCommon/blob/master/Maps/FOHexMap.cs

Result looks like this:

Ganado:
That looks remarkable, I hadn't checked out rotators github that much, only the 2238 one mostly. Really glad you guys share the source for tools like that.

Interesting to see the similarity in some code

--- Code: ---            float x = ((hex.Y * hexH) - (hex.X * hexW));
            float y = (Math.Abs((hex.Y + (hex.X / 2))) * hexHEdge);
--- End code ---

this is mine:

--- Code: ---        tile_pos.x = -(hex.x/2.f)*xL + (hex.y/2.f)*xR;
        tile_pos.y =  (hex.x/2.f)*yL + (hex.y/2.f)*yR;
--- End code ---
(Only tested mine for even hexes, like [40, 62])


--- Quote from: b__B on July 08, 2014, 11:12:40 am ---What language do you use?

--- End quote ---
The little thing I made was in C++ using SFML library. Even with Ghosthack's post, I might still want to try making my little working program just because it's good practice for me. Maybe I might learn C# stuff later.

Actually reading data from a file for tile data:

Edit (13 July): Okay this is torture, especially working with the FRMs, I'm done reinventing the wheel. I think I'm just gonna read more programming books.

Edit (16 July): I got back into it, ready for more torture. Trying to read the frm data, so far it is going well. Thank devs for those .LST files... very helpful.

JovankaB:
Progress Every Year ™

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version