#game-development

1 messages ยท Page 45 of 1

wispy dune
#

Panda
Armory

elder brook
#

I am working on implementing the dungeon crawling aspect of my game, this will be very important later on because the dungeons are going to be one of the main legs of my game's simulated economy (you might also find npc adventures and their camps in the dungeons as well, and I have been testing out some environmental skeletons ๐Ÿ’€), I am really trying to make them interesting, just early generation implemented right now but I hope to add some more variety in the near future: https://www.youtube.com/watch?v=oWEVWb3s3zE

Messing around with dungeon generation, currently the combat system isn't totally implemented so I just use commands to kill the enemies. I have created a simple dungeon system that generates dungeon rooms that are connected by corridors, going to make them more interesting in the future, maybe add some more decorations with some living armour e...

โ–ถ Play video
worn barn
#

watchu libs yall use to develop games

#

and who even develops games in python

#

๐Ÿ˜ญ

#

godot goated ngl

ember star
ember star
low raptor
mild spear
#

pygame-ce is pretty nice to work with imo

wooden night
#

Is godot closer to lua than python?

#

And like the most important question, is it faster than normal pygame-ce or morden gl

vital pond
#

Hello guys, recently I posted my first game on itch.io (https://randomtutel.itch.io/dice-and-bullets) it's a pretty simple game nothing wow, but I learnt a lot from developing it. (I'm still a begginer, and I'm learning new things) and I would like some honest opinions about it, if you have some spare time :) . Thanks everyone.

itch.io

Roll the dice, dodge the bullets, and survive as long as you can!

#

And I forgot to specify.. this was made in Python Arcade.

jade dune
#

Hello Devs or anyone here lol, currently working on a game. https://terradev01.itch.io/blocknova its simple kinda feels like a arcade. I would like some feedback please if any could spare some time thank you all yall. ๐Ÿ˜„

itch.io

A fast-paced blocky arcade shooter. Press space, blast enemies, collect power-ups, and see how long you can survive!

slow copper
# wooden night Is godot closer to lua than python?

gdscript is more like python than lua, It shares more similar datatypes and stuff too iirc. Including type annoations too.

And gdscript has a completely different implementation of it's language than python. It's more or less faster than python in some benchmarks but you don't need to worry about it that much really.

godot uses vulkan graphics pipline on it's newer versions

wooden night
slow copper
#

People do recommend using game engines to make games in general, but if you wanna learn python or you're more comfortable with python then pygame-ce is also fine

slow copper
normal silo
# wooden night And like the most important question, is it faster than normal pygame-ce or mord...

Godot does many things neither pygame nor modern gl do. The way performance works with engines like Godot is that they are written in C++, so they are internally as fast as it gets (they still need to do optimization work, but assuming they did that). So when you use gdscript you might tell the engine to set your objects velocity to some value which can be run trivially in no time at all (set a single variable). The real work is then done in the engine C++ side where it takes all the physics objects and moves them according to their velocities and handles collision and such. Because of this gdscript can be really slow and it does not matter. It just needs to do some very simple high level game logic and configuration.

#

Pygame on the other hand does not have such systems for you. So you need to implement them. If you implement them in Python you will run into performance limits of Python at larger scales (many objects). So if your game actually has many such objects (many games don't), then you might have a problem. However, there is nothing stopping you from implementing such a system in something like C++ just like Godot and then using that in combination with pygame. And also someone may have already done so. In the case of physics people have and you could use something like box2d.

#

As for rendering performance if you use modern gl that is using OpenGL just like Godot does internally.

wooden night
#

So can morderngl compete with gdscript?

wispy dune
wispy dune
#

And its not enough to just use C++, to be fast.

C++ just enables you to write code that doesn't waste a lot of resources.

It takes a lot more, write a performant game engine.

#

And Godot is really not the fastest engine around.

If you want top performance and an open source engine, see O3DE instead.

Godot is the better engine for newbies.

normal silo
wooden night
#

Also how do u use socket?

normal silo
#

Probably WebGL.

wispy dune
#

most?

normal silo
wispy dune
#

You mean most existing projects? I can tell you that fast forward is what almost all do.

normal silo
wispy dune
#

Aha, ok.

#

Both mobile and forward use Vulkan

#

And compatibility is really rarely used.

normal silo
#

Mobile vulkan is iffy, the vulkan drivers are still bad in many cases. Many smaller devices like mobile will advertise vulkan support but it's bare minimum and buggy. Hence the heavy usage of OpenGL ES still.

#

Web being like a weird messed up version of OpenGL ES with WebGL too.

#

Not in Godot's control but in the future they will be ready for Vulkan once all those old devices eventually expire.

#

Or one can just target new devices.

normal silo
#

Although it can be hard for beginners and for that you can use Ursina. Which is built on top of Panda3D.

wooden night
#

Isn't panda3d/ursina made for 3d games rather than 2d?

normal silo
wooden night
#

Do they have collition check?

normal silo
#

Yes.

wooden night
#

For 2d

normal silo
#

It's 3D, but can be used. If you want 2D physics specifically you can use box2d or pymunk.

#

Also 2D physics can be usually done manually yourself because it's typically simple for most 2D games (which is the case for pygame games).

wooden night
#

Wait, so if i use pymunk or box2d will my project run faster(in pygame-ce)

normal silo
#

For many physics objects and with more complex physics.

wooden night
#

I am trying to make paper minecraft so it will help increase the FPS

normal silo
#

Pygame's main limitation is rendering performance, since it's CPU rendering.

wooden night
#

So is there any pygame style renderer module?

normal silo
#

Unless you use like modern gl with it, but in that case you are using pygame mostly for the window, input and audio.

wooden night
#

Moderngl uses gpu or cpu?

normal silo
normal silo
wooden night
#

Isn't pygame made using morderngl

normal silo
#

No.

wooden night
#

Oh

#

Then what is it made on?

normal silo
#

SDL(2).

wooden night
#

Does sdl use cpu too

normal silo
#

Yes, and no. It has an API that uses CPU and it can also provide an OpenGL context (which is why Pygame can do that too).

#

The CPU API is basically what pygame's is, the surfaces and such.

#

Newest version of SDL has its own graphics API for the GPU.

#

(Which Pygame is not using)

wooden night
#

What about pygame-ce?

normal silo
#

SDL is basically a platform layer, so instead of working directly with the OS, it provides a layer on top, but it does not do much more than that.

normal silo
#

A fork.

wooden night
#

Yea but doesn't the pygame community update it once in a while?

wooden night
#

How much faster would moderngl be from pygame?

#

It would be significant or tiny bit

normal silo
#

Multiple orders of magnitude, because of the GPU's design.

wooden night
#

Average?

normal silo
#

Like faster as in certain things are not feasible with pygame at all.

#

Like you won't be making a full modern 3D game with pygame's CPU rendering.

#

Nor can you have fancy effects in 2D.

#

(Like fancy lighting or many particles)

wooden night
normal silo
#

(You can still do some of that, but with limits)

normal silo
# wooden night But will moderngl will havr that?

ModernGL just gives you access to OpenGL, which is a graphics API. It does not give you high level features, you need to make that all yourself. But basically you can use the GPU in whatever way you need to (without getting into details of missing things more modern APIs have and that probably don't matter to you (nor to most games)).

wooden night
#

No not like have that feature(like a class) I mean like enough performance to handle it

normal silo
#

Yes, it's as good as it gets basically (without getting into more modern APIs).

#

GPUs are very fast.

wooden night
#

So my slow fps is not python's but pygames fault, got it

#

Now gotta go and learn modern gl

normal silo
#

Kind of, if what your game needs to do is some CPU intesive stuff then it's Python maybe (in some cases). Like if you are doing a ton of CPU side physics. But as mentioned you can fix that by using stuff like box2d or pymunk.

#

It turns out most games don't really though. If you look at most 2D indie games count how many dynamic objects are on screen. It's probably like 4-10 in a side-scroller.

#

There may be some fancy visual effects going on though and for that you need the GPU.

wooden night
normal silo
#

Like look at this:

#

Count how many dynamics objects are in this scene.

#

It's like <= 100 for sure.

wooden night
normal silo
wooden night
normal silo
#

The actual game logic is (usually) on the CPU, and the visuals happens on the GPU.

normal silo
wooden night
normal silo
#

There are not that many objects so Python can handle that no problem.

#

Python (and C++, etc) just can't handle filling in all the pixels, that is what the GPU is for.

normal silo
wooden night
#

Oh ok, but will the calculations be faster in cpp vs python?

normal silo
#

It depends how much you have going on in the scene.

#

But many (most) games have very little if you count the number of dynamic objects.

normal silo
#

This is where stuff like pymunk comes in, it can do that for you.

wooden night
#

Ohhh, alright thx for the help!๐Ÿ™‚

normal silo
#

The problem with CPU side rendering is that at 1920x1080 resolution you have 2073600 pixels to fill in.

#

That is a lot of looping even for C/C++, etc.

#

The GPU can fill these all in in parallel, it's specialized in this.

normal silo
#

And you need to do it in less than 17 milliseconds for 60 frames per second.

#

With some extra time to spare for other things in the game.

worthy moth
#

https://www.youtube.com/watch?v=HghJoNAY8tg Can you give me guys your feedback?

Pet project to write a multipler game, with acceptance tests, continuous delivery, tdd, ci.

Part #1: https://youtu.be/Rjv8t7p_Fp4

0:00 - Intro
0:26 - Previous video
0:53 - Feedback from community
3:59 - Reflection on previous decisions
4:35 - Core and the player
5:14 - Data flow diagram
6:22 - Controls
8:35 - Basic view
9:59 - View model
11:14...

โ–ถ Play video
summer sequoia
#

Lol I made a "guess the number" game:

elfin pond
#

btw who have used the ursina lib

summer sequoia
elfin pond
elfin pond
summer sequoia
elfin pond
summer sequoia
#

most of my job involves pinging large amounts of computers and making spreadsheets

summer sequoia
elfin pond
summer sequoia
frozen quiver
#

guys im new and i want to learn how to make a game

#

ihave 0 clue how to start

#

i just downloaded python and then joined this server

#

can any one help

elfin pond
#

do uk python??

#

@frozen quiver

frozen quiver
#

yea

elfin pond
#

learn pygame

frozen quiver
#

but i dont now how to use it

#

or to make a game

elfin pond
frozen quiver
#

what is that

elfin pond
frozen quiver
#

everything lol

#

i just started

elfin pond
frozen quiver
#

youtube?

#

do i watch tutos from youtube?

#

i will show you my progress in 3 days

#

bye

elfin pond
worthy moth
night mirage
#

Any recommendations for tutorials to learn python for free most YouTubeโ€™s I tried watching just made a game with no explanation to what everything in the code was

#

Iโ€™m just trying to learn

hearty tapir
# worthy moth https://www.youtube.com/watch?v=HghJoNAY8tg Can you give me guys your feedback?

I've been focused on any kind of testing in game development, as well as architecture for awhile personally. Love to see this type of content! I don't really have much to comment. I'd love to see it applied to slightly more advanced behaviors like say When a coin collides with the player, the score should go up. I think that the engine (or certain patterns on top of pygame for example really will effect the approach on this stuff).

worthy moth
hearty tapir
# worthy moth Yes! I'm going to do that too! Did you watch the first part too? I linked in the...

I'm 11 minutes through the one you linked, haven't seen the first one. My personal opinion after researching a lot is that while a separation of concerns is important the usual patterns that apply to development (like ports and adapters, and others) doesn't really work for automated testing in games. If you have a lot of math in your game and stuff that you can isolate and test with unit tests, you should absolutely, but for a game a lot of the logic isn't in the math and doesn't prove that anything is fit for release. I think when doing automated testing and even certain architectural patterns, the typical separation of concerns/framework independence has to be adjusted, you have to couple to the engine to get the kinds of tests you want, and avoid coupling to anything in a given ecosystem. For example, at rare for sea of thieves the majority of their tests are "Actor" tests which are a part of the unreal engine, they also have integration tests, where they load up a map, place a player and a wheel for example and test the interaction. In Unity you don't really get to do much through code which is disappointing and there's no normal entry point so stuff is messy architecturally (outside of certain dependency injection plugins), a lot of your behaviors come from what you setup in the UI with behaviors you attach to your object, I think there for example you could create a "prefab" which is a template for your object that you can instantiate in the engine and spawn in, and test it against other prefabs, and treat the engine/world space the same way you treat your programming language, like for example, spawn in your player object, spawn in your coin, move them across each other then observe something happen and it could be treated as an acceptance test.

worthy moth
hearty tapir
# worthy moth I'm happy to hear more about that. I think I can test-drive pretty much everythi...

I agree, i just think it takes more like a bit of stuff not seen elsewhere on top (be it simple patterns), or an engine that gives you more to work with, sort of like what you've got going in the video. I finished the video, regarding testing the executable at Rare they have something they call "boot tests" that test if the game launches correctly iirc. I think a basic test would be to start the executable and verify it doesn't crash, maybe a snapshot, they also some tests that compare if before and after are at least 80% similar or something.

worthy moth
#

I'm prepared to agree that certain stuff is not subject to tests, like story, gameplay, appeal of graphics, etc.

worthy moth
hearty tapir
worthy moth
#

@hearty tapir I appreciate your feedback very much! I can't thank you enough.

hearty tapir
# worthy moth I'm opening my mind to the idea, that there are some "undriveable stuff"; I just...

I think not-doable isn't the word just not worth it necessarily, it would probably depend on the game. For example, would you want to start the game, go to a specific level and walk from point a to point b and make sure it works? or would you want to place a player and some other objects on a map as part of a test, give them your input and see how they interact and what happens. Like I can't imagine driving the whole game like a normal acceptance test.

worthy moth
#

I think if I do enough of those features, then the whole game will be driven with that.

hearty tapir
# worthy moth <@888722028016832583> I appreciate your feedback very much! I can't thank you en...

And I appreciate you taking the time to make the video and also having the same interest! I think that architecture is lacking too. I feel like to be productive and test in isolation there needs to be a better separation of concerns for the coordinates, like there should be containers that you can put stuff in and test them in isolation, having them size to their parent like display objects in the flash APIs architecture.

worthy moth
#

So yes, I will not have a test that executes every feature!

#

But I think the whole test suite will execute every feature, though not at once.

worthy moth
split ivy
#

Hey am new here

worthy moth
#

@hearty tapir When I'm creating the new version, you can be online/oncall and you can give feedback as we work. Would you be interested?

#

Then I will edit it, and publish.

hearty tapir
#

Yea, every feature tested, but with stuff setup in isolation, supported by whatever architecture you're working with. I generally work fast building piece by piece, like for example it would be ideal making a score board or a health bar to build it up and put it on something else, in isolation. When i run this method, does the score go up? Maybe even some snapshot tests for an individual component

worthy moth
#

Last time it took me 20-30 minutes to code the increment, then 2-3 hours to record, and 5 hours to edit, and 30 minutes to render.

hearty tapir
worthy moth
#

If there is other ui for games, I'd need to only swap the PygameEngine for tests and Game layer that knows about pygame. Everything else can stay unchanged

hearty tapir
worthy moth
hearty tapir
# worthy moth The way I look at it, 2d or 3d is just a presentation layer of the application. ...

I think this works better in less visual applications. If I isolate the business logic from the presentation then I can change the presentation to whatever is out there and there is a lot to choose from, it's abstractions are largely meaningless and isolated to just presenting results. I think life would be better making a 2D game with abstractions tailored to it over one made for 3D. But maybe I'm biased because the current architecture out there like with unity for example doesn't try to abstract/do both of them well. I guess what I'm saying is this doesn't seem to come with portability and as many benefits. But maybe I'm thinking about it wrong.

normal silo
#

This video was sponsored by Brilliant.
To try everything Brilliant has to offerโ€”freeโ€”for a full 30 days, visit https://brilliant.org/Tariq10x/ . Youโ€™ll also get 20% off an annual premium subscription.

In this video I analyze QUAKE 3 Arena project by id Software.
Comment, like, subscribe, letโ€™s trigger the algo!

The focus will be on sof...

โ–ถ Play video
#

They have the presentation separate from the core. Making testing easier, they also took it a step further and the core is in a VM. This was for better isolation for mods too.

#

Testing the core can be done. And I recommend even having tons of assertions and fuzzing.

#

However, the real issue with acceptance testing in video games is time. Games have too many interactions (depends on the game), and testing all of them would take too much time.

#

Games have combinatorics that a lot of software does not.

#

But it's worth testing the core engine parts, since the engine itself is not subject to as much change or combinatorics of game design.

#

So like fundamental systems like animation.

hearty tapir
# normal silo But it's worth testing the core engine parts, since the engine itself is not sub...

I think that acceptance testing is possible but with a reduction in scope. You can write a test that checks if when a player is spawned in and they collide with a coin, the score will go up if you use the engine you're working in and treat 3D space as you would your environment/programming language. You just spawn in a player, spawn in a coin, move on on the other and see what happens, see if one disappears, sort of like how you'd test the dom/your browser. I think that isolating the core is important but it isn't enough. You can reduce the scope of your tests, and focus on the game or select parts of it meeting the acceptance criteria for release.

normal silo
#

Game development tends to be under such rapid drastic changes until the final sprint of polish in many cases. Not for larger companies, they can't correct course so quickly (and it's a common cause of failure).

#

The problem is that unlike other software whatever game design idea one might have is often wrong until it's tried. And so such tests can only really be done for things that have not changed in a long time (which is often not many things other than core systems (engine stuff)).

#

If however you are developing a variant of an existing game, then you could know all of what you need and have it all tested. Some companies do just that, variants.

hearty tapir
normal silo
#

So if I was a mobile game company making N variants of existing games but with better polish, I would totally just test it all.

normal silo
#

So it's less about game design, and just producing it.

#

Which means it will probably need to be just like another game but a slight variation and different art/assets.

#

Like another Tetris for example.

#

Many companies do that, and in that realm of game development it makes a lot of sense to have heavy testing since it's all about the production of a fixed target.

#

Or if you are making a game engine.

hearty tapir
#

I think a lot of companies end up with stable stuff and prioritize testing, they just do it with QA people and manual testing.

normal silo
#

Yes, they could probably do better.

#

They are often just overloaded with other things and it's a kind of "don't fix what is not broken" situation.

hearty tapir
#

This can be said about normal development though and end to end testing in general. There are many situations I'm sure where if people wanted to they could write an automated test to assure that stuff has the behavior that they want, and to verify that it isn't broken later, and testing isn't always quick or easy, but even unit tests can seem like a lot when you're just starting out.

normal silo
red nexus
#

Been building python bindings for Bevy Engine, and it's looking very promising. Hot-reload with python iteration speed, typings with autocomplete and Rust/Bevy performance. Wonder if this could be useful...?

raven kernel
#

do you have a github link?

#

how would you do queries via type annotations?

red nexus
#

That would be roughly like below, almost as similar except the Query1 for unpacking a single element instead of a tuple for (name,) in query:. For now, maybe I get this still simplified just to a Query

@component
class Name(Component):
    def __init__(self, name: str) -> None:
        self.name = name

def update_people(query: Query1[Name, With[Person]]) -> None:
    for name in query:
        if name.name == "Elaina proctor":
           name.name = "Elaina Hume"
           break
#

(no repo yet, planning to open source soon though)

red nexus
frozen quiver
#

guys this is my frist ever piece of code is it good i want to become a game devolper one day this is my frist day

slow copper
#

something you'll learn with more practice but nice start!

hearty tapir
hearty tapir
#

They're good. Some people just put x y z and so on.

slow copper
#

Yeah try avoiding using such names at all

frozen quiver
#

how do i make grafical inteface

#

like a real game

slow copper
#

with python people usually go with pygame-ce or arcade

#

or even ursina

#

check those out and see what you feel comfortable with

frozen quiver
#

is unreal engine a good one

slow copper
#

yeah but you need to know C++

frozen quiver
slow copper
frozen quiver
#

oh is it like same as python?

#

c++

slow copper
#

C++ is another programming language but nowhere close to python lol

frozen quiver
#

oh so i will stick to pygame

slow copper
#

lol sure

frozen quiver
#

thanks for the information

#

i will send my progress everyday

hearty tapir
# frozen quiver oh so i will stick to pygame

pygame is probably your best option given that you've just gotten started writing python code, and there's the most material out there for it compared to other options in the python ecosystem afaik.

slow copper
frozen quiver
#

i got a gtx 1080 ti is it good?

#

or do i need to upgrade

#

?

slow copper
#

its good in what sense? And you most likely won't be doing any gpu related rendering when you get started

hearty tapir
#

It won't even use your GPU to do any of the computing. You're good.

frozen quiver
#

no i mean in pygame

slow copper
#

pygame runs on your CPU

frozen quiver
#

og

#

oh

#

any gen 8 is fine?

hearty tapir
#

If you can run an operating system you can run pygame.

slow copper
#

in most cases it wouldn't really matter what CPU you have, the result will most likely be same across most gens/brands too, unless you're doing some crazy calculations which causes lag, and at that point you just need to optimize your code

frozen quiver
#

can you give me a game that uses pygame

#

anygame becuse i want to see how do pygame work

slow copper
#

you can check out dafluffypotato on yt, he does dev log and stuff with pygame

slow copper
#

theres also pyweek game jam

#

i saw some really cool games over there

frozen quiver
#

do it have a leveling system?

slow copper
#

leveling system?

frozen quiver
#

like level 1 level 2

#

when you get xp you level up

slow copper
#

whom are you referring to for leveling system?

#

pyweek?

frozen quiver
#

yea

slow copper
#

pyweek game jam is an event where people create games and submit there

#

its a competetion basically

#

some of the games submitted there probably have levlling system in them

frozen quiver
#

oh i will check it out thanks bro fr if i get good at making game it all you

slow copper
#

Good luck

worthy moth
#

@hearty tapir I watched the video you linked with the quake. There are some good ideas there, especially the event sourcing! The further parts of the video went into implementation details, but it was a fun watch anyway. Thanks for the recommendation!

I think I could use event sourcing in my game too!

hearty tapir
elfin pond
#

hi

#

i actually made a raycaster in py

normal silo
#

It also making porting a lot easier.

wide hill
#

Hello

I want to ask if its possible to write a "cloud-system" for a minecraft network.
Is there maybe someone here that can help me out with that?

The base idea is that i have an script that running in a screen that got a connection to a redis-server and a mongodb-server, download a list of json files from a github repository for the versions that can be installed, and maybe run the server in a docker container each?

I would appreciate other Ideas for that project.

minor cloak
#

I'm building a game that would help get my kids to exercise but its gamified that for one push up, increases their character str+1, etc. With a stronger, faster character, they can then go and fight monsters. Something like RPG style or 3D fighting style, idk yet. However, I dont want it to feel too grindy. Any suggestions to keep it interesting enough to keep incentivizing them to workout more?

balmy pilot
#

Reward variety not grind

#

That's actually physiologically valid too in a sports-medicine sense.

#

(Elite athletes can lose strength by doing the same exercise even twice in a row.)

#

Also maybe more points for more limbs involved in the exercise

north sleet
#

You're right, loops should be removed from the final solution

plush quarry
#

Iโ€™m building a Growtopia-like multiplayer text-based game in Python. For networking, should I use socket, asyncio, Twisted, Flask, or something else?

dawn quiver
#

no sorry, the true answer here is to buy a trampoline

pearl elk
#

anyone got a working macro ? the records keystrokes mouse clicks and mouse movements ?

worthy moth
#

If there's some aspect that's understandable, then you can think to upgrade it

tired reef
#

For those who are have done networking for both local and multiplayer games over the internet and can somebody put the files here so I can at least take a look because I've been having trouble

hearty tapir
#

@worthy moth I've thought about a test that could allow for killing the release candidate if the game is really bad once packaged with pyinstaller or anything else really. Since you can put your own engine class over top to handle a lot of the details you could have it output that it is ready, or at another point, for an executable release you could have an adapter print something to the console, if in the future it's in a browser, the JavaScript console. My idea is like when you deploy a normal application for production or even production like automated testing you might smoke test it with some health check, you could do the same with a simple console output. If the binary is bad you'll never get it, if something is wrong before that engine part you can kill the release candidate.

short tapir
#

Hello

#

How to load 3d model into python?

#

In making a vehicle sim, and i need to load a 3d model with track, curbs, gravel and barriers into code. Then i need to render w/ vulkan or opengl (shouldnt be too hard)

#

More importantly, i need the pitch and roll of each track segment for the physics engine to work properly.

wispy dune
tired reef
#

Also why are you using for models are they fully rigged currently

short tapir
#

Im going to learn blender

tired reef
#

Okay what is the game supposed to be about

#

Because then you'll have to think of what type of modeling you're going to use

short tapir
tired reef
#

And then you're getting mean to use heart surface modeling which is easy

short tapir
#

Huh

late fable
#

hello guys i need some help, im started out python as a hobby and im trying to make a lil game on VS code and when i run the code the game just breaks and i get an error "TypeError: Enemy.update() takes 1 positional argument but 2 were given"

#

what do i do..

opal thorn
#

!paste

frank fieldBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

late fable
#

!paste

#

oh wait

#

!paste

#

erm

opal thorn
late fable
#

i pasted it

opal thorn
#

Read the embed

late fable
opal thorn
late fable
#

idk where it is

#

thats the problem

#

i cant figure it out

opal thorn
hidden flame
#

Where can i download pygame

opal thorn
late fable
worn oar
opal thorn
# late fable

update() doesn't take any arguments, but you tried to give it one

late fable
#

oh

opal thorn
#

Is this chatgpt code?

hybrid wren
#

guys

#

here

#

the game

#

@opal thorn

#

@opal thorn

#

hey

#

you wanne play my game

opal thorn
#

!mute 1375139665237245953 1h take a moment to collect your thoughts before you post any other messages

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied timeout to @hybrid wren until <t:1760980034:f> (1 hour).

tired reef
#

player_inventory = Player.inventory()

royal flame
#

ngl, i feel like making a game now, but im bad with everything front-end, so probably not gonna happen

#

but to those making games, yall are cooking

wooden night
#

How do u use socket?

royal flame
balmy pilot
wooden night
#

Because on the same wifi, when I run the code as host in VS code and then run as client at replit its not working

balmy pilot
wooden night
#

Oh ok

wispy dune
wooden night
#

Alright, but how do I integrete into my game? Its a LAN multi

balmy pilot
#

What system are you using?

wooden night
#

I am using windows

balmy pilot
#

I mean, game engine development toolkit etc

#

Or are you writing your own engine?

#

In which case you will definitely need to know everything on that cheatsheet

wooden night
balmy pilot
#

OK, you'll want to read whatever docs pygame-ce has about networking then.

#

It probably offers a few higher-level abstractions.

timber cave
#

does anyone know if i have a sprite in pygame that I wanna do pixel collision with against many rects per frame will using masks really tank performance?

normal silo
balmy pilot
#

Another handy resource handling class is for network connections. Functions to open sockets, pass data with suitable security and error checking, close sockets, finger addresses, and other network tasks, can make writing a game with network capabilities relatively painless.
seems to be EVERYTHING pygame-ce says about networking?

#

So I guess it doesn't offer anything and I guess you're back to "understand that whole cheat sheet"

jagged niche
#

What do you make games with?

wooden night
#

Depends on what u want to make

wooden night
#

But if you are interested in simple games use pygame-ce

jagged niche
#

coool ๐Ÿ™‚ I am thinking of getting C bindings for my C framework I use to make games O_O but i can look at other ones! I used pygame back in the day!

wooden night
#

But I would say morderngl is the best

#

For 2d, and ursina for 3d

jagged niche
#

ok

wooden night
#

@balmy pilot I got it working ๐Ÿ™ƒ

balmy pilot
analog ridge
wooden night
#

If do wanna 3d games from scratch(like all the math and trig to get a 3d perspective) the u can use those

wispy dune
analog ridge
wooden night
#

There are some people take that make actual games in it

wispy dune
#

UPBGE is also an option

royal flame
normal silo
#

If you meant that nobody makes complete commercial games with Python (and Panda3D), then that is false. Panda3D especially has has multiple (highly successful) commercial games (and other projects) made with it.

wispy dune
#

And as always: Python is often used for the scripting, while the actual engine is in C/C++

wooden night
#

Can u tell me some names?

normal silo
dawn quiver
#

hi- i'm new to game dev- what do you recomend for making sprite sheets?

raven kernel
outer ridge
#

hello

outer ridge
#
    return(num1 + num2 + num3 + num4)
    
    
num1 =  int(input("enter num1:"))
num2 =  int(input("enter num2:"))
num3 =  int(input("enter num3:"))
num4 =  int(input("enter num4:")) 


print(clac(num1,num2,num3,num4))```
shut tulip
#

Do you have something to say about that script ?

#

It's cool to write stuff, it's better to talk about them

#

(Also I would that function sum4 or something, to be more explicit)

pine tangle
#

Hello, everyone. I developed so many html5 games with pixi, phaser, threeJs. But I now want to learn how to make game with python.

woeful shard
#

Just to hold myself to it I'm messing around till i finish a boomer shooter in the style of postal 2/ Brain damaged just with different motivs and settings (im not making a clone of the games just really like the why the hell am i here attitude in certain games)

shut tulip
somber smelt
#

every day when i look at my code i get so confused T-T it's probably because i don't use comments ๐Ÿ’€

shut tulip
#

Remember to document your code: clear functions, clear docstrings, typehints, comments when necessary

#

Everyone, including you, should be able to understand your code

turbid fern
#

Hi, I'm new but coding a python game

turbid fern
outer ridge
turbid fern
#

true

outer ridge
#
def clac(num1, num2, num3, num4):
    num1 = num2 + num3
    return(num1 + num2 + num3 + num4)
    
    
    
num1 =  int(input("enter num1:"))
num2 =  int(input("enter num2:"))
num3 =  int(input("enter num3:"))
num4 =  int(input("enter num4:")) 


print(clac(num1,num2,num3,num4))``` exzample: all of the numbers are 10  and it equlis to 50 becuse of num1 = num2 + num3
mortal pulsar
#

I have a question, "Can we make a game out of Python means by Python scripting? Only scripting not designing and all that stuff"

mortal pulsar
#

yeah

modest hollow
#

sure, just make a text-based or TUI-based game

#

or use shapes, colors and text

#

I think I've heard of a game engine that only uses shapes and stuff for drawing (ShapeEngine, not python though)

raven kernel
wispy dune
lean cosmos
elfin pond
wispy dune
mortal pulsar
#

Thanks guys i will start using the engine now to create more games

elfin pond
#

ill check it out

outer ridge
#

hello

quasi sun
#

Does any one use pyroid

#

If yes dm me plz

#

I need help in it

shut tulip
#

Why don't you just ask here your questions and people will try to help ?

toxic glen
scarlet brook
#

Hello everyone so I'm building an ascii snake game and i have trouble in making the time between A and B in the code (the time of listening for a key press) constant even if i press a key early the code below B shoud't execute unctil responce_time end any solution, if you want more details just let me know

from pynput import keyboard

running = True
    grow = False
    response_time = 1.0
    while running:
        # A
        with keyboard.Events() as events:
            event = events.get(response_time)
            if event is None:
                pass
            else:
                print('Received event {}'.format(event))
                if event.key == keyboard.Key.up:
                    direction = "UP"
                elif event.key == keyboard.Key.down:
                    direction = "DOWN"
                elif event.key == keyboard.Key.left:
                    direction = "LEFT"
                elif event.key == keyboard.Key.right:
                    direction = "RIGHT"
        # B
slow copper
scarlet brook
#

Exactly cause if not it the snake will be faster while holding a key

slow copper
# scarlet brook Exactly cause if not it the snake will be faster while holding a key

you can do that by taking a timestamp at the beginning, before executing #A part of your code and another timestamp after #A finishes running. By subtracting both the timestamp you get the total time elapsed running #A part of your code. Now subtract that from response_time and you'll get the extra time left that you will need to sleep off before running #B

#

you can get the timestamp by time.time or time.perf_counter and to sleep off the extra time you can do it with time.sleep

scarlet brook
#

brilliant thanks a lot

slow copper
#

Np ๐Ÿ‘๐Ÿฟ

outer ridge
toxic glen
frank fieldBOT
outer ridge
placid path
#

Can someone help me in Roblox studio

shut tulip
#

isn't roblox lua ?

dense holly
#

You can ask me

shut tulip
#

I think there is a discord server for roblox, you'll probably get better answers

dense holly
#

Roblox itself has documentation

#

That is more helpful than a server

#

It also has forum and it probably has the answers to your questions

shut tulip
#

sometimes having a good talk with people, phrasing things differently, is more helpful than reading 100 times the docs

dense holly
#

True

#

Or you can ask AI but sometimes it's buggy and unhelpful

#

I made a flower generator made with circles in python that spins

wooden night
#

Is pygame made using SDL or openGl?

wooden night
#

Probably simpler too

idle wave
lethal flax
lethal flax
shut tulip
wooden night
shut tulip
#

That's up to you

#

You probably won't do anything better than pygame using SDL tho

charred bobcat
#

Is there any sort of equivalent for https://twinery.org/ in Python? I was looking for text adventure games where you didn't need Ren'Py (I don't need sound or CGs), but aside from it, there's no suitable framework.

If it doesn't exist, it should be feasible with Flask or maybe PyReact.

charred bobcat
slow copper
#

ton of guides on it

#

have a try on it

slow copper
charred bobcat
slow copper
charred bobcat
#

Great!

#

Maybe I should look into it then

upbeat shadow
#

When using pygame and its sprite class if you constantly fill the screen and constantly add sprites to a group while also emptying that group are those sprites still in memory? The reason why I am asking is because whenever I empty a sprite group it is indicated that the group is empty but when I stop filling the screen you can see the sprites still on the screen even though I emptied the group

shut tulip
#

I am not sure to follow, if a sprite is not in a group and you draw a group on the screen, then the sprite shouldn't be on screen

#

wether it still uses memory space is another question

#

but if you don't explictly (or implicitly with a loop or a group) blit it on screen, the it shouldn't be there

#

it might be there is you forget to update the screen or something similar

upbeat shadow
#

the draw and update function are in the gameloop which draws whats in the group

#

but I also have a different function that adds sprites to the group that also runs continously

#

Depending on whats is in a given list

shut tulip
#

Do you draw on a fresh clean screen/background, or do you always use the same surface ?

upbeat shadow
#

I just use the same surface

shut tulip
#

I suspect that what you are currently doing is something like:


# all the init and stuff

while True:
  # event blabala
  for sprite in sprite_group:
     screen.blit(sprite)
  # add or remove sprite in group
upbeat shadow
#

which is the screen var

screen = pygame.display.set_mode((WINDOW_WIDTH, WINDOW_HEIGHT), 
pygame.RESIZABLE)
shut tulip
#

Alright that's what i thought

#

So

#

the screen is a surface

#

like are the sprites surfaces

#

when you blit something on it

#

it staus

#

stays

#

forever

#

what you need to do is:

# all the init and stuff
background_color = (255, 255, 255)
while True:
  # event blabala
  screen.fill(background_color)
  for sprite in sprite_group:
     screen.blit(sprite)
  # add or remove sprite in group
#

for example, here, you fill the screen with a solid color

#

hiding everything blitted previously

upbeat shadow
#

Oh so there is just no way to remove stuff that has been blit to the screen

#

Does that ever affect preformance?

shut tulip
#

no

#

blit litterally replace pixels from the screen by the one from the sprite

#

it's like copy/pasting an image on top of another one in MS paint

upbeat shadow
#

and filling does the same thing

shut tulip
#

filling replaces every pixel of the surface by a given color

upbeat shadow
#

So what about the object since it not being shown on the screen its removed from memory right?

shut tulip
#

python has its way to handle objects that are not referenced anymore

#

it will eventually be removed from memory yes

upbeat shadow
#

Thanks for your help!

outer ridge
#

ello

charred bobcat
#

When using Ren'Py, is it easy to incorporate a side custom package when you're developing your game?

Suppose I have a core package using uv as a building tool, next to game package ( I want to separate functions and rendering), can I easily import stuff like MyCharacter or MyLocation in the game folder?

If that's not the case, should I simply put core as a descendant folder of game?

charred bobcat
#

Hmm

pip install --target game/python-packages python-dateutil

Ok, maybe with a pre-build command. Maybe that can work

shut tulip
#

It's easier to put core in a folder inside game and use from core import ...

charred bobcat
#

Yeah in that case we avoid PYTHONPATH issues. I'm mostly asking because I don't feel confident with my Ren'Py level and I might switch to another framework if I feel too uneasy.

cerulean nimbus
#
class Button:
    def __init__(self, size, pos, text, color:dict[str,ColorLike]={}) -> None:
        if not get_init(): init()
        self.pos = pos
        self.context = Surface(size)
        self.context.fill(color.get("background", "white"))
        self.text = Font(None, 36).render(text, True, color.get("text_color", "red"))
        self.context.blit(self.text, self.text_pos())
        draw_rect(self.context, color.get("border", "black"), self.context.get_rect(), 2)
        
    def text_pos(self) -> tuple[int, int]:
        return (
            (self.context.width//2) - self.text.width//2,
            (self.context.height//2) - self.text.height//2
        )
    
    def draw(self, screen):
        screen.blit(self.context, self.pos)
```improving my button class to be more readable and simple
#

updated version (added button press, some visuality upon press)

wooden night
#

How much performance will box2d than pymunk?

tepid cave
#

Hello

deep wasp
#

hey yall

tepid cave
#

Do u want to see

deep wasp
tepid cave
#

I am new at python but I know lua

#

And python is way better

deep wasp
#

yeah

tepid cave
#

I am starting so my code is not good

deep wasp
#

well when i first heard about lua i heard abt it in roblox studio

tepid cave
#

That is my chat bot

#

It's not the best but it's good

#

I stop playing Roblox

deep wasp
deep wasp
#

maybe try playing around with loops and functions more

tepid cave
#

There is one loop

deep wasp
#

yeah i saw

#

when u learn abt loops and such try making some basic famous algorithms

#

using data structures

tepid cave
#

Kk

#

I will try

#

Whan I get home I am using a python on phone now lol

#

Do you code in visual studios?

deep wasp
#

yeah

#

use that for lightweight

tepid cave
#

Do u have your one discord bot?

deep wasp
#

Not really im not into discord that much for me to make a bot

tepid cave
deep wasp
#

you can just use a template

tepid cave
deep wasp
#

if you wanna add a bot into ur server u can just add it and it works with no further config

#

well not that config

#

much *

tepid cave
#

Kk

#

My bot is ready I think it is good

#

But I need a server because whan I close my computer the bot go offline

#

Do u know what to do?

deep wasp
#

i think you'll find some cloud services or about that will host your bot

#

just google it

tepid cave
#

Kk thanks

deep wasp
tired reef
#
from time import sleep
from random import choice

test = 'hello'
slot = [':cherries:',':heart:',':star:',':moon_cake:']

def slot_mechine(choices:list):
    
    spinner_1 = choice(choices)
    spinner_2 = choice(choices)
    spinner_3 = choice(choices)
    
    print(spinner_1,spinner_2,spinner_3)
    
    if spinner_1 == ':cherries:'and spinner_2 ==':cherries:' and spinner_3 ==':cherries:':
        print('congratulations')

slot_mechine(slot)
shut tulip
#

!rule 6

frank fieldBOT
#

6. Do not post unapproved advertising.

austere frigate
#

!rule 5

frank fieldBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

elfin pond
tepid cave
tepid cave
tepid cave
elfin pond
tepid cave
crimson hound
#

!mute @distant dragon 1d stop spamming

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied timeout to @distant dragon until <t:1762532298:f> (1 day).

toxic glen
tired reef
#

Has anyone ever used pygame_gui?

pliant breach
#

Can python with pygame or other python game framework make games like Hollow knight, Celeste, Tiny glade etc?

outer radish
wooden night
viscid vigil
#

hey everyone! i'm currently working on an app on android studio. was wondering if anyone knows of a discord groupchat for that??

tired reef
#

!e

Health_potion = {"NAME" : "health potion",
                 "HEALS" : 69,
                 "WEIGHT" : 1.5,
                 "COLOR" : (255,0,0,50)}

print(Health_potion["COLOR"])
tepid dust
#

Does anyone want to download my game file? Dont worry its not harmful, its only a reverse shell that i have access to, i want to see how well my malware holds up against traditional antivirus, dont worry i wont do anything harmful just trying to have fun

shut tulip
#

tbh that sounds highly suspicious

tepid dust
shut tulip
#

which is why it sounds highly suspicious

tepid dust
#

Well i cant blame you for being suspicious about it

cold juniper
#

e!

#

!e

wooden night
#

I learned decorators and now I am adicted to it, how could I use it in my game dev?

#

Aside from timers to see how long it took to run this func I am not getting any other ideas

normal silo
#

However, you can use it for anything that needs wrapping behavior. For uses such as registering types and functions in a registry (for introspection, commonly done in game engines and in languages like C++ they need to build up such a registry themselves), but Python already gives you that, since it's all in dicts already.

#

There are also some more complex meta-programming uses.

#

But needing those is unlikely.

#

Basically you will know when you run into a problem and nothing else seems to fit very well (usually something else works just fine).

#

As can be seen here, it's basically to register the function as something that can be called over the network (via HTTP).

#

Remote procedure calls (RPC) in general are a good fit.

keen hatch
#

My name is Denis Iโ€™m from Poland If youโ€™re looking for a professional game developer Iโ€™m available. I can develop
* Third Person Shooter
* First Person Shooter
* Real Time Strategy
* Survival
* Horror
* Sport
* C++
* Blueprint
* RPG
* Prototype
* Single and multiplayer games
* Action, RPGย and more

Hereโ€™s my portfolio

https://youtu.be/F65IMkjG5Io?si=tFd6x0aWjMFZex0H

https://youtu.be/OqgyksQEu4A?si=-PdhZdWNlH6o7SWo

https://youtu.be/VeWGdf_bJ-M?si=ESEr94Y8nbxMdBw3

https://youtu.be/Gv88TalpPf8?si=D_YMs8UMWrs7KFFJ

Services that I Offer: Custom Development: 2D/3D game creation, custom mechanics, and level design Multiplayer Integration: Real-time multiplayer using Photon PUN/Fusion Cross-Platform: Android, iOS, PC, and Web (WebGL) deployment UI/UX & Menus: Intuitive in-game UI, HUD, animations, and menu design Monetization & Ads: In-app purchases, Ads, and...

โ–ถ Play video

Making Games is hard. It takes effort, passion, talent and hard work. Well, lucky you! I got all of that. I can help you to progress your game. Also, I can create Prototype or Full Game for you! I can develop games of any genre, like: First-person shooters RPG Prototype Platformers Action Games Space Shooters 3rd-person games The best possible S...

โ–ถ Play video

This is my competition entry to create a teaser for the game, I paid special attention to framing, composition and lighting. I tried to show the process in an original and creative way and convey the general atmosphere of this game. To create some objects, such as the gas tank, pallets and some lamps, I used Blender and Substance Painter, the re...

โ–ถ Play video

A preview of a GTA-style game in early development, In this project, I implemented third-person mechanics like reloading, ammo management, gun firing, and weapon switching for smooth combat. I also developed vehicles to enhance world immersion and created a police AI system that reacts to player actions. A dynamic star-based system tracks player...

โ–ถ Play video
cerulean nimbus
#
def run(self):
    self.running = True
    while self.running:
        for event in get_events():
            if event.type == QUIT:
                self.running = False
```oppinions on how to make this more dynamically
cerulean nimbus
frank fieldBOT
#

6. Do not post unapproved advertising.

cerulean nimbus
#

i know in this channel you can do some promotion till a certain point but just be aware

cerulean nimbus
#
import app

def app_loop(cls: app.SingleApp):
    cls.event_handler()
    cls.update()
    cls.draw()


my_app = app.make_app("single", {"size": (600,600)}, loop_sorted=app_loop)
``` made it so that you can choose the order of processing
cerulean nimbus
#

did a change around

#
import app, pygame


def event_handler(cls: app.SingleApp):
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            cls.stop()


def draw(cls: app.SingleApp):
    cls.screen.fill("blue")
    pygame.display.flip()


def app_loop(cls: app.SingleApp):
    event_handler(cls)
    draw(cls)


my_app = app.make_app("single", {"size": (600, 600), "loop": app_loop})
my_app.run()

i think this would look neater

slow copper
wooden night
#

How do i install box2d?

#

Cuz its not working

slow copper
#

can you show the traceback

next estuary
wooden night
#

But when I do pip install box2d it said already satisfied

slow copper
#

!traceback

frank fieldBOT
#
Traceback

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

shut tulip
dusk sleet
#

I'm making an in-console game right now. The actual file being run is just ```py
session = Game()
while True:
session.update()

#

In addition, what would be the best way to read and write file info for each level's map?

digital peak
#

I have a very similar project I am working on myself and while I can't really pitch in for the first question as I am struggling with that myself I can answer the second one.
I personally use .json files for reading and writing level data. The json library is really useful as (when using it to read in data from a json file) it transfers that .json file (or a section of it) into a dictionary you can read from and write into during runtime. If you need to write into the .json file directly you can just write the dict into the .json (or a section of it)

dusk sleet
#

Unfortunately I have less experience than you do with game design (working from first principles with no prior research :p) so I don't know anything about json files. My save data is written in .txt files. Thanks for the input though, I appreciate the effort!

digital peak
# dusk sleet Unfortunately I have less experience than you do with game design (working from ...

I definitely do recommend looking into it! It makes life a whole lot easier!
Although the best way to handle data will largely depend on what type of data you are actually working with (should've started with that, apologies)
There isn't a de-facto best way to handle any piece of data (at least from what I know, I may be wrong I'm not an expert or anything)

Are you okay with providing a sample of what you want to work with?

dusk sleet
#

Empty lists are squares with no map tiles, lists with strings are map tiles, contents of strings contain enemies on said tiles

#

My current method for creating maps is: py def tomap(self, id): with open(f"{PATH}//game//writables//map{id}.txt", "r", encoding="utf-8") as file: line = file.readline() layout = eval(line) struct = [] for n in range(len(layout)): struct.append([]) for _ in range(len(layout[n])): struct[n].append([]) for i in range(len(layout)): for j in range(len(layout[i])): if layout[i][j] == []: struct[i][j].append(0) else: struct[i][j].append(Node(id, layout[i][j], [i, j]))
So the indexes of the list represent the coordinates of the tile, and you move across the map by adding or subtracting node coordinates

dusk sleet
digital peak
#

ofc! Go ahead

digital peak
# dusk sleet Okay so basically all the maps are stored in one file, where each line is someth...

I think the easiest way to do it would be something along the lines of:
Since each line corresponds to a different map I would just load in each line individually for whatever map I would require
Edit the Lists however I want
Write them back into the file (although that would require re-writing the entire file programmatically which isn't ideal)

Alternatively, when loading a specific map, you can remove that map from the .txt file and append the modified version later. Although that would require you to implement an alternative ID system for maps

I can't really think of anything else right now, so I apologise if that isn't of much help

dusk sleet
digital peak
#

I mean unless you don't have to write back into the .txt file
In which case I think what you have right now is sufficient

dusk sleet
digital peak
#

In that case having a separate file for saved maps would be better I think
When the game is saved the program dumps the map (with its ID in a tuple maybe) into a save.txt file and when the game is resumed the player can choose to start a new game or load in their last save file

dusk sleet
digital peak
#

glad to be of help :3

next estuary
#

I moved a bunch of the mesh handling to C that gets compiled automatically based on Windows / Linux, and implemented the numba JIT, significant performance improvements on the procgen game

dusk sleet
#

Oooooo

next estuary
#

Smoooooth

wooden night
#

Is C# worth learning for game dev?

#

Like python does fine

shut tulip
#

One of the two main game engine (unreal or unity, I never remember which one) uses it

#

So yes I guess

next estuary
steep wasp
#

Soo basically its all jus magic

wispy dune
sage galleon
#

you can use your C# to make games on Unity

wooden night
wooden night
wooden night
raven kernel
wooden night
#

So C# over python

raven kernel
# wooden night So C# over python

The bulk of the work will be the same in both if you're not going to use a game engine, but still, you're better off using C# for portability and performance reasons. If you eventually want to get into game dev as well, already knowing C# will help you script your Unity or Godot games way more easily than knowing Python and then transferring that knowledge would.

There is something to be said about Godot's scripting language (GDScript) looking similar to Python, but it's completely different really. You won't get to use your itertools or collections magic, or any of the state management that you might have gotten used to

If your focus is to make a game to scale, you're going to have an easier time with C#
But making the game alone, especially smaller ones, especially if your only target is desktop, though Python's portability still isn't great you can get away with using things like pyinstaller or nutika : You might find it easier to use Python especially if you aren't already familiar with programming

TL;DR: It's easier to learn to make games with Python if you're not going to use an engine, but if you want to scale your game and target platforms like mobile or console C# is your best bet even without an engine

The bulk of the work and cost will be creating the assets, game design and marketting though. That would be the same for both, and without an engine and equal familiarity with both languages architecting the code for a big game would be equally challenging to do in either language.

The main difference comes down to portability and performance

#

And of course, transferrability to Unity or Godot. Since you can script both with C#. GDScript is not Python as mentioned above

There is something to be said about Godot's scripting language (GDScript) looking similar to Python, but it's completely different really. You won't get to use your itertools or collections magic, or any of the state management that you might have gotten used to
The language follows entirely different features and mechanisms. The syntax is just inspired from Python is all. The way you access nodes in your scene tree would be totally different from what you'd normally create with something like pygame as well

#

'Water The Cacti' was a game jam entry I made with Godot
the rest are Python submissions

wispy dune
#

There are lots of great engines, the one I like the most is Nu

"Never change a running system" means when something works, you don't have a reason to change it.

Don't try to fix something, that isn't broken.

Use what you love.

unkempt cave
#

Rock paper Scissors

mortal pulsar
#

I want to make a game (Like GTA V, Can I create it with Python) but I don't know the coding about how to do that because i am still learning the basic python

I just have few question

  1. What are the best resources website for my research and codes?
  2. What to learn before going to make games after completing the basics
  3. Can I create an AI or NPC for a game by python?
    how much time it take to aqurie all the knowledge of game development in python
    , learning basics.

Please answer me question and i appreciate u if anyone help me out with these obstacles.

I would be grateful,
thanks!

wispy dune
#

And if you absolutely insist on using Python, use Panda, UPBGE, or Cave.

These three engines use Python as the scripting language, and you will find some support for it.

wispy dune
#

Read a couple of lines above your question

mortal pulsar
#

thanks i am grateful for ur answer, I will do my best in learning python and developing more games from GD script or other programms i will follow ur guide thanks brother!

quasi canopy
#

This is a 2D platformer hitbox test with nanobind and python, where I pass a list of tuples representing the blocks:

8 blocks for 1000 entities:

Average platformer_2d time = 1.596 ms/frame

For 1 entity:

10 blocks โ†’ Average platformer_2d = 0.002 ms/frame

100 blocks โ†’ Average platformer_2d = 0.007 ms/frame

1000 blocks โ†’ Average platformer_2d = 0.060 ms/frame

5000 blocks โ†’ Average platformer_2d = 0.286 ms/frame

8000 blocks โ†’ Average platformer_2d = 0.483 ms/frame

this is correct or i can do better ?

snow solar
#

@keen star

shut tulip
#

Anything below 1ms is more than good

#

Remember that 60 fps is 16ms/frame

frank fieldBOT
#

Please react with โœ… to upload your file(s) to our paste bin, which is more accessible for some users.

errant oxide
#

It took so long tbh ๐Ÿ˜”

warped arch
tepid chasm
#

you guys think its worth to switch from windows to linux to build a own operating system?

wispy dune
#

You can find Discord servers about OS development

hearty tapir
quasi canopy
#

not only collisions

shut tulip
#

Of course, but collision is usually the worst part

quasi canopy
#

yeah

#
import GrnGame

def update():
    # Draw a sprite
    GrnGame.image.draw("./assets/player.png", 10, 10, 32, 32)
    
    # Keyboard inputs
    if GrnGame.keyboard.just_pressed("space"):
        GrnGame.song.play("./assets/jump.wav")
        
    # Quit
    if GrnGame.keyboard.just_pressed("escape"):
        GrnGame.utils.stop_game()

# Initialize the game
GrnGame.utils.initialize(
    width=160,               # Virtual resolution
    height=90,               # Virtual resolution
    fps=60,                  # Target frames per second
    scale=4,                 # Window scale
    image_path="./assets",   # Root folder for images
    sound_path="./assets",   # Root folder for sounds
    update_func=update,      # Loop function
    window_name="My Game",
    error_path="errors/err.log" # Path to error logs
)

do you like this structure of python game engine ?

shut tulip
#

My preference would be to have a Game class that implents everything, and manage states

#

Also idk how you use the path you give but make sure to not load things every update

#

And store them in memory after loading once

#

Also, your code doesn'y support transformations. Imagine I want "assets/imageA.png" to be shown twice, once with a line drawn on it and once without

#

I wouldn't to have 2 distincts assets

deep hare
#

yo guys does anyone know of a good library to just generate a frequency

#

im making a morse code thingy and literally all i want is for it to beep while im holding down a key

quasi canopy
#

i have a class game to access to every const and i load 1 time , you can free folder assets and load again .I store all in memory i have smae cpu performance than pygame and better ram .

quasi canopy
shut tulip
#

Tbh not that much

shut tulip
quasi canopy
#

you can draw line after draw the image

shut tulip
#

Mmm

#

Yes and no

quasi canopy
#

you can apply rotation and alpha on texture not pixels

shut tulip
#

Bc you'll need to keep track of the coordinates, after moving it, rotating and stuff

quasi canopy
#

yeah

#

the fonction draw will be hard

#

i want to apply this and this to image.png in x,y x1,y1 ...

#

likes this :

#

sprite2.add_transformation(Line(10, 10, 100, 100))
sprite2.add_transformation(Rotation(45))
sprite2.add_transformation(Alpha(0.5))

shut tulip
#

Yep looks fine

#

You could do this lazely

#

Wait, take a look to gamarts on github

#

Far from perfect, but I had a nice go at it you could find some insipiration from it

#

It's on my github, you can find it on my discord profile I think

quasi canopy
#

It's going to be torture with SDL

slow copper
#

If you're on windows you'll need to pip install windows-curses

deep hare
#

thank you jiggly balls

cerulean nimbus
#
class Player(pygame.sprite.Sprite):
    def __init__(self, *groups) -> None:
        super().__init__(*groups)
        self.image = pygame.Surface((globs.CELL_SIZE, globs.CELL_SIZE))
        self.image.fill("red")
class Window:
  def __init__(self):
    self.p = Player()
    ...
  def draw(self):
    self.context.blit(self.p.image, self.p.rect)
``````e
Argument of type "Surface | None" cannot be assigned to parameter "source" of type "Surface" in function "blit"
  Type "Surface | None" is not assignable to type "Surface"
    "None" is not assignable to "Surface"
#

eventho i make it a Surface on __init__ of the player class it gets still read as a Surface|None

scenic olive
cerulean nimbus
scenic olive
#

should fix it if not mistaken

cerulean nimbus
#

was just abt to post that i used that to fix it XD

scenic olive
#

my debugging skills are too slow ๐Ÿ˜”

cerulean nimbus
#

i think its a pyright thingy to not make it a Surface eventho its initialized as that

scenic olive
#

yeah the issue does come down to pyright / pylance (they are almost the same either way).

brave swan
#

Looking for a programmer that is good with hit/hurtboxes to help with a cool fighting game If anyone is interested

pure quartz
#

sorr to ask but because i just started coding i have many problems understanding stuff, if someone could help telling me where to type this because this is prbably the wrong category to get help for pragramming game design

cerulean nimbus
pallid wadi
pallid wadi
#

Sounds good

#

@brave swan
I can work with you as a programmer

brave swan
#

I'm more the creative mind and I know what's out there so my focus is to always push the boundaries of what's possible

toxic vortex
#

how do you make games in python all i know how to do is make text games

shut tulip
#

There are mulitple engines or libraries

#

Pygame being one of them

brave swan
keen talon
#

Hi how to hire developers from this channel for full-time?

slow copper
pallid wadi
keen talon
north knot
#

Guys how can I use python for game development?

toxic vortex
#

what game engines use python

brave swan
brave swan
# keen talon Yes please

Be careful of those who ask to help in dms, I had to learn the difficult way on this channel, I wont mention names but fare warning as some folks have significantly alterior motives

toxic vortex
#

ok thanks

#

is there a offical wiki for pygame

ruby roost
icy moat
#

Hey guys I am new to pygame what additional libraries do yall use along with pygame to make dev easier nad faster

quartz fossil
cerulean nimbus
#

like raylib for example

wooden night
#

There are game librarys like pygame or panda3d

#

But if u want to use engine- the closest engine would be gadot

wooden night
#

Or if u want u could fo for pymoderngl but it would be very hard if you don't have prior knowledge

cerulean nimbus
wooden night
wooden night
#

I think pySDL2 is for window control, sound and user inputs while pymoderngl is for rendering

#

Also they use GPU not CPU

next estuary
toxic vortex
#

how did you do that

cerulean nimbus
# toxic vortex how did you do that
  1. create a map
  2. make sure the camera offset is linked with the controls and/or player
  3. apply the offset to the map tiles
  4. update the tile break progress when hovering it and holding the break button
#

+- how it works could deferenciate depending on what library you use

#

i think he is using ursina? which has an implemented camera controller

slow copper
#

hes probably using perlin noise or some procedural generative algorithms to create the map dynamically

next estuary
#

Ursina + GLSL
Usually I use simplex for terrain generation, getting it working I'm just using a bunch of stacked sine functions right now.

I generate a 4096x512 uint8 numpy array and pass it as a texture to the GPU where each block type correspond to a location in the stitched texture atlas.

#

This is what the atlas looks like

frank fieldBOT
next estuary
frank fieldBOT
# next estuary

Please react with โœ… to upload your file(s) to our paste bin, which is more accessible for some users.

next estuary
#

Here's the shader files if you wanted to play with them

#

You'll also need an atlas for the damage textures

#

I can't distribute the damage atlas, but you can make one from minecraft texture packs

next estuary
#

You can use this to stitch square images together into an optimized power-of-2 atlas texture for fast texture fetching on the GPU

frank fieldBOT
limpid bone
#

hello everyone

#

๐Ÿ˜

cerulean nimbus
#
#version 330
in vec2 in_vert; // this is the x, y of the point that needs to be rendered
in vec3 in_color; // color of vertices_triangle[x,y]
out vec3 v_color;
// uniform vec2 target_size;
uniform vec2 resolution;
uniform vec2 target_pos;    // pixel coordinates, e.g., (10, 10)
uniform vec2 tri_center;    // normalized coords of triangle center

vec2 screenToNormalized(vec2 pos) {
    float screenWidth = resolution.x;
    float screenHeight = resolution.y;

    float x = (pos.x / screenWidth) * 2.0 - 1.0; // cause x on the window is from left to right
    float y = 1.0 - (pos.y / screenHeight) * 2.0; // cause y on the window is from bottom to top
    return vec2(x, y);
}

void main() {
    vec2 targetNorm = screenToNormalized(target_pos);
    vec2 offset = targetNorm - tri_center;

    vec2 shiftedVertex = in_vert + offset;

    gl_Position = vec4(shiftedVertex, 0.0, 1.0);
    v_color = in_color;
}
dawn quiver
#

my name is eepy

#

and i love wxwidgets and opengl

brave swan
cerulean nimbus
brave swan
cerulean nimbus
# brave swan Yes

yes should probably work since they get parsed in a vertex and fragment file

cerulean nimbus
#
@functools.cache
def get_shape(self, shape, ctx: moderngl.Context) -> _Cache:
    prog = ctx.program(
        vertex_shader=open(f"./shaders/{shape}/vertex.vert").read(),
        fragment_shader=open(f"./shaders/{shape}/fragment.frag").read(),
    )

    vertices = triangle_vertice()
    vbo = ctx.buffer(vertices.tobytes())
    vao = ctx.vertex_array(prog, self.triangle_content(vbo))
    return {"vbo": vbo, "vao": vao, "prog": prog}
cerulean nimbus
next estuary
# brave swan Nice, thank you

Yeah, you can pass any power-of-two sqaure image, the texture size doesn't matter as long as it's square. You could do 1 pixel per tile or 256 if you wanted

next estuary
#

I should clarify that they technically don't have to be power of 2, but you might have pixels bleed between textures that aren't perfectly aligned

cerulean nimbus
lost kindle
#

!clban 1443077627165409370 Looks like you're here only to advertise.

frank fieldBOT
#

:incoming_envelope: :ok_hand: applied ban to @dim hamlet permanently.

dawn quiver
#

woah what did he do

next estuary
cerulean nimbus
next estuary
#

I tried using both compiled C dlls, and cpython, the impacts were marginal at best compared to just using numba jit, and sometimes slower

cerulean nimbus
#

oooh nice to know

#

i know in some cases it can be helpfull while others can fail i think its just trial and error

#

im not focusing on a game rn but more an own "WS" python version

cerulean nimbus
cerulean nimbus
next estuary
#

Yeah, I highly doubt I'll be able to write something that runs faster than the pure-math nerds who wrote numpy and numba haha.

#

They have my respect, even if I don't understand it all haha

cerulean nimbus
#

im still struggling writing my fragments and vertices for my program

#

they are a struggle in disguise ๐Ÿ˜ญ

next estuary
#

I've been playing with them for 3 years now, and am finally at the point where I'm "ok" enough at them to make things work

#

Will never claim to be "good" at shaders haha

#

Learning how to do memory alignment was helpful, but definitely was a learning curve even with a decent understanding of raw data types

cerulean nimbus
#

ye ๐Ÿ˜ญ

cerulean nimbus
#

looks pretty nice

cerulean nimbus
next estuary
cerulean nimbus
#

hahahhah

#

maybe make it so that if you make a world with a certain seed it will have this behaviour

gloomy spoke
#

I wrote a little program to generate some pseudo-random six-sided dice for a game I'm making and I've run a test program to see if I like the number distribution that it's giving me. I've noticed that it generates noticeably more 2's and 5's than anticipated and I was wondering if anyone knew why that is. There's a lot fewer 1's and 6's, but that's to be expected since there's fewer places that can have those digits, but there's also a lot fewer 3's and 4's for some reason. Is it just the way the random module generates numbers?
My code looks like this:

import random

def create_die():
    num_01 = random.randint(1,2)
    num_02 = random.randint(1,3)
    num_03 = random.randint(2,4)
    num_04 = random.randint(3,5)
    num_05 = random.randint(4,6)
    num_06 = random.randint(5,6)
    die = [num_01, num_02, num_03, num_04, num_05, num_06]
    die = sorted(die)
    return(die)
    
dice_faces = []
iterations = 0
while True:
    die = create_die()
    for i in die:
        dice_faces.append(i)
    iterations += 1
    if iterations == 1000:
        iterations = 0
        print("There are " + str(dice_faces.count(1)) + " ones.")
        print("There are " + str(dice_faces.count(2)) + " twos.")
        print("There are " + str(dice_faces.count(3)) + " threes.")
        print("There are " + str(dice_faces.count(4)) + " fours.")
        print("There are " + str(dice_faces.count(5)) + " fives.")
        print("There are " + str(dice_faces.count(6)) + " sixes.")
        input(">")
#

After running it for a while, this is the output it gave me:
There are 74312 ones.
There are 103573 twos.
There are 89256 threes.
There are 88774 fours.
There are 103889 fives.
There are 74196 sixes.

severe vale
#

1 and 6 only appear once, as you have already noticed. but while most randint calls have three options, the first and last - featuring 2 and 5, respectively, only have two, upping their odds

gloomy spoke
#

Oh, that makes sense. Thank you.

severe vale
#

as a side note, there are easier ways to test this

#

!e


import random
import collections

print(collections.Counter(random.randint(1, 6) for _ in range(10_000_000)))
frank fieldBOT
next estuary
cerulean nimbus
#

this gap is it cause you are working in chunks kinda or ?

next estuary
#

Vertical movement takes priority, and if any vertical movement is available it won't spread horizontally on a given tick set, still working on making it able to equalize quickly and transfer up to 1/2 block per tick rather than 1/8th

#

Also need to distribute the computation over ~.1 seconds rather than doing the entire computation in one frame

next estuary
#

Significant improvements

ember jasper
#

hlo

#

anybody onine

#

online

worn oar
#

No.

next estuary
#

Sometimes math is hard lol

#

Screwed up my glsl texture fetch function in the shader somehow

silk locust
#

of the ocean.

next estuary
#

I call it Pyrarria lol

next estuary
#

Dynamic lighting + rounded blocks

near bloom
#

Hi

next estuary
next estuary
open burrow
#

wow

unkempt forge
#

@pallid wadi hey bro can I dm you

pallid wadi
pale rapids
#

Wow

next estuary
#

Switched to a higher bitcount lightmap, and implemented a much better pressure-based fluid algo

worn oar
#

Make the damn blocks full

next estuary
#

connected textures eventually, the GPU math on that is going to be a pain.

#

for now it shows the volume of fluid in that tile at that moment

gentle haven
#

hi

foggy python
covert dagger
# foggy python

i watch you on youtube all the time i didnt expect to see you here

quasi patrol
nocturne mango
foggy python
viral blade
#

Hi guys any starter pygame tutorial

shut tulip
#

The official one you can find on pygame website

limber veldt
#

Also, saves the positions of items, like keys

limber veldt
#

All of the sprites are in various groups. My idea is to give all items a write_references() and a read_references() method then write a method in main that iterates those groups calling each sprite's write_references() method for saving and the reverse for loading

#

This way all items can write and read their own attributes

#

Such that certain kind of items write/read specific attributes

#

Like some items cannon be rotated, some can

#

cannot*

#

So for those that cannot, there's no need to write a rotation attribute

#

So read all item IDs into a list and use that list as an index into each item's data within a list of all written references

#

Eventually, I'm gonna have to tackle the nested rooms issue

#

Which is the main problem I'm having at this point

#

The game has some items that have rooms inside them. Those objects are always nested in the level, that is, they always are inside some room of the level. The tricky part is that those items can also be inside each other

#

So maybe my save data has a separate section for saving things with internal rooms

#

Each level has a rooms_list, each item has an attribute referencing the room it's in within that list. The nested rooms are not in that list

#

So when an item writes its references, it has to account for that, there needs to be something linking the item to the internal room and that item with the internal room back to the level

#

Excuse me while I think aloud for a minute : )

#

Rubber ducking actually helps me most of the time

foggy current
# foggy python Yep

I discovered your youtube videos they're awesome and inspiring ๐Ÿ‘๐Ÿ‘

outer ridge
#

hello

viral blade
#

Hi

lusty pine
lusty pine
#

It is, in technical terms, a Lexical Wave Function Collapse text sentence generator
WFC is Wave Function Collapse which is a system that uses contraints to propagate things to generate, for instance a 2D map in a video game. It's the reason you don't get Tundra next to Desert in Minecraft. Lexical just means it uses words instead of blocks or tiles
When you first start a sentence, it's basically Schrรถdinger's Sentence, in a quantum superposition until the words begin collapsing in as you look at them, until it becomes a complete sentence

the idea is that the words that are generated by the WFC engine will affect the game state each time you interact

woeful owl
limber veldt
slow copper
#

id imagine it'd be a nightmare without some sort of state machine

proper peak
#

(WFC is pretty new - the repo is from 2021 and based on research starting in ~2010.)

next estuary
#

Lighting is so hard to get right / keep fast

#

ignore the unshaded edges outside of normal fov

viral blade
#

I'm learning game dev what's the simplest game I can make

shut tulip
#

snake maybe ?

#

with only squares

slender rose
#

Guys how do you make games?

shut tulip
#

pygame(-ce)

slender rose
#

and?

shut tulip
#

and patience

slender rose
slender rose
shut tulip
#

pygame-ce is better than pygame

shut tulip
slender rose
slender rose
shut tulip
#

basically pygame stopped getting updated 2 years ago so the community forked the project and kept working on it

normal silo
slender rose
#

the guess the number

shut tulip
# slender rose i don't know

I mean, you need some assets, it can be done with anything from photoshop to MS paint. You need some music (for this I have no idea how to do, but I guess there are software for that if you want to write your own... Then for the game itself, you can use pygame to handle inputs, screen and sounds

#

You can use sqlite for a database if you need, or maybe only store things with a json format

slender rose
#

oh

shut tulip
#

at the end you are quite free on what you use

slender rose
#

and github

shut tulip
#

yep, git for versioning

slender rose
normal silo
viral blade
#

The simplest one

#

I will choose snake

rigid marsh
#

hey can someone help me?

shut tulip
#

Just ask your questions

wooden night
#

It will be harder than pygame but truest me its gonna be good

#

How much do u know python?

covert dagger
viral blade
#

Did u download the sprite

covert dagger
#

it has plenty of free game assets, can be helpful to practice building games

viral blade
#

I'm having problems organizing my code

#

Idk which to bring first

#

I know the base ones which comes first but the rest .....

slender rose
#

uhm

#

I can do a basic guess the word/number game

#

without any UI tho

wooden night
#

And types of data?

slender rose
#

will be glad if you teach

wooden night
slender rose
wooden night
shut tulip
#

!res

frank fieldBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

shut tulip
#

For other resources you could find helpful

wooden night
hearty crater
#

Im trying to make a crosshair overlay however I cant seem to get it to be a overlaid on my screen, any suggestion? please ping or dm

covert dagger
#

but basically u need to figure out the order stuff gets draw in, for exemple you want to draw the hud (score) the last so it appears on top of everthing, background the first so everything gets drawn on top of it, and so on

woeful owl