View Full Version : Game Maker Help Thread (Post your Qs here!)
dammit
14-01-2010, 08:38 AM
This The Clue (http://en.wikipedia.org/wiki/The_Clue!) ?
CiNiMoDZA
14-01-2010, 04:58 PM
This The Clue (http://en.wikipedia.org/wiki/The_Clue!) ?
Yip, thats the one!
dislekcia
14-01-2010, 05:52 PM
Yip, thats the one!
Then it sounds like you need to do the following:
Store a sequence of game moves that the player plans to make.
Give the player tools to both populate and edit that sequence.
Calculate the effects of said sequence when they "occur" in your game world and alert the player of their changes in resources, etc.
Each one of those is a set of smaller problems (I use the word the same way that it's used in the idea of a "toy problem") that require a bit more than a single implementation of a GM idea to solve.
The first and most important question is how are you going to store that sequence of moves? You need to know what information you need for each move to make sense, how you're going to store that information and how players are going to enter that info. Once you've figured that out, the rest is just coding ;)
(So no, a timeline probably won't help. Timelines are for executing a fixed set of events over multiple steps, not storing dynamic info... Which GM constructs exist to do that?)
dammit
14-01-2010, 07:06 PM
(So no, a timeline probably won't help. Timelines are for executing a fixed set of events over multiple steps, not storing dynamic info... Which GM constructs exist to do that?)
Ini files? Just testing my knowledge :P
dislekcia
14-01-2010, 07:44 PM
Ini files? Just testing my knowledge :P
Technically, yes ini files exist to store data, but it's not dynamic data. They're designed to store information that you already know in advance, like game settings that users might want to change, volume levels, etc. But, because you're writing things to files, they're slow and reading from GM's flexible ini-format in particular takes utter ages. They're great for storing info across independent game sessions, but you wouldn't use them to store AI nodes or anything that changed more than once every couple thousand frames...
What other constructs exist for storing dynamic data within GM while a game is running?
CiNiMoDZA
14-01-2010, 10:07 PM
A list???
dammit
14-01-2010, 10:16 PM
Technically, yes ini files exist to store data, but it's not dynamic data. They're designed to store information that you already know in advance, like game settings that users might want to change, volume levels, etc. But, because you're writing things to files, they're slow and reading from GM's flexible ini-format in particular takes utter ages. They're great for storing info across independent game sessions, but you wouldn't use them to store AI nodes or anything that changed more than once every couple thousand frames...
What other constructs exist for storing dynamic data within GM while a game is running?
No idea. My knowledge is pretty much limited to what I already suggested. Please enlighten me :P
dislekcia
15-01-2010, 02:50 AM
No idea. My knowledge is pretty much limited to what I already suggested. Please enlighten me :P
A list???
Like I said before: Focus on what you need to store.
Each move would need to have (I presume, having never played the game) a starting position, an ending position, a character the move applies to and probably stuff like costs when the move happens, etc. The way I would handle that is set up a parent object, BasicMove, which had all these variables declared in its create event. Then I'd set up individual Move objects that inherited from BasicMove. After that, it's just a matter of creating new Move objects as the player does things in your interface, giving them the relevant information and storing their ids in a (yes) list somewhere.
It would be important to point out that these objects are merely data storage objects, they don't collide with anything, have sprites or otherwise participate in the game in any way. Once you start thinking like this, you free up a lot of potential in GM that people don't always realise is there from the word go...
CiNiMoDZA
18-01-2010, 10:57 PM
Im confused here a little! Im trying to give the illusion of my person in my game jumping, while also changing their depth so that I can interact with other objects. So I have this working fine, I can jump and move in all directions, however, when I try to move top-left, I can seem to jump?!? This is the only angle that gives me an issue! Here is my code:
(Note:Please feel free to show me an easier or more efficient way of doing this!!)
//--Variables
if (keyboard_check_pressed(vk_space) and jump = false)
{
jump = true;
}
//--Movement
if (keyboard_check(vk_up))
{
y -=2;
}
if (keyboard_check(vk_down))
{
y +=2;
}
if (keyboard_check(vk_left))
{
x -=2;
}
if (keyboard_check(vk_right))
{
x +=2;
}
//--Jump animation
if (depth = -20)
{
jump = false;
}
if (jump = true and depth < 1)
{
depth -=1;
image_xscale +=.02;
image_yscale +=.02;
}
else if (jump = false and depth < 0)
{
depth +=1;
image_xscale -=.02;
image_yscale -=.02;
}
Thats it...thanks
dislekcia
18-01-2010, 11:04 PM
Im confused here a little! Im trying to give the illusion of my person in my game jumping, while also changing their depth so that I can interact with other objects. So I have this working fine, I can jump and move in all directions, however, when I try to move top-left, I can seem to jump?!? This is the only angle that gives me an issue! Here is my code:
(Note:Please feel free to show me an easier or more efficient way of doing this!!)
Thats it...thanks
That sounds more like a key-conflict than anything else I can see from your code. What kind of keyboard are you using and have you tried using different keys to see if that helps?
Chippit
18-01-2010, 11:10 PM
Are there really keyboards that give trouble with only two keys? Surely he'd have noticed this with other games by now if there are.
SkinkLizzard
19-01-2010, 12:12 AM
as stupid as it may seem just humour me, seeing as your code -should- be fine
change the = in your if statements to == .
again I don't know why if it does make a difference but my brother had a problem
of code that should work but wasn't that was fixed like this.
dislekcia
19-01-2010, 12:48 AM
Are there really keyboards that give trouble with only two keys? Surely he'd have noticed this with other games by now if there are.
Three keys, unless I'm misreading... Up + left + space?
as stupid as it may seem just humour me, seeing as your code -should- be fine
change the = in your if statements to == .
again I don't know why if it does make a difference but my brother had a problem
of code that should work but wasn't that was fixed like this.
You're right, the single = is a problem. That's going to assign to the variable, which will always return true. The boolean test is done using ==... I keep missing that when I look at GML that's not structured in C syntax. I think I'm just assuming that it'll figure out what was meant :(
Chippit
19-01-2010, 12:56 AM
Three keys, unless I'm misreading... Up + left + space?
Oh, right, duhr. I wasn't even reading the code. I just assumed 'up' was the jump key. It all kinda makes sense in context now.
Also, in a partially related note, am I the only person who does "if (!x)" instead of "if (x == false)"? The former's always just made more sense to me, and it looks neater. But I see, like, everyone doing it the latter way. It also makes "if (x == true)" entirely redundant too.
Is this some recent trend I missed? o_O
dislekcia
19-01-2010, 04:05 AM
Oh, right, duhr. I wasn't even reading the code. I just assumed 'up' was the jump key. It all kinda makes sense in context now.
Also, in a partially related note, am I the only person who does "if (!x)" instead of "if (x == false)"? The former's always just made more sense to me, and it looks neater. But I see, like, everyone doing it the latter way. It also makes "if (x == true)" entirely redundant too.
Is this some recent trend I missed? o_O
You are !alone. I do it the same way (and include the theoretically redundant brackets too). The only time I don't let booleans evaluate through is when I'm in a language that uses odd constants for true/false or doesn't use the 0 = false, anything else = true mapping. That really annoyed me with a recent web project until I figured out what was going on.
CiNiMoDZA
19-01-2010, 12:42 PM
Thats pretty weird...my keyboard at work only lets me jump if Im either only pushing one of the arrow keys or top-right??? Is there a way to get around this?
dislekcia
19-01-2010, 01:54 PM
Thats pretty weird...my keyboard at work only lets me jump if Im either only pushing one of the arrow keys or top-right??? Is there a way to get around this?
Have you fixed the == thing? Are there any other places in your code where the jump variable is being accessed?
CiNiMoDZA
19-01-2010, 05:25 PM
yes, I did the ==, it didnt change anything!! And yes, there are no other places that are accessing the variables!
Graal
22-01-2010, 10:36 PM
Okay, so I've been playing around with GM (gm8 lite specifically) lately and I think I've got the hang of the basics. Now can anybody point me towards a decent GM programming tutorial, as I'm too lazy to search through more than a thousand posts. Just take note that I never passed programming at school, so it should be an absolute beginners guide. Any help will be appreciated.
SkinkLizzard
22-01-2010, 11:09 PM
well I'd suggest you read the help file even if just cursorily to get an idea of
what functions are available and what they do.
then I would suggest you decide what type of game you want to start with and let us know,
as I don't think there are going to be very many good overall game maker tutorials.
I had a top down shooter tut lurking somewhere that I made for a durban game.dev hot lab
,back when those where still happening, that I could try and find for you.
otherwise add me to gtalk, same user name as here, and when I'm online I can maybe help walk you through some gm programmy stuff.
Obi Two Kenobi
10-04-2010, 10:05 PM
Hey guys and galz. There are some bugs that need fixing in GM8 project but my knowledge only stretches so far. Should I just post the codes together with the object related info so you guys can point me in the right direction, or are there other means of doing this?
dislekcia
10-04-2010, 11:34 PM
Hey guys and galz. There are some bugs that need fixing in GM8 project but my knowledge only stretches so far. Should I just post the codes together with the object related info so you guys can point me in the right direction, or are there other means of doing this?
Supply an explanation of the bug and/or thing you don't know how to do with as much information as possible and someone will probably be able to help you out. Generally, posting the code itself is a last resort when people can't figure out what's going on, reading other people's code and sifting through a whole game is really not that easy ;)
Bonus points if you can tell people how to recreate the bug you're trying to squash in your game.
Obi Two Kenobi
11-04-2010, 11:22 PM
Okay cool the problem is found in the game I'm working on, the download link is below:
http://www.box.net/shared/cdtlt47f4z (1.4Mb)
Now sometimes when the ball is bouncing it will get stuck on whatever it is touching. Note, this only happens sometimes and I don't know why. When, for example, a green ball gets stuck on one of the green colored destroyable blocks, the block will be destroyed as normal and the ball will go right through, usually hitting the eminent death block behind.
So far, I have only seen this occur when the ball is moving vertically, eiter up or down.
I have created four ball objects, each one a different color of course. Each one has the following events and actions:
* Create - Set vertical speed to 4, set var vspeed to 4
* Step - Here I just put a simple code to fix another problem I had:
if vspeed=0 then
vspeed=4
* Collision with object - I added every block in the game against which the ball has to bounce and
let it bounce precisely against solid objects
The events and actions with the blocks themselves only contain sound actions and in the case of the color-swapping block, an action to change the instance of the balls to whichever color it represents.
The balls move by coded actions and variables containing vspeed and hspeed.
If there is anything else which needs posting just give the word.
The Dash
12-04-2010, 07:48 AM
Now sometimes when the ball is bouncing it will get stuck on whatever it is touching. Note, this only happens sometimes and I don't know why. When, for example, a green ball gets stuck on one of the green colored destroyable blocks, the block will be destroyed as normal and the ball will go right through, usually hitting the eminent death block behind.
So far, I have only seen this occur when the ball is moving vertically, eiter up or down.
I have created four ball objects, each one a different color of course. Each one has the following events and actions:
* Create - Set vertical speed to 4, set var vspeed to 4
* Step - Here I just put a simple code to fix another problem I had:
if vspeed=0 then
vspeed=4
* Collision with object - I added every block in the game against which the ball has to bounce and
let it bounce precisely against solid objects
The events and actions with the blocks themselves only contain sound actions and in the case of the color-swapping block, an action to change the instance of the balls to whichever color it represents.
The balls move by coded actions and variables containing vspeed and hspeed.
If there is anything else which needs posting just give the word.
I think i know what the problem is. When the ball collides with a wall, for a brief step its vspeed=0. so your code makes vspeed=4. So the move code works before the bounce code.
Understand what im saying?
Instead of bouncing and going in the opposite direction, your code in the step event takes over and stops it from bouncing
Obi Two Kenobi
12-04-2010, 08:25 PM
I think i know what the problem is. When the ball collides with a wall, for a brief step its vspeed=0. so your code makes vspeed=4. So the move code works before the bounce code.
Understand what im saying?
Instead of bouncing and going in the opposite direction, your code in the step event takes over and stops it from bouncing
Hmm yes I understand your thinking. Any idea on what can be done to keep it from occurring? Sorry if this sounds like a rather generic reply but I have tried ways of fixing this but my GML knowledge only stretches so far.
dislekcia
12-04-2010, 09:21 PM
Hmm yes I understand your thinking. Any idea on what can be done to keep it from occurring? Sorry if this sounds like a rather generic reply but I have tried ways of fixing this but my GML knowledge only stretches so far.
Step through the logic: You don't want to set the vspeed to 4 IF the ball is touching something else. That's a guard condition, right there...
Fruzz
18-04-2010, 07:12 PM
Are there any decent, well documented physics extension packages for Game Maker? I had a look at GMPhysics but its kinda buggy and not ideal. I've seen another one called GMBullet I think, not sure if its any good.
dislekcia
18-04-2010, 08:24 PM
Are there any decent, well documented physics extension packages for Game Maker? I had a look at GMPhysics but its kinda buggy and not ideal. I've seen another one called GMBullet I think, not sure if its any good.
Physics systems are usually very tricky to use right. What are you trying to do with one? Generally I find that if you have specific expectations with one, they end up not working too well.
I've settled on one of the older versions of GMPhysics, it does what I need and isn't complicated to set up.
Fruzz
19-04-2010, 11:59 AM
Basically, I want to try and prototype a 2D platformer idea thats been floating round in my head. I thought it would be fun to have some objects that could be affected by your character. By affected I mean physically pushed or moved by a shockwave. I managed to get some boxes that could interact with each other because they are of the same rigid body object type but making them interact with the player in a meaningful way didn't really work that well.
Thats the direction I'm going in, does that sound like something I could use an older version of GMPhysics for? It doesn't need to be perfect at this stage, I want to play around and mix things up to see if my ideas will be fun.
dislekcia
19-04-2010, 02:12 PM
Basically, I want to try and prototype a 2D platformer idea thats been floating round in my head. I thought it would be fun to have some objects that could be affected by your character. By affected I mean physically pushed or moved by a shockwave. I managed to get some boxes that could interact with each other because they are of the same rigid body object type but making them interact with the player in a meaningful way didn't really work that well.
Thats the direction I'm going in, does that sound like something I could use an older version of GMPhysics for? It doesn't need to be perfect at this stage, I want to play around and mix things up to see if my ideas will be fun.
I'd do that in GMPhysics by setting up the player character as having a mirrored actor in the physics sim and letting that interact with the boxes.
Something you need to be aware of with physics in games is that the physics simulation is a completely separate world. The sim knows NOTHING about your game that you don't expressly tell it. People assume that a physics library is about integration, no, it's about doing certain sets of maths very, very fast.
Fruzz
19-04-2010, 02:18 PM
Ah ok, thats very interesting.
What version of GMPhysics do you use and where can I get it?
Shad0wstr1k3
09-05-2010, 08:10 PM
Sorry, I have one or two noob questions
1. How would one go about creating pop-up menus, for example, clicking on something then being presented with two or three options. Selecting the different options would have different results, like a big building, or a small building.
2. I have been trying to work this out for a while now, but how would one make a money system?
Thanks
Shad0wstr1k3
10-05-2010, 07:30 PM
OK, I' ve sorted out the money system, I used
"global.money=whatever
Those menu's are still eluding me, could someone please nudge me in the right direction.
dislekcia
10-05-2010, 08:12 PM
1. How would one go about creating pop-up menus, for example, clicking on something then being presented with two or three options. Selecting the different options would have different results, like a big building, or a small building.
This can be quite tricky. Generally, I make all my interfaces modular, so if I want to move things around or have them follow the mouse, it's easy to do.
For example: Base object InterfaceObject, has a depth of -100 (or something equally "high", not "deep") in its Create event I set variables called width, height and parentElement (-1). In the Step event it tests to see if parentElement is > 0, if it is, then I set x = parentElement.x + xstart; y = parentElement.y + ystart and depth = parentElement.depth - 1. This lets me create an interface quite easily: If I want a text box with a button on it, write special objects that inherit from InterfaceElement like TextBox and Button. Then I can do stuff like this:
textBox = instance_create(10, 10, TextBox);
textBox.width = 200;
textBox.height = 80;
okButton = instance_create(70, 60, Button);
button.caption = "OK";
button.width = 50;
button.height = 15;
button.parentElement = textBox;
Thanks to the stuff happening in InterfaceElement, the button will always be at 70, 60 relative to the textbox and will always appear "above". It's quite easy to do things like write a Button object that contains all the logic for mouseovers, etc. Then put your custom click logic on sub-classed objects.
Generally anything interface related is going to take you a while and probably get a lot more complex if you don't make it modular. Trust me.
2. I have been trying to work this out for a while now, but how would one make a money system?
This is a lot easier: Just store the amount of money your player currently has in a global variable. Something like global.money would do the job... Global variables don't get reset when your game changes rooms, so the amount of money the player has would persist across the whole game.
If you wanted the amount of money to stay the same between play sessions, then you'd need to store that amount in some sort of file. Either your own format, or in GM's easy-to-use ini file system. You can read up more about file access and saving via the GM help.
-edit- Erf, took me ages to write that...
Squid
10-05-2010, 10:27 PM
stuff
Alternatively if you don't want anything fancy:
show_message_ext(str,but1,but2,but3) Displays a dialog box with the string as a message and up to three buttons. But1, but2 and but3 contain the button text. An empty string means that the button is not shown. In the texts you can use the & symbol to indicate that the next character should be used as the keyboard shortcut for this button. The function returns the number of the button pressed (0 if the user presses the Esc key).
That'll pop up a standard GM dialog with any number of buttons on it. There is also show_question(), get_string() and get_integer() depending on what you want from the player.
[EDIT]
An example on how you'd use this:
choice = show_message_ext("What size building would you like?","Tiny","Small","Medium","Big","Huuuuge");
if (choice==1){
//tiny building stuff
}
if (choice==3){
//medium building stuff
}
etc.
dislekcia
10-05-2010, 11:39 PM
Good point ;)
Shad0wstr1k3
11-05-2010, 04:19 PM
Thanks, I'll get right on it (once I've finished my revision, damn exams!)
How does one go about making this empty string, do you just leave the space blank, that's what I'm trying, but it keeps saying "incorrect number arguments"
OK, worked it out (a few days ago now) you just make a ""
Shad0wstr1k3
18-05-2010, 08:52 PM
Hey, me again. A the moment I am experiencing some issues. After a bit of testing I found the source of my issues. My code which reads
if distance_to_object(enemy1)<80
image_angle=point_direction(x,y,enemy1.x,enemy1.y)
Whichs works great, till a point. What happens, is a group of enemy1s will walk past, the turret will shoot at them untill they are out of range. Great. Then another group of enemy1s will walk past ant the turret will shoot at the first group of enemy1s again.
Any suggestions?
Squid
18-05-2010, 10:48 PM
Hey, me again. A the moment I am experiencing some issues. After a bit of testing I found the source of my issues. My code which reads
if distance_to_object(enemy1)<80
image_angle=point_direction(x,y,enemy1.x,enemy1.y)
Whichs works great, till a point. What happens, is a group of enemy1s will walk past, the turret will shoot at them untill they are out of range. Great. Then another group of enemy1s will walk past ant the turret will shoot at the first group of enemy1s again.
Any suggestions?
The problem is that "enemy1" is not referencing a specific enemy1. Try something like this:
nearest_enemy=instance_nearest(x,y,enemy1);
if distance_to_object(nearest_enemy)<80
image_angle=point_direction(x,y,nearest_enemy.x,ne arest_enemy.y);
dislekcia
18-05-2010, 11:10 PM
Hey, me again. A the moment I am experiencing some issues. After a bit of testing I found the source of my issues. My code which reads
if distance_to_object(enemy1)<80
image_angle=point_direction(x,y,enemy1.x,enemy1.y)
Whichs works great, till a point. What happens, is a group of enemy1s will walk past, the turret will shoot at them untill they are out of range. Great. Then another group of enemy1s will walk past ant the turret will shoot at the first group of enemy1s again.
Any suggestions?
You're making a classic GM mistake: Game Maker refers to object types and actual instances of an object differently, but if you try to access a variable via an object type, it'll default to selecting the first instance of that type.
So your distance_to_object call is working correctly, letting you know when an instance of that specific type is close to your turret. The problem comes in when you try to grab enemy1.x and enemy1.y, which aren't valid on an object type, so GM grabs the location of the first instance of enemy1 and gives you that. GM has no idea that you wanted the specific instance closest to that specific turret.
What you need to do to get around this is to first make sure you have a reference to the specific instance you want to target and then you'll be able to access it's specific position:
targetEnemy = instance_nearest(enemy1);
if (point_distance(x, y, targetEnemy.x, targetEnemy.y) < 80) {
image_angle = point_direction(x, y, targetEnemy.x, targetEnemy.y);
}
This will work, but probably not give you the behavior you want... Most TD-style games have turrets that pick a target when it first comes in range and then only re-target when their original target goes out of range. To do that you have to think a little differently:
Create event:
targetEnemy = -1; //This is a pointer to "nothing", GM stores pointers to instances as numbers greater than 10000
Step event:
if (targetEnemy < 0) {
//If we don't have a valid pointer to an instance, grab the nearest enemy
targetEnemy = instance_nearest(enemy1);
}
if (targetEnemy > 0) {
//If we do have a valid pointer, test to see if that target is in range
if (point_distance(x, y, targetEnemy.x, targetEnemy.y) < 80) {
//The enemy is in range, point at them
image_angle = point_direction(x, y, targetEnemy.x, targetEnemy.y);
} else {
//The enemy is out of range, kill the pointer so that we can try to get the closest next step
targetEnemy = -1;
}
}
Also, you might want to start getting into the habit of starting object types with capital letters (treat them like proper nouns) and keeping the first letter of a variable name lowercase. That way it's easy to distinguish between them:
Enemy1 is an object type, as are BossEnemy, AnnoyingEnemy and HomingEnemy.
enemy is a variable, as is omgAnotherEnemy, holyCrapMoreEnemy and thisIsProbablyTheLastEnemyEver.
Very useful habit, that.
Chippit
18-05-2010, 11:51 PM
holyCrapMoreEnemy, eh?
I need to use that somewhere...
dislekcia
19-05-2010, 01:13 AM
holyCrapMoreEnemy, eh?
I need to use that somewhere...
fansOfDescriptiveVariableNames++;
Shad0wstr1k3
19-05-2010, 06:07 PM
OK, thanks, will try to get into that habit. Will add this all in when I have a free moment!
Thanks for all the help guys, the game would have still been in the incubater, or on paper were it not for the help.
Chippit
19-05-2010, 06:42 PM
fansOfDescriptiveVariableNames++;
It's not hard to be when you've encountered people whose naming habits go something like:
Pick random letter.
If that letter is used somewhere already
Append it with another letter or number.
Squid
19-05-2010, 09:37 PM
It's not hard to be when you've encountered people whose naming habits go something like:
Pick random letter.
If that letter is used somewhere already
Append it with another letter or number.
I'm quite fond of giving variables human names myself.
Chippit
19-05-2010, 10:46 PM
You mean, like... Bob?
SkinkLizzard
20-05-2010, 03:13 PM
littletimmy = Bob + Lilith;
if littletimmy>=21
{
another_place = new house;
move_out(another_place);
littletimmy = 0
}
could make for interesting code...
Shad0wstr1k3
20-05-2010, 07:34 PM
Hi, sorry to bug all with this stupid question, but I'm haveing a little trouble getting dislekcia's code to work. I'm not sure what I'm doing wrong, so if someone could help me out with a "code for noobs" it would be a huge help
dislekcia
20-05-2010, 08:58 PM
Hi, sorry to bug all with this stupid question, but I'm haveing a little trouble getting dislekcia's code to work. I'm not sure what I'm doing wrong, so if someone could help me out with a "code for noobs" it would be a huge help
It would help if you explained what type of errors or odd behaviors you're getting ;)
Also, you do realise that the code I wrote is split over two different events, right?
Shad0wstr1k3
20-05-2010, 09:11 PM
Yeah, I got that much. I'll try post some pictures, and a detailed description of whats going on, unfortunately exams start next week so I don't have too much spare time
CiNiMoDZA
02-06-2010, 06:41 PM
So Im starting work on a co-op network game, Ive got the framework and everything down, kinda, I just need to sort out timing issues! Does anyone know of some good articles that I can read up on?
@Dislekia: Your Monochrome networking is awesome, how did you manage that??
dislekcia
02-06-2010, 11:33 PM
So Im starting work on a co-op network game, Ive got the framework and everything down, kinda, I just need to sort out timing issues! Does anyone know of some good articles that I can read up on?
@Dislekia: Your Monochrome networking is awesome, how did you manage that??
Are you using the GM networking framework that I made for Monochrome? I think I sent that down to the Durban devlans a while back... If not, I can swing it your way :)
In terms of how I did it, I learned the hard way. Tried to make a networked space combat team game and it was horrid. Lag, rubberbanding, framerate differences made moves repeat or missiles switch owners... Yeah, it sucked. So I sat down and did a lot of reading on how the networking in Unreal Tournament worked and what people did to get Blizzard's games stable over networks and came up with a workable solution in GM. Everyone seems to think that the important part is getting packets flowing between machines, but that's trivial. What you send, when and how you get that info the right GM objects is the hard part.
CiNiMoDZA
03-06-2010, 01:15 PM
I wasnt at the devLans back then! It would be awesome if you could send the framework :D
Ja, I have the same problem with attacks happening twice etc. I want to start on creating the pre-game lobby and joining a game so long, do I need to implement your framework from the beginning or is it ok to do this stuff so long?
dislekcia
03-06-2010, 02:51 PM
I wasnt at the devLans back then! It would be awesome if you could send the framework :D
Here you go. (http://www.gamedotdev.co.za/files/GM_Networking_Framework.zip)
Ja, I have the same problem with attacks happening twice etc. I want to start on creating the pre-game lobby and joining a game so long, do I need to implement your framework from the beginning or is it ok to do this stuff so long?
If you're going to use the framework, it's probably best to go through it and see how it works. Monochrome had a drop-in joining system with a couple of seconds maximum sync time before the entire world state was guaranteed to be received. You could quite easily create a lobby system in the framework with a bit of tweaking.
CiNiMoDZA
03-06-2010, 03:50 PM
Awesome, thanks. You dont happen to have a readme or tutorial on it do you :P
Fengol
12-06-2010, 10:10 AM
I have a couple of small updates to dislekcia's Networking Framework which I must share and upload.
I can vouch for the framework. I've used it in War Machine (http://www.nag.co.za/forums/showthread.php?t=12813) and in Froccer (http://www.nag.co.za/forums/showthread.php?t=3098) (download busted :( )
Squid
27-06-2010, 07:02 PM
Right, so I've built a level editor for a game. In the editor you place tiles for graphics (using tile_add()).
What would be the best way to store these tiles so they can be loaded at a later stage?
At the moment, I'm saving information about the tiles in a grid and then writing that to a file. Unfortunately this method takes too long to load the tiles back in.
Ideas?
dislekcia
27-06-2010, 07:38 PM
Right, so I've built a level editor for a game. In the editor you place tiles for graphics (using tile_add()).
What would be the best way to store these tiles so they can be loaded at a later stage?
At the moment, I'm saving information about the tiles in a grid and then writing that to a file. Unfortunately this method takes too long to load the tiles back in.
Ideas?
That sounds pretty much like exactly what you need to do: Store info about the individual tiles in a file so you can read that back and recreate. I think the slowdown is probably coming in via implementation rather than overall logic... What sort of slowdown are you getting and how are you writing things to/from a file?
Personally, I'd assign an int identifier to each tile type, write the version number, width and height of the map to a file and then just write out the tiles' ints, from left to right and then top to bottom by row. That way you know that you need to do three real reads and then you can calculate how many ints you're expecting... Binary file access in GM is pretty fast, nowhere near as slow as ini files, so unless you're storing hordes of data, I have no idea what the slowdown might be.
It could be that adding tiles like that is slow in GM itself and that's the cause of your slowdown, maybe you should look at using your own data-structure?
Shad0wstr1k3
27-06-2010, 07:52 PM
Sorry to interrupt, but I have a problem of my own. The general idea of my game is an object moving from one side of the screen to the other. But between it and its goal are seemingly insermountable obstacles. The player must help the object by using object (eg, blocks to make a bridge across a gaping chasm). At the top of the screen is a bar (which I created using a draw event). On this bar are the various objects that the player can use to help. There are three versions of each object. The one that is located on the bar, that you select, the semi-transparent mold, that hovers by the mouse and is used to create the final, solid version. The final version can only be placed in areas where no solid objects are present.
The problem is, that the player can place the object on the bar, and on the "selectable" objects! Is there any way to fix this (other than covering the bar with invivible solid objects, and marking the "selectables" solid)
Squid
27-06-2010, 08:07 PM
stuff
Thanks for the help.
At the moment, each time I place a tile, I save a string in a grid. The string contains the size, tileset name and the coordinates of that tile in the set. eg. "32,thebigpinktileset,3,2".
Then I use ds_grid_write() and ds_grid_read() to save and load the grid respectively.
Then I loop through the grid, do some string handling and add the tiles.
I think the adding of the tiles is quite fast. So my thinking is now to have hashtable of some sort linking tile information to an int identifier. Thus meaning I'll only need to store ints in my grid.
I am a genius.
dislekcia
27-06-2010, 11:11 PM
Sorry to interrupt, but I have a problem of my own. The general idea of my game is an object moving from one side of the screen to the other. But between it and its goal are seemingly insermountable obstacles. The player must help the object by using object (eg, blocks to make a bridge across a gaping chasm). At the top of the screen is a bar (which I created using a draw event). On this bar are the various objects that the player can use to help. There are three versions of each object. The one that is located on the bar, that you select, the semi-transparent mold, that hovers by the mouse and is used to create the final, solid version. The final version can only be placed in areas where no solid objects are present.
The problem is, that the player can place the object on the bar, and on the "selectable" objects! Is there any way to fix this (other than covering the bar with invivible solid objects, and marking the "selectables" solid)
In your display code for the "ghost" objects and in the code when you click to place a solid object, just check to make sure that the mouse position is a certain distance from the top of the screen:
if (mouse_y > heightOfBar) //if your view doesn't move around the room
if (mouse_y - room_xview[0] > heightOfBar) //if you're using views that move around the screen
Or you could use different views to create a normal part of the screen and an "interface" view.
Thanks for the help.
At the moment, each time I place a tile, I save a string in a grid. The string contains the size, tileset name and the coordinates of that tile in the set. eg. "32,thebigpinktileset,3,2".
Then I use ds_grid_write() and ds_grid_read() to save and load the grid respectively.
Then I loop through the grid, do some string handling and add the tiles.
I think the adding of the tiles is quite fast. So my thinking is now to have hashtable of some sort linking tile information to an int identifier. Thus meaning I'll only need to store ints in my grid.
I am a genius.
It's probably the string handling that was slow. Why do you need all that info to be in a different format? Surely you could just load all available tilesets and have them be described by objects that know the tileset's size and number of tiles, etc?
Your map file would then logically look something like:
v1.04
Load tileset "OMGitsAtileset" as 1
Load tileset "HolyCrapAnotherTileset" as 2
map width blah
map height yak
<numbers> as mentioned above
Those numbers would then be = tileset number * 1000 + tile number. Super easy to decompose and then grab the tileset info from that.
Chippit
27-06-2010, 11:45 PM
I believe I did something like what dis described for Ultimate Quest 2 as well. But my tiles were built from multiple layers and there was fancy stuff with bitmasks and then complicated **** started happening and I don't even know what's in there anymore.
Good thing I documented all those file formats, actually. Next time I think I just use something human readable like xml, though.
Of course, this was all before someone decided to change their mind about everything. Again. >_>
Now it's even MORE complicated! In an awesome kind of way, though, involving zip files and embedded content and **** I don't even know how I thought of.
...
I'm ****ing crazy, somebody stop me please.
dislekcia
28-06-2010, 01:24 AM
Now it's even MORE complicated! In an awesome kind of way, though, involving zip files and embedded content and **** I don't even know how I thought of.
...
I'm ****ing crazy, somebody stop me please.
I swear I'm going to parachute onto your house and steal your computer while you sleep.
When do we get to seeeeeee?
Chippit
28-06-2010, 10:28 AM
Well it's kinda a bit on hold right now <_<
Not my fault! Blame a certain someone offering me money.
Shad0wstr1k3
29-06-2010, 07:39 PM
I've seem to have run into another problem. As I mentioned before, the main point of my game is helping an orb across the room to the other side. The issue I'm having at the moment is with the collisions. In the create event, I make the orb move left, at a speed of 2. I set it up using drag and drop, it just seemed easier for such a simple task. The problem is, when it collides with a solid object(eg wall), it gets stuck, even when falling! This is the code I am using for landing
if vspeed > 0 && !place_free(x,y+vspeed)
move_contact(270)
vspeed = 0
The problem may be that is never stops moving left, but either way, I can't seem to come up with a solution. Any help will be greatly aprechiated, and cake will be dispenced to your house or other dwelling immediatly
dislekcia
30-06-2010, 03:06 AM
I've seem to have run into another problem. As I mentioned before, the main point of my game is helping an orb across the room to the other side. The issue I'm having at the moment is with the collisions. In the create event, I make the orb move left, at a speed of 2. I set it up using drag and drop, it just seemed easier for such a simple task. The problem is, when it collides with a solid object(eg wall), it gets stuck, even when falling! This is the code I am using for landing
if vspeed > 0 && !place_free(x,y+vspeed)
move_contact(270)
vspeed = 0
The problem may be that is never stops moving left, but either way, I can't seem to come up with a solution. Any help will be greatly aprechiated, and cake will be dispenced to your house or other dwelling immediatly
Yes, your problem is caused by constantly moving left. In a nutshell, you're telling a ball that's 2 pixels to the right (*inside* a solid object) to test if it can move down. It can't. Because it's already 2 pixels in collision. Then at the end of the frame it'll get its move undone by GM because it's inside a solid object. So it looks like it hovers, except that it really isn't: You're telling it to move to a contact position when it's already in one.
What you need to do is test to see if the orb can move right (using place_free), then move it right if it can without colliding with something. Then you need to test to see if it can move down and only move it down if it can. You can add in a velocity and acceleration on the downward movement if you want to.
VGrunn
04-07-2010, 11:55 AM
Pardon me if this is the wrong thread for this question, I'm very new here.
I was wondering, though. Have any 'professional' indie games ever been made/released with Game Maker Pro? I mean something that ended up being sold as a full game, like on Steam or such.
dislekcia
04-07-2010, 09:39 PM
Pardon me if this is the wrong thread for this question, I'm very new here.
I was wondering, though. Have any 'professional' indie games ever been made/released with Game Maker Pro? I mean something that ended up being sold as a full game, like on Steam or such.
Not so much on Steam and right now, but a few years ago there were quite a number of games being sold by indies that were made in GM. The most recent critical success would probably be Spelunky.
I don't really understand the question though, it's not always asked honestly. Either people actually mean "Is GM 'good enough' to make polished games in?" (to which the answer is yes, if you can't polish a game that's not your tool's fault) or they're asking what they "should be learning" to maximise their potentially epic game development amazingness.
The simple answer is this: You can make games in anything. You can make games out of toast and ballbearings (seriously, you could). The trick is to actually finish a game so that other people can play it, once people are playing something nobody cares what it was made in. The only times the tools used to build something matter are:
1. When a game absolutely must run on a particular platform, you take the capabilities of all the tools available that can output to that platform into account. You wouldn't want to work in Cocoa for Xbox development, that would be stupid. (Although probably possible) Or if you need to make a web-game, Flash is going to be high on the list of possible tools.
2. Aspiring game developers with no real experience decide that a particular tool/system/API is "cool" for arbitrary reasons and then use their decision to badmouth people that are actually making games. This badmouthing is so ego fulfilling that they never end up producing anything playable themselves.
Neither of those scenarios matter to players...
So, would I personally try to sell a GM game on Steam? Yeah. Probably. If it was polished and awesome and I only wanted it to run on Windows PCs, sure. I'd have to package SteamWorks access via a DLL for GM to poke at as needed for high scores and friends list stuff, but it's totally doable.
Am I making a GM game to sell on Steam right now? Sorta. DD's prototype is in GM. We're writing it in Unity from the ground up because we want to put it on Mac and iPhone as well as PC via Steam. Unity's great for that, plus we get to hit Android too. Plus with the experience gained from building the game once already, we can create a really awesome system to support the kinds of interactions we want the game to be good at, while making it easier to create more content the second time around. What have we done with the GM version? Well, besides find a market, grow demand, get press and refine the fun in the game idea, we're also submitting a "lowly" GM game to places like Steam and PAX to pave the way for the final game. GM rocks :)
Does this answer your question?
VGrunn
05-07-2010, 12:38 AM
dislekcia,
The main reason I asked was because I was curious if people with the dedication to create, polish, and finish a game ever stuck with GMP to their game's completion. Since really, if someone is that dedicated, unless they're tremendously stubborn, I suspect they'll find "what works best". That's all.
For what it's worth, I bought GMP a year or two ago, and while I've only dabbled in it, I've absolutely loved it. The community support is great, and for the sort of games I've always been interested in (Graphically simple, 8/16-bit style graphics, with great depth of gameplay) it seemed perfect. But I figure, I'm just starting out, so why not ask.
Thanks for the very complete reply though, and good luck with the titles you're working on. I actually stopped learning GMP to try and learn XCode (I figured, if I'm going to make games like the one I mentioned, I may as well try for what seems like an appropriate and most promising platform) but that's ferociously difficult for me. I've heard of but not looked into Unity, but I think I'm going to start in on GMP again. It's just great, and it caters to people in my situation too in ways.
Hopefully that was not a thread derail - just wanted to explain myself after that reply. Back to the learning for me!
dislekcia
05-07-2010, 05:27 AM
GM can work pretty well. The real trick is not actually the game you're trying to polish and finish, it's the loads of games prototypes/tests/playables/concepts that you've made before you start the game you want to polish. Those are where the real learning happens.
For those, GM is the best tool I've ever seen.
Shad0wstr1k3
23-07-2010, 03:30 PM
Well, I'm afraid I've got some more problems...
You are a blue blob, holding off unlimited hordes of green blobs. At the moment, your only tools are a pistol, and a machinegun. But there is where the problem lies. The pistol works fine, untill you swap to the machine gun. The machinegun fires multiple bullets at once, instead of just one at a time, then when you swap back to the pistol, it too fires multiple bullets. The amount of multiple bullets fired varies, but it is not something I want to happen.
I use the variable can_shoot in each one of the guns (seperate objects) to determine when they , can shoot. Once space is pressed the bullet is created, can_shoot set to 0 and an alarm set. In the alarm event, can_shoot is set to 1. This is the same for both guns. When you swap weapons (by pressing 1 or 3) the next weapon is created and the old one destroyed. Ammo (global.pistolammo and global.machineammo) are stored in a special controller object, the the constant destruction and creation of guns should not affect it.
Any help would be aprechiated.
Shad0wstr1k3
24-07-2010, 12:06 PM
Okay, I've sorted it out, the problem was that multiple instances of each gun were being created. Now, whenever a gun is created, all the others, and any of the same type are destroyed
Shad0wstr1k3
24-07-2010, 10:10 PM
Sorry about this, but I have a really basic question
How does make something up to chance. I know how to do this in drag and drop (test chance, the one with a picture of a dice), but not in code, I have been trying to work it out for the best part of 30 minutes, please help
Thanks
dislekcia
25-07-2010, 04:33 AM
Sorry about this, but I have a really basic question
How does make something up to chance. I know how to do this in drag and drop (test chance, the one with a picture of a dice), but not in code, I have been trying to work it out for the best part of 30 minutes, please help
Thanks
If you have a choice between two options for a variable, say a coin toss, you can just use the choose() command, which will pick 1 of it's parameters:
toss = choose(heads, tails);
You can even weight it by adding multiples of a certain option: choose(heads, heads, tails) is twice as likely to give you heads as tails.
Or if you need less cut and dried options, you can just use the random command and see if the result is less than some threshold value:
if (random(100) < 28) {
//Do stuff
}
That would give you roughly a 28% chance of something occurring. I prefer using probabilities between 0 and 1, but out of a 100 is probably easier to relate to things like percentages.
Squid
25-07-2010, 06:54 PM
If you have a choice between two options for a variable, say a coin toss, you can just use the choose() command, which will pick 1 of it's parameters:
toss = choose(heads, tails);
It's worth noting that choose() works with more than just two options. Eg.
vegetable = choose("lemons,"cake","panda","vitamin e","triangle","steve");
Shad0wstr1k3
25-07-2010, 08:12 PM
Well this is the code I'm using:
choice=show_message_ext("Do you wish to enter the Pac-Launcher Lotto? (250)","Yes","No","")
if (choice==1) &&global.money>=250{
global.money-=250
if (random(100)<1)
global.gotpaclauncher=1
instance_deactivate_object(obj_pistol)
instance_deactivate_object(obj_machinegun)
instance_deactivate_object(obj_shotgun)
instance_deactivate_object(obj_rocketlauncher)
instance_deactivate_object(obj_paclauncher)
instance_create(self.x,self.y,obj_paclauncher)
}
else
if (choice==!2)
show_message("Not enough money")
The problem is that you always get the Pac-Launcher, and it never displays the "Not enough money" message. Any suggestions, thanks
dislekcia
25-07-2010, 08:55 PM
Well this is the code I'm using:
choice=show_message_ext("Do you wish to enter the Pac-Launcher Lotto? (250)","Yes","No","")
if (choice==1) &&global.money>=250{
global.money-=250
if (random(100)<1)
global.gotpaclauncher=1
instance_deactivate_object(obj_pistol)
instance_deactivate_object(obj_machinegun)
instance_deactivate_object(obj_shotgun)
instance_deactivate_object(obj_rocketlauncher)
instance_deactivate_object(obj_paclauncher)
instance_create(self.x,self.y,obj_paclauncher)
}
else
if (choice==!2)
show_message("Not enough money")
The problem is that you always get the Pac-Launcher, and it never displays the "Not enough money" message. Any suggestions, thanks
Your problem is poor logic flow and scope. Your random(100) < 1 if statement only deals with the global.gotpacklauncher=1 line. Your else if segment says "if choice is equal to (not 2)" "not 2" is 0. You want to use != 2 which means "not equal to 2".
It always helps to properly indent and scope your code so that you know which if statements govern which blocks of logic. Even if you're Squid...
choice=show_message_ext("Do you wish to enter the Pac-Launcher Lotto? (250)","Yes","No","")
if (choice == 1) {
if (global.money >= 250) {
//Do we have enough money?
global.money-=250
if (random(100)<1) {
//1% chance of happening...
global.gotpaclauncher=1
instance_deactivate_object(obj_pistol)
instance_deactivate_object(obj_machinegun)
instance_deactivate_object(obj_shotgun)
instance_deactivate_object(obj_rocketlauncher)
instance_deactivate_object(obj_paclauncher)
instance_create(self.x,self.y,obj_paclauncher)
}
} else {
//Not enough money
show_message("Not enough money")
}
}
Squid
26-07-2010, 12:27 PM
Even if you're Squid...
I wrote a formatter (http://www.box.net/shared/76a6egzs7u)a while ago, seems it may be useful to someone other than me.
dislekcia
26-07-2010, 01:03 PM
I wrote a formatter (http://www.box.net/shared/76a6egzs7u)a while ago, seems it may be useful to someone other than me.
So you're saying you'd write code, lob it through your own formatter and then look at it again to realise where the logic errors were?
That's... bizarre.
Squid
26-07-2010, 03:16 PM
I only use it when things get a little out of hand.
Shad0wstr1k3
28-07-2010, 04:59 PM
Sorry to bug you all again, but more troubles I'm afraid. Bet you were all looking foreward to some peace and quiet. On the bright side my code is looking much better!
I am having some problems with the choose variable. This is my code:
choice=show_message_ext("Would you like to buy some ammo? (100)", "Yes","No","")
if (choice==1){
if global.money>=100{
global.money-=100
type=choose(pistol,shotgun,machinegun,rocket,pac){
if (type==1){
instance_create(mouse_x,mouse_y,pammocrate)}
if (type==2){
instance_create(mouse_x,mouse_y,sammocrate)}
if (type==3){
instance_create(mouse_x,mouse_y,mammocrate)}
if (type==4){
instance_create(mouse_x,mouse_y,rammocrate)}
if (type==5){
instance_create(mouse_x,mouse_y,obj_pacammo)}
}
}else{
show_message("Not enough money")
}
}
Any help all suggestions would be a great help, thanks. I owe you guys big-time.
Shad0wstr1k3
28-07-2010, 05:00 PM
Sorry to bug you all again, but more troubles I'm afraid. Bet you were all looking foreward to some peace and quiet. On the bright side my code is looking much better!
I am having some problems with the choose variable. This is my code:
choice=show_message_ext("Would you like to buy some ammo? (100)", "Yes","No","")
if (choice==1){
if global.money>=100{
global.money-=100
type=choose(pistol,shotgun,machinegun,rocket,pac){
if (type==1){
instance_create(mouse_x,mouse_y,pammocrate)}
if (type==2){
instance_create(mouse_x,mouse_y,sammocrate)}
if (type==3){
instance_create(mouse_x,mouse_y,mammocrate)}
if (type==4){
instance_create(mouse_x,mouse_y,rammocrate)}
if (type==5){
instance_create(mouse_x,mouse_y,obj_pacammo)}
}
}else{
show_message("Not enough money")
}
}
Any help all suggestions would be a great help, thanks. I owe you guys big-time.
Edit:Damn, it undid all my indenting when I pasted!
Edit2: Sorry, I seem to have accidentilly quoted myself, won't happen again.
Fengol
28-07-2010, 05:18 PM
Are pistol, shotgun, machinegun, rocket and pac variable or strings? If they're strings, they're missing their quotes and you should be comparing string in your if statements. If they're variables you should be reusing the variables in your if statements.
Shad0wstr1k3
28-07-2010, 05:28 PM
I did this
choice=show_message_ext("Would you like to buy some ammo? (100)", "Yes","No","")
if (choice==1){
if global.money>=100{
global.money-=100
type=choose("pistol","shotgun","machinegun","rocket","pac"){
if ("pistol"==1){
instance_create(mouse_x,mouse_y,pammocrate)}
if ("shotgun"==1){
instance_create(mouse_x,mouse_y,sammocrate)}
if ("machinegun"==1){
instance_create(mouse_x,mouse_y,mammocrate)}
if ("rocket"==1){
instance_create(mouse_x,mouse_y,rammocrate)}
if ("pac"==1){
instance_create(mouse_x,mouse_y,obj_pacammo)}
}
}else{
show_message("Not enough money")
}
}
And Game Maker said "cannot compare arguements" at if("pistol"==1)
Fengol
28-07-2010, 05:41 PM
no man!
if (type == "pistol")
why would "pistol" = 1 ?
Shad0wstr1k3
28-07-2010, 06:05 PM
Oh, right, *Facepalm*
Thanks
roosterillusion
01-08-2010, 02:00 PM
Hi. I've just started using game maker. I'm currently making a replica of TRON lightcycles and I would like to add scoring to the game. Do I need to create new objects to add scoring or do I simply add scoring to the lightcycles object? I'm not sure exactly how the scoring would work. I suppose if you hit the sides, obstacles etc then the other player wins and gets a point. If the player gets boxed in then the other player gets a point. What methods in gm would I use to capture these conditions?
dislekcia
01-08-2010, 10:22 PM
Hi. I've just started using game maker. I'm currently making a replica of TRON lightcycles and I would like to add scoring to the game. Do I need to create new objects to add scoring or do I simply add scoring to the lightcycles object? I'm not sure exactly how the scoring would work. I suppose if you hit the sides, obstacles etc then the other player wins and gets a point. If the player gets boxed in then the other player gets a point. What methods in gm would I use to capture these conditions?
That depends entirely on the way that the game is structured.
The questions you need to answer are: Where are you going to store the score value? Is there already an object in the game that is persistent across play sessions? Something else you need to consider is where the game decides that a player has died (which would be an obvious place to insert score conditionals) and how you're going to make the game restart after one of the player objects is destroyed.
There are literally hundreds of ways to add more functionality to the barebones game from the prac, none of them are "the right way", if you feel you need to add more objects, then add more objects - but you need to know what you plan to DO with those and how they're going interact with the rest of the game.
kolle_hond
12-08-2010, 02:06 PM
I'm creating a game with no buttons just for the fun of it(not planning to enter the comp) but I've run into a few problems...
1) I need to change the sprite according to the direction I'm traveling. I've tried working out how to do it but the maths don't seem to work as some of the instances overlap. I need it to check which speed is faster(horisontal or vertical) in either direction and then change the sprite to up, down, left or right. I think I need a function to change the speed to a positive number but if there is a quicker way it would also be appreciated.
2) I need to display the score on a message that don't require the pressing of buttons. I am thinking of doing it manually but I'm sure there is an easier way to just display it on the screen (Draw score isn't working for displaying inside the room).
dislekcia
12-08-2010, 04:04 PM
I'm creating a game with no buttons just for the fun of it(not planning to enter the comp) but I've run into a few problems...
1) I need to change the sprite according to the direction I'm traveling. I've tried working out how to do it but the maths don't seem to work as some of the instances overlap. I need it to check which speed is faster(horisontal or vertical) in either direction and then change the sprite to up, down, left or right. I think I need a function to change the speed to a positive number but if there is a quicker way it would also be appreciated.
Read up on the abs() function in GM. Returns the absolute value of a number...
Any particular reason why you're not using the direction variable and testing to see which diagonals it's between? 0-45 & 315-360, 45-135, 135-225, 225-315...
2) I need to display the score on a message that don't require the pressing of buttons. I am thinking of doing it manually but I'm sure there is an easier way to just display it on the screen (Draw score isn't working for displaying inside the room).
Draw score probably isn't working because you're not doing it during a draw event. Any custom drawing you want to do has to be in a draw event... As such, if you were to draw the value of your own score variable (whatever it might be) using draw_text(), you'd need to put that in an object's draw event.
kolle_hond
13-08-2010, 08:20 AM
Read up on the abs() function in GM. Returns the absolute value of a number...
Any particular reason why you're not using the direction variable and testing to see which diagonals it's between? 0-45 & 315-360, 45-135, 135-225, 225-315...
Didn't know about that thanks, I fixed it using the sqr() function.
Draw score probably isn't working because you're not doing it during a draw event. Any custom drawing you want to do has to be in a draw event... As such, if you were to draw the value of your own score variable (whatever it might be) using draw_text(), you'd need to put that in an object's draw event.
Ok, I'll try to figure it out thanks.
Shad0wstr1k3
15-08-2010, 08:35 PM
Hey, does anyone know how to decrease the size (in MB) of a game? I've been working on a game for a while, and now the size of the executible is way out of proportion for the content (26.2 MB). I realize I could use Winrar, but it is still really big.
The game is 36 objects, 4 rooms (two of which are menu's), 2 fonts, 5 backgrounds, 6 sound effects, 1 background music and 40 sprites.
Any suggestions, I don't really want the download to be this huge!
Thanks
dislekcia
15-08-2010, 11:20 PM
Hey, does anyone know how to decrease the size (in MB) of a game? I've been working on a game for a while, and now the size of the executible is way out of proportion for the content (26.2 MB). I realize I could use Winrar, but it is still really big.
The game is 36 objects, 4 rooms (two of which are menu's), 2 fonts, 5 backgrounds, 6 sound effects, 1 background music and 40 sprites.
Any suggestions, I don't really want the download to be this huge!
Thanks
Sounds, music and large images are always going to be large in a game. GM may not store that data as efficiently as specific file formats might, so your best bet is to load those resources externally when the game's running instead of having them all be included from the word go.
Apart from that there's really not that much you can do to change GM's file-size other than use MP3 over WAV as much as possible...
Shad0wstr1k3
16-08-2010, 05:23 PM
Yeah, the background music was 22 MB
I've gotten rid of it now, so everything's back to normal. Thanks.
Shad0wstr1k3
17-08-2010, 08:37 PM
This can be quite tricky. Generally, I make all my interfaces modular, so if I want to move things around or have them follow the mouse, it's easy to do.
For example: Base object InterfaceObject, has a depth of -100 (or something equally "high", not "deep") in its Create event I set variables called width, height and parentElement (-1). In the Step event it tests to see if parentElement is > 0, if it is, then I set x = parentElement.x + xstart; y = parentElement.y + ystart and depth = parentElement.depth - 1. This lets me create an interface quite easily: If I want a text box with a button on it, write special objects that inherit from InterfaceElement like TextBox and Button. Then I can do stuff like this:
textBox = instance_create(10, 10, TextBox);
textBox.width = 200;
textBox.height = 80;
okButton = instance_create(70, 60, Button);
button.caption = "OK";
button.width = 50;
button.height = 15;
button.parentElement = textBox;
Thanks to the stuff happening in InterfaceElement, the button will always be at 70, 60 relative to the textbox and will always appear "above". It's quite easy to do things like write a Button object that contains all the logic for mouseovers, etc. Then put your custom click logic on sub-classed objects.
Generally anything interface related is going to take you a while and probably get a lot more complex if you don't make it modular. Trust me.
Hey, sorry to be that annoying guy who asks all the stupid questions, but alas I need help once more. A while back, I asked for help with pop-up menus, Dislekcia gave me this, but Squid gave me a really simple solution, so I used that. Now I am trying to use this, but to my eternal shame, I don't know what's going on here.
Could you please explain the first bit a bit more, that's one bit that has be really confused.
Also, are Button and TextBox objects, or drawn images?
Sorry to bug everyone with this, and thanks in advance!
SkinkLizzard
17-08-2010, 09:31 PM
ok well in dislekcia's example thing InterfaceObject, TextBox, Button are objects.
TextBox and Button have their parent set to InterfaceObject.
in the create event of InterfaceObject a few variables that define the size and layer of the interface element are set to default values:
width and height can be set to anything
parentElement is set to -1 (to indicate that it doesn't have a container it belongs to)
in the step event of InterfaceObject we check to see if the interface element has a parent element(or container i.e. parentElement > 0)
if it does have a container we tell our interface element to stick to its container by moving it if the container has moved.
x = parentElement.x + xstart
y = parentElement.y + ystart
we also make sure that our interface element is on top of its container and not hidden behind it
by reducing its depth(increase its height)
depth = parentElement.depth-1
this sets up a basic interface element frame work
all interface elements use these basics.
to make the text box with a button we use the objects TextBox and Button which will inherit the
abilities of InterfaceObject
textBox = instance_create(10,10,TextBox)
textBox.width = 200
textBox.height = 80
// this is our container for the button, but will have some extra code over and above the inherited code
// from InterfaceObject, code to draw text specifically.
okButton = instance_create(70,60,Button)
okButton.width = 50
okButton.height = 15
okButton.caption = "OK"
okButton.parentElement = textBox // tell the button that its container is the textbox we created earlier
// the Button object like TextBox will have code other than that inherited from InterfaceObject this code
// will do things like draw the button and its caption and handle stuff like mouse over and clicking
// the inherited code will take care of keeping the button in place on the text box.
to be honest I have no idea if this is in any way a better explanation of what dis said
but I hope it helps all the same.
Shad0wstr1k3
18-08-2010, 05:11 PM
Thanks, that did help.
One last thing (for real this time) how do you make it, so that when the mouse move over an object a text box is formed displaying info about that object?
e.g. Mouse moves over airstrike button
Message: Airstrike, Cost 2000
Rain misery and death
opon thy foes
Thanks again, I've been struggling with that for a while now, but nothing yields results.
SkinkLizzard
19-08-2010, 11:52 AM
well I'm not sure what the easiest method would be, what I normally do is make a mouseCaption object that follows the mouse and displays captions, and a Captionable object that is used as the parent for anything that needs a mouse over caption.
in the mouseCaption object I would use point_collision to check if there's a Captionable object under the mouse, if there is you display the Captionable objects caption text.
<Captionable>
<create event>
captiontext = ''
<mouseCaption>
<create event>
undermouse = -1;
<step event>
undermouse = point_collision(mouse_x,mouse_y,Captionable,1,1)
<draw event>
if (undermouse>0)&(undermouse.caption!='')
draw_text(mouse_x+50,mouse_y+10,undermouse.caption text)
Shad0wstr1k3
20-08-2010, 11:10 AM
Thanks, just one problem though, I doesn't seem to work!
It says:
ERROR in
action number 1
of Draw Event
for object mouseCaption:
Error in code at line 1:
if (undermouse>0)&&(undermouse.caption!='')
^
at position 32: Unknown variable caption
It might have something to do that the object that gets a caption, isn't always present in the game world, only when you bring up the shop menu. Making the variable global wouldn't help. Must I only create object mouseCaption when the shop is created?
SkinkLizzard
20-08-2010, 05:39 PM
ah yea sorry just change it to
if (undermouse>0)
if undermouse.caption!=''
{
//do stuff
}
this way it'll only check for a caption if your over a captionable object
Shad0wstr1k3
20-08-2010, 11:50 PM
Thanks again. Got it working now, just how do I get it to work for multiple captionable objects? Like BuyPistolAmmo, and BuyShotgunAmmo. I added them in that order, and It only displays a caption for BuyShotgunAmmo?
Also Dislekcia, you are right about modular menus, they are so easy to make and tweak!
SkinkLizzard
21-08-2010, 11:24 AM
BuyPistolAmmo and BuyShotgunAmmo need to have captionableObject(or whatever you called it) as a parent
the easiest thing to do would be to make your interfaceObject have captionable as a parent so that all interface elements could potentially have a caption.
BaldursGate Fan
07-10-2010, 02:36 PM
Can anyone please post a manual for UDK. all I can do so far is place floors!
dislekcia
07-10-2010, 03:15 PM
Can anyone please post a manual for UDK. all I can do so far is place floors!
Epic's Unreal Developer Network (http://udn.epicgames.com/Three/DevelopmentKitHome.html) has a whole section dedicated to the UDK :)
Do you mean placing floors in UnrealEd or cia code?
BaldursGate Fan
08-10-2010, 07:56 PM
through UnrealEd. But thank you this will help a lot.
dislekcia
08-10-2010, 09:43 PM
through UnrealEd. But thank you this will help a lot.
You do know that with UnrealEd you're carving, not building, right? It's a subtractive system... At least, it used to be.
GeometriX
08-10-2010, 09:57 PM
Not UE3. You have the option of creating either an additive or subtractive world.
dislekcia
08-10-2010, 10:18 PM
Not UE3. You have the option of creating either an additive or subtractive world.
Aww, subtractive was so much cooler :(
Chippit
09-10-2010, 12:05 PM
Aww, subtractive was so much cooler :(
Phoreals. No leaks, and none of the problems that Hammer has.
mcarocker
08-11-2010, 02:42 AM
I'm trying to make a megaman game but I don't know how to make the rooms like in EXE and starforce. I have the sprite sheet for the rooms bt idk how to use them. Can anyone help?
example of room:
http://www.sprites-inc.co.uk/files/Ryuusei/Ryuusei2/Maps/RealWorld/EchoRidge/BudsRoom.png
dislekcia
08-11-2010, 10:50 AM
I'm trying to make a megaman game but I don't know how to make the rooms like in EXE and starforce. I have the sprite sheet for the rooms bt idk how to use them. Can anyone help?
example of room:
http://www.sprites-inc.co.uk/files/Ryuusei/Ryuusei2/Maps/RealWorld/EchoRidge/BudsRoom.png
You'd have to either slice up the sprite sheet into separate sprites or, if they're equally spaced, use them as tiles in GM. (Read up on tiles, they should work quite nicely for you) Then, once you've got the images placeable, you'd have to manually layer them one over the other to create the graphical effects you're looking for. Finally, if you want to have a character navigate around the room, you're going to need to place down invisible objects that dictate where the character will be able to walk... Depending on how the movement is supposed to work, you're either going to need to use sprite masks (free movement) or an array of possible locations (grid movement).
Shout if any of the above needs clarification.
moonblade
20-03-2011, 10:34 AM
Is it possible to create browsergames in game maker?
If yes, is there somewhere i can find tutorials to this?
M.
You can play games online on http://gmarcade.com/home/, if you read on their forums (http://gmarcade.com/joomla/index.php?option=com_fireboard&Itemid=29&func=view&id=647&catid=24) they explain their system and how to submit, etc.
Another XNA question (I can never remember if there is a thread, but)...
I had the problem previously, and need to try find a way to fix it, there is a graphical glitch in XNA in 2 directions (or a line if you prefer), I fiddled with cullmodes and other settings and have yet to find a solution:
http://i51.tinypic.com/2vb0ydh.png
Secondly, how would you recommend I sort the draw order of my vertices for the drawuserindexedprimitives method? Currently if you face the direction that is opposite to the draw order (ie. further things drawn later, rather than the nearest things drawn later) you see the further away terrain data.
Here is to code currently:
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using System.Drawing;
namespace Krokodil.Graphics
{
public class MapData
{
private BasicEffect MapEffect;
private Map tempMap;
public struct Map
{
public int[,] HeightData, PlatformData, PathingData;
public int[] indices;
public VertexPositionColorTexture[] vertices;
public VertexDeclaration vertexDeclaration;
public Texture2D MAPDATA; //Texture2D.fromfile()
public Vector3 MapOffset;
}
public Dictionary<Microsoft.Xna.Framework.Point, Map> Maps = new Dictionary<Microsoft.Xna.Framework.Point, Map>();
public void LoadMap(int x, int y)
{
Map LoadingMap = new Map();
//get the height data
//using (Stream fs = File.OpenRead("maps/" + x.ToString() + "#" + y.ToString() + ".bmp"))
//{
// LoadingMap.MAPDATA = Texture2D.FromStream(Krokodil.graphics.GraphicsDev ice, fs);
//}
Bitmap bmp = (Bitmap)Bitmap.FromFile("maps/" + x.ToString() + "#" + y.ToString() + ".bmp");
Microsoft.Xna.Framework.Color[] HeightMapColors = new Microsoft.Xna.Framework.Color[250 * 250];
for (int i = 0; i < 250; ++i)
for (int j = 0; j < 250; ++j)
{
System.Drawing.Color c = bmp.GetPixel(i, j);
HeightMapColors[i + j * 250] = new Microsoft.Xna.Framework.Color(c.R, c.G, c.B);
}
LoadingMap.MAPDATA = new Texture2D(Krokodil.graphics.GraphicsDevice, 250, 250);
LoadingMap.MAPDATA.SetData<Microsoft.Xna.Framework.Color>(HeightMapColors);
LoadingMap.HeightData = new int[250, 250];
LoadingMap.PlatformData = new int[250, 250];
LoadingMap.PathingData = new int[250, 250];
for (int i = 0; i < 250; ++i)
for (int j = 0; j < 250; ++j)
{
LoadingMap.HeightData[i, j] = (int)((HeightMapColors[i + j * 250].G * 150) / 255);
LoadingMap.PathingData[i, j] = (int)((HeightMapColors[i + j * 250].B * 150) / 255);
LoadingMap.PlatformData[i, j] = (int)((HeightMapColors[i + j * 250].R * 150) / 255);
}
//set up the vertices
LoadingMap.vertices = new VertexPositionColorTexture[250 * 250];
for (int i = 0; i < 250; ++i)
for (int j = 0; j < 250; ++j)
{
LoadingMap.vertices[i + j * 250].Position = new Vector3(i * 10, LoadingMap.HeightData[i, j], -j * 10);
LoadingMap.vertices[i + j * 250].Color = new Microsoft.Xna.Framework.Color(0, HeightMapColors[i + j * 250].G, 0);
}
LoadingMap.vertexDeclaration = VertexPositionColorTexture.VertexDeclaration;
//set up indices
LoadingMap.indices = new int[249 * 249 * 6];
int counter = -1;
for (int j = 0; j < 249; ++j)
for (int i = 0; i < 249; ++i)
{
int ll = i + j * 250;
int lr = i + 1 + j * 250;
int tr = i + (j + 1) * 250;
int tl = i + 1 + (j + 1) * 250;
LoadingMap.indices[++counter] = tl;
LoadingMap.indices[++counter] = lr;
LoadingMap.indices[++counter] = ll;
LoadingMap.indices[++counter] = tl;
LoadingMap.indices[++counter] = tr;
LoadingMap.indices[++counter] = ll;
}
Maps.Add(new Microsoft.Xna.Framework.Point(x, y), LoadingMap);
tempMap = LoadingMap;
}
public void LoadContent(ContentManager Content)
{
//MapEffect = Content.Load<Effect>("Effects/map_effects");
MapEffect = new BasicEffect(Krokodil.graphics.GraphicsDevice);
MapEffect.AmbientLightColor = new Vector3(.5f, .5f, .5f);
//MapEffect.LightingEnabled = true;
MapEffect.VertexColorEnabled = true;
//MapEffect.TextureEnabled = true;
}
public void Draw()
{
MapEffect.World = Matrix.Identity;//Krokodil.Helper.WorldMat;
MapEffect.Projection = Krokodil.Helper.ProjMat;
MapEffect.View = Krokodil.Helper.ViewMat;
RasterizerState st = new RasterizerState();
st.CullMode = CullMode.None;
Krokodil.graphics.GraphicsDevice.RasterizerState = st;
foreach (EffectPass pass in MapEffect.CurrentTechnique.Passes)
{
pass.Apply();
Krokodil.graphics.GraphicsDevice.DrawUserIndexedPr imitives<VertexPositionColorTexture>(PrimitiveType.TriangleList, tempMap.vertices, 0, tempMap.vertices.Length, tempMap.indices, 0, tempMap.indices.Length / 3);
}
st = new RasterizerState();
Krokodil.graphics.GraphicsDevice.RasterizerState = st;
}
}
}
SkinkLizzard
19-05-2011, 07:53 PM
I'm pretty sure that the draw order shouldn't matter if you use the z buffer, as each pixel will be filled with the pixel closest (view wise) to the camera regardless of facing direction.
everything in the code you posted looks to be fine, although I don't know much about the basic effect as I wrote my own the last time
I was doing 3D stuff.
for the z buffer thing its simply a case of initializing it and then xna manages it for you.
so each time you clear the screen reset the buffer too
GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Black, 1.0f, 0);
If you're already doing this: ah well sorry I can't help.
I'm pretty sure that the draw order shouldn't matter if you use the z buffer, as each pixel will be filled with the pixel closest (view wise) to the camera regardless of facing direction.
everything in the code you posted looks to be fine, although I don't know much about the basic effect as I wrote my own the last time
I was doing 3D stuff.
for the z buffer thing its simply a case of initializing it and then xna manages it for you.
so each time you clear the screen reset the buffer too
GraphicsDevice.Clear(ClearOptions.Target | ClearOptions.DepthBuffer, Color.Black, 1.0f, 0);
If you're already doing this: ah well sorry I can't help.
That doesnt work, but thanks :)
dislekcia
20-05-2011, 11:54 AM
Another XNA question (I can never remember if there is a thread, but)...
I had the problem previously, and need to try find a way to fix it, there is a graphical glitch in XNA in 2 directions (or a line if you prefer), I fiddled with cullmodes and other settings and have yet to find a solution:
http://i51.tinypic.com/2vb0ydh.png
I'm not completely sure from your image (and the description is a bit vague, what do you mean by graphical glitch), but that looks like a phenomenon called Z-fighting. It happens when polygons are so close to each other in the Z-buffer that the renderer assumes the "closer" one shouldn't be drawn because its Z-depth matches the one already in the buffer for that pixel. Note that even though your polys might be far apart in world-space, the Z-buffer is normalised to between 0 and 1, so if you try to set up a HUGE draw distance (I couldn't see your camera initialisation) you end up losing most of your Z-buffer's accuracy. Never set your clipping planes to 0.00001 and 1000000, for instance. Generally games tend to decide what they're going to draw where and set their Z-buffer accordingly.
Secondly, how would you recommend I sort the draw order of my vertices for the drawuserindexedprimitives method? Currently if you face the direction that is opposite to the draw order (ie. further things drawn later, rather than the nearest things drawn later) you see the further away terrain data.
Firstly, Skinklizzard is right: If you've enabled the Z-buffer (which it looks like you have due to the Z-fighting), then solid primitives should only be drawn when they're closer than what's already in the Z-buffer at that pixel. Check your code to find out what's causing those problems, I suspect it might be a combination of not culling back-facing polygons (ie: Ones that are facing away from the camera, this is usually done via winding order) and your Z-fighting issues, so the rear face of a hill (that you totally didn't need to draw anyway) which shares some vertices with the closer face obscures the closer face because the Z-buffer can't tell them apart. On the flip-side, it's usually always a good idea to have methods of sorting your vertices so that you're aware of the order they're drawn in.
For simple terrain implementations this could mean just having multiple index lists and passing the right one depending on the direction the camera is looking in. For more complex terrains that are more aware of their z-buffer limitations, people usually slice those into chunks anyway and then only draw the chunks that the camera can see anyway. You always want to be drawing from front to back, unless you're drawing transparent objects, which you draw the other way around. It's faster to discard pixels via the Z-buffer than it is to do texture and colour calls for each pixel multiple times, so drawing back to front is slower.
I started putting in the code to sort out the draw order, and it has basically sorted out my issues for the drawing (I just have to sit and find the angles to cover code wise now...
dislekcia
21-05-2011, 08:01 PM
I started putting in the code to sort out the draw order, and it has basically sorted out my issues for the drawing (I just have to sit and find the angles to cover code wise now...
Yes, drawing things back to front would solve the problem of back-faces showing before front-faces, but it doesn't solve your Z-fighting. What are your near and far clip planes set to when you build your view matrix at the moment?
1.0 and 1000.0, I set it to 1.0 and 10.0 and still had "Z-fighting"
dislekcia
22-05-2011, 03:19 PM
1.0 and 1000.0, I set it to 1.0 and 10.0 and still had "Z-fighting"
Um. If you could still see everything you were rendering at those distances, then one of two things is happening: Either you're rendering everything on a seriously small scale (in which case I'd expect a near clipping plane of 1 to slice out half your visible space) or somehow your clipping planes are being set somewhere else to completely different values. The second explanation might also help with why on earth your Z-buffer appears not to be doing what it should be doing.
I still get the issue when I have a view distance of 10.0 (16x2 triangles drawn for terrain), I set the clipping distance only once in the entire solution. I modified my scale from 10x per square making it smaller and smaller, using arbitrary increments at times to see how small I would have to go to get rid of this "Z-fighting".
Ive found that when I create the map, if I sort the vertices and select the correct vertices for the direction Im facing I can get rid of the effect, and despite it seeming like I have Z-buffering enabled I dont think it actually is considering my manual sorting can "fix" the problem.
Nael_Oran
17-07-2011, 11:11 PM
ok well heres my situation... the post rule is on me cause im new...
Im working - or at least trying to - on a game that has some of the final fantasy aspects to it, but i've hit a bump. I need to find a way to randomly generate rooms similar to how Desktop Dungeons does theirs. Im using the lite versions and im sure i can do what i need with that alone, but i need somehelp. ive got a programmers headache and i cant even write a line of code yet! Honestly, im entirely new to writing code. I want to do it myself, but as of now, i suck... so if someone could e-mail me with some help? (NAPittbull_4_ever@yahoo.com)
Thanks..
Your furry programmer,
Nael
dislekcia
18-07-2011, 01:39 AM
ok well heres my situation... the post rule is on me cause im new...
Im working - or at least trying to - on a game that has some of the final fantasy aspects to it, but i've hit a bump. I need to find a way to randomly generate rooms similar to how Desktop Dungeons does theirs. Im using the lite versions and im sure i can do what i need with that alone, but i need somehelp. ive got a programmers headache and i cant even write a line of code yet! Honestly, im entirely new to writing code. I want to do it myself, but as of now, i suck... so if someone could e-mail me with some help? (NAPittbull_4_ever@yahoo.com)
Welcome to the forums :)
Procedural generation can be a lot of fun to get working and it can give games a little something new every time, but it's not just something you drop in and have it work. The first thing you need to do is figure out what sorts of things you want to generate: Are we talking a single screen here? Do you want large rooms that are connected by twisting corridors, ala rogue? Would you rather want a Desktop Dungeons style crisscrossing of straight hallways? Nail down what you're looking for first and then we can start working on the algorithms that will give you that.
The second thing you need to do is figure out how you're going to store your maps. Because you need to do that somehow, you won't get to place tiles in the editor or anything like that, so you're going to have to have some sort of structure that keeps track of everything. DD's GM version has a 2D array that stores a state for each tile in the grid that makes up a level. DD's Unity version is a little more complicated, but makes it easier to create different sorts of levels.
So what sort of stuff do you want to randomly generate?
Nael_Oran
18-07-2011, 05:19 AM
Firstly thanks, and im glad to be here.
Now, I'm looking to generate rooms Like DD, but perhaps i should explain the game more...
The object of the game is to defeat all 4 bosses (not counting the final) and collect 4 crystals.
-Key-
Portals(Purple) - transfer a player from one room to another in a forward fashion
Portals(Red) - Like the above, but only to the previous room.
Crystals - Upon acquisition the player is given a boost in stats and abilities. (stats and abilities have yet to be worked out)
Boss - Like the name implies, this character controls the regions that the player must travel through.
Final Boss - Similar to the above, but more powerful and perhaps a little different.
I have multiple rooms in game maker that are connected like stages. Use of a Portal object would transfer a player from one room to another. every 3rd room (excluding the tutorial that i hope to include and is NOT randomly generated) there will be a lock set on the portal that can only be opened after a crystal is obtained. In order to obtain the crystal, one must defeat a boss at an altar. Namely walls, enemies, and the players spawn point are what i am looking to generate. Making the sprites for such is not hard at all (thank Ye Tile Studio). this is only a prototype of my main goal, which i will attempt once i have more experience.
So, the Main goal here is rougelike, single screen, 2d, with rooms that you can transfer to to give the game length.
Having the crisscrossing halls is optional. i don't want to bite off DD too much. Aaand Map storage... Ill have to look into that. I never expected to have this dropped into my lap. I want to work for it so i can say: "Hell yeah. I did that."
Alas, Sleep is needed now, so i shall.
Friar Tuck
03-09-2011, 09:35 PM
This question is not game maker associated, but it is related to game currently in production by me. When I can create my own thread I shall post details off the game as when input is needed.
Now onto my question:
Say for instance you have created an engine with simple movement mechanics is it possible to import object files into it, or should I write the whole thing from scratch.
How would one do that?
I am currently an engineering student and I am proficient in c++ and pascal languages.
dislekcia
04-09-2011, 12:28 AM
Now onto my question:
Say for instance you have created an engine with simple movement mechanics is it possible to import object files into it, or should I write the whole thing from scratch.
How would one do that?
I am currently an engineering student and I am proficient in c++ and pascal languages.
No. Once you've written the movement system in a game engine, you can never go back and write anything that would read data files and/or display meshes. Looks like you did it in the wrong order and now it's ruined. Probably a good idea to start from scratch and hope you don't mess it up this time...
Seriously, why are you writing a game engine from scratch? If you're planning to learn how game engines work, you need to study some existing ones first to find out how they solve the particular problems they needed to. If you're planning to actually build a game, writing an engine "first" is the worst possible thing you could do. Either way, get some existing engines and poke them. That'll help.
I have to disagree with dis here, you can always layer the graphics on top of your current code (though it wont be great and chances are you will find that you would rather start from scratch at some later stage). The way I see it we have someone here who wants to make game X but doesn't know where to start for graphics, and has already thought about some of the game play.
I would recommend you look at SDL (http://www.libsdl.org/) if you are looking to work in 2D, or Unity (http://unity3d.com/) if you want to work in 3D. (Unity might require some modifications to your movement system).
Just for clarity, I think there is a mix up with the use of "engine" here, the movement code I write for my game I call part of my game's "engine" but I use it in conjunction with a graphics engine to show things to the player. You dont have to build them as a single unit.
Friar Tuck
04-09-2011, 11:15 AM
No. Once you've written the movement system in a game engine, you can never go back and write anything that would read data files and/or display meshes. Looks like you did it in the wrong order and now it's ruined. Probably a good idea to start from scratch and hope you don't mess it up this time...
Seriously, why are you writing a game engine from scratch? If you're planning to learn how game engines work, you need to study some existing ones first to find out how they solve the particular problems they needed to. If you're planning to actually build a game, writing an engine "first" is the worst possible thing you could do. Either way, get some existing engines and poke them. That'll help.
I have to disagree with dis here, you can always layer the graphics on top of your current code (though it wont be great and chances are you will find that you would rather start from scratch at some later stage). The way I see it we have someone here who wants to make game X but doesn't know where to start for graphics, and has already thought about some of the game play.
I would recommend you look at SDL (http://www.libsdl.org/) if you are looking to work in 2D, or Unity (http://unity3d.com/) if you want to work in 3D. (Unity might require some modifications to your movement system).
Just for clarity, I think there is a mix up with the use of "engine" here, the movement code I write for my game I call part of my game's "engine" but I use it in conjunction with a graphics engine to show things to the player. You dont have to build them as a single unit.
One must never say one cannot learn out of one mistakes.
Where would one start with the game?
The game planning is complete like what would the player do and how everything will fit into each other. The story is complete as well. The game type is a 3D role playing game.
Now what to do next, I thought to sort out the movement and how objects would react with the player in the world and then to add the graphics. (As this is wrong I shall start fresh, which I don’t mind)
I looked at other game engines like the CryEngine 3 (http://www.crydev.net/), Unreal Engine (http://www.udk.com/), Unity 3D (http://unity3d.com/). Unity has no download link (I could not found one).
Thanks for your help
Unity download link is on the top right of the page.
Friar Tuck
04-09-2011, 03:13 PM
Unity download link is on the top right of the page.
It goes to this page where there is no link. (http://unity3d.com/unity/download/)
Friar Tuck
05-09-2011, 08:40 AM
It goes to this page where there is no link. (http://unity3d.com/unity/download/)
I was using Google Chrome with Kaspersky and it had certificate errors, so thanks, is shall have a working beta in a few months.
dislekcia
05-09-2011, 04:21 PM
I have to disagree with dis here, you can always layer the graphics on top of your current code (though it wont be great and chances are you will find that you would rather start from scratch at some later stage). The way I see it we have someone here who wants to make game X but doesn't know where to start for graphics, and has already thought about some of the game play.
Really? Are you going to force me to use sarcasm tags in future?
One must never say one cannot learn out of one mistakes.
Where would one start with the game?
The typical progression path is as follows:
Try to build a really large game with little experience, focus on story and paper design, never finish game.
Try again with a smaller game, fail at that too.
Try again with an even smaller game, get reasonably close to something playable.
Try again with an even tinier game, get something playable, learn what quick iteration and prototyping give you access to, start building on your understanding of games.
Try slightly bigger games, build skills, get a job :)
This whole thing only works if you don't give up at step 1. Unity is a good choice, but I recommend you do as many Unity tutorials as you can find right now, even ones that don't produce RPGs, just to learn the engine's ins and outs properly. It will not be time poorly spent.
The Dash
29-11-2011, 03:26 AM
Whoo! Working on a prototype again after more than a year! So I need some help with the logic here, maybe its just late, but i cant figure out why this isnt working:
neighbours is a map that stores nearby nodes where the key = distance, value = node_id
connections is a list of nodes that this node is connected to
ind = ds_map_find_first(neighbours); // Get the nearest neighbour
val = ds_map_find_value(neighbours, ind); // Get its ID
ds_map_delete(neighbours, ind); // Its been processed, so it is no longer a neighbour
if (((val.owner == 0) or (val.owner == 1)) and //if there is no owner or it is owned by the player
(ds_list_find_index(connections, val) < 0) { // if we're not already connected, /**** this line doesnt seem to work correctly ****/
ds_list_add(connections, val) // connect to it
numConnections += 1
ds_list_add(val.connections, self) // add this node to the new node
val.numConnections += 1
val.owner = 1 // affirm that we now own it
}
So if I have two nodes: Bob and Andy.
Bob connects to Andy fine
Andy then connects to Bob, even though they're already connected
SkinkLizzard
01-12-2011, 12:04 PM
I can't see any problems other than it seems you're missing one bracket on the end of the if evaluation part, that and I have no idea how
gamemaker handles multiline evaluations, Imo stick it all on one line as well.
dislekcia
04-12-2011, 05:34 PM
Clean up your logic a bit, make the things you're evaluating be individual terms so that you can test them in debug in case one is failing for some reason:
I don't understand the owner line, that doesn't seem like it'd be different? Why is it 1 or 0?
dislekcia
04-12-2011, 05:34 PM
Clean up your logic a bit, make the things you're evaluating be individual terms so that you can test them in debug in case one is failing for some reason:
if ((not owned) and (not connected)) ...
I'm pretty sure it's breaking because you multiple lined it with the incorrect number of brackets.
I don't understand the owner line, that doesn't seem like it'd be different? Why is it 1 or 0?
charly
04-07-2012, 03:04 AM
Hey guys, I'm interested in learning to program games. I am confused whether I should go straight to C++ our if I should start if on something basic. Could you guys please point me in the direction of a book for complete beginners on amazon.co.uk thanks in advance
Hey guys, I'm interested in learning to program games. I am confused whether I should go straight to C++ our if I should start if on something basic. Could you guys please point me in the direction of a book for complete beginners on amazon.co.uk thanks in advance
Luckily I was browsing the forum to get some info so I saw this post! :)
The general rule is always start somewhere simple. If you know a programming language you can find a game development library that will work with that language, and they usually have a few decent tutorials to get you up and running. If you cannot find a game library that seems within your scope, or you are not yet confident enough in your own ability I would recommend you use a tool like Game Maker (Lite version is free) or Unity 3D, both of which allow you to do a lot with the least amount of programming, and then you can supplement your work with custom code and learn (or improve) your programming skills through their built in scripting systems.
It is often a lot more work getting things working when using a language with a specific library, but you will learn a lot getting your game done that way, you might just need more patience for that though. For instance even though I had used python and pygame, as well as delphi, quite extensively before getting into game development I found it a lot easier to learn to make games using Game Maker, which is actually worth every $1 you would spend on the full version when you need the "Pro" version features, but that gives you so much in the "Lite" version that you can finish many complex games in it.
TL;DR: Make some games in Game Maker, then you can move to a language and library that you like.
charly
07-07-2012, 04:11 PM
Luckily I was browsing the forum to get some info so I saw this post! :)
The general rule is always start somewhere simple. If you know a programming language you can find a game development library that will work with that language, and they usually have a few decent tutorials to get you up and running. If you cannot find a game library that seems within your scope, or you are not yet confident enough in your own ability I would recommend you use a tool like Game Maker (Lite version is free) or Unity 3D, both of which allow you to do a lot with the least amount of programming, and then you can supplement your work with custom code and learn (or improve) your programming skills through their built in scripting systems.
It is often a lot more work getting things working when using a language with a specific library, but you will learn a lot getting your game done that way, you might just need more patience for that though. For instance even though I had used python and pygame, as well as delphi, quite extensively before getting into game development I found it a lot easier to learn to make games using Game Maker, which is actually worth every $1 you would spend on the full version when you need the "Pro" version features, but that gives you so much in the "Lite" version that you can finish many complex games in it.
TL;DR: Make some games in Game Maker, then you can move to a language and library that you like.
Thanks man. I am a very computer literate person and I am very persevering. Would you still recommend trying something like game maker first?
EDIT: I'm busy reading through this thread from the beginning and it sounds as if you can do a lot in GM. I'm just worried that C++ might not be anything like GM. Is it?
Legion
08-07-2012, 04:00 AM
Thanks man. I am a very computer literate person and I am very persevering. Would you still recommend trying something like game maker first?
EDIT: I'm busy reading through this thread from the beginning and it sounds as if you can do a lot in GM. I'm just worried that C++ might not be anything like GM. Is it?
Here and there the syntax has similarities... it's a border language.
I used to be pro GM but mark overmars forum lackey's saw fit to ban me for pointing out his old interpreter "runner" is flawed and horridly slow "try using some high level .dll's in GM8 and you will see what i mean"
Since then i have not touched GM again.
But since then it was updated to use a compiler instead.
So it's a bit faster.
GM is a great tool to quickly test ideas and make simple 2D games.
It's 3D functions are utter junk "that's why we used dll's"
So if it's easy to use and learn coding you want with a massive lack of power and control... ye go ahead and use GM.
Else learn C++ and write the exam when you feel confident... "at least that can go on your CV"
Where as saying i program in game maker will get me laughed out of a interview.
Idk.. my personal opinion may not share your views.
dislekcia
10-07-2012, 11:06 PM
Also, Legion is a bit of a troll... I wouldn't give his randomly emotionally driven analysis much weight when it came to producing games ;)
Worrying that C++ might not be like GM is completely the wrong thing to be worrying about. Once you know the basics of programming, the actual language that you write in is pretty much arbitrary. Give me a programming reference and a few examples and I can write in anything you want. The important thing is learning the basics and how to think about programming, you can learn that in Game Maker easier than you can learn that in something that forces all sorts of busywork on you like C++ does. But you can always move to C++ later, once you're more comfortable with coding AND have a better understanding of what goes into coding game logic - which is vastly different to "engine" code. It's far too easy to get sucked into trying to make a couple of triangles appear on screen for months and months of your life, and then when you do get that right you still don't actually have anything resembling a game.
Legion
12-07-2012, 04:25 AM
Also, Legion is a bit of a troll... I wouldn't give his randomly emotionally driven analysis much weight when it came to producing games ;)
Worrying that C++ might not be like GM is completely the wrong thing to be worrying about. Once you know the basics of programming, the actual language that you write in is pretty much arbitrary. Give me a programming reference and a few examples and I can write in anything you want. The important thing is learning the basics and how to think about programming, you can learn that in Game Maker easier than you can learn that in something that forces all sorts of busywork on you like C++ does. But you can always move to C++ later, once you're more comfortable with coding AND have a better understanding of what goes into coding game logic - which is vastly different to "engine" code. It's far too easy to get sucked into trying to make a couple of triangles appear on screen for months and months of your life, and then when you do get that right you still don't actually have anything resembling a game.
It's just a avatar... nothing more.
=(
Joel Fire
13-11-2012, 04:01 PM
Hello, I'm Mr.Fire, I can see some familiar C# coding here in this thread? I'm still new at game development! Though were is there a link to Game.Dev on this site for local developers and what other sources do you (dislekcia) recommend?
Powered by vBulletin® Version 4.2.4 Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.