Author Topic: CreateMap tool  (Read 29989 times)

0 Members and 3 Guests are viewing this topic.

Offline createmap

  • Newbie
  • *
  • Posts: 3
CreateMap tool
« on: June 19, 2010, 10:43:14 pm »
Hi,

I created a small free software tool that can be helpful for automatically creating maps for some kinds of games, using videos. It's stored here: http://github.com/hmoraldo/createmap

The concept it's based on is not new, it's called image mosaicing. But perhaps this tool can be useful to you when working on game maps, or even for creating maps for other things too: it can be used to extract backgrounds from cartoons too, and also for some kinds of real-life videos too (eg. a film scene of a city as seen from a plane).

I had a lot of fun using this myself, but I think it would be cool if I could see what other people generate using this tool. I don't have too much time to keep coding for it myself but patches are welcome.

If there is interest, I can explain how this can be used and show some examples. The tool is not perfect; it works best for sidescrollers (in whatever axis) but it can also be used for games that move in any direction.

I hope you are interested on this.

Thanks!

Offline createmap

  • Newbie
  • *
  • Posts: 3
Re: CreateMap tool
« Reply #1 on: June 19, 2010, 10:47:15 pm »
To better understand what the tool does and what it doesn't do, this is the typical workflow using the tool:

1) you capture a video yourself or you download a video (eg. a youtube flv, quality doesn't matter much... if you download it the end result won't be yours though, but it's good for testing)

2) you use ffmpeg to convert all the video frames to independent images; after that, perhaps you remove some of those images to ensure only a specific level from the video is processed (eg. you remove the game intro scene)

3) some program configuration (what to process)

4) you process the images with this program

5) when the processing is finished, you get a jpg file with a map that's generated from that specific scene you've chosen

There could be artifacts (depending on how the game works, in the configuration, etc.) and if the images are too big or if the video moves too fast it could take a lot of time, but the results are always interesting to see.

Hope it's useful, let me know if you are interested in any of this.

Thanks!
« Last Edit: June 19, 2010, 10:51:57 pm by createmap »

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
Re: CreateMap tool
« Reply #2 on: June 21, 2010, 02:25:17 am »
Sounds a lot like my Screenshot Autostitcher but with support for lossy video. A few questions:

- How does it handle video at non-native resolution? The image matches might be on non-pixel boundaries.
- How does it decide what to do with artifacted video? Does it average them out?
- What happens to sprites, animated backgrounds, etc?

It's also worth noting that as a rule, screenshot maps should always be produced in a lossless fashion. Having multiple lossy compression stages (video -> JPG -> JPG) must make things somewhat worse.

Offline The Ultimate Koopa

  • Hero Member
  • *****
  • Posts: 509
Re: CreateMap tool
« Reply #3 on: June 21, 2010, 09:03:30 am »
The only way I can think of this working, at least with emulators that support disabling of seperate backgrounds and sprites, is to record the game as an input file (e.g. a VMB file for Game Boy or Game Boy Advance games), and then play them with the desired layers disabled, and output as an AVI.

I have a feeling, and I'm sure Maxim was also referring to this, that if say, you did a map of a 2D level, then wouldn't your character be spread across in a weird constant line?

Like, say, you had a character that was nothing more than a hyphen (-), wouldn't the result turn out like this:
----------------------------------------------?
Also, is this for Mac or something? I have no idea what GIT files are or PY or whatever.
« Last Edit: June 21, 2010, 09:05:16 am by The Ultimate Koopa »

Offline createmap

  • Newbie
  • *
  • Posts: 3
Re: CreateMap tool
« Reply #4 on: June 21, 2010, 10:15:40 am »
I only read about your Autostitcher after making my posts; I couldn't try it yet, but according to the comments I could read it looks like your tool is more useful than mine for this kind of maps. It's faster and it can work with higher quality images for that reason.

Quote
- How does it handle video at non-native resolution? The image matches might be on non-pixel boundaries.
- How does it decide what to do with artifacted video? Does it average them out?

I match the full image, not only the map boundaries... so video quality doesn't matter much, as I don't need pixel perfect matches (I do a image difference of the displaced images; then I compute the total error).

Quote
- What happens to sprites, animated backgrounds, etc?

Animated backgrounds are a problem. Sprites, not so much. It depends on the order I use to compose the final image: if I start from the first frame, you'll only see the player character in the last frame, since the only information that you can see for each frame that is not the last one is just a tiny border. For other characters, it depends. But their images are most of the times lost. It's hard to explain why, the point is that every pixel gets overwritten many times, and the last time it's written is the last time such pixel is seen in the video. Most of the times, an enemy character is not there then, there is at least some extra exposure for that pixel. Only if there is not the enemy character gets recorded in the image. If the order that's used for composing the image was reversed, though, the results would change.

Quote
It's also worth noting that as a rule, screenshot maps should always be produced in a lossless fashion. Having multiple lossy compression stages (video -> JPG -> JPG) must make things somewhat worse.

True. I thought this would be useful as a first draft for some games, maybe.

Quote
Like, say, you had a character that was nothing more than a hyphen (-), wouldn't the result turn out like this:

Not if the character was in the center of the screen, for example. It would be erased when all the frames were put together, as explained above.

Quote
Also, is this for Mac or something? I have no idea what GIT files are or PY or whatever.

Sorry, this is the Python source code only. No .exe provided still (but if you install python it should be easy to run it out of the box). I tested it on Linux but it should work in all platforms: Windows, Mac, Linux.

« Last Edit: June 21, 2010, 10:16:43 am by createmap »

Offline TerraEsperZ

  • Hero Member
  • *****
  • Posts: 2326
Re: CreateMap tool
« Reply #5 on: June 21, 2010, 11:39:04 am »
It's not a bad idea in theory, but it would defeat the purpose of the site to try and create maps that are as accurate and good-looking as possible. I personally wouldn't find it useful except for games where it's impossible to constantly take screenshots and where a rough version of a level could be used to then recreate the map by hand as it should look.
Current project:
Mega Man: Powered Up (PSP)

Offline Revned

  • Hero Member
  • *****
  • Posts: 1094
Re: CreateMap tool
« Reply #6 on: June 21, 2010, 12:07:33 pm »
I saw an interesting application of photo panorama software awhile back that this tool could probably do. Some guy got on a train and pointed his camera directly out the window. He filmed for awhile, then fed the video into a program similar to this one. He ended up with a *very* long panorama of his train ride.

Offline TerraEsperZ

  • Hero Member
  • *****
  • Posts: 2326
Re: CreateMap tool
« Reply #7 on: June 21, 2010, 03:42:50 pm »
Say, that's not a bad idea. I've always had a hard time thinking outside the box so that never even came to mind. Apparently, the more recent digital cameras use a similar principle to capture a very large panorama, but seeing the same thing applied to a train ride must look cool! My dad, who's a train enthusiast, would undoubtedly love to see the result!
Current project:
Mega Man: Powered Up (PSP)

Offline bradhig

  • Newbie
  • *
  • Posts: 6
Re: CreateMap tool
« Reply #8 on: October 05, 2010, 09:12:47 am »
Maxim I tried your autosticher on zaxxon in mame and the score at the bottom of the screen and the height gauge on the left side of the screen streeked across the maps covering much of the playfield.  Any way around this?

Offline Maxim

  • Hero Member
  • *****
  • Posts: 974
Re: CreateMap tool
« Reply #9 on: October 05, 2010, 11:27:02 am »
Yes:

- use the crop settings to cut those bits off, or
- use the mask feature by creating an image which is white for the good pixels and black for the unwanted parts

In this case, I think the mask would be better, although the score probably never overwrites anything important.

Better to post in this thread: https://www.vgmaps.com/forums/index.php?topic=516 since this thread isn't for my stitcher.
« Last Edit: October 05, 2010, 02:34:28 pm by Maxim »