Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

16x16 tile theory...

Ter13

Member

So, I've been doing quite a bit of thinking about making a 16x16 tile system, and I'm getting closer to a full theory.

Basically, I can do this, I think, within the limits of the default system. The only problem is, I would have to keep a dev-copy, and a running-copy of the default system. The reason for this, is that the dev-copy and the running-copy would have to have 2 seperate tilesets, the 32x32 one for the editor, and the 16x16 one for the game. Fortunately, there is another way around that.

I could do this in one of two ways, one being impossible without the hidden classes, and one being feasible without the hidden classes.

I could totally scrap the default mapping system, and just create images based on the tileset, loading chunks of the tileset by halving their size using the default sprite value of zoom_x/y, and then blasting them up on an already lowered screen size of 320x240, now, this would be very simple to do using an array of custom created Sprite objects, unfortunately, the only problem with this method is 1: I can't stop the map from blitting a normal viewport anyway, and 2: I'd have to marshal dump about half a dozen objects to discover their methods and/or variables, then stumble around in the dark for a bit...

Now, the second method, that is not possible, is by getting the hidden classes, loading the map reader, and changing the default viewport rendering behaviour. Basically, I have sized-up tiles, and then stretch them to 50% size, and render them at half-interval on a 320x240 viewport. Of course, yes, this would create unneccesary size for image files, and yes, will cause rendering speed to decrease only slightly... Still though, RMXP could use this system. 32x32 tiles can sometimes be a bad thing... especially in the case of a fangame. Personally, I'm a bigger fan of mutable tilesize, and with this, we should have it.

Even method #2 has many things I could change to make more sense, but do you guys see what I'm getting at?
 
The Tilemap re-write class I started on has this feature. You can scale any size and customize the width and height (in tiles and pixels) of the tilemap as well.

No idea when I will finish it though. Probably some time within the next month.
 

Ter13

Member

Really... Is there any way I can get a WIP copy of that so I can take a look around what you did?

...Tilemap, isn't that one of the hidden classes? Do you have a copy of the hidden class scripts?
 
I never give out WIP scripts. Only a select few have ever seen WIP stuff from me.

Yes, it is one of the hidden classes, but no I have no copy. You basically just need to understand how it works with the drawing of tiles and such. I will let you know when I finish it.
 

Ter13

Member

See, the reason I ask, is that I understand HOW it should be done...


Note this is written in messy algorithm, not in any kind of actual code...
Code:
var x <- 0, layer <- 0;
for(layer<3)
  for(x<screen_width*screen_height)
    var tile <- tile_map[layer][screen_left+map_width*(screen_top+(int)(x/screen_width))+x%screen_width]
    tile->draw(x%screen_width*tile_width,(int)(x/screen_width)*tile_height);
    x <- x+1;
  end for
  layer <- layer+1;
end for
var event <- null, count <- 0;
for(count<map_events->length)
  event <- map_events[count];
  if((event->x_pos-screen_left)*32+event->getSprite()->width/2>screen_left*32 AND (screen_right-event->x_pos)*32-event->getSprite()->width/2<screen_right*32)
    if((event->y_pos-screen_top)*32>screen_top AND (screen_bottom-event->y_pos)*32+event->getSprite()->height<screen_bottom)
      event->getSprite().draw(event->x_pos-screen_left,event->y_pos-screen_top,event->direction);
    end if
  end if
  count <- count+1;
end for

That is the most efficient way to blit a map, but again, RMXP is not known for being efficient... Thanks for responding, I was expecting the answer, so it's not a let-down. But thanks for letting me know it's possible without the hidden classes...

Anyway, take it easy.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top