Pages: 1
  Print  
Author Topic: Urgent! A way to scale collision masks.  (Read 5777 times)
Offline (Male) time-killer-games
Posted on: August 12, 2013, 01:17:01 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1170

View Profile Email
Alright, my game doesn't open in enigma/lgm I assume its because of my HD sprites. I'm considering to optimize my game for enigma via scaling all my sprites and backgrounds down by 50%. This should hopefully fix my issues, but with everything scaled in half (paired with being scaled to the original sizes at runtime via draw_sprite_stretched) the collision masks will still be cut in half, with no easy means to resize them.

Even if I didn't need this for my project, I'd say that scaling collision masks would be a great feature...
Logged
Offline (Unknown gender) TheExDeus
Reply #1 Posted on: August 12, 2013, 01:56:35 PM

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Don't collision masks take image_xscale and image_yscale into account? At least they should as they do in GM. I committed a fix that returned image_width and image_height correctly, by taking into account scaling. The same should be done for masks.

And are you sure that it doesn't load because of sprites? I am not sure if there is a that kind of limitation in LGM (or Java), but it does seem very weird. Robert should look into that. ENIGMA can handle large sprites for sure.
Logged
Offline (Male) Goombert
Reply #2 Posted on: August 12, 2013, 02:00:30 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
TKG, it would be a lot more helpful if you could describe in detail exactly what is happening when you try to load HD textures, as I myself have used 1028x1028 textures for instance in the 1 million cubes tech demo.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #3 Posted on: August 12, 2013, 02:17:28 PM

Developer
Joined: Apr 2008
Posts: 1860

View Profile
There were not actually a million cubes in the demo though. Just wanted to point it out.
Logged
Offline (Male) Goombert
Reply #4 Posted on: August 12, 2013, 03:41:46 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
You could bump them up, I lowered it down to ensure I didn't break somebodies PC, the Game Maker Studio cubes demo however can't do more than 32k at 40-60fps for me? And I have yet to figure out why.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) time-killer-games
Reply #5 Posted on: August 13, 2013, 11:19:13 AM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1170

View Profile Email
Whoever wants to see for themselves the issues I'm having with loading my project, feel free to comment here and I'll send the source in a pm...
Logged
Offline (Unknown gender) TheExDeus
Reply #6 Posted on: August 13, 2013, 11:36:45 AM

Developer
Joined: Apr 2008
Posts: 1860

View Profile
I think most of the devs are interested in that. So I am interested to see the problem.
Logged
Offline (Male) Goombert
Reply #7 Posted on: August 13, 2013, 12:07:02 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
I have already seen his one super large project, I am outlining the GMX reader in LGM right now, don't know if I will be successful at it or not, but I'd rather focus on getting that and that should solve his woes since Studio dropped GMK exporting.

This is what I have so far today of the GMX format working...

« Last Edit: August 13, 2013, 03:05:34 PM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Male) Josh @ Dreamland
Reply #8 Posted on: August 14, 2013, 07:15:39 AM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
If you're loading it using Ism's methodology, it will not be very successful. You'll have to load the entire file into memory at once, just like all the serial formats. While I guess it's better than nothing (and technically necessary right now due to ENIGMA's inherently poor support for external resource management), it ultimately should not be done that way.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Goombert
Reply #9 Posted on: August 14, 2013, 10:00:46 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Well, it is good enough for now Josh, as LateralGM is really meant to be for GMK and older Game Maker versions. GMX is something we will much better support from a new IDE. Also, it needed to load them all anyway Josh, so that the GMX could be saved into GMK.

Here is my progress now...


Also I want to warn everyone about trying to import old GMK's into Studio, basically, you shouldn't try because it is a disaster. The thing couldn't even properly import loading the old Mark Overmars FPS tutorial, and you may in fact seriously damage your game.
« Last Edit: August 14, 2013, 10:21:43 AM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) jimn346
Reply #10 Posted on: August 14, 2013, 09:45:12 PM
"Guest"


Email
I'm not sure I understand what the problem is, but if you want to have the scaling for the collision and drawing separate, you could just set x_scale and y_scale to however you want the mask to be scaled and then override the draw event to be something like:

Code: [Select]
draw_sprite_ext(sprite_index, image_index, x, y, my_xscale_var, my_yscale_var, image_angle, image_blend, image_alpha);

OR

Code: [Select]
draw_sprite_ext(sprite_index, image_index, x, y, image_xscale * my_ratio, image_yscale * my_ratio, image_angle, image_blend, image_alpha);
Logged
Offline (Male) Goombert
Reply #11 Posted on: August 14, 2013, 10:58:14 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
jimn, the issue is he thinks large images are the results of his games not being able to properly load into LateralGM the IDE. I am attempting to resolve this correctly with my implementation of the GMX format, which should hopefully solve his problem.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Offline (Unknown gender) TheExDeus
Reply #12 Posted on: August 15, 2013, 04:53:47 AM

Developer
Joined: Apr 2008
Posts: 1860

View Profile
Quote
I'm not sure I understand what the problem is, but if you want to have the scaling for the collision and drawing separate, you could just set x_scale and y_scale to however you want the mask to be scaled and then override the draw event to be something like:
But are the collision masks scaled right now in ENIGMA just like they are in GM? I haven't tested that yet and I don't know if someone else has implemented it.

Quote
jimn, the issue is he thinks large images are the results of his games not being able to properly load into LateralGM the IDE. I am attempting to resolve this correctly with my implementation of the GMX format, which should hopefully solve his problem.
That is actually NOT the issue. The topic itself is about collision masks.
Logged
Offline (Male) time-killer-games
Reply #13 Posted on: August 17, 2013, 12:43:23 PM

Contributor
Location: Virginia Beach
Joined: Jan 2013
Posts: 1170

View Profile Email
With this LGM update just released, my project loads perfectly. Well, almost perfectly. I tried loading the gmx version instead of the gm81 and it did load, but the resource tree had a duplicate of every folder (i.e. 2 sprite category folders) and inside every folder and folder duplicate there is a duplicate of every individual resource (except the rooms folder which is empty and failed loading), when I tried deleting the duplicate resources, it ended up deleting the original resoures as well even though I didn't tell it to do that. As we speak Robert, I am sending you my source...
Logged
Offline (Male) Goombert
Reply #14 Posted on: August 18, 2013, 06:55:46 PM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
Hey, sorry I did not respond for two days I was on vacation, I have just arrived home and will sort through news on the site. Like I said I did not completely finish GMX, just wanted it tested, and your source code will help me finish the full implementation.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print