#game-development
1 messages · Page 3 of 1
Hello, anyone know a lib that connects to a Minecraft server apart from mcpi and discordSERV?
What software do you recommend to make a 3d game which wouldn’t need any pre made assets or prefabs
probably Panda3D
Would you recommend making a 3D game on python
it would probably depends on the game, but Panda3D core is written in C++ anyway
Bump
As @vagrant saddle said you can use Panda3D. You can also use Ursina which is based on Panda3D or Pyglet which is in pure Python and uses OpenGL. Although it might be very hard on Pyglet to make 3d games.
Sorry it’s just I’m tasked with making a “game” doesn’t have to be 3d could be 2D but everything must be made by me, textures, the Players first person pov and what not all the code everything. so Would this change exactly what I should use or would panda 3d still work
you should make a ray casted game with pygame, there are plenty of examples around
you could make a clone of a game. I don't see why it has to be completely originally
I'm not too familiar with Panda3D but if you use it for a 2d game it will require a lot more work than using something like Pygame.
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
Anyone familiar with the PAWN language, which has been described as mashing Python and AWK together?
just finished the first part of my 4 part project
it’s gonna be huge
it’s all up on my github
WIP Harfang3D GUI
try this one, all done in Python:
https://github.com/harfang3d/game-astro-lander/releases/download/2.1.0-hg3.2.4/astrolander_release2.0.0_hg3.2.4.zip
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)
Hello can i see your project?
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 🙂
Ooo nice work
@dawn quiver 🙂
Can you try double clicking on the .bat files ?
oh sure
I wanna talk about pygame
@vagrant bobcat sorry for the late response. It's a language I built myself. Just finished defining everything after 2 years
woah
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
i think most .bat or .cmd are quarantined by default if coming from internet on recent windows
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
Can you follow these steps, exactly ? 🙂
https://github.com/harfang3d/game-astro-lander
I am looking for someone who is proficient with PyGame to join me for this game jam: https://itch.io/jam/32bit-jam-2022.
Send me a DM if you are interested.
#help-ramen with pygame
pro
Hi
What then snakes doin
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
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
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
I am assuming you want to change the view
The math for a view or camera is really simple but you can use pygames camera object if you need to
what does that do?
thanks i think i found it
It’s a GUI library :
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 ?
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 🙂 )
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?
idk
i dont understannd what u r trying to do here
Just tryna if pixel perfect collision with img2 mask then print collision else nothing but it prints out collision everytime
I have no experience with masks, so i cant help here, sorry
Tesekkurler
how i can download opengl sdk ? help pls (.vert ... file format glsl shader)
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 🙂
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
Hmm... but that would be frontend part in that case, or em I missing something? Could you elaborate a bit more about how whole stack and communication could look like?
You can take a look at https://github.com/pygame-web/pygbag
Here's the demo page: https://pmp-p.github.io/pygame-wasm
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
I checked those it doesn't seem that there is any client-server communication or at least I couldn't figure out how it works
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?
In the fifth episode of Coding in the Cabana, Gloria Pickle and I investigate the Marching Squares algorithm and apply it to Open Simplex Noise in Processing.
💻 https://thecodingtrain.com/challenges/coding-in-the-cabana/005-marching-squares.html
🔗 Marching cubes: A high resolution 3D surface construction algorithm by William E. Lorensen and Ha...
As seen in pikmin three's final boss the plasm wraith
👉 In this tutorial, we will see how to display a VR scene in Python:
- Main loop of the program
- Get render matrices from VR system
- Render the scene in several framebuffers
👉First part of the tutorial:
https://youtu.be/Ti6xMY36guM
👉About Views:
https://youtu.be/AKQEOXEx42I
📍 Join us !
Install Harfang3d: https://pypi.org/project/harfang/
...
Brython for the front end would be a good choice
It should be faster than pygbag, but still relatively slow. There are many slow operations: https://brython.info/speed_results.html
It may be work with pixi.js, so even if a bit slow it is still valid choice
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
it also allows websocket operations , webrtc, direct use of javascript libraries, and also compilation of python code to wasm with mypyc. it is just not documented right now.
brython is great but you cannot use compiled python libraries that require reference counting
I am at a weird impass
i don't get what you mean there's no backend at all, everything run client side
Well, for game dev speed is very important. I want to avoid situation when I have to rewrite whole game after a few months of development because framework speed is low
I specified in my first question that I'm asking about backend for multiplayer game 😮
We probably shouldn't use Python libs anyway. They will be much slower than JS ones
tbh compiled wasm python is faster than uncompiled native python ...
depend on game communication model but with a messagebox like a websocketed irc channel as a cheap backend, you only need client logic and python wasm can already connect to websocketed irc without problem.
It will be still slower than pure JavaScript
What do you recommend as communication model for action/shooter multiplayer web game?
"websocketed irc channel" - what is it? Could you give me a link?
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.
Yeah, I asked about backend, so I'm a bit surprised about getting answers related to frontend only...
Like the socket module
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
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.
It would work like this: Frontend (websocket) <-> (websocket) FastAPI (redis) <-> (redis) Engine app
for action/shooter there's too much latency, use webrtc (udp based) instead
WebRTC is peer-to-peer, so it doesn't use server at all
Without server I won't be able to ensure that players aren't cheating
I didn't know you can use this protocol for client-server communication, do you know any good framework that supports it, like FastAPI?
there are some, but in the previous link it is https://github.com/HumbleNet/HumbleNet
This one has bindings for C and C#, it doesn't seem to be Python lib
well C is not a problem for python
and you probably want your netcode in wasm to prevent (a bit) from cheating
You can run it - yes, but it won't be easy to develop without bindings
I noticed HumbleNet uses both WebRTC and Websockets, so perhaps I don't need WebRTC part in first place
There is also https://github.com/aiortc/aiortc that seems to be recommended only for audio/video steaming
usually websocket is used for peer discovery ( by adressing the server ) and then switch to webrtc
This would make much sense 😮 I guess chat part could be in websocket
yeah aiortc seems good for making the server
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?
udp (webrtc) is 2x faster
Websockets are supported in almost any web server while webrtc needs additional setup, so I would like to ensure it's worth it
also routers on internet prioritize webrtc traffic
How did you calculate that?
Source?
udp is one way, so half the time of tcp handshake to get back
counterpart is you can lose data in flight
It is one-way because it accepts that you may lose data, but it doesn't mean it is 2x faster
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
you are both right and wrong, but for action/shooter which you asked for it's 2x faster because most event don't need ack as they are merely world updates
I doesn't sound right, I know UDP should be faster depending on how WebRTC is implemented compared to Websockets, but it shouldn't be 2x. I would like to see any tests proving it. Otherwise it is just your theory 😄
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
Comparing TCP vs UDP is not comparing WebRTC vs Websockets 😄
indeed, websocket is so much worse than tcp that nobody had to demonstrate it
It is faster than HTTP and better supported than WebRTC. People use it for games and video/audio streaming without problems
I agree that WebRTC should be faster and better for action game, but I need to know exact numbers to justify more complex implementation
- 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
btw about latency this one is interesting https://www.ggpo.net/
GGPO networking SDK pioneered the use of rollback networking in peer-to-peer games. It's designed specifically to hide network latency in fast paced, twitch style games which require very precise inputs and frame perfect execution.
- I will do it, but since you are so sure there is 2x increase in speed I was hoping that you actually tested it 😄
- I'm not saying WebRTC is more complex as a protocol. I saying that my specific game implementation would be more complex if I use WebRTC since it is not as well supported as Websockets in various frameworks
It is, but is there a way to use it in web browser?
it is already used in web browsers eg in wasm4 fantasy console
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?
https://wasm4.org/blog/release-2-4-0 " Low-latency rollback netcode based on GGPO.
"
Ok, thanks
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?
hello guys, someone knows how to make Steam Achievements in python ?
I don't know the specifics but you'll want to look into the Steamworks SDK
I will watch again, because it didnt some much helpe me
@sweet shard Actually Steam just show us how to od it in C++
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
Hire someone
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.
The only thing I can think of would be making a 3D low poly model, animating that, and then pixelizing it
e.g. https://libreddit.tiekoetter.com/r/Cataclysm_DDA/comments/tb2rpk/pixel_art_cutting_edge_ai_generation/ which used https://github.com/pixray/pixray
You could, but why not just use a pixel image studio?
I’m sure there is something that could help you create sprites.
3D is marginally easier on my brain. Though I suppose we'd get better results with a pixel engine
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
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.
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
Your scope is too large. Sword or bow, pick one. At least one person should be dedicated to graphics only.
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).
Anyone knows about UI game dev ?
What lib are you planning on using
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!
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
as long as you have a direct link api for the cats its a case of using open("cat.png", 'wb').write(requests.get("direct-image-link").content)
to download pictures
yeah but it says something like the content don't match with type
maybe somewhen I will try to implement it again
Pythons main 3d engines are Panda3d, Ursina (which is built on top of Panda3d and simplifies somethings), and Upbge which is a fork of the blender game engine
As long as you're okay with your game code being open source It sounds like Upbge would be the best fit for you
Yeah the steamworks sdk is written in C++ I believe so unless you can find someones Python bindings for it you'll have to write your own
OK thanks man
like https://github.com/philippj/SteamworksPy maybe ?
maybe tkinter
Ever made a game?
I made some basic ones with the turtle module graphics
You should get into Pygame, it's pretty fun to use
Alright, thanks
If you prefer watching videos for learning, Clear Code has good Pygame tutorials
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
👊🏽
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.
Oh thank you for letting me know. Also sorry cuz I didn't mention that the game we will make will be probably be on C or C++ since my friend started with C and doesn't really know python so sorry about that! I will keep it in mind for when I work with python! (Also for some reason discord bugged and I din't reply)
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
deos anyone have a good source to generat 1D perlin noise thats mostly easy to understand
is there a way to find the lastes pygame version for python 3.6?
3.6 is at least listed in this version : https://pypi.org/project/pygame/2.1.2/
And there are definitely 3.6 wheels there
brotha what is perlin noise
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
Oof
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.
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
Could I check your code I could probably help you out (if you haven't solved the problem)
No problem, enjoy making game!
Murdering my eyeballs
!paste
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.
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.
!paste
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.
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
Is pygame a solid development method or is it like a meme?
I'm a bit confused on its legitimacy
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()
It's one of the most popular libraries to make visuals and games. Completely legitimate.
are there any games i would know made in it
Are you expecting some AAA game or something? 😄
There are definitely python games on steam made with various different libraries
not at all just anything that would make its way to alot of ppl
like a hollow knight would be a totally cool example
There are of course other libraries out there like Panda3D/Ursina, Arcade, Pyglet etc etc etc
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.
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).
Hey @dawn quiver!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
The only games I know of, that have been published on steam using Pygame is this dude's games:
Interesting
I like it I just don't wanna get wrapped up in it if there's going to be like massive issues
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
You can try his games for free as well. https://dafluffypotato.itch.io/
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
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
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
Look at the Unreal Engine Store, there are a lot of assets there that may help
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
I dont understand why my game isnt rendering. https://paste.pythondiscord.com/imiyabikas It's all in a class so I can call the class in one game loop in the main file
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?
How big you want to go/experienced you are?
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.
What are the most complex types of games python can make?
python can make any type of game
Open world?
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
Game engines are there to help with game development. But they have no bearing on the capabilities of what one can do with python.
Ye i dont, i still think python is like a baby language, ik its useful in some careers but i want game dev so..
python is used to power some billions dollars companies. It's far from what one would call a baby language
Damn fr? What companies
ever heard of youtube or dropbox?
HUH youtube uses python waaaaat
python is everywhere throughout the software industry.
Alright
Reddit, Google, Netflix, Facebook, Spotify, Quora, Instagram, etc.
Isn't a good chunk of Eve online's server code built on Python?
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
can I get some help with an extremely specific problem in vc
I could use some help thinking my way through some procedural generation stuff
i tried doing to same thing. I gave up
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?
When I think of top down games I think of binding of issac. It is a top down dungeon game.
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
More like zelda — big open world with relatively few obstructions
I mean, not to put too fine a point on it, what I had envisioned was a topdown BotW
Is this your final project?
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
What can you do?
When I say "procedural open world" I mean something ultra simple. But, it does need to be well thought out.
So you want to procedurally generate a GB zelda-esque map?
Something along these lines
ok just doing that might be enough
As for collision detecting, Unity should take care of most of it
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...
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
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
oh
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
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
So, this game won't actually have any dungeons
Might want a couple extra tiles to account for possible vertical movement. EG second stories of houses, or going down in dungeons
Yo that's an amazing video
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
This could be an algorithm for you world
But there's nothing to that
it doesnt have to be used for dungeons
This is fine, you can make some regions favor more open tiles (for the more overworldy feel), and others favor the more mazelike 2 entrance tiles in windy patterns
Windy as in winding?
Yes, sorry
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
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
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?
Well if you go mazelike then the maze itself is resistance. Another goto is enemies. For "natural" obsticals, you can always resort to pits the player needs to jump over, rivers with current they've got to get across (and if they don't make it, get swept downstream to where they started)
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
Note: these sorts of obstacles rely on "walls" of sorts — like big spans of trees which are impassable, with a hole between them
Yes and?
This. Interaction-activated obstacles. Good call
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
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
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
Can I post a link to a map from a game here, is that allowed this disc?
I don't see why not
Thank you! Its hard to find large scale topdown maps
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
Respectfully, I'm a bit less worried about algorithm at this point
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.
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
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
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...
hello
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
Hello
Do you have a question perhaps?
no not really just wanted to say hello to anyone here :]
Aah, that's fine too
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
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()
because you are flushing the event queue twice with pygame.event.get()
keep only one for event in pygame.event.get(): and use elif elif
and put the most frequent events first
ok
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?
What results are you getting? As that might help narrow down the issue.
additionally, if you put 3 backticks (usually to the left of 1 on your keyboard, same button as ~) before and after a comment, itll render it more like code
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
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
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?
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
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?)
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
Huh, if I manually creat a grid (4x4), and change line 13, g2[y][x] to = number_of_neighbors (and comment out the rest), and run it, I'm getting 6 neighbors on cells with 3 and 4neighbors
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
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
Are there any gamedev here who are making games for the Raspberry Pi ? 👍
Actually any literature on the math behind physics in video games would be great
Modern or not
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?
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
I've been messing around with gamedev on the Pi that but haven't made anything substantial
ok 🙂
could you tell why ? workflow problem ? not enough GPU / CPU power ?
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
and how often is their real position updated really? i'm making one myself and currently it seems to be able to update about 12-13 times per second, and because i'm not simulating any movement yet, even though the game is running at 60 fps, because the other players are only changing their position when an update is received, it appears as if they're displayed at 12-13 fps
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
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)
i believe it's not that, i added some time.perf_counter() prints right before and right after the commands for listening and most of the latency seems to be here https://cdn.discordapp.com/attachments/878686998829879356/1031981454802034789/unknown.png
each message is taking about 40ms
Mind sharing the code? Probably a bit easier then asking a slew of questions 😄
its not the first print i just picked one little bit from the hundreds
i mean it's pretty long but basically
https://paste.pythondiscord.com/wasuhulenu this is the server function, https://paste.pythondiscord.com/ewilenebag this is the threaded function i run on the client, and here are the methods it calls https://paste.pythondiscord.com/xeviduhosa
someone please answer me
why would there be a crypto giveaway from this python discord?
btw this is in the wrong channel, there's a few off topic ones / general you can ask instead
Do you use any sort of multithreading?
Where is it being used?
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
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 😄
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
okay, thanks...
we're evaluating if it's relevant to build HARFANG for the Raspi...
https://github.com/harfang3d/harfang3d
it would be in 64bits (and that's another issue, potentially)
why won't my sprite be able to move right
@last moon i managed to get it working
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
#help-corn with pygame if u have some time
damn thats impressive lol, if u don't mind me asking how long did this take u and do you have any tutorials i could you to create something similar to this?
i've been working on it on and off so i don't really know how long, started learning pygame/game dev in summer
ah ok
relevant guides would be this: https://www.youtube.com/watch?v=QU1pPzEGrqw&t=1815s
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...
LOL im watching his starter tutorial right now
This socket programming tutorial will show you how to connect multiple clients to a server using python 3 sockets. It covers how to send messages from clients to server and from server to clients. I will also show you how to host your socket server locally or globally across the internet so anyone can connect. This uses the python 3 socket and t...
ahhh
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
oh ight
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.
Huh cool good to know
bit off topic but would using udp be better so you don’t have to wait for the handshake
guys should i use vscode or atom for pygame development
nice
ill try atom
because engineer man uses it
wait no ill use vs
ato is better for like data science
pokeman 😂
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?
hi, I like games like this, even with the obstacles, after cleared the character will be able to move around with this,
you can also make enemies too powerful or maybe with a necessary item or move to kill
with this, you can make it with many kinds of tiles, it will can be generated in a random and interesting way,
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!
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.
i found this online
so it wouldn't work
at least the way my networking is currently coded
thats pokemen not man theres 2 people
😠
Is outthere any sugsesful games made in python?
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
"story telling" and "point and click" game types
Ehm, do u have any examples? Haha
https://www.renpy.org/ and lot of games from sierra/lucas art
hi guys
like "day of the tentacle"
so I have been working on a pygame for about 2 months(I am slow)
And I just realized its a multiplayer game
and I dont know anything about networking,
any good advice here?
question is a bit too broad, networking requirements vary from game to another
then i'd suggest an irc channel and some json
I saw some socket tutorial, is it good?
no need to go too low level, any client irc lib will do
yeah the socket server part can be complicated
I see
an irc channel will handle the annoying stuff for you
irc is a simple protocol layout upon a tcp socket server
somehow sockets looks easier to me XD , thank you man I will look more into it
I'll develop infinite button presser ( pro game development moment )
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?
I mean I have my own silly projects, but what are you interested in making?
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
what is the best game programming package?
(serious game, free package, startee one)
Its not much, but its all i can make
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
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?
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?
hi
how are you collecting the packages of sound
what the size of the stream?
12000
with a global variable in the callback function
i use np.frombuffer and multiply the chunk by two numbers
I miss a way to show the NPC play
did you try decrease this value?
no, but i will good idea
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 ...
you mean stereo might make pyaudio drop fewer audio frames?
i am collecting mono at the moment
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
no, i'm not playing it back. just analyzing it and displaying the results on the screen
so maybe this will help
perhaps. i will try it. thanks for your help
If you are CPU bound you could do some work in a separate process?
Just communicate with a Queue to make it simple
Ah, good point!
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
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
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.
So, everything I've said thus far makes sense, right?
Seems about right, sure.
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)
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?
Yeah, its a tall order. Maybe its too difficult 😐
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
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.
Thank you, for telling me what my goal should be. Lord knows, I'm incapable of deciding that for myself.
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?
Are you trying to record the screen the entire running time of the game?
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
Video recorders get complicated because of this. They need to compress and also save to disk.
Probably beyond me then
As of my current knowledge atleast
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.
Pillow can compress images?
Ive only ever used it to get a list of rgb tuples from an image file
You can also only save the past N amount of time, and have it overwrite the older stuff.
Or say only record one in every 2 frames
So basically lower the framerate of the recording
If you save to PNG or JPEG format it is compressed.
PNG is lossless, JPEG is lossy but more compression.
Which one can compress/save faster?
Or would it not matter because they are both so fast
That too, but I meant that you have a buffer of size N and you store that many frames, and when it goes past that limit it wraps around to the beginning, replacing the older frames.
So it contains the past N frames.
There are also video libraries.
Or maybe it saves those frames to a file and clears the list to make space
Then use some dark magic to fuse the files together at the end
Depends what you want.
Most importantly, videos are not just a sequence of images. Video codecs save a ton of space by, very roughly speaking, storing only the parts that differ from last frame.
So this approach won't get you good results even if you use something like PNG/JPEG. You really should use a video encoding.
It's better than raw, PNG/JPEG, but not a full proper video.
Pretty simple to do though.
I have this example of recording video from frames via ffmpeg-python: https://github.com/RundownRhino/Cellular-Automata-Simulator/blob/public/src/gameoflife_ndimage/video.py
For my simple brain thinking of it as just saving a bunch of pngs works well
What would be a good python video library
ffmpeg, can't escape it.
JPEG.
But it depends on if you are ok with losing some information or not.
I see that everywhere.
Only time ive ever needed to use it was a discord bot that plays audio
ffmpeg-python is actually a very good wrapper IMO. like, easier to use than the CLI.
Btw tysm for the example
Ill definitley go through it and try to learn something from it
Using ffmpeg CLI is something else. An experience.
Like we never left the 90s.
I have a markdown document with command line commands I saved for later use and like half of it is ffmpeg 🥴
ffmpeg -i ".\filename.mp4" -map 0 -dn -ignore_unknown -c copy -f mp4 -bsf:a aac_adtstoasc result.mp4
ah yes, totally comprehensible
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
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)
okay
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
no it's not closed source it's open source I leave you the repository I'm not breaking any rules let's go private https://github.com/jglim/gunbound-server
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?
Check privado
Where are the latest changes? Can you share here?
It's better to talk in public
Dom sorry add
I apologize Dom I sent you a friend request
We do things in pubic here. No problem.
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
!rule 9
Where can I request my requirement to avoid the ban
Talk to @light nest
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
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
The code is in the main.py file
If you can DM me with what is wrong I'd be super thankful C:
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
You can request help from volunteers for open source projects. No money involved 🙂
WIP emulators front-end in Python
could you help me? dude
Cant dev for you but can help with some stuff
what do you need?
I work on too many open source projects already. 10+
Hello, how are you? I need to advance this GitHub open source project - jglim/gunbound-server: Emulator for GunBound Thor's Hammer...
GitHub - jglim/gunbound-server: Emulator for GunBound Thor's Hammer...
I understand friend, excuse my English, I'm from Latin America
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
Are you talking about mobiles and their shots? did you manage to compile the game
wdym compile the game
you want the code?
fyi python isnt compiled
then that's called "transpiled"
well, it doesn't really matter
it compiles to bytecode, let's just say
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
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?
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
pygame
have you tried to use a debugger ?
it usually help 😄
I need help with pygame and opengl
I want to render image on pygame screen using opengl
needed a python developer
become one
Man this stuff is cool
i think pygame has a rotate function
google it
like pygame.rotate or smth
ima try ty
good job
Anyone here got any experience modelling combat systems? I need some help brainstorming my models
How i can draw a rectangle in specific place and then wrap the texture on it? (pygame and opengl)
That might depend on what kind of combat system.
Just draw a textured quad with PyOpenGL or moderngl in pygame window with OPENGL flag set?
how? can you send me code example please?
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
ModernGL 5.7 just released with python 3.11 support. There are still some missing 3.11 wheels that will be added asap: https://github.com/moderngl/moderngl/releases/tag/5.7.0
greek mythology?
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?
https://ibb.co/dp93FBq
https://ibb.co/fYVTFcK
Can anyone please advise why it's printing all the % last instead of 1 first, and then the rest later?
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
ok I fixed it
Is Kivy a game development library or meant for user interfaces?
Kivy can and has definitely been used for game development but it is more useful for creating cross-platform UIs
Can definitely make some simple games with it
FYI: python 3.11 wheels for moderngl is out
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?
I don't know about all the game companies but I believe that Unity has a C# library that relies on PyTorch. If you look up Unity Machine Learning Agents you could see some examples of what they use it for
First time i see that i know that unity using machine learning for their agents but never did any research about it, thanks dude i will look up for sure
No problem I would also check out Embark Studios they're doing some stuff with animation and machine learning
Looks awesome! Is it completely custom made or built on top of another library?
It’s built on top of Harfang
Same as this project btw :
This one is used by aeronautics laboratories in ML research
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
clock.tick(20) makes the loop to run 20 times per second/keypress..am I right?
In this tutorial, we will show you a simple exemple of what HarfangGUI can do !
👉 Harfang GUI repo on GitHub:
https://github.com/harfang3d/harfang-gui
- Part 1 available here: https://www.youtube.com/watch?v=tF6rwrVPQUc
📍 Join us !
Install Harfang3d: https://pypi.org/project/harfang/
doc: https://github.com/harfang3d/harfang3d/
👇 ...
we decided to make a series of short "work in pogress" video
the library is getting more and more usable
ok
is it a python game dev lib?
Yes 👍
Python : ✅
Gamedev : ✅ (it has scene, objects, animations, physics, audio, gamepad, VR)
nice!
that's really impressive
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
- https://www.pouet.net/prod.php?which=91906
- https://github.com/astrofra/demo-marine-melodies
Made with Harfang 3D
00:00 Elsewhere (Erk)
04:16 Of Lobster and Men (AceMan)
08:45 Sweet Mermaids (Nainain)
11:45 Coral Pillows (WillBe)
16:...
Just make a variable named time_a,
And set it value increasable as the time goes when pressing Q , within that time_a variable ,if someone presses enter than you can call function Quit.
that's cool i didn't think it'd still be getting reactions 11 days later
DUDE
IDK HOW I SAW THIS JUST NOW
YOURE INSANE, THATS SO COOL BRO
anywho, back to struggling with my python problem 🥲
It's was on top on home channel
Okie
ooh
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? 🤔
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
Make a bool al and bl=false,
When pressing key set al to true,
And set a condition that if al==true and bl==false then play the sound and set the value of bl=true,...
If al== false then stop sound and set value of bl=false.
Ok, thanks!! Guess that works as long as i don't hold down a key longer as the length of the Soundfile.
Maybe i need to add a condition to let start sound gain, if the the mixer.channel output isn't buy anymore.
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)
i learned tkinter for several hours like in 2 months
until my brain mastered it
sorry i have a mathematical question where should i ask it
mathematics discord server. Link: https://discord.com/invite/math
or just ask me if its simple
You can loop the mixer, see the docs
This shows an early proof of concept of a Python program built on HARFANG that helps to control a real-life Poppy Ergo Jr.
made with python? or like you import harfang blah bla blah
The GUI lib is 100% Python but yeah, it starts with “import harfang” like it could start with “import pygame” or “pyopengl” 🙂
ok
Can I build a video game with only Python or with like c++
If you want to do a simple 2d game python works well.
What about 3d?
It works, but I don't know if it works well. But if I'd make a 3d game I would use Ursina engine.
thats really cool.
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?
Should
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.
I would just store the map as a list of tile indices. Those indices index into a sprite atlas or sprite array
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
Wow that’s so cool, how are you tracking the movement?
The Poppy Robot has a Raspberry Pi embedded so it is easy to send commands and receive data from it
Oh cool I’ll check it out
a temperature bar
mb
like you have to stay cool
in shade or smth
Can I get any help with adding an enemy into my very simple ASCII maze game? It's due tomorrow
got an issue when i try to find input on a seperate object it only occasionly owrks
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?
Depends on a game client, really. Minecraft, for example allows for modding - so you could put it there. Some games are written in python, where injection or memory reading is a bit harder. Finally, there are games written in CPP, where memory reading is one of the options.
Do I need CPP for reading memory or does python have that option too? Also I need to find pointers with cheat engine right?
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.
Alright, thanks guys
there's this nice series of videos (not in python, and not finished yet) on injection/memory reading/stuff like that, which I personally found very interesting
https://www.youtube.com/watch?v=m902hm3fK7Q
https://www.youtube.com/watch?v=xN5WjaeeklA
https://www.youtube.com/watch?v=Yr9qy9reLCc
https://www.youtube.com/watch?v=aLeMCUXFJwY
it's more of a "how does this work at all" than "how to do it", though.
pygame is compatible with 3.11 right?
i got told it isnt
it didnt when i tried and it runs on 3.10 so id use 3.10
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
Hi everyone, this is my first game dev project. Decided on making a fast 2D platformer to test my skills. Try my game and let me know what I can improve on 🙂
This is really cool jood job
Id personally like to look at the code for this project
Thanks 🙂 I'd make the repo for the src public, but I might want to release a full version of the game eventually so I need to keep it private for now.
It's pretty cool
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
Fixed it 😄
This might have to do with the way itch.io uses fullscreen. Not sure. Will have to look into that.
Yeah, I was thinking that was the problem
Noice
Also congrats, Thanks for playing through it. I appreciate it 🙂 Hope it was fun
Mostly game devs go there but theres tons of free games similar to steam
pretty cool 🙂
Good to know
Anyone know how to create a good looking ascii logo? .::::::. .-=+*+++=++++*+=: :+*+===++*******+++*=. .-- .*+===+*##############+= :==: :. -*==+*##############*-. : -. .-+*#. -*==*#######+---=++: .-. .=+++=+= #==*######- .-==: =-: :+#+=====# :*=*######: -##%##*. .-+####=====*- -*=######= *#**+=*- -######*=====* :*+##*=. : .+*++*= *######=====*- ++- .-=-. . .=#######**+==+* : . :=####**########*==+#+=*: : -+###############*+*+++#=+* .****##########**+====+++==*: :+*+==++++=====++*======++ .-=+++++++==-..*+====*. *+==++ ++=#. =*= :
In simple cases you can start a timer. In your draw loop and decide behavior based on elapsed time?
Hey all, where would you store multiple class objects?
Like where would you put all the lines that create those objects
Create instances when needed
I randomly decided to throw myself into trying to figure out python and making a basic game, how do i find a topic?
What kinds of objects?
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?
class GameData:
swords: list[Item] = field(default_factory=list)
shields... ```
This is a data class?
Yeah
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]
no not quite
You can put all created items in a dataclass instance (or even a dict)
And access it anywhere
but where do you put the lines that create the Items?
For eg if you want to spawn some random weapons in a treasure chest
these lines
For spawning, it depends on what your game entails
Is it a single level, or multiple levels?
Using pygame, how exactly would i get a rectangle drawn on the screen?
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
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
I know a tiny bit about dataclasses, and what he suggested seems useful, but I think you're missing the point of my question
# Importing the library
import pygame
# Initializing Pygame
pygame.init()
# Initializing surface
surface = pygame.display.set_mode((400,300))
# Initialing Color
color = (255,0,0)
# Drawing Rectangle
pygame.draw.rect(surface, color, pygame.Rect(30, 30, 60, 60))
pygame.display.flip()
The surface is the window, correct?