• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

How to start practicing coding for a survival, base building game?

M

MarciaL

Guest
I hope I asked the question correctly, but I am a novice at game maker (I made a game sometime ago and stopped for awhile now I'm back at it again.). I'm still learning how to code. I was wondering if I wanted to create a based building game like (rimworld or oxygen not included (not as complex though.. I know I'm not there yet)) how would I go about learning to code around these type of games? Currently I am making a platformer, It's good practice I know, but I would like to learn code for base building, and ai input and such. Are there any tutorials out their for these type of games. To start learning on my own, I was going to create a tamagotchi type game to start me on the path. But if anyone out there doesn't mind pointing me in the right direction I would really be grateful for your help.
 
A

AveCoo

Guest
I'd always start with finishing small games first. I think lots of devs get disheartened because their aspirations are outside of their technical abilities and they never get anything fully done.

Start super simple, and work your way up gradually. Make a game in 3 hours (pre-made assets will be your friend), 6 hours then a day for example. Making something like a simple maze counts, just as long as it has a beginning and end. Always challenge yourself to use a new function as well. Get to know it and build those strengths. You'll end up learning and mastering everything you need to know, and get a brain for the problem solving involved with game development. If you keep up this practice, you'll end up learning everything inadvertently and surprise yourself with how confident and capable you feel when you finally take on your dream base building game project.

I hope this helps a bit; I know it's not exactly what new devs want to hear, but it will save you lots of heartbreak. Soldier on!
 

Yal

šŸ§ *penguin noises*
GMC Elder
I'm thinking you need to practice all of these things to have a fighting chance at a project like this:
  • saving and loading files
  • pathfinding
  • menu code
  • inventory
  • random world generation (perlin noise, sanity checks, population)
  • random tables (used for loot drops, enemy selection, etc)
  • chunk-based level streaming
  • floodfill algorithm (used to tell what's inside a room, if something only works when "indoors")
 

Xer0botXer0

Senpai
I think the more you code the better picture you have of what you can do and cant do, and with that, what is required.

Just quickly thinking of base building from oxygen not included, the player queues up objectives which the AI then carries out where and when possible, I think sims is a bit easier since the actions are literally just queued for one character, oxygen not included allows you to prioritize tasks, while having certain characters perform tasks according to criteria such as a character with higher level cooking will perform that duty instead.. in game maker you've already got a primary loop unlike say Python where your code runs from start till end and closes. In game maker studio your code will continue to run until your user exists the game, it crashes etc.

So for ai, they'll do their current task if any, if not then scan through a list of tasks given to them by the player, before doing the next task first prioritize etc then start on the task,which is usually literally just moving to a point, performing an animation for x seconds while say the water within the square clears up, since the task is cleaning water it means bottling water so after the animation a bottle o water is created at x/y location of the character.the character then checks to see if there's a designated area for dumping clean water and if not drop the bottle there, task is then completed unless you've added more code and in the next step the character will once again go back to checking for a new task.. one step before checkingfor a new task may be to check if it's daytime still, if not then sleep instead, think they're called nested if statements or nested loops..

Ooh random level generation, it could be as simple as looping through a 2D array of items that populate the world, where items have properties that theplayer sees like the durability of a tree, and properties that doesn't have meaning to the player like during level gen, can this tree spawn in this biome, no well then skip to next item in the array, can this plant spawn, yes, okay how many say between 1& 10, alright find a spotwhere it can spawn on..

More experienced devs can tell I'm missing inbetweens and important concepts here in my example of what kind of thought goes into considering functions that you'd like to and need to implement.

In any case if it seems daunting it's cause it is, I'd like to add though that it's better to get started and not finish than not start at all. ;P

I haven't finished a game either, I'm currently working on sprites, eventually I imagine creating rooms and adding dud objects with the new sprites into the rooms, then coding it afterwards. Alternatively people also use place holders before hand and just code it out and do the art afterwards. Many ways to make progress.
 
Hello !

I come here to share my very small experience in the matter ;)

What I personaly did is that I had an idea and I started by a plan on paper. What's is on the menu, How do I want the game to look like but always according to the things I knew already about game maker (which was for me rooms, objects and step events haha). And I started with the idea of a learning work. I accepted to redo everything once and I still have major mistakes that I wish to correct. It 's hard to redo but it's very good to learn. As you see what you've done the month before you find a much better way to make it out. That's how you realize you've improved ! And then while doing you will meet problems more and more complex that will bring you to learn more and more advanced techniques and functionalities. Problems are excellent to learn.

If you stick with small project using only what you know then you won't learn. If you learn before then later on, try to do, you will probably forget while learning and have to learn again what you forgot or even maybe learnt something you didn't needed ...

I believe it's best to aim high and try to climb step by step. It requires patience however :)

Something I like to recommand is to watch Shaun Spaling's video about "state machine". It has truely blown my mind (and made to redo everything ...). I think it's a really good starting point !

Don't be affraid !

Hope it helps o/
 
M

MarciaL

Guest
Thank you, I this will help me greatly. Thanks everyone... I just wanted to know which direction to go since their is soooo many different directions you can go with GML.
I made a small pet game some years back in game maker 8 ( I think). I really love ai-based/building games, or just sitting and watching them do task and such. At the moment I'm working on a simple platformer game. Afterwards I will begin working on really simple pet games. I know all this info will help me figure out what I need to learn for these specific type games. If anyone is interested I have a pic of my platformer in progress. (art is my strong-suit) :) thanks again.
 

Attachments

Last edited by a moderator:
Top