2021-02-20 14:23:07

Hey everyone. Hope you are doing well.
So I have been writing down Ideas for a racing game that I have been wanting to develop. SO Between Top Speed and Rail Racer, there are things I liked about both. In top speed, you had more ambiance to choose from within the game. You could make your own tracks with different types of terrain that would effect how your vehicle drives. What I did not like about Top Speed was the engine panning every time you steered your vehicle. What I liked about Rail Racer was the fact that your engine was always in the center and it made you feel like your were in the vehicle. The curves were a good Idea. But I also liked how Top Speed had four different types of curves. I liked how in Rail Racer there were different types of objects to interact with. What I also liked about Rail Racer was when an opponent was behind you, you would hear there engine on your left. If they were in front of you, you would hear there engine on your right. So you can think of this like a number line. Positive numbers to the right and negative numbers to the left. What I did not like about Rail Racer was the fact that there was only one computer player named Art. So I am planning on incorporating a combination of both types of mechanics from Top Speed and Rail Racer. And then adding lots of my own touches inspired from Video Racing Games. So I want people to make there own vehicles with there own start sounds, single or multiple engine sounds, Gear Shifting, breaks and crash sounds etc: I want people to create there own tracks with music and either built-in ambiance or there won, race announcer of that track etc: And I want people to be able to create custom drivers, custom pit bosses, and custom co-drivers. There is more I could say and I have lots more Ideas written down. What makes me sad is that BGT is no longer supported. Since that is the first programming language I messed with. I'm told Python is good but you have to include the Python interpretor in your games which makes them very huge. I hope I am not being two confusing here and I don't mean to upset anyone here.

Sincerely:
John Follis
Check out my YouTube Channel.

2021-02-20 14:46:18

Very large... video games nowadays weight more than 100 Gigabytes, the Python interpreter is like 3 or 4 Megabytes in size, I'd recommend you don't worry about the size of an interpreter, but see which language suits you best for such a task.

2021-02-20 14:54:25

python will be more than ok to handle this, And also, Switching from bgt to python is easy, At the least, Compaired to other languages like the c languages, And you also have lucia which has too many concepts taken from bgt, Although it's maybe a bit of broken, But it works, And about the compiled size, You can avoid this by just using a virtual invirement, Sorry broken spelling, But you get the meaning, And that way, You install all your stuff via pip and when you compile to exe theprogram will just use what you installed in the virtual invirement, And avoid stuff you installed for other projects for example.

2021-02-20 15:35:41

OK. Well this will not have any video in it what soever. So it is good to know all these things. I will check out that lucia stuff I have been seeing.

Sincerely:
John Follis
Check out my YouTube Channel.

2021-02-20 15:37:58

do not use python if you can help it, you need a lot of work to get the game fast enough to play, doesn't mean python is slow but  to make it fast enough to be playable you need a lot of work

2021-02-20 15:43:04 (edited by mohamed 2021-02-20 15:45:22)

@5, Python isn't slow, Maybe slow compaired to c++/rust and those crazy speeding languages, But it's not vary slow, You still can do stuff with it even online, And if you got lagg or stuff there's modules like multiprocessing that may help, Tip, Don't ever put multiprocessing in a while loop, Or good luck crashing your computer.
And also, You got something called cython which speeds up your python code by 25%.

2021-02-20 15:46:28

many peapol  online advice to not use threading or   processing  for some reason though

2021-02-20 16:15:35 (edited by mohamed 2021-02-20 16:21:13)

unfortunitly yes, Python threads are kinda slower than the main thread if you are going to compair them, But however if you do a game with single thread for the whole thing, Then using python and using bgt is not really a difrent, It goes better when too many processes goes on where threading becomes better.

2021-02-20 20:04:45

@Meatbag please stop going around telling new programmers that python is slow. python is plenty fast for a project like this. I'm not even a huge fan of python for application development, but I know for a fact that it can handle 90% of audio games out there, including this idea.

others have tried to point out to you that python isn't the problem, but rather the algorithms and data structures used. if you don't use them well, then your program will be slow even if you programmed it with raw assembly, let alone C/C++.

I don't want this to sound mean. I think you are probably very young, so it isn't your fault you don't know much about reasoning about space and time complexity in programs. however, you don't understand that the language/runtime isn't the problem when developing an audiogame like this, it is that you don't know how to write performant code. going around posting don't use python because it is slow, when others have pointed out to you multiple times that it is not the isssue is really unhelpful to other new programmers

2021-02-20 21:26:15

Came here to say basically this.

Facts with Tom MacDonald, Adam Calhoun, and Dax
End racism
End division
Become united

2021-02-20 21:38:39

I really thought the collision tutorial from a while back proved the point.  Apparently not.  Sigh.

Threads are bad because if you use threads and you're even remotely new to programming, you've just taken your one problem, namely it being slow, and added a second one, namely being buggy.  It took me something like 2 or 3 years to be competent at using threads and, at work, we've got a bunch of threading experts and the code reviews for threading stuff are always the most painful regardless of who wrote it. Just don't.  Learn how to not write slow algorithms first.

My Blog
Twitter: @ajhicks1992

2021-02-21 10:20:46

@camlorn, Any tips of using threads the correct way? I'm really interested to know what is the correct and the incorrect way of using them, From what i understand you are saying there are some ways the developer should and shouldn't use threads with.

2021-02-21 18:04:51 (edited by camlorn 2021-02-21 21:22:31)

@12
Google deadlocks for an example of what happens if you get it wrong.  Getting them right is very situation specific.

The easiest way to use threads is when they don't share any state.  So for example if you're fetching a bunch of web pages you might do one thread per web page.  And in fact you can even find libraries that will make it easy, for example the Python multiprocessing module, which lets you do something alongb the lines of this:

def process_webpage(url):
    # ... stuff
    return result

processed = multiprocessing_pool.map(process_webpage, url_list_here)

That's not exact because these days I primarily do C and Rust, but it's along the lines of how things go.

The problem is that there's a ton of overhead to starting up something like that, enough that if the work you're doing isn't like 10-20 ms per work unit then you're wasting time.  But more to the point the safe/easy approaches like that don't work for games because every thread is going to want to touch the whole game all at once.  It requires a good bit of originality to rearrange your algorithms to be friendly to threads.

But then you run into the fact that on a 2 core laptop running the OS and NVDA you don't get more than one core anyway, which means even if you use threads they're not running in parallel, they're just taking turns.  So even if you do get it working, the people who benefit from it are the people who don't need it because they've got a powerful computer, and if you rely on it instead of making fast algorithms then no one with a cheap laptop can play it and you've just defeated yourself.

Where threads show up more is e.g. a web server, which will do one thread per request (Django does this for example, but it's hidden from you).  Or databases like Postgresql which will use divide and conquer approaches to run parts of the query in parallel.  I deal with them a lot at work because part of work is a custom database and another part of work is an analysis engine that has to process millions of giant files a minute sometimes.

If you were doing an online game you might do one thread per area.  Getting objects between threads and making sure that areas don't have to read other areas that other threads own is a thing that's not so easy, but it's a good divide and conquer approach and an environment where one core won't do it (you've got physics, all your pplayers go to a different map, now you're running the equivalent of 20 games. One core isn't going to do it).  But if your game is complex enough to justify that you'd probably not use Python first, and I don't think we currently have multithreaded online games save perhaps for doing the networking in the background, so the scale at which it matters is larger than you'd expect.

My Blog
Twitter: @ajhicks1992

2021-02-21 20:24:49

@13 I think in your code example you forgot to pass process_webpage to the map() call

2021-02-21 21:22:07

@14
Ah, so I did. I'll fix that.

My Blog
Twitter: @ajhicks1992