Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411275 Posts in 69323 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 05:04:48 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Tuning GameMaker for Platformers
Pages: 1 [2]
Print
Author Topic: Tuning GameMaker for Platformers  (Read 9076 times)
Xion
Pixelhead
Level 10
******



View Profile WWW
« Reply #20 on: January 15, 2009, 06:29:05 PM »

stuff
I was messing around with having objects affected by tiles and found that you can, for an object, check the tile on which it rests, and if it has a certain x/y origin change the sprite and mask of the object accordingly, so you only really need one object for stuff and stuff. You can also use only one image and change image_index rather than the entire sprite. I don't know how efficient this would be speed/precision wise and stuff, but hey, it works, right? And it's not like it's being done in the step event. Just on creation, so it shouldn't be slow or anything.
Logged

Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« Reply #21 on: January 15, 2009, 06:39:37 PM »

Yeah, I haven't used GM's movement functions in a very long time, but I had been using some of the collision checking functions like collision_rectangle() etc.

So just out of curiosity, what is the big disadvantage to using them?  (I'm not doubting that there is one, I just don't know what it is...processing power maybe?  Degree of precision?)

Actually you lose a lot of processing time by using a custom movement system.  The default system is powered by compiled code, whereas one in GM must be interpreted then executed every step.

The gain is control.  You have complete control over when/how/why things move.  When you get into more complex things like vertically/horizontally moving platforms, jump-thru platforms, etc it becomes much easier to deal with.

Plus with GM's system I always get a weird bug where if you collide with a convex corner at a perfect 45 angle, you get stuck (this bug is present in An Untitled Story).
Logged

Noel Berry
Level 4
****


Yarr!


View Profile WWW
« Reply #22 on: January 15, 2009, 08:29:44 PM »

I usually do something similar to YMM

Code:
if keyboard_check(vk_right) and cspeed < mspeed { cspeed += 0.5; }
if keyboard_check(vk_left) and cspeed > -mspeed { cspeed -= 0.5; }

repeat(abs(cspeed)) {
    if place_free(x + sign( cspeed ),y) { x += sign( cspeed ); } else { cspeed = 0; }
}
cspeed is the current speed, mspeed is the maximum speed.
I then do something very similar to the code above for the vertical movement.

I find using your own variables and engine, rather then using v/hspeed works much more smoothly.

@ Xion:
I have experimented without using object either, and just having 'collisions' with tiles. It's possible, but requires a bit more work and almost never works as well without a lot of fine tuning.

In my opinion, it is overall a bit easier just to use objects.

Quote
is the best way to handle world building to use invisible bounding objects and just tile over them with pretty graphics?
Yeah, that is pretty much what I usually do. Even though it takes time to place the tiles AND the objects, it usually ends up being a bit smoother then just using tiles and having special 'collision' checking with them.
« Last Edit: January 15, 2009, 08:36:00 PM by Drazzke » Logged

GregWS
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« Reply #23 on: January 15, 2009, 08:38:53 PM »

Plus with GM's system I always get a weird bug where if you collide with a convex corner at a perfect 45 angle, you get stuck (this bug is present in An Untitled Story).
:D  Now that sounds familiar!  I haven't had that happen in ages, but it's probably still there in some of my newer engines and I just haven't experienced it.  That in itself is worth an entirely custom engine; I really hate the thought of having bugs sitting dormant somewhere in my games.

I made it through An Untitled Story without ever experiencing it though, so that's good.  Smiley
Logged
salade
Level 4
****



View Profile
« Reply #24 on: January 17, 2009, 09:00:34 AM »

guy's, check the source of that drum game prottotype in art and design. there are some pretty cool things in it, methinks.
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic