2019-02-06 19:21:19

Just a thought I had one day.
So, I guess the reason people like BGT over Python is that BGT is set up specifically for the task of creating games, which means it has few other hard things to learn.
Python on the other hand is for many things and has lots of advanced stuff too.
So my idea is to create a BGT wrapper thing for Python. This contains all the BGT compatible functions and objects. I realize this would be hard, however it might encourage many people including me to try Python, since it won't be required to get used to all the different ways to do stuff.
What do you say?

My tactical battle scripts: https://www.dropbox.com/s/dzsmqv2pgqvu1 … h.zip?dl=1
Currently, one of my favorite games is Trimps.
So I'm the Trimper Trooper!

Thumbs up

2019-02-06 19:33:12

very grate idea

Thumbs up

2019-02-06 21:10:21

This would be nice for newcomers. I'd rather avoid a lock-in like BGT has, though.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

2019-02-06 22:19:01

So ... an easy out-of-the-box sound engine? Python comes with most everything else, and what's missing can be installed with accessible_output2 or toke, and pygame / pyglet. Of course, some of those result in dependency scavenger hunts (I reinstalled windows, and somehow this results in my having to import some wintype or windows gui or something module or else AO2 crashes).
... Ok, that's not exactly fair. Pygame doesn't have something as convenient as show_game_window. Javax.swing had a less annoying way to open a window. But pygame's is nicer over all.
Ugh. OK, yeah, if you can package all this stuff into one big setup.py install, then please do. It's crazy how impossible it's been to replace BGT's sound engine, even by just trying to copy the blasted thing (turns out directX is being forgotten for reasons). Fmodex looks nice, but now I have to upgrade Python to a version that supports it, and subsequently reinstall Pygame, VisualPyode, box2d, accessible_output2, numpy, all of their numerous dependencies, and everything else that I forgot. That's a ton of effort for approximately 0 benefit, so I still haven't gotten around to it.
I'd pay someone to do that part for me, except I lack the cash that it would be worth. I'd contribute to a crowdfund, probably.

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up

2019-02-06 23:39:53 (edited by keithwipf1 2019-02-06 23:40:52)

I don't suppose we could set up this on Github, maybe start, like, focusing on one ssmall part of the help file at the time, implementing the functions contained in it?
I am absolutely no good with python, I can't even make an if statement yet.

My tactical battle scripts: https://www.dropbox.com/s/dzsmqv2pgqvu1 … h.zip?dl=1
Currently, one of my favorite games is Trimps.
So I'm the Trimper Trooper!

Thumbs up

2019-02-07 05:45:07

Hi,
Me and my friends were already making it. I think it's the best time to public the github repository. I invite you to contribute. And a small request. This is my first day with github. So if you find something is incorrectly done/missing feel free to point out.
Https://github.com/amitaggarwal444/BGTKit
Regards,
Amit

There once was a moviestar icon.
Who prefered to sleep with the light on.
They learnt how to code, devices sure glowed,
and lit the night using python.

Thumbs up

2019-02-07 06:26:42

404

Thumbs up

2019-02-07 06:57:15 (edited by Amit 2019-02-07 06:58:42)

Hi,
Sorry for it; it seems to be working now. Try below.
https://github.com/amitaggarwal444/BGTKit
Regards,
Amit

There once was a moviestar icon.
Who prefered to sleep with the light on.
They learnt how to code, devices sure glowed,
and lit the night using python.

Thumbs up

2019-02-07 11:16:27

Well, Python is very slow, and although BGT is not as fast as something like C++, it has much better syntax than Python, although I'd like to learn Python too because NVDA was made with it.

Best regards
T-m

Internet access is a human right.

Thumbs up

2019-02-07 11:32:32

Hi,
I don't think there is anything which will be faster than C/C++. But python isnt slow as much as you may think. It's in the world's top 5 programming languages list for a reason. It's beeing used in high speed apps, games I mean. And it's most popular language if you'd ever like to do machine learning data science or natural language processing.
Regards,
Amit

There once was a moviestar icon.
Who prefered to sleep with the light on.
They learnt how to code, devices sure glowed,
and lit the night using python.

Thumbs up

2019-02-07 13:01:13 (edited by Aarush 2019-02-07 13:05:08)

hi there.
I'm a proud member of this project's development team, and i'm glad that we decided to make this open to the public, so that everyone could contribute to it and make it a success!
as for the speed, i myself have quite an experience in python programming, and i dont think its really as bad as people might think. Sure, it has its downfalls, hell every programming language does, and i'm sorry but i'll have to disagree mstuff, i find python's syntax way more simplistic than bgt, or any other language.
Anyway, best of luck and we hope for feedback and contributions from you guys soon!
Have an ausumn day!
regards

i am the godfather, aarush is my name
dominating the world, is my aim.
obey my commands, or thou shall suffer excrutiating pain.

Thumbs up

2019-02-07 13:13:32

at post9:
Python is very slow? What?
Come on dude. Go google about python a bit, and you'll see it's not "very slow". Python might be a bit slower than C++ or C#, But it's way faster than what you think.
Just think for a second. If python is very slow why would google use it? Why would python become one of the most used languages in the world?

Add me on skype: kianoosh.shakeri2
Or follow me on twitter @kianoosh shakeri

2019-02-07 14:00:37

this would be so nice for beginners

2019-02-07 17:17:46 (edited by keithwipf1 2019-02-07 17:21:58)

This is cool and thanks for putting a link to that here.
Maybe I can make and learn something out of it. smile
Edit: This seems a nice start. I wonder if someone should set up a small website where certain data can be listed, so that we don't go redoing functions that were already completed?

My tactical battle scripts: https://www.dropbox.com/s/dzsmqv2pgqvu1 … h.zip?dl=1
Currently, one of my favorite games is Trimps.
So I'm the Trimper Trooper!

Thumbs up

2019-02-07 18:06:52

In theory, that's what Github does.

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up

2019-02-07 18:11:45

I dunno, is it all on one page? I don't use Github much, but for that to be useful, there is no point clicking of 21 different links to know what's been modified.

My tactical battle scripts: https://www.dropbox.com/s/dzsmqv2pgqvu1 … h.zip?dl=1
Currently, one of my favorite games is Trimps.
So I'm the Trimper Trooper!

Thumbs up

2019-02-07 18:53:39

honestly, I wouldn't even want to compare the two since they are one interpreted and the other compiled, but probably that's just me.

if you wish,  you could give a look at my github profile.
If you want to get in touch with me you can follow me on Twitter
have a nice day.
Paul

2019-02-07 22:50:23 (edited by Hijacker 2019-02-07 22:52:22)

Hi,
when developing such a massive project, i'd definitely recommend to use GitHub and further plan on which dependencies you want to use, including submoduling them and such stuff.
From a quick look at it, it seems rather messed up. You're using both wx and pygame already, both seem like they want to do the game window stuff, but neither of both does it correctly. Why use wx when you can use tk, which is natively installed and will do for easy tasks like quick message boxes?
The entire setup is still missing, but thats not a problem, since this is a rather young project and you'll get to this point sooner or later.
Since you just pushed your stuff into a git repository i'm unable to tell anything about your git experience. Lets just say that managing a team of developers without git experience within such a large project will get messy rather quickly. I appreciate your efforts and don't mind to submit some pull requests, having years of experience developing auditive python content myself, but you should rethink your git strategies and maybe hand the repository management to someone more experienced with git, GitHub, pull requests, issue management and all that kind of stuff. Maybe setting up a GitHub organization for this situation and adding collaborators / organization members with the corresponding rights to fullfil their jobs will be a nice idea here as well.
Best Regards.
Hijacker

Thumbs up +1

2019-02-08 04:29:50

Hi,
You got it right. I am still learning these things. And I don't mind anyone more experienced to handle the process actually, since that will be a guided learning in my opinion. I read somewhere you learn much more under the wing of an experienced developer. So yes, I am waiting for the suggestions. What needs to be done now etc. It's kind of hand holding but it's a grate way to learn for not just me, rather for every young developer who will be involved in it, since we all will get to see how a real project is developed live and step by step.
Regards,
Amit

There once was a moviestar icon.
Who prefered to sleep with the light on.
They learnt how to code, devices sure glowed,
and lit the night using python.

Thumbs up

2019-02-08 09:44:30

Hi.
This seems very interesting for sure. I think I might be able to use it if I learn just a bit more Python. I haven't downloaded it yet, but I would like to ask if it comes with a readme, which lists all the functions and how to use them? Keep up the great job.

Best regards SLJ.
If you like the post, then please give it a thumps up.
Feel free to contact me privately if you have something in mind. If you do so, then please send me a mail instead of using the private message on the forum, since I don't check those very often.
Happy gaming... :D

2019-02-08 13:37:37

As far as I can see, not yet. But one part of a project like this would be a fully featured guide (documentation), including a hand full of examples to get you started.
Best Regards.
Hijacker

Thumbs up

2019-02-08 15:03:59

Ok, Python might not be as slow as I said, but BGT's syntax is still much much much much much much much much much much better than Python.

Best regards
T-m

Internet access is a human right.

Thumbs up

2019-02-08 16:17:19

Because it uses braces rather than indentation? Is that really worth that many muches?

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up +1

2019-02-08 17:25:38 (edited by cartertemm 2019-02-08 19:41:33)

Okay, here's my issue with this package. All gripes aside, I appreciate the work done and desire to move on. Also it's nice to see a modicum of collaboration from the community once and a while. I just wish it were to be to different ends, and I'm failing to see how this is truly breaking free from the aptly named BGT trap at all. If nothing else your actually enforcing it by foiling the ability to move forward, I'll explain.
I'm not here to discuss the unfavorable code practices in use, everyone starts somewhere and it's mainly the thought that counts. If you'd like an in-depth code review, let me know and I'll be more than happy to provide one.
What you've done is rallied a bunch of BGT programmers who have been wanting to get a hand full of python for a while now but had no idea where to start. They either want to move on due to anti-virus flagging, a desire for crossplatform development, a simplistic workflow, the agreeably superior standard library, or a combination of these. One of the most important aspects of any language is undeniably it's stdlib, past syntax, not knowing the standard library like the back of your hand will leave you spending debilitating hours upon hours rifling through boring documentation to merely understand what's going on. I dare say a language is nearly next to useless without it's standard library. A language is only what you make with it.
Here, you have functions such as directory_create, directory_exists, file_exists, file_copy, file_delete, wait, exit, read_environment_variable, string_left/right, string_trim*, string_reverse, string_replace, string_split, string_len, string_is*, string_contains, base64_encode, ascii*, and probably a lot more I'm not listing that are simple must-know one-liners in the standard library. This project is giving everyone an extremely easy way out. Pick up python, learn syntax, and go. Sounds all well and good in the short term, but later on I fear

  • dependence: In wrapping some of the core functions, we're looking at a library that one must rely on and toat across all projects because that's simply all one is able to effectively use.

  • Detriment to collaboration: The standard library is universal, known to every python programmer worth his/her sault. Throw a project up on github? Good luck getting anyone without a prior BGT background to colaberate. Not for the whole opensource idea but know a friend who codes in python, same dilemma. Are we then saying such a prerequisite is required? Wait wait, isn't the idea to abolish BGT anyway? Don't wanna use BGT please learn how to use BGT and then you can contribute, talk about an oxymoron and unproductive one at that.

  • lack of resources: In BGT, an irrifutable downside was the inability to search for errors, functions, or practices on the web. In python however, running into a weird error or interested in how to pull something off? Simple as a couple clicks away on the godly stackoverflow. With this library, nobody has any clue what string_trim_left(string_left(string_mid(string_to_hex(something_bad)))) means and nor would they care to figure it out. In pythonic lingo, slices, str.replace, str.split, etc will yield a no problem Here's how your issue is fixed. In a matter of minutes.

  • lack of creativity: Python includes a host of glorious functions and modules not dreampt of in BGT. Sometimes the only way of figuring these out is by digging into existing code. But if the code your looking at doesn't feature the all mighty bgt kit, ahem every pythonic project ever written, your at a serious disadvantage and probably will have no idea what your looking at. codecs.encode(string, "Hex"), weird right? string.split(" "), even weirder. os.path.isfile(path), whoa! hashlib.Md5.new(data).hexdigest(), oh so complicated! Anything ctypes is foreign, notice what I did there? Shut up, I'm pre-coffee.

  • development time all around: Why, just why spend time wrapping everything, builtin types included in reference to the empty array directory, when you could be creating something helpful that isn't reinventing the wheel with absolutely zero improvement? Why not spend your time on games, or wrappers that don't exist right now.


I guess the biggest source of irritation here is the shear allusion of progress when in theory it's like 1 step forward and 1 step back. Nothing is positively impacted. We're far enough behind as it is without introducing more pitfalls.
I don't like writing posts that seem bashful through and through, so allow me to make some suggestions based on years of experience in the field.

  • Remove all standard library wrappers. String*, file* directory*, all of it. Encourage learning the builtins. If your not up to moving past standard BGT functions, sorry but I don't know if programming is your game no pun intended. For the lazy nearly everything is a google search or forum post away. There's an evident difference in those who simply make a program run and those who spend the time to make a program that runs.

  • Get your hands dirty wrapping useful includes if you like, sound_pool, sound_positioning, possibly dynamic_menu. But not, and I repeat not, line for line. The birth of a new language should spell out the birth of a myriad never-before thought of ideas. It did in my case anyway.

  • Stick to only the required dependencies. There's nothing at all wrong with using more than a couple modules, but they should seamlessly flow in a way that makes your program not only work, but work well. I'm looking at the combination pygame+WxPython here.

  • Learn the ins and outs of git. It has somewhat of a steap learning curve, but trust me when I say your on the way to making a really good lifelong friend who will never leave your side.

  • Learn  the builtin facilities offered by python. Use them as much as possible. They've been tested and proven to be reliable time and time again over the course of many years, contributions, and dedication. If you want some inspiration check google to see a list of widely known projects that use python, facebook for example.

  • Create tests, not only an engine. This could be in the literal sense with unit tests, or an actual game. Just as long as the project is widely used and tested. During the case of working on our non-visual gaming framework (nvg) I can't even begin to estimate the number of bugs fixed due to the fact that everyone in the team was in the process of creating a game of his own.

I'll stop here for now, this wall of text has already gotten long enough. Thanks for reading and I sincerely hope you take some of these points to heart. I really believe python has the ability to yield some extremely Innovative results if only we would approach it in the right way. Anyone is more than welcome to add me to skype (name crtbraille) and I'll be more than willing to help to the best of my ability.

Thumbs up +4

2019-02-08 19:15:39 (edited by Ethin 2019-02-08 19:21:30)

Heh... carter pointed out some things I didn't even think of. Thanks, Carter.
Carter is right about the built-in usage. Python has built-ins for a lot of things (check out the Python standard library docs on built-in functions for all of them). You need not write your own custom hex encoder/decoder (though you might do it for learning sake), just use hex() and int() (hex() to encode, int() to decode). You can use codecs.encode(), too, which is most likely a better solution since you can define custom codecs along with the pre-registered ones (which includes all the standard encodings (ASCII, Big5, ...), along with Python specific ones (idna, mbcs, ...), and many others). To be of more help, I have below provided built-in/stdlib alternatives to what you have already created:

  • directory_create: os.mkdir, os.makedirs

  • directory_delete: os.remove, os.unlink

  • directory_exists: os.path.exists, iterative os.scandir (more costly)

  • file_exists: again, os.path.exists, and iterative os.scandir (again, more costly)

  • find_files, find_directories: conditional if item in os.listdir(). (As a personal preference, I highly recommend os.scandir/os.walk, but that's me.)

  • file_copy: shutil.copy, shutil.copy2

  • file_delete: again, os.remove, os.unlink

  • exit: sys.exit

  • wait: time.sleep (or if your using SDL2, sdl2.SDL_Delay.) (There are sleeping functions in Pygame as well if I'm not mistaken.)

  • read_environment_variable: conditional item in os.environ

  • run: subprocess.Popen, subprocess.call, or subprocess.run

  • ascii_to_character: chr()

  • character_to_ascii: ord

  • hex_to_string: codecs.decode

  • number_to_hex_string: hex()

  • number_to_words: (why is this actually necessary?)

  • string_base64_decode: base64.b64decode, codecs.decode

  • string_base64_encode: base64.b64encode, codecs.encode

  • string_contains: str in string, re.search, re.match

  • string_is_alphabetic: string.isalpha

  • string_is_alphanumeric: string.isprintable

  • string_is_digits: string.isdigit, string.isnumeric

  • string_is_lower_case: string.islower

  • string_is_upper_case: string.isupper

  • string_left: string slices

  • string_len: len

  • string_mid: string slices

  • string_replace: string.replace

  • string_reverse: string slices

  • string_right: string slices.... again

  • string_split: sting.split

  • string_to_hex: codecs.encode

  • string_to_lower_case: string.lower

And that's not all. I'm looking through the code and am not impressed at all. Almost the entire foundation layer is dedicated to ripping off the standard library and Python's built-in functionality. And I won't even jump into the fact that I saw at least one instance where you pulled from the event queue manually, and possibly engineered a situation where the event queue is being pulled from in two separate functions (terrible idea, by the way). I don't mean to bash, but come on... I know you guys can do better than this. And let's not forget that your trying to get WX to work with Pygame... .sorry, not happening. And don't try running WX in a separate thread, it won't let you.
Update: 33 instances, 4 of which (at least) I counted where I listed you could use string slices. And I wasn't even close to done. I haven't even gotten into the objects part, or the "helper layer". A game engine should not be focusing on all this when the language provides this for you. A game engine should be focusing on what the standard library doesn't provide you and what you can use in a game (i.e. audio, joystick, game controller, haptics, physics, and so on). My personal recommendation would be to use FMOD or Wwise, primarily because I've used FMOD (though Wwise can be a pain) and FMOD is at least very good. (Its also one of the top audio lbraries in the mainstream industry, thoguh Wwise kicks FMOD's ass, by far.)

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up +2