Thought process of making a game. Am I doing this right?

Hello everybody! First post :wink:

So I just started to study computer science which got me into programming. I´ve always had a thought in the back of my head to programm a small game on my own. Im not THAT unexperienced in game making, but I have always used various editors, for example the warcraft 3 map editor or GameMaker etc… Starting from scratch is completely new to me and I hoped for some advice about my thought process.

My game idea: Its a survival game. You are a wizard in a small labyrinth (not really, but it has walls) and enemies are coming to get you. You have 4 spells, but start with only one, the others are gonna be placed on the map in form of items. The first, and key spell is creating a wall. However you can only have 1 wall up at a time. The idea is surviving by placing the wall in strategic positions to survive longer and pick up more and more spells with which you can kill the enemies.

What I think I need:

  1. A map, basically tiles with x,y coordinates. A tile can be ground or a wall, so basically 2 states. ( basically my biggest problem)
  2. The player, has hp and mana, is represented by a wizard which also centers the camera. Spells are casted by clicking while the spell symbol is tapped.
    2.1 The wizard can only be positioned on ground tiles.
    2.2 Spellclass need to be picked up, and have mana cost. They also need a getmousclickpos method to know where they affect.
  3. Enemies who have hp and attacks and pathfinding and spawntimings + positions.

My doubts:
I feel like not knowing where to start. I mean if there wasn’t for the graphic representation im planning on, I could propably program this effortless. But just the creation of the map/board brings my brain to desperation.

My hopes:
Even though it seems so difficult, Ive seen tons of cool minigames on this site which always sets me in a great mood. And the more I look into others code I feel I can master the art of programming. I hope you can tell me what Im missing in my thought process, and what simple hints could make my life a lot easier. Finally heres some concept art in case you didn’t understand yet what I am planning.

Nice project as first game, it has some obstacles, but it will teach you a lot.
The problem is, you cant dive in programming somewhere at te middle :(.
So we would need to know where you are with your knowledge, how much experience do you have with any programming languane, and how much with java?
For an start this info would be nice.

Are you starting with java, then you should try some tutorials and get familiar with oop first i guess.

Mhh yeah I get what you are saying. Its tough for me to say since I kind of know what to do, I just don’t know how to type it. Basically the syntax is my problem and I guess it just takes time to learn that. What Im hoping for is just some feedback on the thought process. Did I forget something/where could the problems occur.
I guess what Im gonna do is search for top down 2d games and look for the parts which are similar.

Well your saying you want to build an house, you know the color, and how many rooms you would like to have, and ask did i forget something?
Yeah you forgot a lot, programming is not just about syntax, i wish it was that easy, code of diffrent solutions cant just work together.
You cant just take any window from some house and put it into your house, you would need to know if it fits, and where to put it excactly and how it works, maybe you expect an full glass window to open at some spot or something, it would never work and you would be better of building your own window.
The problem with programming is, there is no main solution, each problem you are going to have would have multiple solutions (also depending on choices you made for other problems).

To give an example:


    private void Init(){
        vbo = new VBO_Terrain((2*SIZE + 1)*SIZE, parent.getShader().getAttribLoc("terrain"));
        
        depth = new float[SIZE+4][SIZE+4];
        SimplexNoiseGenerator gen = new SimplexNoiseGenerator(parent.getSeed());
        
        for(int x = 0; x <= SIZE+1; x++){
            for(int z = 0; z <= SIZE+1; z++){
                depth[x][z] = (gen.noise((this.x+x-1)/100f, (this.z+z-1)/100f, 0, 5, 3, 0.2f) * 20);
            }
        }
         
        water = new WaterChunk(x, z, depth);
        
        int x = 0;
        for(int zpos = 0; zpos < SIZE-1; zpos++){
            for(int xpos = 0; xpos < SIZE; xpos++){
                x = zpos % 2 == 0 ? xpos : SIZE - (xpos+1);
                
                addvertex(x, zpos);
                addvertex(x, zpos+1);
            }
        }
    }

This basicly creates some random 3d terrain and sends it to an VBO.
Its an solution for my try to create 3d terrain.
best solution?
no, far from it.
Could anyone else use it?
Nope, it would take hours before anyone understands the mess i made.
But for me it works to test some rendering, when im going to expand anything, i can throw this code away.

I really recomment taking some introduction tutorials, just so you wont get overwhelmed by any code.
Then you should find some open source game / engine you can mess around with to see what you could do.

Start with something simple, but which progresses you towards the finished game. I would start with the game board. See if you can render the board on the screen.

Don’t start with an image of the board, you need to store the positions of the walls in a data structure and then render each wall in the right location. You will need that if the walls can be removed and added by spells. You also need to know where the walls are so that later, the player and monsters are prevented from passing through walls.

It looks like a 2D tile game, which is a great place to start, so use a 2D array. Something like

byte[][] maze = new byte[32][32]

would create an empty array.

Write a game loop that does nothing other than draw the screen. The screen can be a single quad for the “grass” in the background and then small quads where ever you have data in your array. I suggest using a byte in the data structure, rather than a Boolean, because you could have different wall types in the future.

You will need to fill the array with data of course. For a test like this you might just put it into the code by hand. Maybe start with an 8x8 grid.

Once you have a maze, add a Character. It can be a simple sprite that hops from tile to tile as you press the keys. Then you can make it move smoothly with more changes to the code. Stop is hitting walls. Add other entities and so on.

You will not end up with an award winning game this way and the code will be far from optimal. But you will learn a lot. And your next game will be better.