#game-development

1 messages · Page 3 of 1

vagrant saddle
#

sure you can have all sorts of models procedurally generated

arctic flare
#

Hello, anyone know a lib that connects to a Minecraft server apart from mcpi and discordSERV?

mystic epoch
mystic epoch
vagrant saddle
#

it would probably depends on the game, but Panda3D core is written in C++ anyway

finite solar
mystic epoch
vagrant saddle
#

you should make a ray casted game with pygame, there are plenty of examples around

dawn quiver
#

nice 😄

#

yes

dawn quiver
finite solar
#

I'm not too sure on the restrictions of having to code everything. But if you use Pygame you will have to create your own game loop and game object for your game. I hope this helps

paper sandal
#

Anyone familiar with the PAWN language, which has been described as mashing Python and AWK together?

plush wedge
#

just finished the first part of my 4 part project

#

it’s gonna be huge

#

it’s all up on my github

snow hill
#

WIP Harfang3D GUI

#

you can also pull the whole repository

#

it runs straight from the clone

#

it's a little workshop I did with a team of CS students

#

they created each one a level of the game

#

(you have all the levels in the latest commit)

dawn quiver
snow hill
#

you are probably not using it properly 🙂

#

try the .bat files

snow hill
#

Ok 👌

#

Will try on my side and make a short video

#

It should help

#

Thanks for testing anyway

#

BUT

#

A screenshot with an error message would help 🙂

dawn quiver
snow hill
snow hill
#

Can you try double clicking on the .bat files ?

plush wedge
snow hill
#

wip car driving simulator in python

dawn quiver
#

I wanna talk about pygame

vagrant bobcat
#

what is this?

#

I've never seen code like this before

signal creek
#

@vagrant bobcat sorry for the late response. It's a language I built myself. Just finished defining everything after 2 years

vagrant bobcat
#

woah

plush wedge
#

Here’s a project I’m working on, this is just the output of the code I spent days typing, there’s other output’s to the first input but i just wanted to show what would happen if you didn’t follow the instructions

vagrant saddle
tame patio
#

I am trying to make a arcanoid clone using arcade, which engine should I use. I tried arcade.PymunkPhysicsEngine but it is not working properly

snow hill
dusty burrow
#

Send me a DM if you are interested.

desert beacon
rotund quail
lavish kraken
#

hey i need help with a code rel quick

#

im usuing (turtule)

dawn quiver
#

Hi

spiral skiff
#

What then snakes doin

raw shadow
#
def return_map(
        self,
    ) -> list[pygame.Rect, list]:  # sourcery skip: for-append-to-extend
        self.map_array = []
        x_rand, y_rand = random.randint(0, self.height), random.randint(0, self.width)
        print(x_rand, y_rand)
        color = WHITE
        for y in range(self.height):
            for x in range(self.width):
                if x == x_rand and y == y_rand:
                    color = RED

                x_pos = x * self.block_size[0] + 5
                y_pos = y * self.block_size[1] + 5
                self.map_array.append(
                    [
                        pygame.Rect(
                            x_pos,
                            y_pos,
                            self.block_size[0] - 10,
                            self.block_size[1] - 10,
                        ),
                        color,
                    ]
                )
        return self.map_array

one of the squares should turn red, but its not turning red. which sorta seems impossible as im generating a random int in the domain of the nested loops which the random number should match at some point

snow hill
#

as I was unable to complete my #PyWeek34 entry, I decided, at least, to make a decent readme file so that people can see how it was supposed to look like (I even included a "release")
https://github.com/astrofra/pyweek34-planete-encore

GitHub

Game prototype for the PyWeek 34 game jam. Made in Python with HARFANG 3D. - GitHub - astrofra/pyweek34-planete-encore: Game prototype for the PyWeek 34 game jam. Made in Python with HARFANG 3D.

haughty goblet
#

hello I am currently recreating mario on python thanks to pygame and I would like to know the pygame method which allows to move the window if there is one of course

dawn quiver
#

I am assuming you want to change the view

dawn quiver
#

The math for a view or camera is really simple but you can use pygames camera object if you need to

dawn quiver
haughty goblet
snow hill
snow hill
#

You downloaded the zip from the release section, you clicked on the .bat file and it still fails :/ ?

#

Can you post a last screenshot to help me figure out what’s wrong ?

#

You downloaded this file, right ?

snow hill
#

ok

#

do you know how to run a .bat file ?

#

a .bat file is for Windows, no for PyCharm 🙂

#

you simply need to open the Windows Explorer

#

then, locate the folder where you unziped the game

#

then, double click on "2-run"

#

(the .bat file format was created around 1980, I assumed it was obvious you had to run it from Windows and not PyCharm, sorry 🙂 )

stable lion
#
 import pygame as pg

pg.init()
display = pg.display.set_mode((500, 500))
t = pg.time.Clock()
img = pg.image.load("Assets/Dino/DinoStart.png").convert_alpha()
img2 = pg.image.load("Assets/Bird/Bird1.png")
img_rect = img.get_rect()
img2_rect = img2.get_rect(center= (50, 50))
while True:
    display.fill((255, 255, 255))
    for e in pg.event.get():
        if e.type == pg.QUIT:
            exit()
    mx, my = pg.mouse.get_pos()
    img_rect.center = (mx, my)

    img_mask = pg.mask.from_surface(img)
    img2_mask = pg.mask.from_surface(img2)
    offset = (img2_rect.x - img_rect.x, img2_rect.y - img_rect.y)
    if img_mask.overlap_mask(img2_mask, offset):
        print("Collision")
    display.blit(img, img_rect)
    display.blit(img2, img2_rect)

    pg.display.update()
    t.tick(60)``` why do i get collision message everytime?
silk mountain
#

idk

dawn quiver
stable lion
dawn quiver
dawn quiver
#

how i can download opengl sdk ? help pls (.vert ... file format glsl shader)

spice cliff
#

What would you recommend as backend/engine (in Python) for web-based 2d multiplayer action game? I decided on FastAPI with Websockets for now, but maybe there is something better I could use 🙂

dawn quiver
#

Pygame can be ported to the web now, but the answer depends on the exact game you are making
If it's just clicking in buttons and getting certain options then maybe your approach right now is better, but personally speaking if it's something like a platformer I'd use pygame and package it with pygbag

spice cliff
dry frigate
#

hey guy
I'm new here
I want to create a Voice Voice Assistant on replit and we can talk back and forth together
I guy have any idea or keyword?
thanks a lot

spice cliff
#

I think in this project backend is only limited to serving assets amd there are no calculations done on server side for game itself

#

To build multiplayer game I need client-server communication, client-client may be useful as well

#

For the frontend side I'm a bit concerned about using it for larger game, how does it compare to JS ones?

dawn quiver
#

As seen in pikmin three's final boss the plasm wraith

snow hill
sweet shard
spice cliff
#

It may be work with pixi.js, so even if a bit slow it is still valid choice

sweet shard
#

Yeah it won't be the fastest but you do get access to all of the Javascript browser libraries which is nice

#

If speed is an issue I believe there's another python library that precomplies your python into javascript

vagrant saddle
#

brython is great but you cannot use compiled python libraries that require reference counting

dawn quiver
#

I am at a weird impass

vagrant saddle
spice cliff
spice cliff
spice cliff
vagrant saddle
vagrant saddle
spice cliff
spice cliff
spice cliff
tranquil girder
#

if you're making backend, that is, running code on a server to communicate with clients over the internet, wasm and all those are irrelevant. you can just run CPython or PyPy or something like that. I assume since you're posting on the Python discord that's what you want to use. And it works well for that. There are lots of libraries in the standard library and others which work well.

spice cliff
tranquil girder
#

Like the socket module

spice cliff
#

As I'm mentioned in first message I'm using FastAPI with websockets as web backend, but I'm not sure if this is right direction to go

#

I'm also thinking about adding separate engine app that will communicate with FastAPi via Redis, because FastAPI doesn't support long running tasks

tranquil girder
#

Or the one you're already using, FastAPI. I think as long as it's tried and tested, it's good. I don't really have any experience with this.

spice cliff
#

It would work like this: Frontend (websocket) <-> (websocket) FastAPI (redis) <-> (redis) Engine app

vagrant saddle
#

for action/shooter there's too much latency, use webrtc (udp based) instead

spice cliff
#

Without server I won't be able to ensure that players aren't cheating

vagrant saddle
#

webrtc can use a server, peer to peer does not mean always serverless

spice cliff
#

I didn't know you can use this protocol for client-server communication, do you know any good framework that supports it, like FastAPI?

vagrant saddle
spice cliff
vagrant saddle
#

well C is not a problem for python

#

and you probably want your netcode in wasm to prevent (a bit) from cheating

spice cliff
#

I noticed HumbleNet uses both WebRTC and Websockets, so perhaps I don't need WebRTC part in first place

vagrant saddle
#

usually websocket is used for peer discovery ( by adressing the server ) and then switch to webrtc

spice cliff
vagrant saddle
#

yeah aiortc seems good for making the server

spice cliff
#

It could be, I probably would have to pair it with some web server like FastAPI anyway

#

Do you have any speed comparison between websockets and webrtc?

vagrant saddle
#

udp (webrtc) is 2x faster

spice cliff
#

Websockets are supported in almost any web server while webrtc needs additional setup, so I would like to ensure it's worth it

vagrant saddle
#

also routers on internet prioritize webrtc traffic

spice cliff
vagrant saddle
#

counterpart is you can lose data in flight

spice cliff
#

TCP and UDP are similar, but TCP will wait for packet if it is lost

#

And this is only at network level, if we want to compare WebRTC and Websockets we have take into account that those are different protocols not only at network level, so we have to use real tests

#

It would be different scenario when you send multiple small events compared to sending one large file using those protocols

#

I would like to have this kind of performance data

vagrant saddle
spice cliff
vagrant saddle
#

just consider that websocket has xor'ed chunks and is encapsulated in TLS and has no control over maximum transfer unit. A very simple test is compare unix network file system (nfs) speed on a lan with tcp and then udp

spice cliff
#

Comparing TCP vs UDP is not comparing WebRTC vs Websockets 😄

vagrant saddle
#

indeed, websocket is so much worse than tcp that nobody had to demonstrate it

spice cliff
#

I agree that WebRTC should be faster and better for action game, but I need to know exact numbers to justify more complex implementation

vagrant saddle
#
  1. get the numbers yourself if you don't trust random people that actually work on the tech 2) webrtc is not more complex
#

it's making reliable messaging with it which is more complex

spice cliff
spice cliff
vagrant saddle
#

it is already used in web browsers eg in wasm4 fantasy console

spice cliff
#

Building GGPO is currently only available on Windows....

#

Windows builds requires both Visual Studio 2019 and CMake.

#

Are you sure?

#

Could you send me some more links?

vagrant saddle
spice cliff
#

Ok, thanks

distant dove
#

I need some major help and I don't even know where to start. I could use some good help in port forwarding, or whatever I need to do to make my code work on remote devices (it works on my own device but not connecting different devices). I know the general idea of it, but I want to be able to provide a .exe file of my code online for anybody to use, and I don't want to have users of my code to have to go through a whole process of port forwarding. How do I implement something like this into my code?

torn jackal
#

hello guys, someone knows how to make Steam Achievements in python ?

sweet shard
torn jackal
#

@sweet shard Actually Steam just show us how to od it in C++

untold sentinel
#

Maybe you guys can help me

#

My group decided to build a topdown game (with Unity) for our term project

#

We're all fine coders, and are not particularly worried about that aspect of things. But we've hit a wall when it comes to graphics

#

If we want our player to be able to, say, use a bow in addition to a sword, we need a set of sprites that can show that. If we want any kind of a story, we need NPC sprites.

#

And, none of us can draw

dawn quiver
proper peak
#

I'd unironically look into AI generation for that. Sadly, from my experiments, general-purpose stuff like stable diffusion is optimized for high res and performs horribly for pixel art or low-res (well, you could generate a high-res sprite and pixelate it but that has its own issues); you need a dedicated model.

untold sentinel
#

The only thing I can think of would be making a 3D low poly model, animating that, and then pixelizing it

dawn quiver
#

You could, but why not just use a pixel image studio?

#

I’m sure there is something that could help you create sprites.

untold sentinel
#

3D is marginally easier on my brain. Though I suppose we'd get better results with a pixel engine

dawn quiver
#

Oh I just saw, you need it animated?

#

Like a shooting animation?

untold sentinel
#

Well, our character is going to need to be able to move. That means a walking animation. In theory, we can just do two directions (left and right, one being a reflection of the other) which makes things a bit easier. But in addition to walking, we'd need a melee attack animation and an idle state. And then if we want anything beyond that, like using a bow or casting a spell, that's a different animation for each

#

Then there's enemies, which will all need a walking and attacking animation, and NPCs which need walking animations

dawn quiver
#

How would you import it into Unity? As a video? Gif? As a 3D model that preserves the animation? Because depending on what you use will change what you have to do.

untold sentinel
#

Unity consumes sprite sheets — each sprite in the animation, regularly spaced

#

It automatically creates subsurfaces from the sprite sheet, and wraps them up in some kind of SpriteSequence object. It's pretty much automated

normal silo
#

In top down you can split the sprites into parts. Head, body, legs.

#

Make the NPCs not animated other than simple bobbing up and down programmatically (they don't walk / move around). Then make multiple static NPCs that you can talk to by giving them 1 of 3 hair styles and changing the colors (variations).

hushed marten
#

Anyone knows about UI game dev ?

tame patio
dawn quiver
#

Hello everyone I have a question.So I wanna make a game with a friend of mine and I have a made the character already on blender and my question is that do I do the code on blender or use other app/game engine?If you recommend another app can you tell me which one should I use!

blazing void
#

Hello, I made an simple dvd screensaver (I wanted at beginning to implementing to switch the dvd logo to cat pictures with using an API and then I noticed it is pain to download pictures from url, so I gave up the idea) and and to ask if is there is something what can I optimize?
https://paste.pythondiscord.com/lafuxecayu

native seal
#

to download pictures

blazing void
#

yeah but it says something like the content don't match with type

#

maybe somewhen I will try to implement it again

sweet shard
sweet shard
hushed marten
tame patio
hushed marten
eternal vessel
hushed marten
eternal vessel
#

If you prefer watching videos for learning, Clear Code has good Pygame tutorials

dawn quiver
#

Hi

#

I know a bit of C, Could I help?

dreamy pagoda
#

im using sockets for a multiplayer locally hosted game and my client easily connects to the server when both are run on the same machine, but client throws this error when i run the client on a bridged adapter VM

what might cause this?
i don't think it's a firewall thing because i had been able to connect this way a week or 2 ago

frank fieldBOT
#

Hey @dreamy pagoda!

It looks like you tried to attach file type(s) that we do not allow (.mkv). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

dawn quiver
dawn quiver
# dawn quiver I know a bit of C, Could I help?

On the game I don't think it will be possible since most things me and my friend have thought about putting in the game are some things we won't be able to show you so I am sorry.If you mean telling me what game engine I could use then sure

brazen leaf
#

deos anyone have a good source to generat 1D perlin noise thats mostly easy to understand

dawn quiver
#

lemme just measure my spacing real quick

ashen condor
#

is there a way to find the lastes pygame version for python 3.6?

potent ice
#

And there are definitely 3.6 wheels there

vestal sand
#

brotha what is perlin noise

clear cloud
#

im making the movement for my game rn but only for some directions the left and right work, the other direction they are both really similar to up and down
can som1 help

#
    def movement(self):
        sin_a = math.sin(self.angle)
        cos_a = math.cos(self.angle)
        dx, dy = 0, 0
        speed = PLAYER_SPEED * self.game.delta_time
        speed_sin = speed * sin_a
        speed_cos = speed * cos_a

        keys = pg.key.get_pressed()
        if keys[pg.K_w]:
            dx += speed_cos
            dy += speed_sin
        if keys[pg.K_s]:
            dx += -speed_cos
            dy += -speed_sin
        if keys[pg.K_a]:
            dx += speed_cos
            dy += -speed_sin
        if keys[pg.K_d]:
            dx += -speed_cos
            dy += speed_sin

        self.x += dx
        self.y += dy
``` this is most likely the thing causing the movement to be weird
#

bruh now after i continued the code the movement stopped working

eternal vessel
#

Oof

frank fieldBOT
#

Hey @sterile cipher!

It looks like you tried to attach file type(s) that we do not allow (.pdf). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

#

Hey @sterile cipher!

It looks like you tried to attach file type(s) that we do not allow (.pdf). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

turbid isle
#

hey guys

#

for a programming hw question

#

I need to scan an image using pygame with a nested loop

#

does anyone know how to do that

#

I have tried it but it gives me and index error for some reason

eternal vessel
turbid isle
#

Oh yeah mb I solved the problem than you for responding tho

#

Thank*

eternal vessel
#

No problem, enjoy making game!

dawn quiver
eternal vessel
dawn quiver
#

!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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

dawn quiver
dawn quiver
#

This code doesnt scale well

#

I need to revist it

frank fieldBOT
#

Hey @dawn quiver!

It looks like you tried to attach file type(s) that we do not allow (.zip). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

analog dew
#

!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 floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

analog dew
#

could someone help?

#

i need to display text to the pygame window

ancient shale
#

im trying to make a guessing game but the computer guesses my number. each time the computer guesses a number, i decide whether the number is too low or too high

#
 import random
 
maximum = int(input("Maximum number: ")) 
minimum = int(input(" Minimum number: ")) 
answer = input("Answer: ") 

x = random. randint(minimum, maximum) 

while x != answer:
     print(x) 
     y = input("Higher or Lower: ") 
     
     if y == "H":
         minimum = minimum + 1

     elif y == "L":
          maximum = maximum - 1
#

but i camt seem to figure out whats the problem here

elder needle
#

Is pygame a solid development method or is it like a meme?

#

I'm a bit confused on its legitimacy

dawn quiver
# ancient shale ```python import random maximum = int(input("Maximum number: ")) minimum = i...

Here is a small implementation of your idea:

import random


def main():
    select_random = determine_number()
    find_number(select_random)


def determine_number():
    minimum_number = int(input("Enter the minimum number: "))
    maximum_number = int(input("Enter the maximum number: "))

    select_random = random.randint(minimum_number, maximum_number)

    return select_random


def find_number(select_random):
    counts = 0

    while True:
        answer = int(input("\nEnter your estimate number: "))

        if select_random == answer:
            print(f"It took you {counts} attempts to find the right number: {select_random}")
            break

        else:
            print("Not yet. Try again!")
            counts += 1


if __name__ == '__main__':
    main()
potent ice
elder needle
potent ice
#

There are definitely python games on steam made with various different libraries

elder needle
#

like a hollow knight would be a totally cool example

potent ice
#

There are of course other libraries out there like Panda3D/Ursina, Arcade, Pyglet etc etc etc

gloomy ledge
#

the only other python "game" engine that is actually used for lots of "games" is Ren'Py. I put "games" into quotes, because it's an engine for visual novels. I believe "Doki Doki Literature Club!" is made using Ren'Py.

proper peak
#

the original, yup. For the Plus release, they painstakingly ported the entire game to Unity (since that allowed releasing it on non-PC platforms too).

frank fieldBOT
eternal vessel
elder needle
#

I like it I just don't wanna get wrapped up in it if there's going to be like massive issues

eternal vessel
#

People are just concerned of it because Python is a slower language, but it's fully capable, if you have $5 you could try one of his games. Their kinda hard though so beware on that

dawn quiver
dawn quiver
# elder needle I like it I just don't wanna get wrapped up in it if there's going to be like ma...

There are. This is coming from someone who has used pygame a whole lot! Made a few PRs here and there too.

It's a great tool, but you definitely won't find it easy given the amount of control you have, you have to plan everything if you want a nice end product. It's what me and many others like to do, and are good at, but if you aren't up for that I'd recommend something with a little bit more abstraction
Godot and GD script are great

Don't be discouraged from using pygame though, its definitely usable for what you're talking about, but you need to know what you're doing which may take some time to cultivate

vale swift
#
import random
from time import sleep


while True:
    sample = {"Ace":[0,2,3,4,5,6,7,8,9,10,11,12,13],
            "Deuce":[-1,0,3,4,5,6,7,8,9,10,11,12,13], 
            "3":[-1,-2,0,4,5,6,7,8,9,10,11,12,13], 
            "4":[-1,-2,-3,0,5,6,7,8,9,10,11,12,13], 
            "5":[-1,-2,-3,-4,0,6,7,8,9,10,11,12,13]}

    card1 = random.choice(list(sample.items()))
    while True:
        #card1_val = random.choice(list(sample.values()))
        #print(card1)
        print(card1[0])
        #print(sum(card1[1]))
        #print(card1_val)

        card2 = random.choice(list(sample.items()))
        #print(card2)
        print(card2[0])
        #print(sum(card2[1]))


        if (sum(card2[1])) < (sum(card1[1])):
            print(f"{card2[0]} is higher")
        if (sum(card2[1])) > (sum(card1[1])):
            print(f"{card2[0]} is lower")
        if (sum(card2[1])) == (sum(card1[1])):
            print("Both cards are the same")

        card1 = card2
        
        sleep(3)

im making a hig/low card game

celest hamlet
#

Can anyone recommend a "almost top down" (not sure what you call it) Player & NPC character sprite pack with 8 directional movement and melee attacks, damage, death animations etc.
I'm happy to pay

Theme: Zombies or medieval/fantasy
Bonus: Would be 8 directional range attack animations

lofty sigil
nimble crypt
#

ayo how do i add postgresql database in my pygame game ;-; anyone can just get its code and get the database's user, password and stuff

brazen leaf
woven canopy
#

So, odd question. Last night was on the LearnPython reddit, helped a guy with a few bugs he had in a text adventure game he was having. Now I've made a couple of these before when I was initially learning, but then shifted to more roguelike design games. And helping him out brought me to a question.

So say you're making a "map" for a text based game, each location obviously needs to link to several others. In the guy I helped's each location name was tied to a dictionary, which's keys/values were the move-commands/destination room. Which that worked.

Just been thinking though. For that game there was about 8 rooms, with about 2 adjacencies each. Obviously if one wanted to scale this up a lot, you might end up with 100 rooms each with a couple adjacencies. Any thoughts on how to efficiently generate/encode those?

dawn quiver
#

does anyone have a good beginner project I can try?

#

looking for ideas.

woven canopy
#

A great early option, try and remake "The Oregon Trail" as a text game (you can find basic templates for this all over the net. And then just add stuff to it for a few days). Then if you feel a bit more confident, maybe step otu of console and try and make it again (but better) with pygame and a 2d interface.

teal gulch
#

What are the most complex types of games python can make?

olive geode
teal gulch
olive geode
teal gulch
# olive geode _any type of game_

Damn, i didnt know that, i thought complex games like open world needed game engines, uk anything about open world python? Idm learning

olive geode
teal gulch
#

Ye i dont, i still think python is like a baby language, ik its useful in some careers but i want game dev so..

olive geode
olive geode
teal gulch
olive geode
teal gulch
#

Alright

acoustic hill
woven canopy
#

Isn't a good chunk of Eve online's server code built on Python?

sweet shard
#

Yeah Eve Online uses Stackless Python for most of their servers

#

Python was also used by Disney for ToonTown Online and Pirates of the Caribbean Online

brazen leaf
#

can I get some help with an extremely specific problem in vc

untold sentinel
#

I could use some help thinking my way through some procedural generation stuff

brazen leaf
#

i tried doing to same thing. I gave up

untold sentinel
#

Its a top down game, for a school project. It doesn't need to be big or even great, so long as its been well thought out

#

I can see why procedurally generated and, more specifically, open worlds are not common for topdown games. World traversal in these games is made more interesting because you are directed by the shape of the level to only ever move in one direction (more or less), and you are constantly met with obstacles which must be bypassed one after another

#

This, and height differentials in the landscape is tricky. For the most part you can't have anything lower behind something which is higher. You can get away with something lower if what's higher is only ever higher by one level, but it starts looking very off if the differential is too great.

#

And then in terms of obstacles, they have to be "wide" or "long" enough to force the player to go far out of their way for them to be worth the time.

#

Does anyone have any experience procedurally generating a topdown world? Anyone have insight?

dawn quiver
#

It is also called a rogue like

#

If you dont want to go that direction maybe legend of zelda?

#

They are several algorithms for generatig room layouts.

#

You could make up your own algorithm. Doesnt have to be complex. Some can do it.

#

The Coding Train has a maze generation video and a video on wave function collapse

untold sentinel
#

I mean, not to put too fine a point on it, what I had envisioned was a topdown BotW

dawn quiver
#

Is this your final project?

untold sentinel
#

On a small scale, of course. But that's a tricky notion without being able to climb, swim, etc

#

Our term project — though the majority of the project emphasizes planning, requirements specifications, various design diagrams

dawn quiver
#

What can you do?

untold sentinel
#

When I say "procedural open world" I mean something ultra simple. But, it does need to be well thought out.

dawn quiver
#

Do you know how to detect collision

#

What about resolving the collision after

woven canopy
#

So you want to procedurally generate a GB zelda-esque map?

untold sentinel
dawn quiver
#

ok just doing that might be enough

untold sentinel
#

As for collision detecting, Unity should take care of most of it

dawn quiver
#

maze algorithm might be good for that

#

but the mazes generated from that are a bit narrow

#

and not open enough

#

could be modified to be more open

#

In Part 1 of this coding challenge, using p5.js, I create the cells which are going to become our maze.

💻Challenge Webpage: https://thecodingtrain.com/CodingChallenges/010.1-maze-dfs-p5.html
🎥Part 2: https://www.youtube.com/watch?v=D8UgRyRnvXU

🚂Website: https://thecodingtrain.com/
💡Github: https://github.com/CodingTrain
💖Membership: https://yo...

▶ Play video
#

Maybe use this for each room

#

not whats in the rooms

#

but for the rooms themselves as pieces to the maze

#

then modify the algorithm to be more open

#

where each room has four possible exits

woven canopy
#

Yeah, 1 "easy" way would be to maunally creat a bunch of "tiles" that your map generator can piece together to make your map. Set some of the edges to have exits, and the generator will stick more tiles on such that you can keep the maze going

dawn quiver
#

oh

woven canopy
#

If you reach a dead end, just throw trees or other obsticles at the end of that road, and flag that area to spawn something. (Maybe a fight, have a chest spawn, whatever)

#

As far as blocks between major areas

dawn quiver
#

id look into wave function collapse wich is really just a fancy way of saying what Nikarus just said

#

each room tile has four possible exists. Either there is an exist or there is not. That is 2^4 possible room tiles

#

so 16 room tiles

untold sentinel
#

So, this game won't actually have any dungeons

woven canopy
# dawn quiver so 16 room tiles

Might want a couple extra tiles to account for possible vertical movement. EG second stories of houses, or going down in dungeons

woven canopy
untold sentinel
#

We don't have time to implement a dungeon generation algorithm AND a world generation algorithm. I had though of maybe implementing "natural dungeons" which tightly clustered world objects like trees, cliffs, etc, to make for a puzzle of sorts

#

But even that is a stretch. What I do want is for the world to feel organic (easy enough with noise), for the world to be open, and for the world to have at least some interesting aspects to it. Consider spawning a forest. Its simple enough to plop clusters of trees down on a flat grassland

dawn quiver
untold sentinel
#

But there's nothing to that

dawn quiver
#

it doesnt have to be used for dungeons

woven canopy
untold sentinel
#

Windy as in winding?

woven canopy
#

Yes, sorry

untold sentinel
#

As opposed to blowy, gusty 😛

#

So, lemme clear the air on something. The key to making world traversal interesting is to provide some kind of resistance to traversal. Most levels do this by having you move on a set path, and placing obstacles in front of you one by one, right? BotW does this by letting you climb and swim and all sorts of fascinating movement mechanics

woven canopy
#

Mind oyu the Wave Form collapse/maze is what you do as a first pass to make the overal terrain. You can have a script run over it after, and say you've got a large wide open area... plonk down some buildings to make a village, or a nice 24x24 area might be flagged as an area for a boss battle

untold sentinel
#

So something I should be keeping my eye on is having enough freedom of movement to make the world feel open, but "reigning in" the player's motion enough to make getting around a challenge

#

Does this make sense?

woven canopy
#

Zelda games typically blocked off areas by requiring an item that you get in a dungeon to clear or bypass obsticles. Rocs feather to jump pits. Power glove to pick up and move rocks. The speed boots would let you charge through some obsticles, or when combined with the feather would get you across long pits.

#

Sometimes you had to shoot targets to trigger bridges, the hookshot was a thing or the "swaphook" from Oracle of Ages

untold sentinel
woven canopy
#

Yes and?

untold sentinel
#

Well, with an open world, you aren't really enclosing the player in impassable borders and limiting them to points-of-access

#

*Avenues-of-egress

woven canopy
#

The whole world doesn't need to be completely open. There's plenty of places you get stuck going a single path in Skyrim or Botw

#

Also, when we talk before about generating a maze. The maze doesn't need to be 1 tile wide. You can have "open feeling" areas, where you're still in a maze, but the paths are 16 tiles wide

untold sentinel
#

So, what I think I'm picking up on

#

Is points-of-egress

#

So, I've got a big ol' world. Say, 2000x2000 tiles. This world is broken into regions each 200x200 tiles wide. Maybe one region is a desert, another is a forest, maybe a river-delta/lakes area

woven canopy
#

Can I post a link to a map from a game here, is that allowed this disc?

untold sentinel
#

I don't see why not

woven canopy
#

this is the map for A link to the past

untold sentinel
#

Thank you! Its hard to find large scale topdown maps

woven canopy
#

this is the starting house. Now, remember what we were saying about the 16 tiles (each tile can have 4 exit points, so theres 2^4 possible tiles to build the terrain out of)

#

Consider that your terrain map tiles, can take any size from 3x3, up to like a 16x16

#

a 16x16 can have 4 exits, just like a 3x3, the 3x3 is just more total wall than walking area

#

This "Link's house" area, is made up of a bunch of different ones of these

#

Like the main path across the bottom from right to left, that's a bunhc of maybe 5x5 tiles with east/west exits. There's 1 with a north exit that leads up the ramp to the house on the left

untold sentinel
#

Respectfully, I'm a bit less worried about algorithm at this point

woven canopy
#

What one might do, start off with a 3x3 "overall map", this is where you set your regions. Regions define what kind of enemies might spawn, "Density" (walkable area vs wall), the color palate. Perhaps each region has a single major objective (the "dungeon" if you will). Can merge a couple of these major regions to make a superregion if you want.

All of these regions have at least 1 connection to neighboring regions.

Break each Region up into areas, these are where your maze generator code goes to work. Set 1-2 connection points on the edges where you'll need to link up to other Regions. Plop your objectives around in random spots, generate paths between them, and throw in some noise to fill each place with side paths. Things don't need to fit together perfectly mind you. You can ahve areas that are inacessible that are jsut a swathe of trees or mountain.

untold sentinel
#

I don't think this is the direction I want to go. But I thank you for taking the time

#

🙂

#

I want the world to be the opposite of a maze

woven canopy
#

Then use wider paths. Fact is, at the end of the day, every game world in a top down game is to some extent... a maze

#

they just don't look it because they're zoomed way in

woven canopy
#

I do really recommend the video linked before about waveform collapse. I understand you don't want mazelike (thats more my word for it tbh, as I started learning this stuff from maze generation)

But if you will, consider this timestamp. https://youtu.be/rI_y2GAlQFM?t=564
On the grid he's generated out of these tiles, the top left has a cluster of 6 tiles that are all interlinked.

The whitespace inbwtween those doesn't need to exist in the final game, it jsut exists when generating the... topology perhaps, of the map. That NW corner could be made to be 1 wide open space

Straight out of quantum mechanics, Wave Function Collapse is an algorithm for procedural generation of images. https://thecodingtrain.com/challenges/171-wave-function-collapse

In this video (recorded over 3 live streams) I attempt the tiled model and explore a variety of solutions to the algorithm in JavaScript with p5.js.

💻 Github Repo: http...

▶ Play video
velvet tendon
#

hello

woven canopy
#

That whole 4x4 he's got could be a fairly open area, with a big ledge stickign throguh the western side, and a lake on the right or such

woven canopy
woven canopy
velvet tendon
#

no not really just wanted to say hello to anyone here :]

woven canopy
#

Aah, that's fine too

last moon
#

Not exactly sure what I’m asking but how do you go about doing (for clarity’s sake) harmonics?
Kinda had an idea for a physics sim where when objects collide they produce a ring/wave that grows out until it hits another object/limitation.
First thought was to create 360*x objects in a linked list and interpolate between them but I don’t think that’ll work properly

faint bane
#

why don't mouse clicks register?

#

import pygame
from pygame import *

pygame.init()

white = (255, 255, 255)
green = (0, 255, 0)
blue = (0, 0, 128)
black = (0,0,0)

X = 800
Y = 600

score = 0
display = pygame.display.set_mode((X, Y))
pygame.display.set_caption('Box Clicker')

while True:

display.fill(white)
for event in pygame.event.get():
    if event.type == pygame.QUIT:
        pygame.quit()
        quit()

    

for event in pygame.event.get():
    if event.type == pygame.MOUSEBUTTONDOWN:
        if event.button == 1:
            print("clicked")
        
        
font = pygame.font.Font('freesansbold.ttf', 32)
score_text = f'Score -> {score}'       
text = font.render(score_text, True, black,)
textRect = text.get_rect()
textRect.center = (X // 2, Y-50)
display.blit(text, textRect)

pygame.draw.rect(display, black, (340, 240, 60, 60))
pygame.display.update()
vagrant saddle
faint bane
#

oh crap

#

ye

vagrant saddle
#

keep only one for event in pygame.event.get(): and use elif elif

faint bane
#

thanks

#

tysm

vagrant saddle
#

and put the most frequent events first

faint bane
#

ok

misty quarry
#

hi. So, I have to implement conway's game of life for a school project. In my code, I have a list of list. Every "tick", I replace it with a new list, using the following function:

#

def update_grid(grid):
g2=grid[:]
for y in range(grid_resolution):
for x in range(grid_resolution):

        number_of_neighbours=0
        for x1 in range(0,3,1):
            for y1 in range(0,3,1):
                if (x>=-x1+1 and x+x1-1<grid_resolution) and (y>=-y1+1 and y+y1-1<grid_resolution) and (not(x1==1 and y1==1)):
                    if grid[y+y1-1][x+x1-1]:
                        number_of_neighbours+= 1
        g2[y][x]=False
        if number_of_neighbours==3 and grid[y][x]==False:
            g2[y][x]=True
        if (number_of_neighbours==3 or number_of_neighbours==2) and grid[y][x]==True:
            g2[y][x]=True

return grid
#

This doesn't give me the expected results, and I don't know why

#

Help pls?

woven canopy
#
def update_grid(grid):
    g2=grid[:]
    for y in range(grid_resolution):
        for x in range(grid_resolution):

            number_of_neighbours=0
            for x1 in range(0,3,1):
                for y1 in range(0,3,1):
                    if (x>=-x1+1 and x+x1-1<grid_resolution) and (y>=-y1+1 and y+y1-1<grid_resolution) and (not(x1==1 and y1==1)):
                        if grid[y+y1-1][x+x1-1]:
                            number_of_neighbours+= 1
            g2[y][x]=False
            if number_of_neighbours==3 and grid[y][x]==False:
                g2[y][x]=True
            if (number_of_neighbours==3 or number_of_neighbours==2) and grid[y][x]==True:
                g2[y][x]=True

    return grid
#

Is just a tiny bit more presentable

misty quarry
#

As far as I could tell, the problem seems to be that I'm not getting the correct number of neighbours (I'm getting less)
also, thanks for the showing text as code tip, I didn't know how to do that

woven canopy
#

Just remembered you can also do this. Using quotes in place of the backtics. '''py ~code ''' and it'll color it

#

So a question on your code then, getting yo line 11, you have too few neighbors you say

#
            for x1 in range(0,3,1):
                for y1 in range(0,3,1):
                    if (x>=-x1+1 and x+x1-1<grid_resolution) and (y>=-y1+1 and y+y1-1<grid_resolution) and (not(x1==1 and y1==1)):
                        if grid[y+y1-1][x+x1-1]:
                            number_of_neighbours+= 1

I assume this is the bit that's supposed to look at the 8 adjacent cells.
Walk me through how that If is supposed to work, like what are each of the pieces supposed to do?

#

I ask this as, it looks like you're trying to detect the edges of your grid, to avoid checking for cells in those locations.
If X,Y is 0,0 meaning say the top left corner. What's with the -x1+1?

misty quarry
#

It's the same as x+x1-1>=0, I just made it more confusing (also when I was testing it, the iteration went from -1 to 1, but I thought that was creating an error, so I replaced it)

#

That's what the +/-1 is there for

woven canopy
#

Well this bit looks like its good then, but you're getting too few number_of_neighbours. Are you able to manually set up a test grid and step it once to see the outcome?

#

(Also is grid_resolution supposed to be the size, liek 20 nets you a 20x20 grid?)

upbeat plinth
#

Hey Guys, check out this cool workshop on Android Development! I've been meaning to learn android development, could someone please tell me if this is worth attending?

the link is www.techfest.org/workshops/appdev

woven canopy
#

even just a 3x3 grid with a 1 in the center outputs this after 1 iteration

[3, 4, 3]
[2, 4, 3]```
#

Seems each iteration that you finish counting neighbors, and then update a cell in g2. You're also editing that cell in grid (or g1 if you will). So for a 3x3 grid with a 1 in the center. top left gets checked first, it has 1 neighbor so it puts a 1 in there. Cell to its right gets checked, it should only have 1 (the cell below it) but because the original array has been updated, the top left has a 1, so now we actually have 2 neighbors

#

Doesnt explain the 2 in the bottom left though

misty quarry
#

I think I got it to work

#

It was because of the changes being made to both grids, so I just made sure to create a new grid for g2

#

(I am not very familiar with python passing by value or reference thing, because I usually use c++, which makes it easier to know how things are changing behind the scenes)

#

thanks

snow hill
#

Are there any gamedev here who are making games for the Raspberry Pi ? 👍

last moon
#

Modern or not

dreamy pagoda
#

is it common practice in multiplayer games to have other players have a separate class with different movement physics to attempt to "predict" movement in order to mitigate the effect of latency?

tranquil girder
#

yeah, basically the one the user is controlling is "real", while all the others are "fake". they're just visuals trying to match the other players as good as they can, but they usually interpolate the movement for example, so it appears smooth

sweet shard
snow hill
sweet shard
#

Workflow can be an issue for me. Just because the pi lacks a lot content creation tools. Personally I never hit any GPU/CPU issues

dreamy pagoda
#

i was under the impression before this that, because it's a pixel art game and the data i'm sending is very small, it would be able to update frequently enough that, without simulating movement, they would update 30-60 times per second

last moon
# dreamy pagoda and how often is their real position updated really? i'm making one myself and c...

I’m guessing a majority of that latency depends on how quickly you can send inputs to the server and how quickly the server can send updates back. If you’re not using some sort of p2p and solely relying on a dedicated server, latency will be noticeably higher (don’t quote me on any of this I’m very sleep deprived)

Poke mentioned interpolating between those updates and that’s probably why they appear choppy/laggy (could be a number of causes but if they’re just teleporting around this might help)

dreamy pagoda
#

each message is taking about 40ms

last moon
#

What’re you pickling

#

And how’s your server being set up? 13ms seems strange to me

last moon
dreamy pagoda
waxen hawk
#

was there any btc giveaway recently?

#

someone dm me that i won 0,.42 btc

dreamy pagoda
waxen hawk
#

i came in third place

#

and i dont see any giveaway channels

dreamy pagoda
waxen hawk
#

someone please answer me

bitter compass
waxen hawk
#

its possible tho

#

well now ik

bitter compass
#

btw this is in the wrong channel, there's a few off topic ones / general you can ask instead

waxen hawk
#

ty hes probably a scamer

#

ok tnx

last moon
dreamy pagoda
#

yeah

#

both on the sevrer and client

#

that function from the second link

last moon
#

Where is it being used?

dreamy pagoda
#

on the server, whenever a client connects it runs a threaded while True method

#

and on the client, whenever the game loads an area it starts a threaded function aswell

#

also while true, until leaving the area

#

the server method just listens and replies with something depending on what the message was

#

the client one only sends update requests

last moon
#

If you get a chance to look into github that’d help a bit, part of the problem is probably (?) how you set up the threads - from what I can tell send/request are running successively which would slow down data flow

#

Network wise I have 0 clue what I’m doing and don’t really feel like being malicious atm 😄

dreamy pagoda
#

when i say request i just mean the client sends the server the player's data

#

the server interprets that as an update request

#

and sends back the data for the players in his area

#

there's just a send line of code followed by a receive line of code

snow hill
faint bane
#

why won't my sprite be able to move right

dreamy pagoda
#

apparently these are tcp packets, and tcp by default waits a certain amount of time to send, in case the sender might want to send more data, so it can package the data and send a single package in order not to clutter the network

#

by using this socket setup, instead of sock_stream, you can force it to send asap

hoary ruin
#

Game developers 😄

#
ask = str (input("Who here can create a game like free fire? "))
desert beacon
desert beacon
dreamy pagoda
dreamy pagoda
#

A Zelda-style RPG in Python that includes a lot of elements you need for a sophisticated game like graphics and animations, fake depth; upgrade mechanics, a level map and quite a bit more.

Thanks for AI camp for sponsoring this video. You can find the link to their summer camp here: https://ai-camp.org/partner/clearcode

If you want to suppor...

▶ Play video
desert beacon
#

LOL im watching his starter tutorial right now

dreamy pagoda
desert beacon
#

ahhh

dreamy pagoda
#

the networking is slightly more complex than shown on this video so if you get there feel free to ask

#

it's nothing too crazy tho

desert beacon
#

oh ight

stiff tinsel
#

I think this is the correct place? As an administrator I'm trying to install plotly to the Python plugin for UE5, C:\Program Files\Epic Games\UE_5.0\Engine\Binaries\ThirdParty\Python3\Win64>python.exe -m pip uninstall plotly, however it keeps saying the access is denied. I know that you can install to that file due to reading https://filipsivak.medium.com/python-in-unreal-engine-the-undocumented-parts-7585434f5d76 where the person ran C:\Program Files\Epic Games\UE_4.27\Engine\Binaries\ThirdParty\Python3\Win64\python.exe -m pip install numpy and it worked for them. The folder itself isn't read-only but rather the files inside it are. Another odd thing is that I somehow managed to install numpy and matplotlib, checked the dates the folders for them were created, even when it kept saying access was denied. I also just moved the files I made on that day to a separate folder and tried to see if I can install matplotlib and numpy again, it doesn't work and says access is denied, and I checked in the Win64 folder, nothing appeared. So far I've checked controlled folder access is off and the folder is not encrypted. In fact it's greyed out.

I'm really not sure what to do now. Please ping on reply and thanks to anyone who does.

Medium

Some python features are not documented at all. Such as declaring struct or enum and how to pip install python package into Unreal Engine.

last moon
#

bit off topic but would using udp be better so you don’t have to wait for the handshake

lean bison
#

guys should i use vscode or atom for pygame development

radiant sage
#

personal preference

#

i’d recommend vscode, others would recommend atom

lean bison
#

nice

#

ill try atom

#

because engineer man uses it

#

wait no ill use vs

#

ato is better for like data science

bold bramble
untold sentinel
#

What makes for a good open world in a 2D game?

#

Here are my thoughts

#

We're building a topdown with an open world for our CSCI265 term project. I've got a handle on the basics — simplex/perlin noise layered ontop of each other, and multiple passes over the world to add increasingly fine-grained detail

#

But then I picture in my mind creating a forest. Is it just a flat expanse of grass tiles with trees thrown in? That's not fun or impressive. Speaking from what little I know about good level design, I know that part of a good game experience is making world traversal interesting.

#

Often this means putting obstacles in front of the player that they have to bypass using items or by climbing/etc.

#

But with an open world, free movement in all directions means that a player can just go around most things. "Wide" obstacles like rivers or elevation changes can sorta solve this, but if you rely too heavily on this then your open world just becomes a series of massive "rooms" connected by the very same maze-like/graph-like points of egress that an open world is designed to avoid

#

Any thoughts?

proven shore
#

you can also make enemies too powerful or maybe with a necessary item or move to kill

proven shore
#

also, depending on how your game will work, you can make an encounter when some area is generated, depending on status, weather, time, something

#

And a bunch of trees blocking the vision of the game in the background is cool!

frank fieldBOT
#

Hey @brisk skiff!

It looks like you tried to attach file type(s) that we do not allow (.mkv). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a, .csv, .json.

Feel free to ask in #community-meta if you think this is a mistake.

dreamy pagoda
#

so it wouldn't work

#

at least the way my networking is currently coded

boreal seal
dreamy pagoda
#

😠

void storm
#

Is outthere any sugsesful games made in python?

uncut bolt
#

I wanna make a game, but i cant code 💀 r there any game types where u draw and design a lot but little coding? Cuz im blank on that part haha

vagrant saddle
uncut bolt
#

Ehm, do u have any examples? Haha

vagrant saddle
tawdry sluice
#

hi guys

vagrant saddle
#

like "day of the tentacle"

tawdry sluice
#

so I have been working on a pygame for about 2 months(I am slow)

uncut bolt
#

Ahhh like ddlc

#

Tysm! :)

tawdry sluice
#

And I just realized its a multiplayer game

#

and I dont know anything about networking,

#

any good advice here?

vagrant saddle
tawdry sluice
#

so It's a cards game

#

and I need to send some cards id mostly

vagrant saddle
#

then i'd suggest an irc channel and some json

tawdry sluice
#

I saw some socket tutorial, is it good?

vagrant saddle
#

no need to go too low level, any client irc lib will do

tawdry sluice
#

oh I see, so socket is too basic?

#

oh no

#

I am dumb

#

the opposite

#

?

vagrant saddle
#

yeah the socket server part can be complicated

tawdry sluice
#

I see

vagrant saddle
#

an irc channel will handle the annoying stuff for you

tawdry sluice
#

thanks man I will look for that

#

so hmmm...

#

I don't get what exactly is icr

vagrant saddle
#

irc is a simple protocol layout upon a tcp socket server

tawdry sluice
#

somehow sockets looks easier to me XD , thank you man I will look more into it

rare oracle
#

I'll develop infinite button presser ( pro game development moment )

proven shore
#

sorry to ask this here, but I don't never did a full project, and I want this xp, so anyone here wants help to develop a game or want to join me in creating a game?

woven canopy
proven shore
#

actually, my silly projects, too!!!

#

lol

#

I never developed anything like a full big and functional project

#

but I want to learn and make something!

#

I have a lot of little games that kind of work, but none really ready

#

also, i can join some project

smoky berry
#

what is the best game programming package?

#

(serious game, free package, startee one)

ancient jetty
#

And im kinda proud of it

#

How can i improve It?

1: better buttons
2: a background
3: sounds
4: a timer for when the text goes away (or another screen for the text)

#

Pls add to list if you know anything

untold sentinel
#

I'd like to pick everyone's mind about world design best practice for a top down rpg

#

I'm building a topdown with an open world for my term project this year. It's for software design class, so design and forethought is more important than the actual implementation. In the very least, I need to be able to say I made sensible choices

#

So, what makes for a good "world" in a top down game?

nimble dagger
#

i'm using pygame as an audio analysis gui and a nonblocking pyaudio stream to collect real-time microphone data, but frames get skipped sometimes. does anyone know how to ensure that no audio frames get dropped?

proven shore
#

hi

proven shore
#

what the size of the stream?

nimble dagger
#

12000

#

with a global variable in the callback function

#

i use np.frombuffer and multiply the chunk by two numbers

proven shore
proven shore
nimble dagger
#

no, but i will good idea

proven shore
#

try it

#

i had some problem like this

#

and some times, the package is not lost, but pygame just don't play it

#

sometimes you have to increase the channels it uses

#

don't know why, but ...

nimble dagger
#

i am collecting mono at the moment

proven shore
#

no. I don't know what you are doing, but if you are playing the sound collected back, sometimes it just don't play

#

if a lot of sounds are played at the same time, this happens

nimble dagger
#

no, i'm not playing it back. just analyzing it and displaying the results on the screen

proven shore
nimble dagger
#

perhaps. i will try it. thanks for your help

potent ice
#

Just communicate with a Queue to make it simple

ancient jetty
faint bane
#

i have questio

#

while True:
clock.tick(60)
for event in pygame.event.get():
#controls + easter egg
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_LEFT and sprite_x > 0:
sprite_x -= x_velocity
pygame.time.delay(5)
pygame.display.update()
elif event.key == pygame.K_RIGHT and sprite_x < x:
sprite_x += x_velocity
pygame.time.delay(5)
pygame.display.update()
elif event.key == pygame.K_UP and sprite_y > 0 :
sprite_y -= y_velocity
pygame.time.delay(5)
pygame.display.update()
elif event.key == pygame.K_DOWN and sprite_y < 800:
sprite_y += y_velocity
pygame.time.delay(5)
pygame.display.update()
if event.type == pygame.MOUSEBUTTONDOWN and no_clicks == 0:
screen_colour = purple
if event.type == pygame.QUIT:
pygame.quit()
quit()

DISPLAY.fill(screen_colour)
DISPLAY.blit(text,text_rect)
pygame.draw.rect(DISPLAY, black, (sprite_x, sprite_y, 80, 80))    

  
    
pygame.display.update()
#

why does the screen collision not work properly

#

it'll stop but it'll do so too early or too late

#

btw here are the sprite coords: sprite_y = y/2-40
sprite_x = x/2-40
x_velocity = 80
y_velocity = 80

untold sentinel
#

I want to run something by you all, just to check my understanding of the situation. I'm building a procedurally generated open world for a topdown as part of my term project. Unfortunately, its been proving difficult to find prec-gen tutorials any more detailed than just creating height maps.

Anyway, some theory: key to a good game experience is making world traversal interesting, and, to impose challenges upon the player as they approach their goals. The standard approach (the only approach prior to advent of open world generation technology) has been to create linear levels which channel the player in one direction — forward. Since there is only one way forward, the player will be forced to overcome (as opposed to simply go around) any obstacles placed along this path. Multiple paths can criss-cross, or else branch into multiple directions. Various graph based procedural generation techniques can be used to generate such a map.

Open worlds throw a wrench in this. If the goal is unencumbered movement in all directions with smooth transitions from region to region/biome to biome, then its much more difficult (though not impossible) to place obstacles between the player and the goal. The player can just go around.

Some options for address this are: encase the "core" or "goal" of each region in radial obstacles like mountain ranges, systems of rivers, and so on; provide a main path to the core of each region and make the off-path areas more difficult to traverse; turn the world into many many many crisscrossing paths with many obstacles on each.

Does anyone have any experience or insight they can share?

#

In terms of procedural generation, I'm having a bit of a mental block. Naively, I originally thought that multiple passes by noise algorithms and then direct construction-of-features algorithms could create a natural feeling landscape. This approach works for landscapes which look natural, but it doesn't necessarily make for a good play experience. To do that, I somehow need to treat individual landscape components (mountains/ranges, rivers, patches of trees) the way an artist treats paint. Then, I'd need to use some algorithm to generate a landscape designed for playability from these components. I'd need to do this while somehow keeping things feeling natural

proper peak
#

Depending on what kind of game it is, the "radial obstacle" in question can just be increased mob levels/some other kind of difficulty, the closer the player is to the goal.

Avorion comes to mind, which actually does both - the game has a natural goal of reaching the center of the galaxy, and the game makes this hard both by increasing the difficulty of, well, everything as you get closer to the center, and also the central region is encased by an impenetrable Barrier that you need to do a multipart quest to cross.

untold sentinel
#

So, everything I've said thus far makes sense, right?

proper peak
#

Seems about right, sure.

untold sentinel
#

So here's my problem. I need to make a procedurally generated world with tight constraints. The world needs to have two mountain ranges — one volcanic for the fire dungeon, and one snowy for the ice dungeon. I need a dense forested area, a desert, a swamp, and a lakes/river-delta region. And, I need to generate these regions such that the world still feels organic. Ontop of this, I need to facilitate borderless world traversal in all directions while still presenting the player with obstacles.

#

Making the first constraint work with the second, I can't just divide the world into clumps, each clump being a region. This will make it, well, clumpy. There would be no satisfying mountain-range-wrapping-around-plains effect, and other such organic sorts of geography. It'd just be clumps. Somehow, I need to apply realistic generation such that every region is present, of a decent size, and largely singular (patches of biome-x scattered around, independent of the main biome-x-region are fine)

tranquil girder
#

This sounds like cutting edge stuff. I've never played a procedurally generated game with good level design at least. Is there any reason you can't make the levels by hand?

untold sentinel
#

Yeah, its a tall order. Maybe its too difficult 😐

untold sentinel
#

I feel like its waveform collapse (or some such) to the rescue

#

Maybe

#

Here's an algorithm with some ideas I'm trying to absorbe

#

What about spilling the island into Voronoi cells, and then, placing two mountains and a big ol' lake. As happens with the algorithm I posted, altitude would then decrease from mountain ranges by distance, until the ocean is encountered. Next, built rivers coming off from the mountains. Knowing now where the moisture is and what the elevation is, I could classify cells into biome types and it would already be mostly perfect.

#

Deserts would be low elevation, low moisture. Swamps would be low elevation, high moisture. Forests would be mid elevation, high moisture. Grasslands would be mid elevation, low moisture.

#

The issue is ensuring that each of these four regions is present, in an acceptable quantity, and that its a singular region as opposed to cells scattered everywhere

normal silo
# untold sentinel Any thoughts?

Same as my previous answer to the art assets question. Your scope is too large. No open world (as in large open areas, having many rooms/screens to go between is different), no procedural generation. Your goal should be to make something like the original Zelda and even that will not be as easy as it seems.

#

After completing it, if you need something to show off your programming skills (although being able to make any complete game shows enough practical skill IMO), you can always add some fancy shaders / lighting / vfx or enemy AI.

untold sentinel
dry cloak
#

Not a very important question but its a problem ive encountered and i might learn a thing or two from it.

So i have this basic pygame script which stores every frame

import pygame
pygame.init()

screen = pygame.display.set_mode((500, 500))
clock = pygame.time.Clock()

frames = []
player = pygame.Rect(0, 0, 50, 50)

while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT: pygame.quit()
    player.center = pygame.mouse.get_pos()
    screen.fill((255, 255, 255))
    pygame.draw.rect(screen, (0, 0, 0), player)
    pygame.display.update()
    frames.append(screen.copy())
    clock.tick(60)

(Apologies for any syntax errors, i typed it on mobile lol)

The problem with it is that it seems to take up alot of memory very quickly. running this at 60fps averages around 1-2 minutes = 1gb of memory 💀 (well according to task manager, on my hardware atleast.)

How could i reduce the impact of this?

normal silo
dry cloak
#

Pretty much

I cant really give a particular circumstance since im not actually using this in a game, just playing around and tried to make a game recorder

normal silo
dry cloak
#

Probably beyond me then

As of my current knowledge atleast

normal silo
#

You could probably get a library to do some of it for you.

#

Maybe convert the surface to an image and have Pillow compress it for you.

dry cloak
#

Pillow can compress images?

Ive only ever used it to get a list of rgb tuples from an image file

normal silo
#

You can also only save the past N amount of time, and have it overwrite the older stuff.

dry cloak
normal silo
#

If you save to PNG or JPEG format it is compressed.

#

PNG is lossless, JPEG is lossy but more compression.

dry cloak
#

Which one can compress/save faster?

Or would it not matter because they are both so fast

normal silo
#

So it contains the past N frames.

#

There are also video libraries.

dry cloak
normal silo
#

Depends what you want.

proper peak
#

So this approach won't get you good results even if you use something like PNG/JPEG. You really should use a video encoding.

normal silo
#

It's better than raw, PNG/JPEG, but not a full proper video.

#

Pretty simple to do though.

proper peak
dry cloak
normal silo
#

ffmpeg, can't escape it.

normal silo
#

But it depends on if you are ok with losing some information or not.

dry cloak
proper peak
#

ffmpeg-python is actually a very good wrapper IMO. like, easier to use than the CLI.

dry cloak
normal silo
#

Like we never left the 90s.

proper peak
#

I have a markdown document with command line commands I saved for later use and like half of it is ffmpeg 🥴

proper peak
#
ffmpeg -i ".\filename.mp4" -map 0 -dn -ignore_unknown -c copy -f mp4 -bsf:a aac_adtstoasc result.mp4

ah yes, totally comprehensible

normal silo
#

It's like how we used to edit text with ed. Before vi/vim.

#

Line by line in the CLI.

proper peak
#

tbh the reason I'm eager to say that example is because it took me a Journey to learn how to do this

#

I spent a looong time doing stuff like saving frames as pngs to disk, making gifs out of them postfactum, etc

#

and then, eventually, like a ray of light in the darkness, found ffmpeg's -i pipe: (or however exactly it's spelled) option, which powers the example i posted

normal silo
#

I used to learn this stuff, but stopped. It's not my job to configure things due to arbitrary complexity that should not exist (e.g. Linux config files for random things I don't care about).

#

(Devops is NOT for me)

#

(Because of Python / it's many libs I can avoid much of this now)

#

(ffmpeg is also kind of an extreme case)

dawn quiver
#

hey guys

#

Why does my character look like this when I go down alot

dawn quiver
#

okay

potent ice
#

You should be able to share more information. Possibly a link to the project as well (git repo)

#

If this is a private closed source project you may be breaking rule 6

#

!rule 6

frank fieldBOT
#

6. Do not post unapproved advertising.

wicked hinge
potent ice
#

Good stuff 👍 (Even MIT license)

#

Things like that are good to share and you will probably get better a response.

#

However. I don't see any pygame stuff in this project and there has been no activity for 4 years

#

There must be some other repo involved?

wicked hinge
#

Check privado

olive geode
potent ice
wicked hinge
#

I apologize Dom I sent you a friend request

potent ice
#

We do things in pubic here. No problem.

olive geode
#

!rule 5

frank fieldBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.

olive geode
#

!rule 9

frank fieldBOT
#

9. Do not offer or ask for paid work of any kind.

wicked hinge
#

Where can I request my requirement to avoid the ban

potent ice
fresh geyser
#

Hi guys I’m currently making a text based adventure game using Python. For some reason when it asks “would you like to see you’re stats” for some reason it when it prints the vars they are all zeros. Can someone please help.
Here’s the link to it: https://replit.com/@OllieMobile/World-of-Goblins-10-mobile

OllieMobile

Run Python code live in your browser. Write and run code in 50+ languages online with Replit, a powerful IDE, compiler, & interpreter.

coral badger
#

Hey guys, I am trying to learn PyGame Library and also work with it, I decided to do a proejct of "falling food objects" in a supermarket where a cart should "catch" those objects and get score and level up. When level goes up, the velocity of the objects go. Now, I have a small bug with it, I try to do the system that it will spawn a random object from the food classes objects I chose. Now it does work, and the Y of the object goes up (The object goes down) so the physics works, but, I try to make a condition that when the object's x value is in the range of the cart's x value and the object y's value is the cart y's value the object disappears and a new object appears but I have no idea of how to do that system. And else if the object touches the bottom of the map without the cart picking it up, then do something else (I will add 3 hearts and each time 1 heart will go down). Now somehow I have some problems with these specific conditions. All the other things work pretty good. If someone can take a look and tell me what is wrong and how to fix these conditions in the code I'd really appreciate it

https://github.com/idoredid123/PyGame-Project

GitHub

Creating a game in Python while using PyGame library. Needs to think about an idea for the game specifically - GitHub - idoredid123/PyGame-Project: Creating a game in Python while using PyGame libr...

#

If you can DM me with what is wrong I'd be super thankful C:

wicked hinge
# potent ice Talk to <@683001325440860340>

Hi, they told me that I can't:/ Request a developer on this channel. I think everyone needs help for a project. For the same reason, there should be a work section. Anyway, thank you very much for your time, friends. I'll continue to search for you. Greetings

potent ice
snow hill
#

WIP emulators front-end in Python

woven canopy
#

what do you need?

potent ice
wicked hinge
#

GitHub - jglim/gunbound-server: Emulator for GunBound Thor's Hammer...

wicked hinge
faint bane
#

how do you get screen collision to work

#

i can't find the exact value

#

the sprite collision will work

#

but it'll go too far or too little

wicked hinge
faint bane
#

no

#

just so sprites dont leave the screen

faint bane
#

you want the code?

faint bane
#

fyi python isnt compiled

dawn quiver
#

then that's called "transpiled"

#

well, it doesn't really matter

#

it compiles to bytecode, let's just say

faint bane
#

sorry lol

#

alr

#

can someone help with my screen collision thing

#

just tryna keep the sprite from leaving the screen

#

but i can't get it to stop at the screen

#

edge, it always stops too early or too late

#

wait lemme try smth

#

maybe

#

how do i position the sprite in the center of the screen

#

first

#

ok

#

so like

#

if the screen is 800x800

#

and sprite width is 80

#

itd be

#

360?

#

it looks a bit left

#

right*

#

fully 80 pixels

#

its just a black rectangle for now

#

i just used this: pygame.draw.rect(DISPLAY, black, (sprite_x, sprite_y, 80, 80))

#

im new to game dev stuff lol

#

idk

#

it might not be right

#

might just be my brain

#

idk

#

alr

#

nah i think its good

#

so now

#

the screen collision thingy

#

the sprite moves 80 pixels right when the right arrow pressed etc.

#

so i made the sprite stop when sprite_x - 80 > 0

#

and sprite_x - 80< 800

#

ok

#

can you explain why?

#

just so i can fix these sorts of problems in the future

#

for moving right?

#

isn't it already zero

#

oh ye

#

sprite_x + 80

#

ohh

#

so just

#

sprite_x > 0

#

then half the sprite leaves the sreen

#

here's the main game stuff

#

#does moving stuff
sprite_y = 360
sprite_x = 360
x_velocity = 80
y_velocity = 80

#change colours stuff
no_clicks = 0

#game loop
while True:

for event in pygame.event.get():
  #controls + easter egg, note: fix screen collisions
  if event.type == pygame.KEYDOWN:
    if event.key == pygame.K_LEFT and sprite_x > 0:
      sprite_x -= x_velocity
      pygame.time.delay(5)
      pygame.display.update()
    elif event.key == pygame.K_RIGHT and sprite_x - 80 < 720:
      sprite_x += x_velocity
      pygame.time.delay(5)
      pygame.display.update()
    elif event.key == pygame.K_UP and sprite_y > 0 :
      sprite_y -= y_velocity
      pygame.time.delay(5)
      pygame.display.update()
    elif event.key == pygame.K_DOWN and sprite_y < 800:
      sprite_y += y_velocity
      pygame.time.delay(5)
      pygame.display.update()
  if event.type == pygame.MOUSEBUTTONDOWN and no_clicks == 0:
      screen_colour = purple
  if event.type == pygame.QUIT:
        pygame.quit()
        quit()
        

    
DISPLAY.fill(screen_colour)
DISPLAY.blit(text,text_rect)
pygame.draw.rect(DISPLAY, black, (sprite_x, sprite_y, 80, 80))    

  
clock.tick(60)    
pygame.display.update()
#

width and height are both 800

#

fyi

#

ok

#

what does max do?

#

oh ye

#

lol

#

wait

#

why wasn't it working b4 tho

#

ahhhh ok

#

so it had to be like

#

uhhh

#

40.4

#

wait no

#

ok

#

isn't that just arithmetic tho

#

oh ye

#

alr ty

#

so basically

#

the velocitty stops when it gets bigger than da other number?

#

is that what max() is doing?

#

kdina

#

what about for right edge?

#

ok

#

wat

#

when i press da right arrow key the sprite jumps immediately jumps

#

to 720

#

ohhh

#

ahh ok

#

ty

#

thanks

#

@warm dagger

#

helped alot

fallen arch
#

I’m trying to make a spinning circle, but even tho I googled a lot I couldn’t find anything on how to this? Someone here can help?

faint bane
#

spinning as what?

#

movng in a circular motion

#

or rotating

#

360 deg

fallen arch
#

the circle should turn around itself in 360 deg

#

like spinning on the same spot

last moon
#

What library are you using? I’d say use a rotation matrix but there’s a good chance the library already implemented a way to do it

fallen arch
#

pygame

snow hill
#

have you tried to use a debugger ?

spiral kite
snow hill
#

it usually help 😄

neat ledge
#

I need help with pygame and opengl
I want to render image on pygame screen using opengl

wicked hinge
#

needed a python developer

tranquil girder
#

become one

slim berry
#

Man this stuff is cool

faint bane
#

google it

#

like pygame.rotate or smth

fallen arch
#

ima try ty

broken citrus
mighty pebble
#

Anyone here got any experience modelling combat systems? I need some help brainstorming my models

neat ledge
#

How i can draw a rectangle in specific place and then wrap the texture on it? (pygame and opengl)

potent ice
potent ice
neat ledge
lavish mist
#

hey guys, im trying to let the player input a name, and if that name has more than 8 characters in it, keep re-running the code, however python just keeps re-running the code no matter what and i was wondering how to fix this.

import random
import time

def playerName(name):
    nameList = [" Evenbloom", " Ravenoak", " Holyfist", " Hellspark", " Truemaw", " Sagesky", " Twobash", " Swiftrock", " Mossdancer", " Bronzeforge"]

    while True:
        if len(name) > 8:
            print(input("Your name must be 8 characters or less: "))
            continue

        elif len(name) <= 8:
            print(name)
            print("The Fates were cruel when they spun your thread... " + name + random.choice(nameList) + "...\nBorn to serve the sentence of your father after his death." + "\nyou must now fight your way through the arena to be free from the chains of imprisonment...")
            time.sleep(2)
            print("You enter the arena to the roar of thousands of spectators... \nYour opponent approaches...")
            break

playerName(input('Enter your name: '))
#

this is what I came up with so far

#

ok i somewhat got it to work, except for the first if statement, where now, if you input the wrong number of characters, it just repeats over and over instead of moving onto the second portion

potent ice
fair glacier
#

in pygame i want to be able to close the window after i type QUIT and press the enter key in the pygame window how can i do this?

night moss
torpid prism
#

hi, I have some problems with numpy, will be very thankful for help

#

here is script

#
import numpy as np
import random
def func(m, a):
    x = random.randint(0, (a[0]))
    y = random.randint(0, (a[1]))
    if m[x, y] != 9:
        return x, y
    else:
        func(m, a)
a = list(map(int, input("put x and y: ").split()))
m = np.zeros((a[0], a[1]))
for i in range(int(input("bomb number: "))):
    d = func(m, a)
    m[d[0], d[1]] = 9
print(m)```
#

the idea is to create a matrix with numpy using x and y in "a"

#

then put number of bombs and randomly put them in the matrix

#

but it also has to be checked if the place isn't with a bomb already

#

what I do in the function "func"

#

there is a problem in the func, sometimes it generates x and y that doesn't exist in the matrix so the output looks like this: IndexError: index 10 is out of bounds for axis 0 with size 10

#

idk how to fix it

torpid prism
#

ok I fixed it

cinder mist
#

Is Kivy a game development library or meant for user interfaces?

fallen hill
#

Kivy can and has definitely been used for game development but it is more useful for creating cross-platform UIs

potent ice
#

Can definitely make some simple games with it

potent ice
#

FYI: python 3.11 wheels for moderngl is out

snow hill
#

WIP HARFANG GUI ❤️

#

all in Python

dense trench
#

Guys i am really lost in something here, my big question is how the big gaming companies uses python to develop AI in their games, if most of the games are developed using C#, i need to understand where they are using python?

sweet shard
dense trench
sweet shard
#

No problem I would also check out Embark Studios they're doing some stuff with animation and machine learning

sweet shard
snow hill
#

Same as this project btw :

#

This one is used by aeronautics laboratories in ML research

acoustic hill
#

Hey! I'm currently using a Python game engine called Pyxel. I have part of a basic platformer, but how would I go about implementing collision detection to find if a player collides with a certain kind of tile? I have a level designed in the tilemap, but tilemap(0).pget doesn't seem to work... I don't have a list of walls or anything, it's all in the tilemap. Here's the Github link: https://github.com/hedgenull/pyxel_game

GitHub

Contribute to hedgenull/pyxel_game development by creating an account on GitHub.

spiral kite
#

clock.tick(20) makes the loop to run 20 times per second/keypress..am I right?

snow hill
snow hill
#

we decided to make a series of short "work in pogress" video

#

the library is getting more and more usable

faint bane
#

ok

faint bane
snow hill
#

Python : ✅
Gamedev : ✅ (it has scene, objects, animations, physics, audio, gamepad, VR)

faint bane
#

nice!

formal forge
snow hill
# faint bane is it a python game dev lib?

this one runs in Python as well, based on the same library : https://www.youtube.com/watch?v=tpzKMSOpD8w

A PC Music Disk, 9 electro & hip/hop tracks composed by Erk, Nainain, GliGli, Aceman, mAZE, Riddlemak, WillBe

00:00 Elsewhere (Erk)
04:16 Of Lobster and Men (AceMan)
08:45 Sweet Mermaids (Nainain)
11:45 Coral Pillows (WillBe)
16:...

▶ Play video
tight ocean
dreamy pagoda
trail plaza
#

IDK HOW I SAW THIS JUST NOW

#

YOURE INSANE, THATS SO COOL BRO

#

anywho, back to struggling with my python problem 🥲

formal forge
dreamy pagoda
#

ooh

edgy basin
#

Hey!
I'd like to play constant noise soundfile while specific keys are pressed. When my plane is moving (with WASD keys), this "engine sound" should be audible.
I'm using pygame.mixer to play a simple WAV file. Everything works fine but the sound is not smooth at all. Probably because it restarts with the 60 FPS ticker (while i keep holding the key down).
Any ideas how i get continuous sounding noise while a key is pressed? 🤔

trail plaza
#

anyone here good with python by any chance, have a python exercise that i have been struggling with for the past couple hours

#

tried posting it in the help channels multiple times but didnt turn out great

tight ocean
waxen dagger
#

how do i make this in pygame?

#

just api

edgy basin
snow hill
# waxen dagger how do i make this in pygame?

hours of work, usually 🙂

  • read the docs
  • find a sample project on github
  • try to run it
  • if it run, try to modify the code, until it makes something meaningfull
  • repeat until you are confident enough to start something from scratch
  • define some reasonable milestones, go step by step
#

(probably thousands hours of work)

waxen dagger
#

until my brain mastered it

dawn quiver
#

sorry i have a mathematical question where should i ask it

celest breach
celest breach
tight ocean
snow hill
faint bane
snow hill
faint bane
#

ok

sharp tulip
#

Can I build a video game with only Python or with like c++

robust hearth
sharp tulip
robust hearth
#

It works, but I don't know if it works well. But if I'd make a 3d game I would use Ursina engine.

tardy flicker
alpine shoal
#

What is the best practice of creating maps? In some tutorials i looked, they seem to store the maps in a list[str]. Is there a better way to do it?

copper thorn
#

Could anyone name some cool survival game mechanics I can add to my game? It already has a lot of mechanics but I think it is still unfinished.

dawn quiver
tranquil girder
#

list of list of int is good if you need to check neighbors
while that's a good way to store maps, it's not the best way to make them
the best way to make them would be a tile map editor, either an external program or an in-game custom made one, or you can draw bitmap in something like photoshop or paint and parse it into the format you want

#

for smaller games, or when you're making a tutorial and want to avoid separate assets, using a string can be a good idea, it's not bad, just a hassle to edit

last moon
snow hill
last moon
#

Oh cool I’ll check it out

faint bane
#

mb

#

like you have to stay cool

#

in shade or smth

sage temple
#

Can I get any help with adding an enemy into my very simple ASCII maze game? It's due tomorrow

rain vigil
#

got an issue when i try to find input on a seperate object it only occasionly owrks

brittle saddle
#

Not sure if this is the right place for this question, but lets say I would like to create a bot for the game. I don't want to use computer vision but i want to use actual game data. So for example have player position in x,y coordinates, resource to be mined at x,y. Ability cooldown in seconds. Do I need to read memory or is there another way?

edgy plank
brittle saddle
edgy plank
#

I did it in CPP once

#

Not sure if python has a wrapper

proper peak
#

python has pymemory (IIRC the name). in general, reading memory requires calling platform-specific functions, win32api for windows. So if pymemory didn't exist, you'd use pywin32.

brittle saddle
#

Alright, thanks guys

proper peak
frozen knoll
#

Python 3.11 + Pyglet 2.0b23 + Arcade 2.6 + Pymunk

faint bane
#

pygame is compatible with 3.11 right?

true merlin
#

it didnt when i tried and it runs on 3.10 so id use 3.10

true merlin
#

alr so ive been tryna learn pygame to make a game for my school project

#

i want it to be text based in the sense that

#

theres a ui with a few buttons

#

then theres text boxes that appear on screen with the info

#

nvm i think i see something that can help

gleaming scaffold
dawn quiver
#

Id personally like to look at the code for this project

gleaming scaffold
eternal vessel
#

This level's timer is broken though

#

Also when you're in fullscreen and try to press ESC to pause, it takes you out of fullscreen, so you gotta press it twice real quick

#

Aye I beat it

#

Getting the key on the last level was so annoying

gleaming scaffold
gleaming scaffold
eternal vessel
eternal vessel
gleaming scaffold
eternal vessel
#

Yep, I love playin' little games. Just started with itch.io

gleaming scaffold
#

Mostly game devs go there but theres tons of free games similar to steam

#

pretty cool 🙂

eternal vessel
#

Good to know

hardy escarp
#

Anyone know how to create a good looking ascii logo? .::::::. .-=+*+++=++++*+=: :+*+===++*******+++*=. .-- .*+===+*##############+= :==: :. -*==+*##############*-. : -. .-+*#. -*==*#######+---=++: .-. .=+++=+= #==*######- .-==: =-: :+#+=====# :*=*######: -##%##*. .-+####=====*- -*=######= *#**+=*- -######*=====* :*+##*=. : .+*++*= *######=====*- ++- .-=-. . .=#######**+==+* : . :=####**########*==+#+=*: : -+###############*+*+++#=+* .****##########**+====+++==*: :+*+==++++=====++*======++ .-=+++++++==-..*+====*. *+==++ ++=#. =*= :

dawn quiver
#

i need help

#

how can i wait in pygame without yielding?

potent ice
neon tinsel
#

Hey all, where would you store multiple class objects?

#

Like where would you put all the lines that create those objects

alpine shoal
#

Create instances when needed

dawn quiver
#

I randomly decided to throw myself into trying to figure out python and making a basic game, how do i find a topic?

fallow glade
neon tinsel
#

Like if I had an Item class

#

Where should I store all of the lines like

basic_sword = Item("Basic Sword", damage=100)
sharpened_sword = Item("Sharpened Sword", damage=200)
#

Cause if I have a ton of items, I wouldn't want to have multiple lines of that beneath the class, would I?

fallow glade
#
class GameData:
    swords: list[Item] = field(default_factory=list)
    shields... ```
neon tinsel
#

This is a data class?

fallow glade
#

Yeah

neon tinsel
#

Wait I'm confused

#

Is this similar to doing

basic_sword = Item("Basic Sword", damage=100)
sharpened_sword = Item("Sharpened Sword", damage=200)
[basic_sword, sharpened_sword]
woven canopy
#

no not quite

fallow glade
#

You can put all created items in a dataclass instance (or even a dict)

#

And access it anywhere

neon tinsel
#

but where do you put the lines that create the Items?

fallow glade
#

For eg if you want to spawn some random weapons in a treasure chest

fallow glade
#

For spawning, it depends on what your game entails

#

Is it a single level, or multiple levels?

dawn quiver
#

Using pygame, how exactly would i get a rectangle drawn on the screen?

woven canopy
#

rise, I think you're jumping a bit ahead of what the average person makign their first inventory system needs, with a dataclass. 100% that hasn't been covered in any tutorial they've read

fallow glade
#

If the latter, better to have this data stored in a json or csv file
level1.json
And have a function to read the file and create a Level object

neon tinsel
#

I know a tiny bit about dataclasses, and what he suggested seems useful, but I think you're missing the point of my question

woven canopy
dawn quiver
#

The surface is the window, correct?