A lets play and lets think on gamemaker :tm: by a newbie(basically a devlog i guees?)
notice:
most boring and really unhelpful stuff will be cut out,so this isnt the full version
disclaimer:
take what i wrote with a grain of sand because i am literally a newbie to GML LOL(but i do have some experience to programming)
you need to think and doubt what i wrote is correct or not,do not blindly copy my actions,because everyone have their own way of doing things that is most suitable for them
2/22/2022:
just reading the manual and also debugging the manual lol
2/23:
started watching shaun's 2d platformer tutorial series
i chose a tutorial because well i only intended to learn the basic bread and butters of GM2 such as collision system and well just how GML works in general
never intended to make it into a full game but plans always get thrown out of the window
if you noticed it,i changed walksp into walkspd,because code(and by extension variable names) that are easy to read are really important(by saving you a lot of trouble in the future)
to me,the first thought i have of sp is SPecial,and well walkSPecial doesnt make sense to me,so i changed it into walkSPD(walkSPeeD)
if theres any chance in the future that your code will be read by someone else(due to working as a programming team/etc),then you should start building a habit of writing easy to read code for others
but in this case,i dont think i will be working with anyone else in terms of programming,so i will just write code that is easy to understand for me
why is easy to read code important you ask?
IMO,thats because you will be looking at your code a lot for different reasons,
such as debugging,you trace your code to figure out which part went wrong,(and more reasons to make it easy to read if you are presenting your code in the help channels in GM discord and is looking for help)
or just improving your code in general to make it more efficient(or even easier to read)
etc etc
and whenever you need to look at your code,its gonna be one of hell of time if its a mess of spaghetti which you have no idea what it means because you never build the habit of making code easy to read
so for the sake of anyone who reads that code,try to make your code easy to read if possible without compromising other important things
drawing my own sprites because i just need some programmer art as a placeholder for the tutorial anyway(never thought of turning this into a real game until a later point)
in programming,you will face problems that you need to solve in order to progress,do not be afraid to ask for help,but try to solve the problem on your own first
its normal if you fail and cannot come up with a solution,but its the attempt that more important in here,the ability to solve problems does not magically comes from nowhere,in order to improve it little by little,you must use your brain and try to think up different ways to solve problems
if you are afraid of failure and avoid doing anything,then you will never gain any experience,and thus,never grow and improve
so if you wish to improve and grow,embrace failure as if eating breakfasts
and well i tried to solve this problem on my own,but this problem is way outta my league so i just asked for help in the help channels lol
and well,since my sprite is different from the tutorial,this is the part where i start derailing from the tutorial and have to figure out how to make things work for my 2 frame sprite(probably not a good idea if you are completely new to programming since i do have some experience of how things work in general)
i copy the code from the tutorial,but i also try to understand the code i copy,because otherwise i am not going anywhere with programming if i can only blindly copy and paste codes from others
(and well the collision system is really hard to digest)
if you have no idea what a function(such as place_meeting) does,middle click the function and the manual will show up with a page of what the function does
drew some bullets
drew a GUN
and drew an enemy
and well this is the point where drawing an entire tile set would take too much time(plus i dont want to),so i just went to itch.io and grabbed some random assets
2/25
took vaccine to covid,nothing special really
2/26
tilesmaps and auto tiling giving me massive headache becauase i have no idea how in earth they work
why is the sprite 70x70 when i need it to be 64x64
countless hours spend figuring out how to downscale 888x910 tilemap to 832x832(64*13) properly because i have no experience with it
i dont quite remembered what happened but i think i just gave up on auto tiling and just tile manually since the game isnt that big anyway
downscaling was a success iirc
following the tutorial and adding transitions
getting a phallanx background from itch.io and suddenly things look a lot much better
if i were to work on a new game i am sure as hell getting a placeholder background first lol
and now,lets talk about //commenting
proper commenting helps you understand the code your wrote even easier,and for others,it gives them an idea of what the purpose of that part of the code is
you may have understood what the code mean now,but from my experience memory just aint reliable man,a few weeks later and the future you will totally forget about what does all these code mean,and you have to try to figure out what they mean again
assuming the future you did forget everything(and you did comment your code),the comments will help him quickly figure out which part of the code does what,just by looking at the comment you wrote before
if you want your code to be easy to read,then commenting will help a lot
random pro tip:
pressing F4 opens a menu for your bread and butter statements and blocks
2/28:
just spending the day looking for cool art assets on itch.io
2/29:
added player death animation
3/1:
signpost gaming
(quite some time later like in june i asked myself if there is a (way/function/whatever its called) to check if an object exists,so the code doesnt get run and crash the game if the game checked and know that the object did not exist.and then i just i asked google and i got instance_exists lol)
this is also where having a dev diary/lets play is cool,because you can print and type out your thought process in text,and be able to go trace your thought process and make it a lot more clear,i guess this is somewhat close to <rubber duck debugging>
tbf having a dev log/lets play helped me a lot since it make me easier to know:
what i did
what am i doing
what am i going to do
< rubber duck debugging>:
https://rubberduckdebugging.com/
in communication,you dont always know how much the other side(the rubber duck) knows about something,and thus you should assume the other side knows nothing and communicate based on this assumption(or the even better way just ask him if he knows about it)
if you want to talk/discuss about <rock paper scissors> to someone and you know he have no idea what is <RPS>,then the first thing you should do is to synchronize your information by explaining to him what is <RPS> and how it works,then you two can actually start talking about <RPS>
otherwise,the conversation will never go anywhere because the other side have absolutely no idea what on earth you are talking about
3/2:
added >Coyote jump(
lets make the enemy spit out corpses like baby slimes gettting shot out of king slimes body because why not
3/4:
added gun pickup and rotating bullets
3/5,3/6:
downloading and sorting and building a music armory for gamedev
3/9:
more debugging and also adding particles for player moving
and well a kinda interesting bug(?) where the bullets lost all speed and just freeze in air
3/12-17:
breaks
breaks are important to protect your passion,if you burnt out your passion then you will lose your will to continue,unless you dont need the breaks because you are having fun with gamedev
3/18:
setting up git(i have no idea how to actually use it,but you cant go wrong with having a backup first then figure out how to revert it when needed)
why is backing up important you ask?
i say,just delete your current project with backing it up,and you will understand the pain of losing progress
3/19-22:
covid vaccine shot number 2
3/23:
even more music sorting
3/25-4/8:
i decided to go write an essay on tf2 LOL
4/9:
making enemy death animation for fun
4/24-4/27:
more music sorting while browsing reddit
a random meme because why not
4/30:
lost all my memories on how my code works because i havnt touch my project in quite some time lol
time to figure out how things work again
also the point where i decide to make this into a actually real game instead of just a tutorial for education purposes
5/4:
the background asset comes with a tileset so i have no idea why i wasnt using it since it matches with the background
5/6:
you dont want the bullets that the player have to dodge to blend in with anything else(which makes it really hard to see and makes the player feels unfair which can leads to unhappy players),so outline+clear color we go
the same goes for anything that is a threat to the player(unless you are have a special reason for the threat to be hard to see like horror games)
5/7:
i dont like forcing the player to stand still to read signs so lets remove that(definitely not because of the bug that crashes GM)
5/11:
cant run away from all the bugs,still gotta figure a way out to solve it
but i decided to go do player hitboxes first
redrawing the player sprite for quite some time since it needs to be very visible to the player,otherwise the player is gonna have a bad time if he cannot locate his actor very easily
in a nutshell
GUI is constantly seeking for player
and since it couldnt find the player as it died
game crashed
i can fix this bug
or i can dont
and make it into part of the game narration
i wil postpone the decision forn ow
ah
but i want to show my death animation
so no i guess
trace_on();
seems like its related to the health bar
>deduction
when player dies
obj_player disappears
which will crush the game since gui needs it to exist
>theory 1
i turn obj_player invisble
instead of removing it from game
>theory 2
kill the gui bar too so the bug just dispapers
no good
>theory 3
create a obj_player somewhere as a decoy to trick the engine
probably would confuse the engine hard thr
if only theres a way to check if a object exists
:thinking:
bingo
>checkmate
making the hitbox smaller since theres a lot of bullets flying around
and the current player visual does not contrast enough against the green background
https://www.tpgi.com/color-contrast-checker/
also yellow+red looks dumb
:thonking:
>a few hours later
getting a bug where something in the code did not catch up to the hitbox change and the player start floating and wavedashing above the ground
may have to split up player_obj into 2 different objects
one for physical collision
one for hitbox
probably just print a invisble object at the player
and make a invisible hitbox
litteraly
the obj_player_hitbox exists visually now,but it doesnt follow obj_player
here we go again,same solution as the last time
no more wave dashing
welp now the hitbox isnt catching up
(also i figured out copying and pasting picture actually does work blogger but it takes time to the pic to load)
gotta do things step by step instead of trying to write perfect code first try
now to figure out to make it blend in with the obj_enemy position code so it doesnt noclip into walls
留言
張貼留言