It is currently Tue Dec 12, 2017 2:34 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 279 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19  Next
Author Message
PostPosted: Mon Feb 23, 2015 11:47 pm 
Offline

Joined: Mon May 12, 2014 6:43 pm
Posts: 10
这次的更新很好!
之前的版本在我的笔记本上运行拖慢的现象,现在已经没有了,运行非常流畅。


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 12:23 am 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 179
I'm working on Astyanax and it is annoying that the same tile is reused at different location in the single large image in cut scenes. So I'm thinking about the script feature. The primary use of the script is to allow the emulator to identify a tile and palette being use in different situations and apply a different HD tile to it. So there are several steps to this:

1. Find out if a specific tile and palette is being used by searching the name table, attribute table and OAM.
2. Find out how the tile is used: e.g. location on screen, values in RAM or variables used by the script.
3. Tag a number to that entry in the name table or OAM. A specific HD tile is previously added to the graphics pack for that particular tile, palette and tag combination.
4. When the emulator renders that tile, it will use the specific HD tile instead of the default one.

For example many tiles are repeated in the title screen of Super Mario Bros. For a particular tile on the screen, the script can find the location of the tile to identify it. However the screen will scroll as the demo starts and so we need to subtract the horizontal scroll value of the map to find out the real location of the tile. Then we tag a number to that tile. Better still, if we know we are in the title screen and the horizontal scroll value, we can immediately identify each entry in the name table and tag them in a loop.

Let's use the standing of Mario as another example. If we can find out whether Mario is standing still, we can start a frame counter and tag the OAM according to the counter to show Mario breathing like in some fighting games. We can also find out the direction that Mario is facing to have more detailed rendering as suggested in an earlier post.

So the emulator needs to provide the following functions:
1. Read from name table, attribute table and OAM.
2. Tag a number to name table and OAM.
3. Read from RAM.
4. Some memory for the script to read and write and the values written persist across frames.
5. A search function to find the existence of a tile.
6. The script will run once per frame

Is that enough to make it work?


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 1:11 am 
Offline

Joined: Sun Jan 19, 2014 5:15 pm
Posts: 50
Could be good -- could make it easier to do better art for Super Mario Bros and other games where there are a lot of "cheats." I know that the artist who did (some) 2x art for Super Mario got very frustrated at all the cheats present in the original coding.

I am concerned about how it would affect the speed of the emulator. Alex Douglas who did some tests on SMB2 reports that the new version of HDNES runs faster and smoother, allowing for real gameplay (if not recording) at 4x on his computer.


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 1:28 am 
Offline

Joined: Sat Dec 27, 2014 7:40 am
Posts: 10
mkwong98, maybe you need to enable replacing tiles and sprites with bigger picture?
For example: 8x8 tile replaced by 8x64, which can owerlap the neighboring repeating tiles.

And sprite limit option needed too.


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 3:55 pm 
Offline
User avatar

Joined: Fri Jul 18, 2014 4:52 pm
Posts: 24
An alternate idea is to have it possible to mark tiles that are next to each other as a whole. Mario standing is 8 tiles total (2x4) but instead of replacing each tile by itself it replaces it as a whole 64x128 sprite (@ 4x). And then multiple tiles that are used twice can be replaced as well because it's seen as it's own separate object.

Using HEX values from the pattern table in this example.
----------------
| $00 | $01 |
----------------
| $4C | $4D |
----------------
| $4A | $4A |
----------------
| $4B | $4B |
----------------
That's Mario standing.

Mario's second(?) walk frame is this.
----------------
| $00 | $01 |
----------------
| $02 | $03 |
----------------
| $04 | $05 |
----------------
| $06 | $07 |
----------------

As you can see the top 2 tiles are the same while everything else is different. Now if we made it one whole object that is replaced you could edit the top of Mario's head as well and not worry about the tile being used somewhere else unexpectedly. Selecting the tiles to group together could be as simple as clicking and dragging on the captured frame in the editor and pressing a button saying "mark as object"! :D

I've noticed people prefer/expect to use composite sprite sheets for sprite editing and doing it this way would make those edits usable.

Example with graphics.
Attachment:
combined.png
combined.png [ 1.99 KiB | Viewed 2974 times ]


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 7:32 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10164
Location: Rio de Janeiro - Brazil
Detecting meta-sprites automatically isn't such a trivial task though. But I like the idea of having tiles look different depending on the tiles that surround them.


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 7:59 pm 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 179
Yes, both evgeny's and GGuy's ideas are good ideas that I haven't thought of. But I think there is a limitation that the whole object must be in the name table or OAM in order to get recognized. That means it won't work for objects in scrolling background or sprites that can more out of the screen. And for sprites, all the tiles must be placed in consecutive entries OAM, otherwise it will be hard to tell when there are several instances of the same meta sprite flying all over the screen.


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 9:06 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19335
Location: NE Indiana, USA (NTSC)
You could hook each game's sprite engine and have it write out the display list in some other format.


Top
 Profile  
 
PostPosted: Fri Mar 13, 2015 11:43 pm 
Offline
User avatar

Joined: Fri Jul 18, 2014 4:52 pm
Posts: 24
My idea is similar to a lua script for FCEUX. Hitbox drawing
But instead of hitboxes it would be metasprites. I don't know how it works exactly because I'm not a programmer but it might be possible with your scripting system mkwong.
Good luck with this however you decide to implement your alternate tile replacement script. It's a much needed feature.

edit: typo


Last edited by GGuy on Sat Mar 14, 2015 9:34 pm, edited 1 time in total.

Top
 Profile  
 
PostPosted: Sat Mar 14, 2015 6:03 am 
Offline

Joined: Sat Dec 27, 2014 7:40 am
Posts: 10
Another idea: add custom parameter. (RAM adress and value)
for example: if RAM $0010=1 then draw tile variant 2, else default.
Maybe use optional RAM, ROM, VRAM, CHROM adresses for check, then anybody can select use pallete or NameTable or game level or anything else as indicator for individual tiles. Also selection custom for byte, word, or double word as value for this.


Top
 Profile  
 
PostPosted: Sat Mar 14, 2015 4:36 pm 
Offline

Joined: Sat Mar 14, 2015 4:25 pm
Posts: 2
@mkwong To title screens and fixed images you could do the following:

we have to dump a tile that doesn't repeat.

If the image that we want to replace is a 8 x 8 tile screen we could use the following name patern in the edited tile:

"thenormalnameofthetiledumped-08x08-02-07.bmp"

The 08x08 is the column vs lines the 02 means that the dumped tile was in the second column and the 07 means the dumped tile was in the seventh line.

The file "thenormalnameofthetiledumped-08x08-02-07.bmp" is the whole 08x08 tile image that uses my reference the unic dumped tile in the name file.

Edit: Thinking more this method could be used for everything! It will make the work of dumpers and editors very very easy!

Sorry about my english!


Top
 Profile  
 
PostPosted: Tue Mar 17, 2015 9:14 am 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 179
Now that I think about it, the meta-sprite idea may actually work well enough in most cases if I add a restriction to it. The restriction is that the the meta-sprite must be a strip of tiles, so that a big object will be composed of a few vertical or horizontal strips of tiles. If an object only move into the screen from left or right edge, then we can break the object down into vertical strips. This way, we still have the whole meta-sprite to work with even when only part of the object is on the screen. This will also simplify the detection algorithm as it is much simpler to match a strip of tiles to a known pattern.


Top
 Profile  
 
PostPosted: Tue Mar 17, 2015 3:39 pm 
Offline

Joined: Sat Mar 14, 2015 4:25 pm
Posts: 2
mkwong98 wrote:
Now that I think about it, the meta-sprite idea may actually work well enough in most cases if I add a restriction to it. The restriction is that the the meta-sprite must be a strip of tiles, so that a big object will be composed of a few vertical or horizontal strips of tiles. If an object only move into the screen from left or right edge, then we can break the object down into vertical strips. This way, we still have the whole meta-sprite to work with even when only part of the object is on the screen. This will also simplify the detection algorithm as it is much simpler to match a strip of tiles to a known pattern.


Great news Mkwong! It will expand the possibilities and will be very easy to edit the graphics!


Top
 Profile  
 
PostPosted: Tue Mar 17, 2015 8:33 pm 
Offline

Joined: Sun Mar 08, 2015 12:23 pm
Posts: 251
Location: Croatia
Awesome! So original and new! I've never seen an emulator like this. It's great! Now, when the cartridge bankswitches, how do you manage to keep track of which sprite goes where?
I think you should do the following
Name every HD sprite as the hex sequence of the sprite's data and 3 colors from the palette. For example: 01020408102040800103070F1F3F7FFF2C2E31
That way every sprite, wherever it comes from, will have its HD sprite.


Top
 Profile  
 
PostPosted: Fri Mar 20, 2015 6:38 pm 
Offline

Joined: Mon May 30, 2011 9:01 pm
Posts: 179
8bitMicroGuy wrote:
Awesome! So original and new! I've never seen an emulator like this. It's great! Now, when the cartridge bankswitches, how do you manage to keep track of which sprite goes where?
I think you should do the following
Name every HD sprite as the hex sequence of the sprite's data and 3 colors from the palette. For example: 01020408102040800103070F1F3F7FFF2C2E31
That way every sprite, wherever it comes from, will have its HD sprite.


In HDNes, the mappers return the real address of the read so bankswitching is not a problem.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 279 posts ]  Go to page Previous  1 ... 14, 15, 16, 17, 18, 19  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Yahoo [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group