Somenone can teach me for Python with BGE ?

I need to rework my workflow in BGE, to refresh my understanding to code.

So there anyone can teach me python with BGE ?

Thanks

I had a quick browse through your forum posts, but could’t find anything of your current skill level to base advice off.
So if you can answer some questions:

  • How fluent are you with software developemnt (any language, even include html and other markups)?
  • How fluent are you with python?
  • Have you worked with object oriented programming concepts?
  • Have you worked with version control systems (eg GIT, SVN)?

Answering “no” to all of those questions is fine.

My reason for asking is because you mention workflow (a high level concept) but also seem to indicate you aren’t familiar with python (teach me to python).

First, understand the basics about the Python syntax ( https://docs.python.org/3/tutorial/ ), later try to read the Python guide for BGE by Monster ( https://blenderartists.org/forum/showthread.php?249757-Prof.-Monster-s-BGE-Guide-to-Python-Coding ), then mess around with the BGE Python API by yourself ( https://docs.blender.org/api/current/#game-engine-modules ), that’s how I learned, may not work for you, however.

i agree, your best bet is to learn python syntax. not by digging through manuals, but by picking apart the many good python examples line by line. figure out why it does what it does. discovering it for yourself is much more effective then someone hitting you over the head with a textbook.

code is very much a problem solving game.

remember, python has a dynamic nature, meaning a variable can become anything at any time.

read up on modules and classes, this will help you understand the BGE api docs.

Try https://www.codecademy.com/learn/learn-python. Then you can use the blender API for what methods are available: https://docs.blender.org/api/current/

If you get stuck, the forums are always here to help.

Yep my way is no more than programming, but we let see about your question:

  • I have some fluent in C++, I know the basic syntax and oop but i make small system that pretty work and simple.
  • I know some python but I have not try the concept oop, but I think it is quite easy to make it
  • yes but very basic of oop
  • I already use GIT and SVN to clone, update but not commit

My main reason is teach me as intermediate to advanced in python with BGE, as algorithm, list, tuples, AI, interface, etc…

So is who is ready to help me ?

I know the syntax but I need someone to make me to “good right direction”

that I need for solving problem to make concrete example, I search this one.

I get stuck because I need some concrete example as show me on how to code like pro :slight_smile:

First up:
It will take time to become familiar with advanced programming concepts. You can’t understand the need for the next layer of abstraction until you’ve hit the limits of the previous one. It’s hard to explain why functions are useful to a person who has not yet found that maintaining copy/paste lines is annoying. And explaining classes and OOP to a person who has not found themselves passing dictionaries/hash-tables/game-objects around dozens of functions struggles to see the advantage. Myself, I’m currently hitting the limits of OOP, and while some people seem to have found adequate solutions for some of these limits, I can’t help but feel there is a fundamental concept (I am) missing to embark on the ‘next level’ of programming. I am of the opinion that it takes about 1-2 years to become familiar with modern programming concepts - regardless of if you work with software full time or regularly as a hobby on the weekends.

So if a pro comes along and starts talking about concepts above your head, remember the names of what he is talking about, so you can google them in a few months, but it is often better to ignore the specifics of what he tells you to avoid confusion.

That said, here are a few rules that apply at almost every level of programming ability:

  • Read other peoples code and try figure out why they did things the way they did. Particularly in the language you are working with, but keep a little variety

  • Diagrams are amazingly useful - particularly when working with big systems. Diagrams for flow, diagrams for state machines, diagrams for architecture etc.

  • Try and figure out how parts of your code will interact before you write it (interface design)

  • Simple code is nearly always better than complex

  • Less code is nearly always better than more code

  • Worry about performance when it becomes an issue, not before. (That said, as you get better at writing code you will also typically write faster code)

  • Divide code up into reuseable sections (functions, classes, modules and packages are the way to do this in python)

  • Avoid global state variables wherever possible. They are a pain to debug.

Following those paradigms is pretty universal in the software world, and the last one (global state) will eventually lead you to OOP


Given where you’ve indicated you’re at, my suggestions are:

  • Balance developing BGE and pure-python software.
  • Use module mode rather than script mode, and keep scripts external to blend files.
  • Try write reusable functions. Package functions on similar topics inside different python modules
  • Learn how to work with git or svn. They will save you a lot of time if you ever want to go back to a previous version, and to share work with others. It is a bit of a leap from just knowing how to clone to being able to commit.

If you want a project to analyse that I’m mostly happy with the architecture of, try looking through to source to Inferno. It’s a relatively small game, and is fairly well structured (in my opinion). Feel free to ask questions about it.

Thank sdfgeoff for your words and interesting but I am ready to receive from pro user to give me some tips and tricks, now nobody can help me cause it is more advanced or too advanced to learn something to code. But thank the rule which you bright more clear idea and I look sure for your project inferno. You don’t want help my project of my game as tomb raider I need you as developer for python with BGE ?

Other thing, well I will read more books and source code from github to inspire me a lot :slight_smile: