It is currently Mon Oct 16, 2017 11:09 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: HDNes with 3D graphics?
PostPosted: Fri Jan 08, 2016 3:30 pm 
Offline
User avatar

Joined: Fri Mar 08, 2013 9:55 pm
Posts: 349
Location: Linköping, Sweden
Hello,

Has anyone considered something like HDNes but with the added capability to replace (groups of) tiles with 3D models? That's what I had originally planned for Nesalizer, but since I seem to have a hard time getting around to it, I thought I'd just throw the idea out there.

The implementation I imagine is having a bunch of contexts, where a context consists of at least a context identifier and an (x,y) position on the screen. A context could be defined by a particular tile, by a tile but only if surrounded by particular other tiles, or by something more complex. With that general framework, the original graphics, replacement graphics, a 3D model, etc., could later be drawn for each context. The context identification/generation code would be decoupled from the drawing code (except perhaps for passing stuff like tile data if available), so that most of the work would turn into just identifying different types of contexts after a while. It would probably be possible to do fancy stuff like detect how far into a level a game has scrolled and generate different context identifiers depending on that.

Having an editor would be nice too, where you could e.g. select a few tiles and drag-and-drop them to have the editor generate a .png with a filename that uniquely identifies those tiles and allows them to be edited.

It might seem silly, but I've felt pretty bad over the last few years about not getting around to this, and in a way it would give me some closure if someone else implemented it. :roll:


Top
 Profile  
 
PostPosted: Fri Jan 08, 2016 5:37 pm 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5707
Location: Canada
There's one attempt in this recent thread: viewtopic.php?f=3&t=13552


Top
 Profile  
 
PostPosted: Sat Jan 09, 2016 11:18 am 
Offline
User avatar

Joined: Fri Mar 08, 2013 9:55 pm
Posts: 349
Location: Linköping, Sweden
rainwarrior wrote:
There's one attempt in this recent thread: viewtopic.php?f=3&t=13552


That's a cool approach, but I'm thinking of something more manual. Having as an option to assign a shape instead of importing a 3D model would probably be nice though.


Top
 Profile  
 
PostPosted: Wed Jan 27, 2016 4:58 am 
Offline

Joined: Wed Apr 22, 2015 4:02 am
Posts: 6
ulfalizer wrote:
Hello,

Has anyone considered something like HDNes but with the added capability to replace (groups of) tiles with 3D models? That's what I had originally planned for Nesalizer, but since I seem to have a hard time getting around to it, I thought I'd just throw the idea out there.

The implementation I imagine is having a bunch of contexts, where a context consists of at least a context identifier and an (x,y) position on the screen. A context could be defined by a particular tile, by a tile but only if surrounded by particular other tiles, or by something more complex. With that general framework, the original graphics, replacement graphics, a 3D model, etc., could later be drawn for each context. The context identification/generation code would be decoupled from the drawing code (except perhaps for passing stuff like tile data if available), so that most of the work would turn into just identifying different types of contexts after a while. It would probably be possible to do fancy stuff like detect how far into a level a game has scrolled and generate different context identifiers depending on that.

Having an editor would be nice too, where you could e.g. select a few tiles and drag-and-drop them to have the editor generate a .png with a filename that uniquely identifies those tiles and allows them to be edited.

It might seem silly, but I've felt pretty bad over the last few years about not getting around to this, and in a way it would give me some closure if someone else implemented it. :roll:


Do you have any code or anything that showcase how to do it?


Top
 Profile  
 
PostPosted: Mon Mar 07, 2016 7:50 pm 
Offline

Joined: Wed Mar 31, 2010 12:40 pm
Posts: 207
ulfalizer wrote:
The implementation I imagine is having a bunch of contexts, where a context consists of at least a context identifier and an (x,y) position on the screen. A context could be defined by a particular tile, by a tile but only if surrounded by particular other tiles, or by something more complex.


How about absolute address of the tile in CHR memory (after banking bits, etc are applied)? That is a very unique identifier and you could group them together in a json file, something like so:

Code:
{
  "models": [
    { "name": "model-2.fbx", "replaces": [ "$1f000", "$1f008", "$1f010", "$1f018" ] }
    { "name": "model-3.fbx", "replaces": [ "$1f020", "$1f028", "$1f030", "$1f038" ] }
  ]
}


The emulator would then provide the X/Y position of the tiles, possibly an average of all the positions for use as an origin, and render the 3D model at that screen position (possibly subject to matrix transformations to implement a free-floating camera).

Since it's all just based on CHR address, you could replace sprites and backgrounds with the same functionality. The only problems arise with games using CHR-RAM, but that's another story.

EDIT: Replacing sprites in this fashion could be more difficult, perhaps provide a way of mapping groups of sprites to certain key frames to provide for rudimentary animation?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Google Adsense [Bot] and 10 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