Author Topic: Need help rendering the FF7 World Map  (Read 12996 times)

Omzy

  • *
  • Posts: 205
    • View Profile
Need help rendering the FF7 World Map
« on: 2010-09-01 04:33:25 »
Hello all, my first post here.

I am working on a total conversion ff7 remake for Fallout 3 with some others at the MDMD Forums:http://z9.invisionfree.com/industrialpolygons/index.php?act=idx. So far I've managed to get a working battle menu UI into the game and I was about to start working on developing the battle system. A friend of mine wants to help by starting work on the environments. However, I realized that I needed a complete world to drop cities and towns into before he can build them (for technical reasons). I made a heightmap using a flat screenshot of the ff7 world map and then hand-drew the mountainous regions and applied some photoshop filters to give them slopes. The problem is, its just not as accurate as I would like it to be.

What I really want is to get the original 3d map from the game and render it into a 4096x4096 heightmap. Then it will be absolutely true to the original. I'm kind of like you guys in my craziness to get things done properly, so that's why I came here to ask for help.

This dead thread: http://forums.qhimm.com/index.php?topic=5825.0;nowap
+
This wiki article: http://wiki.qhimm.com/FF7/WorldMap_Module

are the basis for my interest here.

Tonberry actually rendered the full map and posted this image:


As I said, I need it 4096x4096, so I'll need to render it on my machine. What I'm asking is for help taking the wm0.map and wm2.map files from data/wm, parsing them for their mesh data, and rendering this somehow. I am educated enough to follow instructions and I know a bit of java/c++, but I have never used anything like OpenGL or done any hex editing for that matter.

Basically, I don't want to spend a week doing this when someone else with skills can accomplish it in a few hours. It is the only low-level part of my project (I work with functions like Player.Cast FireBall Enemy  ;D)

Thanks in advance for any replies,

Omzy

Disclaimer: I own multiple copies of ff7. I'm not attempting to rip any game assets for direct use. My profit-less distribution is intended to meet all legal requirements upon eventual release.
« Last Edit: 2010-09-01 05:47:38 by Omzy »

Shankifer

  • *
  • Posts: 203
  • Jack of all trades - Master of none!
    • View Profile
    • Facebook
Re: Need help rendering the FF7 World Map
« Reply #1 on: 2010-09-01 05:36:27 »
Be careful with what you do and what you post here due to copyright infringement stuff.

Just a heads up, best bet is to keep questions vague  ;) ("Can I get a 3D map? 4096x4096 ect)

I really don't have an answer to your question, just trying to catch a possible problem before it hits big and you get disappointed with your experience on qhimm. :)

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #2 on: 2010-09-01 05:40:15 »
Yah, I've been reading other posts where people keep getting shot down.

Added disclaimer to main post.
« Last Edit: 2010-09-01 05:48:21 by Omzy »

Shankifer

  • *
  • Posts: 203
  • Jack of all trades - Master of none!
    • View Profile
    • Facebook
Re: Need help rendering the FF7 World Map
« Reply #3 on: 2010-09-01 05:44:33 »
Believe it or not, sometimes it helps to cover yourself just in case. not trying to be a prick, just speaking from experience.  :)

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #4 on: 2010-09-01 05:45:45 »
Lol, I understand, thanks for lookin out  :P

Micky

  • *
  • Posts: 300
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #5 on: 2010-09-01 06:43:10 »
It may be easiest to write it out as a .obj file and render it with a 3d program. Then you don't need to mess with OpenGL or with writing your own software rasteriser.

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #6 on: 2010-09-01 07:12:52 »
It may be easiest to write it out as a .obj file and render it with a 3d program. Then you don't need to mess with OpenGL or with writing your own software rasteriser.
This is the kind of brilliantly simple advice I'm looking for. That would save me tons of time if I can just copy the info into the right format. So the problem now is that each set of vertices is LZSS compressed, but the rest of the file isn't. Any ideas how to get the uncompressed code out?

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Need help rendering the FF7 World Map
« Reply #7 on: 2010-09-01 13:11:15 »
There are lots of ways to decompress LZS files. If you're looking into writing your own then you could check the wiki's info on the format. Once you understand the format then making a decompressor is simple.

battlemage210

  • *
  • Posts: 19
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #8 on: 2010-09-01 13:40:50 »
as painful as starting from NOTHING on a project like this would be... i think that would be a very good way to go at this. simply having something like a similarly shaped peninsula can really hurt... having the same continents and islands is just begging for trouble.

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #9 on: 2010-09-01 14:29:02 »
There are lots of ways to decompress LZS files. If you're looking into writing your own then you could check the wiki's info on the format. Once you understand the format then making a decompressor is simple.

I think that first link is dead. I think I'll look into the format on it then, thanks!

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: Need help rendering the FF7 World Map
« Reply #10 on: 2010-09-01 16:52:20 »
There are lots of ways to decompress LZS files. If you're looking into writing your own then you could check the wiki's info on the format. Once you understand the format then making a decompressor is simple.

I think that first link is dead. I think I'll look into the format on it then, thanks!

...No it's not. Can you not access Mediafire?

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #11 on: 2010-09-01 19:58:21 »
Oh. Weird, wouldn't let me download it this morning, got it now. Let me see what this thing is...

Ok, its a decompressor for lzs files, but since the .map files only contain segments that are lzs compressed, I think I'll just write my own decompressor and stick it in a loop. If that fails, I'll use a loop to cut out the compressed segments and write them to their own lzs files and then decompress those with the prog.

I'll post what I accomplish. Might be a useful little tool for file previewing .map files if I code it efficiently enough.

Update:
Ok, I'm assuming I should start with this skeleton (copied from a tutorial site)
Quote
// reading a complete binary file
#include <iostream>
#include <fstream>
using namespace std;

ifstream::pos_type size;
char * memblock;

int main () {
  ifstream file ("example.bin", ios::in|ios::binary|ios::ate);
  if (file.is_open())
  {
    size = file.tellg();
    memblock = new char [size];
    file.seekg (0, ios::beg);
    file.read (memblock, size);
    file.close();

    cout << "the complete file content is in memory";

    delete[] memblock;
  }
  else cout << "Unable to open file";
  return 0;
}
Is this a correct assumption?
« Last Edit: 2010-09-01 20:32:58 by Omzy »

pyrozen

  • *
  • Posts: 791
  • Team Avalanche Member
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #12 on: 2010-09-01 21:57:59 »
i know this may be beyond the scope of this project right now, but would if it is possible to generate a 3d mesh from the .map files for export, would it also be possible to alter the mesh and repack it for use in FF7?

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #13 on: 2010-09-01 22:03:25 »
On first glance, I don't see why not. You'd have to also map the textures right, though, in addition to the mesh data. My program will just be exporting mesh data.

pyrozen

  • *
  • Posts: 791
  • Team Avalanche Member
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #14 on: 2010-09-01 22:15:25 »
true, i realize your not trying to tinker with FF7 itself. As far as viewing the mesh, the viewer Reeve does an admirable job considering its the ONLY tool every developed to do so.
http://ncs.millenia3d.net/etc/Reeve.zip
it may or may not help you out, its also kinda a bear to get working.

lee

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #15 on: 2010-09-01 22:28:36 »
Arg! Its so close! It actually displays the wireframe from a 1st person point of view. Unfortunately, I need an overhead view with height coloring. For a minute there, I thought I was home free, lol.

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #16 on: 2010-09-01 22:49:01 »
Ok, for the sake of laziness, I think I can get away with writing each compressed section to its own file and then using the ficelzs command:

lzs.exe -d *
Decompresses all files in current folder (uses filename.dec as the output for each one)

Then another program can recombine the data into the obj format.

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #17 on: 2010-09-01 23:52:00 »
I need help with this (C++):
I need to run an exe from my code, so I am using
Quote
system ("lzs.exe -d -q mesh.lzs")
Thats fine and dandy, but now I need to wait until lzs.exe is finished making the decompressed file. So what command would I use to check when it is finished? I been googling but its not the easiest thing to search for.

EDIT: Apparently the system call is 'blocking', so my program halts execution until lze.exe is finished. Quite a fortunate limitation  :D
« Last Edit: 2010-09-02 00:05:41 by Omzy »

obesebear

  • *
  • Posts: 1389
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #18 on: 2010-09-02 00:57:45 »
Triple post!! Winnar!

Omzy

  • *
  • Posts: 205
    • View Profile
Re: Need help rendering the FF7 World Map
« Reply #19 on: 2010-09-02 01:02:27 »
Oh, sorry. Will use 'modify' from now on.

FINISHED: See http://forums.qhimm.com/index.php?topic=10717.0 for .exe and source.

« Last Edit: 2010-09-03 22:37:20 by Omzy »