Jump to content


Dylan93

Member Since 18 Dec 2007
Offline Last Active May 23 2013 07:05 PM

Topics I've Started

Surface problem

18 December 2011 - 11:25 AM

Hello GMC,

Since I have huge game rooms (4096+) I thought that surfaces the size of the room would be to big, so what I did was making it smaller and make it move with the view.
The only problem is, it looks like this:

Posted Image

Here it looks like it should, however this is what it looks like when I move the view:

Posted Image

The shadows move too while the object just remains at its position.

The code I use for drawing the surface:
draw_surface_ext(shadowsurf,surfx,surfy,1,1,0,c_white,salpha);

surfx and surfy are updated in the end step event:
surfx = view_xview[0];
surfy = view_yview[0];

Can someone tell me what I'm doing wrong :) ?

How to do NPC feet

27 January 2011 - 02:12 PM

Hello GMC,

Like the title says, in my upcoming engine showcase level I have a complete forest with a town in the middle.
Now the problem is, I want every NPC to be able to have legs/paws etc, currently it works like this: (Which I doubt is efficient)

All NPC's are a object, lets say for example a deer.
The deer itself is a object, having its own sprite and code etc, but for the feet I use a different object that handles the feet animation and speed etc.
Now the problem is that I use this method for every NPC, and there are many of em so its highly inefficient and it raises the number of objects a lot.
In this scene is also a complete village with NPC people, the scene has a day/night system and the shadows and lighting are based upon that.
There is bloom, which including the shadows are drawn on a surface.
The game is topdown for as far that matters.

So can anyone help me out with another method ?

- Dylan

Collision problem

29 December 2010 - 12:07 PM

Hello GMC,

I currently use a collision method which just forces the object to move away from the thing its in collision with, here's the code:
var dir, xcol, ycol;
dir=point_direction(x,y,other.x,other.y)
xcol = lengthdir_x(1,dir);
ycol = lengthdir_y(1,dir);

while (place_meeting(x,y,other))
{
    x -= xcol;
    y -= ycol;
}

Well, here's what happens:
Posted Image

The enemy's collide with the wall at the start of the arrow and they just 'glide' until they are at the point where the two blocks are aligned to each other and they move through that spline...

Can anyone help me solving this problem ?
I already tried other (basic) collision things like bounce and move_contact but neither works.
The enemies move with mp_potential_step codes towards the target.

btw, putting the walls more 'in' each other wont work either, as they still go through the little line where the sprite of the walls are colliding.

Problem with surface

20 December 2010 - 03:37 PM

Hello GMC,

In my game I have different surfaces, 1 for shadows and 1 for effects.
Now I have a problem with the effect surface, I want things like blood to be drawed onto that surface so I use this code:

Create Event of the blood object:
if System.effectsusesurf = 1
{
    surface_set_target(System.effectsurf);
    draw_clear_alpha(0,0); 
    draw_sprite_ext(spr_b,choose(0,1,2),x-random(10)+random(10),y-random(10)+random(10),random(floor(4)),random(floor(4)),random(360),c_white,choose(0.4,0.5,0.6))
    surface_reset_target();
    instance_destroy();
}
else
{
image_angle=random(360); //Random angle.
image_single=random(image_number-1); //Random subimage
image_alpha = choose(0.4,0.5,0.6);  //Alpha
size = random(floor(6));
fade=false; //Not yet fading.
alarm[0] = random(300)+10; //Alarm for fading.
}

Here it just checks if its allowed to draw it on a surface and then draws it on it and destroys itself.
The else part is for when the effect surface is disabled, the game has customizeable options thats why.

Here is the surface drawing code in the System objects draw event:
//Surface drawing
if shadows = 1
{
    draw_surface_ext(shadowsurf,0,0,1,1,0,c_white,.25);
}
if effectsusesurf = 1
{
    draw_surface_ext(effectsurf,0,0,1,1,0,c_white,1);
}

The problem is that the blood is drawn really weird on the surface, and whenever a new blood sprite appears the other dissapears...

Posted Image

and I cant figure out whats going wrong.

-Dylan

Atmosphir

02 October 2010 - 09:46 PM

Hello GMC,

Just gotta share this game with ya.
Atmostphir is a adventure where people can create their own levels for others to play together or alone.

This is a Youtube link to the trailer

Their server is currently so busy with people joining that it takes a long time to register and login or come at their site.

Curious who else play's this or is going to play this.

Here is the link to the game