Author Topic: Game Design Megathread  (Read 556436 times)

I went back a few pages on here and I noticed not a lot of people do top-down games. Does anyone have any experience in top-down collision detection in game maker?

Edit: I figured it out, kinda sorta, honestly if anyone has a better option I'd switch to it, lol.
« Last Edit: March 04, 2015, 01:45:45 PM by Oasis »

I went back a few pages on here and I noticed not a lot of people do top-down games. Does anyone have any experience in top-down collision detection in game maker?

Edit: I figured it out, kinda sorta, honestly if anyone has a better option I'd switch to it, lol.

yes, i have a whole folder with code snippets from the GM forum:

This is generally for circular sprites, but can easily be adjusted to rectangular or whatever you want. Just change the collision_<shape> code.
Adjust arguments to fit your needs (below code was made for a 32x32 circular sprite). Use with a centered origin on sprite, or adjust to fit.
Place this in a Step event.
Code: [Select]
if(collision_circle(x + lengthdir_x(6, direction) + hspeed, y + lengthdir_y(6, direction) - vspeed, 16, obj_block, 1, 1)) { // Horizontal collision
    hspeed = 0; // Stop horizontal movement
}
if(collision_circle(x + lengthdir_x(6, direction) - hspeed, y + lengthdir_y(6, direction) + vspeed, 16, obj_block, 1, 1)) { // Vertical collision
    vspeed = 0; // Stop vertical movement
}
This works best with centered origin sprite.
Place this in a Collision event.
Code: [Select]
//This one is for 32x32 horizontal and vertical walls ONLY
var xDif, yDif;
xDif = x - other.x;
yDif = y - other.y;

if abs(xDif)>abs(yDif)
{
x = other.x + sign(xDif) * 32;
}
else
{
y = other.y + sign(yDif) * 32;
}
This works best with centered origin sprite.
Place this in a Collision event.
Code: [Select]
x += 0.1 * (x - (other.x));
y += 0.1 * (y - (other.y));
This script checks all solid objects.
Place this in a Step event.
Code: [Select]
if hspeed!=0
if !place_free(x+hspeed,y)
{
    if hspeed>0 move_contact_solid(0,hspeed)
    if hspeed<0 move_contact_solid(180,-hspeed)
    hspeed=0
}

if vspeed!=0
if !place_free(x+hspeed,y+vspeed)
{
    if vspeed>0 move_contact_solid(270,vspeed)
    if vspeed<0 move_contact_solid(90,-vspeed)
    vspeed=0
}
First script is used only to slide past circular shapes.
Second script is used only to slide past rectangular shapes.
Code: [Select]
//avoid_circle(player_radius,x,y,radius)
//(x,y) is the center of the circle
var d;
argument3+=argument0
d=point_distance(x,y,argument1,argument2)
if d>0 and d<argument3
{
    xx=argument1+(x-argument1)*argument3/d
    yy=argument2+(y-argument2)*argument3/d
    return 1;
}
return 0;
//avoid_rectangle(player_radius,x,y,width,height,angle)
//(x,y) is the center of the rectangle
var xto,yto,v,h,ah,vh,d;
argument3/=2
argument4/=2
if point_distance(x,y,argument1,argument2) < point_distance(0,0,argument3,argument4)+argument0
{
    xto=cos(degtorad(argument5))
    yto=sin(degtorad(argument5))
    
    xx=x-argument1
    yy=y-argument2
    
    h=(xto*xx-yto*yy)
    v=(xto*yy+yto*xx)
    ah=abs(h/argument3)
    av=abs(v/argument4)
    
    if max(ah,av)<=1
    {
        //If the object is inside the rectangle
        if ah>av{
            h=(argument3+argument0)*sign(h)}
        else{
            v=(argument4+argument0)*sign(v)}
        xx=argument1+xto*h+yto*v
        yy=argument2+xto*v-yto*h
        return 1;
    }
    else
    {
        //If the object is touching the rectangle
        h=median(h,-argument3,argument3)
        v=median(v,-argument4,argument4)
        xx=argument1+xto*h+yto*v
        yy=argument2+xto*v-yto*h
        d=point_distance(xx,yy,x,y)/argument0
        if d<1
        {
            xx+=(x-xx)/d
            yy+=(y-yy)/d
            return 1;
        }
    }
}
xx=x
yy=y
return 0;
Argument0 = target instance (for example obj_wall)
Argument1 = resolution (1-45, low integers are slow, 15 is default)
Place this in either End Step event or Collision event.
Code: [Select]
//THIS CAN GO IN THE END STEP OF THE INSTANCE
//OR THE COLLISION EVENT WITH AN INSTANCE
//
//scr_move_slide(inst, res);
//
//argument0 = instance to check for
//argument1 = resolution. Must be between 1 and 45 (low numbers are SLOW). 15 is a good default

var xmot, ymot;
x=xprevious;
y=yprevious;
for (i = 0; i < 90; i += argument1)
    {
    xmot = x + lengthdir_x(speed, direction + i);
    ymot = y + lengthdir_y(speed, direction + i);
    if !place_meeting(xmot, ymot,argument0) {x = xmot; y = ymot; exit;}
    xmot = x + lengthdir_x(speed, direction - i);
    ymot = y + lengthdir_y(speed, direction - i);
    if !place_meeting(xmot, ymot, argument0) {x = xmot; y = ymot; exit;}
    }

So I have a bit of a dilemma.
I have a idea that has a more original concept but I cant think of much gameplay for it and a game with a less original concept but I have tons of Ideas for gameplay with it.
I can't choose one I want to work on more any thoughts.    
« Last Edit: March 08, 2015, 05:52:10 AM by Marscott23 »

So I have a bit of a dilemma.
I have a idea that has a more original concept but I cant think of much gameplay for it and a game with a less original concept but I have tons of Ideas for gameplay with it.
I can't choose one I want to work on more any thoughts.    
Uhhh...

Merge them? Ideally, gameplay should be a higher priority than story if you can only pick one, but the best games merge them seamlessly.

Honestly, you should just go for the one that entertains you more, since you don't want to burnout half way through development. My ex-game teach made it quite clear that you should projects that answer big questions you have, because you're more dedicated to see that project out to the end over just making something for profit.

oh I meant like more original gameplay concept but less level design ideas but your advice still stands.
I'll try to mix my the two gameplay styles and see what I get.


Does Unreal Engine IVs animation system work better than Unitys?

Does Unreal Engine IVs animation system work better than Unitys?
Absolutely.

Proper animation blending thanks to the simplified yet also deep animation tool kit (it involves visual scripting and also allows you to directly edit bones, nodes and a lot more things all in the editor), plus you have the really loving good Matinee.

yes, i have a whole folder with code snippets from the GM forum:

Thanks, that helped a bit. I got collision working enough for the purpose of the game, don't need it to be perfect.

Absolutely.

Proper animation blending thanks to the simplified yet also deep animation tool kit (it involves visual scripting and also allows you to directly edit bones, nodes and a lot more things all in the editor), plus you have the really loving good Matinee.

Holy stuff an animation system that actually works?

Bye bye Unity.

Absolutely.

Proper animation blending thanks to the simplified yet also deep animation tool kit (it involves visual scripting and also allows you to directly edit bones, nodes and a lot more things all in the editor), plus you have the really loving good Matinee.

!

That sounds awesome


I'm really upset right now.

I have a class called "ICT". It's 2 game designers and 3 animators, and we have to make a game. This week, we had to submit ideas for games so we could choose 3 to expand on for next week.

I presented 5 ideas to the class and everybody else presented 1 idea each. The top 3 ideas which we have a week to think about are:

1 - My idea about a first person shooter involving gravity puzzles, where people can easily invert gravity and need to use these to traverse the level and kill players. We also want to make it a game that makes use of the Oculus Rift AND the Emotiv Insight (an EEG machine that can read you mind so you can control the game just by thinking).
2 - My friend's fighter with real life pictures idea (similar to the original Mortal Kombat games, except this is going to be really funny and we don't have any need to balance characters since it's only for demonstration).
3 - One of the animator's ideas which is where you have to escape the school without being caught by the teachers.

And of course, all the animators are leaning towards the third one.

I really, really think #3 is the dullest one with the most work involved (in terms of how many features the animators want, including a full detailed parkour system, character customisation and an RPG system). It's not something I would be interested in. I would be working on it only because I need to fulfil the assessment and because my name would be tied to the game during the public demo. #1 and #2 sound really loving fun to do, since #1 gives me a chance to play with some new toys, and #2 means we get to A) all design our own OP characters and B) make use of the INCREDIBLE studio/green-screen space the college has.

Am I wrong for feeling upset about this? I just can't see any positives to #3, and I'm likely going to be the lead programmer.

what does the other game designer think? im assuming he wants to do his idea

what does the other game designer think? im assuming he wants to do his idea
He's one of the most open, level-headed guys on the planet I know. From what I recall, he's split between 1 and 2 as well, but ultimately he wants to work on the game that the most people like.

you aren't always going to get to work on things you're excited about