Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 30 Jun 2004
Offline Last Active Yesterday, 10:41 PM

#5292883 Can't get enemy shoot at a certain point in game maker studio

Posted by kburkhart84 on 22 May 2016 - 11:08 AM

All you need to do is change the counter amounts.  Right now the code(in the pictures) has it going to 360.  If you have the room speed at the default of 30, it will change in 12 seconds.  If you have it set to 60(which I like better, as it is much smoother), it is only 6 seconds.


There is a built-in variable for the room speed.  You can use it.  So if you want 10 seconds worth of steps, multiply 10 by the room speed variable.  If you want 1 minute, multiply 60 twice(preferably in the same line).  This way, if you change the room speed later, you don't have to come back and change this code at all.  It is a lesson you should learn, basing calculations on constants and variables so that if you have to make a change, it is only in the one place.  For example, that array for the bullet speed.  If you want to change it, you only change it there, and any other thing that needs it can access it.  That is a lot of the point of controller objects.


Side Note:  I'm going to be getting back into GMStudio I'm thinking.  I DO like Unity and 3d for projects, but I'm finding out that things take longer to get done, including coding(not just the graphics).  One limitation of GMStudio that I didn't like was how with GML code, you declare variables in the create event, but then have to remember exactly how you named them when you use them in other events.  You don't have that problem in Unity as the script events are all on the same page, and you have intellisense for your own variables too.  GMStudio does intellisense, but only for built-in stuff, and resource names, and constants, but not for declared variables.  The 3rd party Parakeet IDE changes that, and a lot more.  I'm doing the 7 day trial of it and would likely buy it and use it.  It fixes my one biggest complaint with GML.  If you are interested in what I'm doing, I'll share.

#5292408 Can't get enemy shoot at a certain point in game maker studio

Posted by kburkhart84 on 18 May 2016 - 09:35 PM

vspeed = 4;
collision of obj_block:
Anything else?
I assume that the vspeed = 4 is the creation of the bullet.  This is where you use the '.' syntax to access the variables of the objController object using the line of code...
vspeed = objController.speedarray[objController.difficulty];
This does assume that you have an instance of that object in the room.

#5292380 Help creating sprite sheet

Posted by kburkhart84 on 18 May 2016 - 05:34 PM

The free version of GMStudio I believe handles the sprite rotating.  It appears now that they are more like Unity, with the free version being the complete engine, but forcing splash screen and not having all exports.  So, unless the lighting/shading is different on the sprite, you are better of just having the single frame(make it point right so it is at what GMStudio calls 0 degrees rotation), and then rotating it during gameplay.


I would have to see exactly what you mean by "sliding around."  If it was an issue with sprite offsetting due to rounding numbers or similar, then the ship would likely be jerky, shaking around instead of a sort of smooth sliding.  You might also run into issues with having it "split" into pieces due to it drawing the middle of the sprite.  Since I don't know exactly what is going on, it isn't easy to comment.


Another thing I can recommend that I always did when using GMStudio...I keep my sprite frames as separate PNGs, at least for the importing step.  If you are using some software that keeps all the sprite frames in a single file(like Pro Motion, Graphics Gale, and others), then when you export, export separate frames instead of a sprite sheet.  Just put them all into a single folder, and then when you import the sprite, select all the files.  This will ensure you not only have the hassle of checking what sprite offsets to use, saying how many frames it is, etc... because it is easy to simply select all files with Ctrl-A then to remember for each sprite how many frames it is.  And since GMStudio does texture packing on its own anyway, you aren't losing performance because the sprites are getting packed into atlas textures/sheets when you run the game(and when you build it).

#5292205 Can't get enemy shoot at a certain point in game maker studio

Posted by kburkhart84 on 17 May 2016 - 10:00 PM

There is a big difference between '=' and '==' in my code.  I have an IF statement there.  In the create event, I'm giving(assigning) it 360.  In the step event, I'm saying "IF counter is equal to 0, do whats in the {}, so if counter is at 0, it will do the code in the braces, putting counter back at 360 again, and IF difficulty is currently less than 3, it will increase that variable as well.


I prefer to use the double equals in the comparison syntax, and in many languages you actually HAVE too.  There was a time in GML where you could use either single or double equals in an IF statement.  I don't know if that ever changed, as they made some changes when they changed things up upon releasing GMStudio, and even if they haven't, it is a good habit to get into, as in the future they are likely to make that change.

#5292176 Can't get enemy shoot at a certain point in game maker studio

Posted by kburkhart84 on 17 May 2016 - 05:37 PM

Not exactly...if you want the values to "upgrade" at different speeds, then yes, you need more than one variable for the counters(or an array).  But the idea was to just have a single counter variable counting down, and one single variable for the current "level/difficulty" that you increase each time the variable goes down.


//create event of objController
speedarray[0] = 2;
speedarray[1] = 3;
speedarray[2] = 4;
speedarray[3] = 6;
counter = 360; //let's say room speed is 60 and you want 6 seconds, so it is 360 steps
difficulty = 0;
//step event of objController
counter--; //or counter = counter - 1  or counter-=1 work too
if(counter == 0)
    counter = 360;
    if(difficulty < 3)//3 is the highest I went in my arrays
//bullet creation event
speed = objController.speedarray[objController.difficulty];


Note that you can add more array values as well in order to get higher speeds if you want.  Also, pay attention to how I did "objController.speedarray[]".  This assumes you have a single(important that it is only one) objController in the room, and that it is already set up, as in created, which means the create event ran, creating the array variables.  This syntax allows you to access variables that actually belong to the objController object, and you can do this from any other object, which is why it works no matter how many bullets you did.

#5291989 Can't get enemy shoot at a certain point in game maker studio

Posted by kburkhart84 on 16 May 2016 - 10:00 PM

About difficulty, if you are trying to make the bullets faster, you will need a few variables, and maybe another object.  I would have another object that would be a controller object.  It would store variables for things like the current difficulty, and could also store the current bullet speed if there is only one type.  Then, in the create event of the bullet, you would access the variables in the other object and use that speed instead of just using the default speed.


Your controller object would then track whatever you need it to in order to increase difficulty.  If it is a matter of time, then you could have an array(a concept you should learn soon anyway if you don't know it) to hold a group of bullet speeds based on difficulty.  If difficulty is level 1, then access the first value in the array, which would be the lowest speed.  Then if you increase the difficulty number, it accesses the numbers further in the array, which you should have as larger numbers for the bullet speed to be faster.  Now, since you have decided on time as the factor, say after 60 seconds, you use an alarm event(set to 60 times the room speed amount of steps), and increase the difficulty at that point.  You also have to have a check somewhere, say if you have 5 difficulty levels, the speed never goes higher than that.


Another option is to use some formula to calculate things.  It takes a bit of math to figure it out, though you can do things simple too.  For example, you could say the bullet speed is simply a formula based on how long the game has gone, with a max of some number.  Say you start with a speed of 2, and want a max of 10, increasing 1 per minute, then somewhere you store in your controller a counter for how many steps have gone, and each time it gets to a minute worth(depending on your room speed), you add one to another variable for minutes.  When you create a bullet, you set it with the speed of 2+(the minute variable).  Somewhere, either the minute variable, or the bullet speed setting, you have to designate the max, unless you expect the player to never get to the point where the speed would be too high for gameplay purposes.


As far as contacting me for help, I don't mind.  I check the forums often during the evenings(US Central Time, I'm in North Texas), but I work all day and usually get home around 6-7PM, so if I don't respond right away, that is why.


And also, I understand completely you wanting to use GMS over Unity.  I used it for years, not so much because I couldn't use Unity, but because of how quick and easy it is.  Eventually, I got to wanting to work on things that GMS is simply not good at and needed to make the switch, but if I want to make a project that fits GMS I will be glad to use it, the best tool for the purpose.

#5291976 Can't get enemy shoot at a certain point in game maker studio

Posted by kburkhart84 on 16 May 2016 - 06:22 PM

As long as you are indeed decreasing the variable each step, there is nothing stopping you from doing an if statement..

if(counter == 15)
    //do something
if(counter == 10)
    /do something else
if(counter == 0)
    counter = 20;


Also, there is nothing stopping you from using the alarm event to do things.  You would then save having the code in your step event(though for performance it is really irrelevant since the code is happening in GMC's runner anyway).  As part of the alarm responding event, you reset the alarm using "alarm[0] = 20" and then it will count down again.  You could also do it in the D&D blocks, but it is quicker to just add the line of code there.


And yes, I understand the pain of the GMC forum no longer being available.  I have been a member for years having done plenty of hobby stuff in GMStudio.  I use Unity now though, so I probably won't be signing up for the new forum when it gets set up.

#5284805 Allegorithmic Substance for Non-Artist, Tools for Amping up Graphics?

Posted by kburkhart84 on 02 April 2016 - 06:01 PM

Unity has a Substance engine I believe to be comparable to UE4's.  If the Substance has exposed parameters you can change them, and if the material is being used as a Substance(not as baked textures from the substance, as not all platforms are supporting it yet), you can change those parameters at run-time.


I'm no artist, but I can tell you, these softwares, if you learn at the least some basics, can help you make better graphics, especially combined with pre-made textures(like GameTextures.com textures).  I don't think it will help with "hand-made" textures like some cartoon styles because those require actual art skill generally, while using pre-made textures and Substance Painter you can take a UV, mask off the UVs, and apply materials that can look good if done right.  But this is more skill with software, not so much with actual art.  It is like making textures/graphics relying primarily on Photoshop filters instead of actually drawing things with the brushes.  It CAN work though in my opinion.


About Substance Designer, I think it is also a worthy investment.  In theory it allows you to not be an artist and via the node system still create good textures.  I haven't done much with it, but given time I've been able to make a couple things that I wanted to.


I honestly believe the LIVE Subscription is perfect for me.  The $20 per month isn't much for me, a working adult with 3 children and a wife.  But I had a bit of a head start, having learned basics of modelling with Blender3d, and knowing basics of UV mapping, etc... despite not having actual artist skill.

#5281072 picture to texture workflow (especially to height map) ?

Posted by kburkhart84 on 13 March 2016 - 12:47 PM

There is another post here talking about exactly that.  The artist is taking the picture, and actually modelling the details.  He then creates the height, normal, AO, by baking that model.  There is some more post-processing as well, making the height and normal maps more noisy/detailed.


There are programs that can do the job automatically.  It appears that you are already using one for the normals.  You could easily convert that normal map into heights I'm sure, though it wouldn't be as good as modelling the stuff.  I think Crazy Bump does it, and I'm sure Bitmap2Material from Allegorithmic could do it as well.

#5280613 Cheating with graphics

Posted by kburkhart84 on 10 March 2016 - 05:44 PM

You have hit on some little "cheats" that can work.  The main thing with cheats like this is find a style that you can do, and stick with it.  If creating objects out of geometric shapes works, maybe it can be a solid style for you and a game.  You can then vary that up possible for a different style, say by using those filters, gradients, etc...  In fact, maybe you could learn to create graphics with a vector program(Illustrator, or the free Inkscape).


The way I used to "cheat" for 2d graphics was by creating them as 3d models and pre-rendering them.  For whatever reason, 3d was much more intuitive form me, maybe because I'm just creating geometry instead of worrying about lighting/shading.  And though this method takes more learning time, and more time for the initial model creation, once you pass that stage, things suddenly get much easier.  Need animation?  Just do it with that model.  Need to change something, do it and re-render any animations you have, no need to redraw a bunch of stuff.  Need a bigger/smaller size version, just re-render.  The same thing applies if you want to change the lighting direction.  There are considerations to take with this.  For example, the size can't really be 16x16, with 32x32 being pretty much the bare minimum for most things, and really not that great, more like 64x64 being a pretty good starting size.  You also have to consider how you shouldn't model details that wouldn't show up in the final render, but remember to include some things that might show up if you increase size so you already have it in case.  It's a balancing act.

#5273378 Structuring a Simple 2D Engine

Posted by kburkhart84 on 30 January 2016 - 12:34 PM

One thing about game engines, as mentioned above, is how some code ends up being the game, while other code is in the game engine.  But at some point, the better game engines have code that would be better in specific games, but can be used in some games, so becomes a feature.  These are things like path-finding, AI, and any number of similar ilk of features.


Once you are past the basics, the things that pretty much every game will have, you would then move on to making features like I describe above.  Sometimes, this comes on because you know of a certain feature, or because you try making a game with it, and then after coding that game, extract that code, and make it work in a general sense with your engine.  Either way can work, though if you do it the second way, making a game, then I recommend you remember the eventual goal of the engine, and therefore should remember to write things in somewhat general ways when possible.  It will make things take a bit longer, but will be quicker at the point of integrating the thing into your actual engine.


So, you have two paths you can generally follow, though you can go back and forth no problems.  You start making some simple games, and then you start extracting game code from them so you can then put the features into your game.  Or you can make a feature list of things you know games have that would work in your engine.  This list would include things like navigation, AI, particle systems, lighting systems, maybe custom shaders, you know, all those things that make games great.  Then you can simply make some test cases in order to make sure your engine features are working in a good general way, and that you can use/not use the features as you wish for any given game, and ensure that nothing interferes with other systems in the engine, regardless of which all features are actually in use at the moment.  Everything should work in concert with each everything else, in any usage combination, under any given circumstances.  That last part is generally the hardest part of making generic game engines, much more than any single given feature.

#5273366 Low Poly vs. High Poly

Posted by kburkhart84 on 30 January 2016 - 11:04 AM

In some cases, you can get away with simply adding something like Blender's Subsurf modifier.  It adds smooth geometry and you can control just how much of it.  You can also then apply it and then modify it as you need to.  Note that this is similar to what would happen if you put it into ZBrush as suggested.  Also, Max and Maya have their versions(TurboSmooth in Max I think) so it should work wherever you go.


Just note that the results will also depend on how the original model is, and just how "low-poly" it is, including just where the the geometry is on the model, as these modifiers use a form of subdivision, so if the geo on the original isn't even, it won't be on the subdivided one either without some extra work.

#5268790 Getting started with Unreal Engine or something else?

Posted by kburkhart84 on 01 January 2016 - 11:33 PM

I recommend you take a look at Unity, and at GameMaker: Studio.  Unity is generally easier to learn and use than the Unreal Engine, though the scripting is C#(and 2 other options) while Unreal Engine 4 uses C++.  GMStudio uses a propietary C-Style scripting language called GML.  It is quite easy to pick up if you have some programming background, which you do.  Unity excels at 3d, while GMStudio excels at 2d, so that may also help make a decision.

#5264154 Looking for a free 2D engine

Posted by kburkhart84 on 29 November 2015 - 04:10 PM

Well, though GameMaker isn't what you are looking for, I have to refute your mentality that it isn't "programming."  In fact, the GML language is much more than a bit of drag&drop, and isn't something you should take so lightly before getting better informed.


Unity is also something to look at, though it also isn't C++.  Also, it is somewhat like throwing a jackhammer at a small nail in that it does much more than a 2d game.  That can be a good thing though, as it is a pretty good system to get into, and would allow you to move into 3d pretty easily, using the same skillset and programming language.

#5264153 How Is This Pixel Art So Detailed?

Posted by kburkhart84 on 29 November 2015 - 04:05 PM

I don't know for sure as I didn't create those pieces.  It appears to be quite flat shaded, which leads me to believe it wasn't done with any 3d renders, except maybe as reference material to get poses right or something similar.


General pixel art is time consuming.  But I doubt that game was made with a single person, rather probably at a minimum programmer, artist, and musician, over a lengthy period of time.  Remember that it is possible to pixel out anything you want any size you want, given both the time and the skill.  Fighter game sprites used to have resolutions of over 100x100, with animations that were quite fluid, though they took much time to do and do right.


Last thing I mention about that game,  notice how much of the color is in chunks.  The environment as well as the character are made of mostly single colors for things.  There isn't much shading going on.  In that style, I would think that it wouldn't matter as much how big the pieces are because the actual work wouldn't be as much as on other styles due to using the same color in big chunks.