øAslickproductions.org/forum/index.php?PHPSESSID=el595hnjnm7ckk8pg17pdbsl55&topic=2260.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe263-2.htmlslickproductions.org/forum/index.php?topic=2260.45e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexe263-2.html.zxò»h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ0P.XOKtext/htmlISO-8859-1gzip8:ÖXÿÿÿÿÿÿÿÿWed, 11 Mar 2020 10:39:07 GMT0ó°° ®0®P®€§²ð®ñ»h^ÿÿÿÿÿÿÿÿè$X Alright, REALLY preliminary, something I've been working on for a couple days.

Author Topic: Alright, REALLY preliminary, something I've been working on for a couple days.  (Read 5053 times)

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
https://github.com/Entroper/FF4MapEdit/releases/download/0.1/FF4MapEdit.zip

Open a 1.1 US ROM.  1.0 works too, it will just complain.  Headered or not, doesn't matter.

You can't do anything yet except scroll around.

It's pretty slow, takes about 30s to load and scrolls slowly.  I'll work on that tomorrow.  :)

Source code is available.

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Oh, cool, Entroper.
I'm not in a position to actually check it out today, but will tomorrow.
I presume this is, to some extent, based in the code from FF4ed?
Any ideas about the functionality it will eventually include? If you're interested in requests on that front:
- some sort of confirmation before automatic ROM expansion (this would be useful for anyone who also uses FF4kster)

... I thought this might be a list, but that's the only thing I can think of now.

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
It's all-new code, but obviously the FF4Ed code was a very useful reference to see how things worked.

My goal was to have something I could be comfortable working on as far as the UI goes... WPF is way easier than MFC.  :)  Honestly, the code that edits the ROM is the easy part.

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
Alright, I fixed the performance: https://github.com/Entroper/FF4MapEdit/releases/download/0.1.1/FF4MapEdit.zip

Now to see if I can make it edit the map.  :)

Bahamut ZERO

  • Cagnazzo
  • *
  • Posts: 347
  • Gender: Male
  • If ye're takin a beatin, hop in de back row!
    • View Profile
.... I fucking love you.  :omg:


Alright, I fixed the performance: https://github.com/Entroper/FF4MapEdit/releases/download/0.1.1/FF4MapEdit.zip

Now to see if I can make it edit the map.  :)

YOO CAIN DOO EET!!


Quote
- some sort of confirmation before automatic ROM expansion (this would be useful for anyone who also uses FF4kster)

That would be GREAT to have at some point down the line.   :happy:
I update my graphics thread on almost a daily basis, so keep an eye out for new stuff!

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
Order of priorities is as follows:

  • Edit the map.
  • Save the map to the ROM file.
  • Edit the tile properties (walkable, etc.)
  • Edit the other world maps (Underworld, Moon)
After those are done, we can start getting fancy.

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
« Last Edit: August 14, 2016, 08:43:23 PM by Entroper »

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Order of priorities is as follows:

  • Edit the map.
  • Save the map to the ROM file.
  • Edit the tile properties (walkable, etc.)
  • Edit the other world maps (Underworld, Moon)
After those are done, we can start getting fancy.
Aaaaaaaaaaand holycrapitworks.  :omg:

https://github.com/Entroper/FF4MapEdit/releases/tag/0.3
All of that works now? Or 1 and 2?
Either way, good stuff. I'm off tomorrow, so I definitely will be messing around with this a bit.
 :cookie:

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile

All of that works now? Or 1 and 2?

Just 1 and 2.  Getting to #4 should be reasonably easy, after that it gets trickier.
It was pretty amusing when I got save working.  I edited a little piece of the map near Baron, expecting to see it after leaving the castle.  But then it showed up in the opening cutscene when the airships landed.  "Oh there it is!  It worked!"   :laugh:

I didn't realize how little space there is for the overworld, it's almost right up against the 16k space that it sits in.  You're pretty likely to overflow that if you add much detail.
 

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Because of the way map data is stored, I've found that the trick to adding detail in one place is to remove detail in another. There are some little peninsulas that the player would never walk on that can be oceaned over, which could free up a fair amount of space if done right. Likewise with snow-capped mountains, etc. An entire row of ocean can be written with only two bytes; but a row of ocean, then west bank, then piece of land, then east bank, then more ocean takes seven bytes. That kind of thing adds up.
But also, that's why yousei's editor would just automatically expand the ROM. If you're not constantly paying attention to space, you can go over pretty easily.
Pinkpuff put a pretty ingenious device into the location map editor: a "space remaining" window. In my project I've never even come close to filling location map space up (I think I have around 5700 free bytes, it says), but I know others have had problems getting enough map space for their projects. That would certainly be helpful in a world map editor, though, if it were possible.

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
The "space remaining" thing is something I wanted to add, but it's harder to calculate that on the fly for world maps that are compressed.  Not impossible, though.  It just now occurs to be that since it's row-based, I could just re-compress a single row when it's modified, that should be about as fast as copying the pixels.

I'll look into things like ROM expansion post-1.0, after the editor is basically complete.  I'm still trying to decide how to model the changeover between maps, and a few other things like the snow-capped mountains.  Right now you can draw those incorrectly, and it will just pretend you drew them correctly.  Or crash if you put them too near the right border.   :eek:

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,285
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Location maps are compressed the same way as the world maps, actually, the only difference between the way the data is arranged between the two is the termination of rows with an FF (I think the world map does it but location maps don't?).
 :edit:
Quote
the snow-capped mountains.
Oh, right, and that. That's another difference.
There's definitely a bit of a lag on my relatively weak computer when I use the location map editor in FF4kster, which might be at least in part due to the on-the-fly recompression, but it's not intrusive enough to complain about.

I just tried it out, by the way. Replaced the desert next to baron castle with a lake. Worked like a charm. This is already more useful than yousei's editor (no offense to The Father of FF4 Hacking).
Nice work!
 :cookie:

 :edit: 2
By the way, how does your editor handle overflow currently? Does it just move into the Underworld's territory? Or does it do something crash-y?
« Last Edit: August 15, 2016, 11:21:21 AM by chillyfeez »

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
If you overflow, you just can't save.  It tells you how big your data is so you know about how much you need to cut.

Interesting that the location maps are also compressed, I think I must have been remembering the FF1 maps not being compressed.

The snow-capped mountains are only an overworld thing, not even applicable to the underworld or moon maps, since they don't have oft-repeated 4x4 regions, I guess.  So many special cases to handle with these old games.   :finger:

Entroper

  • FF4 Hacker
  • *
  • Posts: 235
  • Gender: Male
    • View Profile
I fixed the map area not resizing with the window.

I think we'll do #3, and then the row-compression thing, since that will simplify my save routine anyway.  And I think I'll add an encounter-area grid, and maybe try and make a "snowcaps brush" before starting on #4.  #4 requires some refactoring if I want to avoid turning the code into an awful mess.  #5 will probably be town/dungeon maps.