Hello!
i would like to try an experiment and make a very simple game template here on the forum. The goal of this post would be to generate a step by step template for a simple game in UPBGE x0.3.6.
First lets describe the game.
I would like to make a car race game. There will be a ONE player car, with basic BGE physics and controls. And 2 other AI drive opponent cars.
The game will have 3 levels.
The game should have a LOADER to ensure everything is loaded and working properly in the scene.
After the loading screen, the next screen should be a MENU screen. From this menu the player should be able to either START the game, load a saved level or go to SETTINGS.
The game mechanics should be very simple.
The goal of this project is to create a simple template / mock up game with UPBGE in order to get a basic proved method of making a game from start to end and come up with a bug free, working as intended product.
I believe that would be a more efficient way to learn than reading thousands of threads and that once you have the basics down and manage to get a game actually working, from there is much easier to develop and experiment.
What i can do is to ask questions here and hope to get answers that would help reach my goal.
I will post and update this thread with my progress and try to make a video tutorial.
Thank you to everyone that will take part in this project!
First let me say I am Blender user. I am not a developer. I don’t really understand python, i have a grasp of some concepts, but i can use, edit copy and paste enough to make a script. Basically i am a complete newb. So please forgive my mistakes.
I think the first step should be to define the game files structure. Considering i want this game to be a exe file in the end, how should my project be organised? Should i have everything in a single .blend file or should i have each element in separate files?
From what i’ve read i understand that it should be something like this
Considering the goal of this project to use BGE not BPY, could this be a correct structure for the game folder and assets?
What is the proper procedure?
i am not professional game developer , so i cant say that my advice are 100% accurate
here is how i started to do in game development
crate everything in separate files so it would be easy to control when i want to fix or edit something !
player
enemys
npc if you have
environment props and items
thin i do the game file , and thats the file where i build everything in , from menus to loader script to the level scene .
i link all the things i did before into this file too
what i used to do in my last games is
one file that has everything in
and that’s because testing things and fixing them is much easier when its fast to access the rest of the scripts and logic
thy might be in a chaos form for you .
also i created them using old upbge 2.79
the newer one structure changed in a way where i cant understand them anymore !
but the important thing is to have a great knowledge of game scripting . because there is so little that you can do without it !
It might be worth taking a c++ Unreal course on Udemy if you want to get into game development properly. The courses are always on sale for a couple of dollars. It’ll give you better prospects if you want to get a job with a game studio. Blender will be great for creating the assets, animations and artwork, but the BGE is very limited comparatively. Unreal is also free until you earn over $100,000 I think.
The process is:
create the assetts
set up the engine for your intended hardware/operating systems.
lay it out in the engine’s editor
modify collisions where necessary
modify the materials if necessary
create the game logic for player controls, interactions, scoring, etc
add menus and end ingame/completion screens/animations.
package
release.
I took this course on Udemy:
It was pretty good, but I think it would be worth taking a C++ course first if you’re new to programming. It also has a tank battle game in it, which might be useful for your racing game.
Thank you for your reply @Michael_Campbell .
I like doing research and figuring out the hard way. Also i am very familiar with Blender and UPBGE being Blender is what makes me want to try this. I don’t want to have to get familiar with a new environment like Unreal at this point.
After some research i think the best approach for this project, would be to use a single folder for all the files.
I managed to get a Menu working that opens another blend file.
But i hit a interesting bug. I import in a new scene a collection with a vehicle.
I hit P and it plays as intended. I close the scene, open it again and https://www.youtube.com/watch?v=96oPMF6TST8
I tried just using the blender file that works, so no append, and now the car doesn’t jump anymore, but it’s just frozen, and once i hit escape to return to UPBGE 0.3.6.2 it crashes.
Anybody knows how to use a debug log? What am i looking for?
I found this at the end of the file
I guess i have to keep workin on it, i’'l get back once i have a working first file.
Please subscribe to my YT channel if you want to keep an eye on my project.
So i got to this point where i have to scenes, Menu.blend and Level1.blende.
Each one works. In play mode, when i load Level1.blend from Menu.blend, the scene loads but the controls don’t work. If i press escape to get back to upbge, it crashes.
Open Level1.blend
(BTW I get a message “Eevee next” not available. Addon is needed blabla."
I ignore this)
And there is an extra window with the system console. Close this window and save the file.
a small progress with my project, thanks to @musikai
https://youtu.be/n9fJT6OOeI8
i recommend the upbge comunity to anyone looking to learn more about UPBGE.
For instance i learned that the last 0.45a seems to work ok, until now.
Anyway, until i can do a complete tutorial on the whole process, I have to actually make the whole project, so back to work.
I’ve been combining tutorials from www.youtube.com/@FireforgeLabs and https://www.youtube.com/@FireforgeLabs
and i realise i need to understand Phyton. It’s very confusing for me that there are so many ways to do the same thing, and i am looking for a pattern, a template. Everywhere i look on youtube, i find millions of learning python courses and tutorials, but i can’t find one to explain the basic underlying procedure in the BGE context. And the fact that the libraries and functions and syntax seem to change from one version to another doesn’t help.
For a non-coder the fact that you can call something anything and it can mean something doesn’t make sense. For instance i see people using “self” or “own” or ‘owner’ and it means the same thing, but for me is so incredible frustrating and confusing. Why can’t i just use the name my object has in the scene, without having to declare it in all kind of ways and parenthesis!?
Anyhow, just a non-coder venting. Don’t mind me:) I’ll go back to studying and get back soon with actual questions.
Quick progress. Managed to make a usable gui using only bge. The code example was already there, but because i am a non-coder, trying to change a bpy relative path to a bge relative path took me 3 days! All i had to do was change themepath = bpy.path.abspath('//') with themepath = bge.logic.expandPath('//') 3DAYS! But now i know how to use theme with bgui.
Please subscribe to my channel if you looking for a full tutorial coming soon.
I’ve read some of the replies. I agree that you need to decide on the structure. Some suggest multiple *.blend files; I disagree with that approach. I would look at using scenes for. As I understand it, a scene used as a GUI can be identified as an overlay. I’ve been looking at UPBGE and Range. Range fits me better. For UPBGE, I’d concentrate on places where you can use a Python script controller to limit the number of conditional logic brick connections. There may already be a car example that would save you from coding or bricking out the car logic. I’ve learned that coding is easier with an external editor. You can set the PYTHONPATH environment variable to find BGE modules, then use VS Code with a Python extension for a better coding experience.