Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879943 Posts in 33014 Topics- by 24384 Members - Latest Member: sassah

May 25, 2013, 09:53:04 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Game maker Knytt style world movement?
Pages: 1 [2]
Print
Author Topic: Game maker Knytt style world movement?  (Read 2442 times)
GregWS
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« Reply #15 on: February 11, 2009, 06:41:07 PM »

I'm sure it's there, but I found it totally unnoticeable while playing An Untitled Story.  So yeah, minimal.
Logged
Matt Thorson
Level 7
**


c'est la vie


View Profile WWW Email
« Reply #16 on: February 11, 2009, 06:53:50 PM »

And a lot was happening on room switch in An Untitled Story.

The most expensive things off the top of my head:
  • Removing from video memory the background/foreground images for the previous room.
  • Loading into video memory the background/foreground images for the new room (two 630x480 PNG files).
  • Updating the map (accessing and writing to a ds_grid structure).
  • Clearing particle systems.
  • Miscellaneous room-specific code (initializing weather effects and what-have-you).

So yeah.  In general don't worry about it.

(Ugh, thinking about An Untitled Story makes me feel guilty for all the tiny memory leaks.  Should go back and fix those some day)
Logged

Graham Lexie
Level 0
**



View Profile Email
« Reply #17 on: February 13, 2009, 11:30:28 AM »

For large rooms you could check the player's position in the room when transitioning, to see by how much you need to offset the room's coordinates.
Say, if a standard room were 2000x1500 pixels, something like:
room_x += floor(player.x/2000)
room_y += floor(player.y/1500)
(I've no idea if this code is quite right since I don't know Game Maker)
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic