Jump to content


conantbh

Member Since 03 Mar 2012
Offline Last Active May 03 2013 02:45 PM

Topics I've Started

Is resolution changing in gm:studio buggy?

28 December 2012 - 09:26 PM

After dealing with way more complicate things I'm stuck with view changing based on the screen resolution. This example works perfectly in gm8 but not at all in studio. Do someone know why and how to fix it? Thanks.

gm8 example (by Chris_Devl): http://www.mediafire...9y6d6dd776w0g1n
gm:s example (same thing, just imported in studio): http://www.mediafire...byz7fc90vhs4gzh

I have also tried to set a with manually with gml without using the views tab in the room but that wont work either: the scale goes away and it becomes all blurry.

Camera shaking when using following views

09 December 2012 - 08:54 AM

The title explains itself. When the view moves (aka when is following an object) the game get every possible graphical issue: the view shakes, sprites flickers and go blurry (this one may be difficult to notice, but the others are evident).
Someone says it is an unsolvable problem with LDC monitors, someone says it is a tecnical limit of game maker for not allowing non-integers coordinates for views. However, I cant belive no one solved this yet.

In the player object:

Step event:
movement code

EndStep event:

view_xview[0] = round(x-320);
view_yview[0] = round(y-240);

Draw event

draw_sprite_ext(sprite_index,-1,round(x),round(y),image_xscale,image_yscale,image_angle,image_blend,image_alpha);

Here is a gmk I made (look for the camera shaking and the block object flickering, when the view is moving, using the WASD keys)
http://www.mediafire.com/?upaiazjbnfp1501

What I have tried and didnt worked out:
- Placing the view and movement code in different combinatios of beginstep, step, endstep, draw
- drawing the sprites with floor(n) and ceil(n) (that worked out only for the player)


So I'm here asking for advice and help.
Thanks in advance, Conan


p.s. some other older and unanswered topics

http://gmc.yoyogames.com/index.php?showtopic=525270
http://gmc.yoyogames.com/index.php?showtopic=534101#entry3922785
http://gmc.yoyogames.com/index.php?showtopic=526101&st=0&p=3871899&hl=+view%20+flickering&fromsearch=1&#entry3871899

CBNA SmartLight for GM:studio?

07 October 2012 - 02:18 PM

Recently I found this interestig lighiting engine, it works perfecty in gm8, but i would love to see it in gm:studio. There is a port somewhere? Cuold someone help me to port it? Thanks in advance, Conan

EDIT: The problem is the use of the (now obsolete) function variable_global_exists and variable_local_exists.

mp_grid advice appreciated

25 July 2012 - 01:57 PM

Hi guys, I have quite a hard problem. I am coding a small 2d game with a player (obj_player), a few enemies (obj_enemy) and some blocks (obj_block). The motion planning grid works nicely and every enemy avoid correctly every obj_block. The problem is between the istances of the obj_enemy. They avoid the blocks but obvously not others obj_enemy. I passed some days thinking about this and nothing great came. I need some advice on how to make every obj_enemy avoid others obj_enemy.
(Yes, I know that asking for code is forbidden, but i'm not asking readytouse code, but only some advice)

Here is the code of obj_enemy

-create event

//just some setting

tooclose = 0
seen = 0
path=path_add();
grid=mp_grid_create(0,0,room_width,room_height,1,1);
with(obj_block)
{
mp_grid_add_rectangle(grid,x-15,y-15,x+47,y+47)
}

-step event

// this makes the enemy face the player when is in sight or to face where the istance is going when the player is not in sight

angletoplayer = point_direction(x, y, obj_player.x, obj_player.y)

if !collision_line(x,y,obj_player.x,obj_player.y,obj_block,1,1)
{
if angletoplayer <= 22.5 or angletoplayer > 337.5 {image_index = 0}
if angletoplayer > 22.5 and angletoplayer <= 67.5 {image_index = 4}
if angletoplayer > 67.5 and angletoplayer <= 112.5 {image_index = 1}
if angletoplayer > 112.5 and angletoplayer <= 157.5 {image_index = 5}
if angletoplayer > 157.5 and angletoplayer <= 202.5 {image_index = 3}
if angletoplayer > 202.5 and angletoplayer <= 247.5 {image_index = 6}
if angletoplayer > 247.5 and angletoplayer <= 292.5 {image_index = 2}
if angletoplayer > 292.5 and angletoplayer <= 337.5 {image_index = 7}
}

if collision_line(x,y,obj_player.x,obj_player.y,obj_block,1,1)
{
if direction = 0 {image_index = 0}
if direction = 45 {image_index = 4}
if direction = 90 {image_index = 1}
if direction = 135 {image_index = 5}
if direction = 180 {image_index = 3}
if direction = 225 {image_index = 6}
if direction = 270 {image_index = 2}
if direction = 315 {image_index = 7}
}

//this marks the player as seen and stores the last x,y of the player when was in sight

if !collision_line(x,y,obj_player.x,obj_player.y,obj_block,1,1)
{
    lastseenx = obj_player.x
    lastseeny = obj_player.y
    seen = 1
}

// this makes the enemy stop when it reaches the player

if distance_to_object(obj_player) > 16
{
    tooclose = 0
}

xx = x + lengthdir_x(16, direction);
yy = y + lengthdir_y(16, direction);
if collision_circle(xx, yy, 16, obj_player, 1,1) 
{
    path_end()
    tooclose = 1
}

// these are the mp_grid_path commands

if !collision_line(x,y,obj_player.x,obj_player.y,obj_block,1,1) and tooclose !=1
{
    if mp_grid_path(grid,path,x,y,obj_player.x,obj_player.y,1) = true
    {
    path_start(path,2,0,0)
    }
}

if collision_line(x,y,obj_player.x,obj_player.y,obj_block,1,1) and tooclose !=1 and seen = 1
{
    if mp_grid_path(grid,path,x,y,lastseenx,lastseeny,1) = true
    {
    path_start(path,2,0,0)
    }
}

I tried to add a rectangle with the mp_grid_add_rectangle on every enemy but since is applied to all the istances it locks in place every obj_enemy.
I also tried to make differnt grids but it was very 'bad'.

Any help is very much appreciated, thanks in advance, Conan.

Triggers

17 March 2012 - 08:00 PM

Hi, (yes i'm new in this forum)
I am feeling a little stupid: all my costum triggers worked fine on gm standard and now that I have ported the game to studio they dont work on win, while they work perfectly on html5. I see that apparently no one asked this before me.. Am I that stupid?

Thanks, Conan