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  



w h y



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


2/27:

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




tl;dr the game crashes if it cannot find obj_player(which happens because obj_player is removed from the game if the player dies),i did not have a solution at this time so i just made the bug impossible to happen for now by not letting the player die lol

(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


maybe i could make a level where all the ground is invisible and the player have to figure it out like INK with bullets

5/5:
enemies finally having a gun

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)


maybe moving it to run at end step(from step) will make it update closer
if not
then i guess i will just ask the code/hitbox to predict where player goes 


oh well
not gonna complain about an easy solution





5/12:

making a copy of obj_gun


parenting ahoy


whats better than one gun?
2 guns 




like really the general advice(i think)for new game devs is to make your first game'scope as small as possible then publish it
so you feel like you actually finished something which creates a positive loop to help encourage you to dive deeper into game dev and avoid getting frustrated with not getting any results out

this guy isnt a good example but at least expanding on the scope is better than having a unreasonable oversized scope in the first place

5/13:




5/14:





5/18:
https://foxyofjungle.itch.io/post-processing-fx

i dont know how hard shader actually is,but i have monee and i dont want to deal with shader,and theres a really nice shader engine here,so.........

5/20:



5/21:


i must go
my planet needs me.mp3 


5/22:


well time to figure out what to do now
1:start doing level design
2:start digging more art assets
3.watch even more shaun tutorials because why not
4.adding some more mechanics(death pit,time slow,bullet knockback)

5/23:
sorting art assets and bought the dark fantasy studio bundle


5/24:
time to start working on the bullet knockback
now i need to i figure out
how to detect where the bullet come from
and how to move  the enemy when its hit
(without it clipping int o a wall hopefully)
no vertical
only X asis knockback
i mean i could do y too
but lets focus on X first



turns out 1 is a lot of when you hit a by a dozen bulets
and the big enemas go sliding now
postiion is one thing
hspd is another tihng
moving the object position is actually what i want.not hspd





and i got it reversed
time to reverse the code thne



gotta do things step by step instead of trying to write perfect code first try

the trick to "better" code is probably write out some code first so you can improve on it


now to figure out to make it blend in with the obj_enemy position code so it doesnt noclip into walls

so i have 2 ways
theory 1
copy the collision system from obj_player to this obj
and do the collision check again here
(which is kinda dumb and ineffcient)
theory 2
somehow send the data back to obj_enemyxl and do it there

since T1 is kinda dumb lets go with T2 first






no idea how but the knockback made them went down somehow

5/25:
bought a shader engine(or whatever thats called)



 hm
i wonder what wrong with this code
putting xknockback into Y collision
also the xknockbac sohuld be added earleir
the current order overrides to collision


inbe4 pong with bullets

in the meanwhile have more pictures of i have no idea what i am doing





still not working,let me try swapping the order,ngl i dont know shit about collision systems



time to bruteforce this because i have no idea what to do while also questioning is this worth it

do i  really even need kb anyway
since enemy XL already have kb
i only need the KB on the boss anyway
KB should only be applied once but somehow it stacks 
or it just doesnt belong in the step event where its run 60  times a second

also time to give T1 a try


:thinking:

and well
this thing(xknockback += 1) here keep stacking the knockback,no wonder the enemies keep going faster and faster
the root of all evil
gotta figure a way to "reset" it


back to T2 again

again
figuring out the collision system
i have no idea what am i doing but it seems to be working.jpeg







i have no idea how ds_lists work because i just copied this one from the manual

dont have grpahics for the shockwave but well it works


pretty sure this isnt how you do slow motion but whatever



TIL

mp++;

5/26-6/1:
figuring out how the shader engine works



haha settings go funni





6/1:

tfw ur game start to look like something

current goals:
1.fix the mp bug
2.actually start doing level design
3.trying to start using snowstate
4.go watch more shaun tutorial beause why not
5.giving MC a wizard hat

6/4-8:

working on writing this funni lets play and also:


imagine not listening to the music assets bundle you bought









will update this lets play if i feel like it

留言

這個網誌中的熱門文章

my 2000 cents "essay" and thoughts on tf2 and life after 9000 hours

a lets think on dicey dungeon(reunion dlc witch)