How to start? The very first steps...

BlitzPlus Forums/BlitzPlus Beginners Area/How to start? The very first steps...

Imed(Posted 2015) [#1]
Hello super-community.

I start with blitzplus some days ago, and i am in a weird situation because i know/understand the code, i mean, i went to all the tutorials, know what a variable, array, or type is, etc. With some time, i can even read and understand other people code... But dunno how to start coding, i mean...what structure should i follow?.
I think, the first thing to do is initialize the graphics part, but then what?, should i load all the resources i need and then put the gamelogic? should i divide the loadresouces part in one file and the gamelogic in another..? and that is just thinking in a very simple game. I check the code samples, and they are very good for what they do but i dont see how can modify it to my own needs, for example, loading the resources at the very beginning of the code could be good for a arkanoid tipe game with few graphics, but if i made some kind of rpg where you have a lot of images, sounds, etc...is that the best approach?.

Also, how to create levels or maps for a game? I am starting to believe that i not only should have to create a game, i have to create the editors too.?

Sorry for the long post, i dont speak english so is hard to me be brief and direct. Hope you understand me.

I dont see any tutorial pointing to how to approach a game creation (witch i was specting after finish reading the beginners guide...).

Thnx in advance, i hope someone could pointme in the right direction..

EDIT: Also forgot to ask...if i have for example a game where the player can manage a spaceship, but in another moment, get down from the ship and walk over a planet or be inside his base. Those three "states" works diferently, is possible/reccomendable doing different codes for each (like differents games) and then merge together, like load "insideship.bb" when is in the ship or load "onfoot.bb" when is not.?. Or is better to make all same time in "continun" code?.


RemiD(Posted 2015) [#2]
My advice to you would be to start by making different templates to achieve different things that you will use in your game.
When doing that you will improve the way you code and structure your code and you will be able to reuse these templates to make your game.
Also try to create procedures/functions/systems that you can reuse for others games.

If this is your first game, you should probably start with a game with separate maps/zones and loading screens so that it is easier to manage the loading/saving process.

About the loading of components (images, sounds) you don't want to load them when the program starts (except maybe a font and a cursor and a gui (if you need one)) because the necessary components depend on the map/zone the program will have to create and update.

Personally i separate the getinput (keyboard, mouse), the logic (update state, turn move, detect collision, reoriente reposition, update state), the render (determine what need to be rendered, animate and draw the images), the sound (play stop the sounds).

Good luck !


Imed(Posted 2015) [#3]
RemiD Thanks!!

That was exactly what i need!! Lets code right NOW!


RemiD(Posted 2015) [#4]
:)

About the different gameplays in your game (control the character or the spaceship or a computer or whatever), you can use a variable (for example "gamemode")

You can use constants to make your code more readable.
For example :
global gamemode%
const ccharacter% = 1
const cspaceship% = 2
const ccomputer% = 3
gamemode = ccharacter

If( gamemode = ccharacter )
 ;update character depending on previous state and input
else If( gamemode = cspaceship )
 ;update spaceship depending on previous state and input
else If( gamemode = ccomputer )
 ;update computer depending on previous state and input
endif



About how to create maps for your game, you can use existing tools or a custom map editor... It depends on what you want to achieve...


Imed(Posted 2015) [#5]
Thanks again for the support RemiD. I am organizing my proyect, planning it before write any code so i can go step by step. Also thanks for the gamemode code, i was predicting a future problem with that..LoL, and about the map editors, at the moment, my plans are going to avoid them as much as i can, because if i understand correctly, i should see the format of the files created by those tools and "read it"/ "write it" with my software so it will require a lot more knowledge i have right now -time too-. So, i just will start simple, following your advice, and using separate zones/screens.

Many thanks again. I'm really excited about all this, i used to create mods for other games -half life, wolfenstein3d, civ2- none of this ever released, but never has the kind of control or creativity freedom as i could have now where there is almost no limit of what can be done. Cheers!


RemiD(Posted 2015) [#6]

i used to create mods for other games -half life, wolfenstein3d, civ2- none of this ever released, but never has the kind of control or creativity freedom as i could have now where there is almost no limit of what can be done.


I have also created some mods for Morrowind before learning to code/create my own games, because as you may have seen, when you create a mod you can't modify everything as you want, you are limited by the existing gameplay and what the modding tool allows...

Of course it's easy to have ideas, the difficult part is to make them become real, there are many things to learn, but if you start with a 2d world and images it will probably be easier to see results (it is quicker to draw color 2dthings).
You will probably need a pixel perfect image editor tool (i recommend photofiltre 7) and maybe a sound editor tool (i recommend wavepad)

Goof luck for the next steps, :)