#game-development
1 messages · Page 22 of 1
then your adding 1 to it
yes
to clarify, my problem is the rate at which my game updates is increased for no reason when I run the game
gameticks = 0
while True:
gameticks += 1
this is your gameticks code
you mean the fps or the variable
fps
it's alright, should have clarified more
but how do you know that the fps increases?
the ball that I have moving on the screen starts moving really fast
and the rate at which the variable is added to increases
here's the code, btw
https://paste.pythondiscord.com/YTFQ
(I hope that works)
From what i see (i tested it), after some bounces it goes fast, after some it goes slow
so it isnt a pygame tick issue
ah
you know why maybe? Because if it bounces on the left wall and imediatly at the wall next to it, it speeds up
do have any idea of why that's happening?
well im testing it out right now, but no i dont
alright
AHH MAN YK WHY?
Because you take a random int
so it moves with different speeds everytime
you use rantint
You take the speed, and look for a random number between 1 and speed variable, and move it with that speed
thats why its so weird with the speeds
because every time its random
but it's limited between 1 and 5, it shouldn't move as fast as it is
Well dont forget that you arent limiting the FPS
SO if you limit that
it will go slower
because now the speed it effected by the FPS and the randint
I didn't realize I had to
well its up to you if you want to, but it looks a lot slower if i limit it so something like 60 fps
I'd be angry if I bought a game and it's locked to 60 fps on my 100hz monitor. It's better to multiply in delta time instead, to make it consistent at different framerates
Anything that simulates movement should have a frame limiter, else one could never really know how fast anything is actually going to move
@vital saddle wooo it worked
yeah that is a way too
its kinda up to the developer how he wants his program to function
but deltatime would be the best option yes
I learned how to dt a year or two ago, along with a limiter, it keeps things moving at the right speeds
see, I'm writing clones of classic games that were more or less locked to 60fps ... this is something I will have to outgrow
https://discord.com/channels/267624335836053506/1198008330992500796 if someone has the time to help me out
for gameTicks in rage(float("inf")):```
/j
lmao
dont buy forager then
Player shouldn't be able to lose items by dropping them offscreen, I got it. If the room has another room on that side, the dropped item is moved to that room. If not, as is the case with robots who have no up, down,left or right rooms, it just automoves the item back onscreen
This should prevent losing any items by dropping out of bounds
Games I've done before were arcade-ish kind of games, where moving and shooting and things are the challenge. This game is all logic, the movements are basic, so basic that I'm not even using vectors for it here. A totally different kind of challenge
I always use a vector for positions but all these items just move in ints
Each direction moves independently. Meaning things moving on two axes move slightly faster
That looks good!!
hello
im trying to make snake in pygame
as intuitively as possible
just double checking the bottlenecks or issues i could run into if
i made a Snake class to store a list of the coordinates of the snake body
Well you can do it why?
hardly any bottlenecks to run into in a snake game, like you could get away with some pretty slow stuff
ok tyy
In theory it wouldn't create any bottlenecks
It would be fast enough
Yeah
https://stackoverflow.com/questions/15112125/how-to-test-multiple-variables-for-equality-against-a-single-value is there a way to do this with classes? for a crafting system in a game
would someone be willing to help me debug a basic pygame physics sim?
I'm getting a bug where I can't move the physics objects past a certain height and I can't figure out why
https://paste.pythondiscord.com/345A
Altered my sim to do this. I had to
Scissors and?
hm?
What are the images?
no they're perfect
Oh so they're rocks. Just small images
Yeah, I can only sim 300 entities at a time tho...sad
need to optimize
All the detection cones ☠️
cant draw without my fps dropping to 5
Also made thsi heat transfer, but its so slowwwww. Thats why Im learning C++
Cooler sims
hi
This lock is wired for sound
The puzzle is hard, the solution is easy
Or one of the solutions, there has to be others but probably not as simple
Working on inheritance for a few. I have many objects subclassed from a single object. Like all my gates subclass from Device() and most are rotatable. So I put the rotate() method in Device() and for a couple of devices that cannot be rotated, I override by giving them an empty rotate() method, just return from it
But now I've given the Device().rotate() method a condition if self.rotatable: and all the subclassed devices can have a bool for that attribute. Now those few devices that don't rotate just have to set that attribute to False while the others default to Device() attribute, which is True
So the override is now of the attribute instead of the method
could you elaborate? like 1 and 2 are instances of the int class, so doing x == 1 or x == 2 is already doing it with classes (more like instances of them, but yk)
Classes can go f themselves! No classes?
Hello Guys, i'm trying to create a Pong game in Python for learning. I already created the game but I've some issue with collision thru pads and ball. I'm not able to undestand what's wrong with the code, beucase sometimes the ball hits one of the two pad in anomalous way, the ball hit 10 times the same pad and assign 10 point. It looks like if the ball is locked in the pad and score many points at time. Can anyone help me ?
I'm doing some pygame coding using pgzero and pgzhelper but anyways, I was tryna make a pokemon game, and once you beat the first gym leader you can advance to the next gym leader. but when you do, for some reason the move button isn't working and I tried printing to lmk what screen I'm on the problem is showing that it's not switching screen to "play8" (screen names)
classes are just convenient wrappers for dicts of functions
and objects are convenient wrappers for dicts too
everything is a dict
lua moment
lua uses tables
(they are totally nothing like dicts)
Sup. Im using pygame to make a really simple game as a test, but for some reason Im getting a trackback error that I cant make sense of?
Program Output:
pygame 2.5.2 (SDL 2.28.3, Python 3.12.0)
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "E:\Python\mow_lawns_game\main.py", line 138, in <module>
Game().run()
File "E:\Python\mow_lawns_game\main.py", line 133, in run
self.move()
File "E:\Python\mow_lawns_game\main.py", line 73, in move
self.pos[1] = self.y
~~~~~~~~^^^
TypeError: 'tuple' object does not support item assignment
Process finished with exit code 1
Tuples are inmutable, try searching the error message
i know that, the my problem is that its saying that im trying to do an assignment to a tuple, but the variable im editing is a list
theres no self.pos[1] = self.y in the code
i renamed the variables, but its there. heres is the code with the updated variable names, but its on line 73 like it says in the error
updated error, still the same
Traceback (most recent call last):
File "E:\Python\mow_lawns_game\main.py", line 138, in <module>
Game().run()
File "E:\Python\mow_lawns_game\main.py", line 133, in run
self.move()
File "E:\Python\mow_lawns_game\main.py", line 73, in move
self.player_position[1] = self.player_position_y
~~~~~~~~~~~~~~~~~~~~^^^
TypeError: 'tuple' object does not support item assignment
because player_position is a tuple
player_position is a list, not a tuple
somewhere in the code you're changing it to a tuple.
i guess ill try some debug prints
well i have no idea where im type casting it into a tuple, but type casting it back into a list works i guess
New level data idea that I'm testing out: https://paste.pythondiscord.com/UEKA
That data test results
It populated the room
Eventually leading to level initialization being the same for loaded levels as for new instanced levels
I'll have a method to read that data and a method to write it the same way
is there a reason you aren't using pickle?
Saved game files will be large-ish, maybe a 100kb or so. I wonder if pickling that data will be necessary
I personally find pickling a Save class easier to work with than json
Oh yeah, once I get the data structure worked out, I can toss it in an attribute and pickle the object with it
I don't think there's a downside to it
like
pickling is pretty fast
unless you had a different concern
Yeah, I have a method to pickle data already
ah ok
Just not yet implemented with this testing
Originally called Robot Odyssey (1984 The Learning Company) ported to Java as Droidquest (1998 or so, Thomas Foote, github)
And now ported to Python, sst
oh nice
The only downside to pickle is the security issues but with user generated save data in a pickle, they'd be secure. Just wouldn't trust sharing those objects with others, maybe
oh true I'd forgotten about those
my game uses json to define default level states and pickle to save them so I'll hopefully still be able to have custom level sharing with that system
And that's just a small three-room level, some of my levels are 60+ rooms
So the data is quite large
the other issue with pickle is that if you have a lot of visual effects when you save you're just wasting space
oh wow ok that's quite a few
440 rooms total
So saved games will be level based, just save the level, not all of them
wouldn't it be more storage efficient to only save the modified rooms?
I mean it's negligible anyway
It'd be really difficult to track modified from unmodified when the room_items['layout'] can be mutated
They're all subclassed from Item()
Well, Device is subclassed from Item() and gates are subclassed from Device()
I have a parser that reads those item IDs and instances the object
def str_to_class(class_name):
if type(class_name) == list:
return getattr(sys.modules[class_name[0]], class_name[1])
return getattr(sys.modules[__name__], class_name)
``` this is what I've been using
I just store the class name as a string
That is very interesting, can you explain it?
Because I'm all for exploring other ways to get objects from strings instead of ints
it takes in a string or list of strings and converts it into a path to the desired class
so for example I used ["engine", "Sprite"] as an argument in one of my levels which would be the same as engine.Sprite
Do those modules need to be in the same file?
that's what the list check is for
if you pass a string rather than a list then it only checks the local module
which is passed as a string through __name__
wait
otherwise you need to state the module
Just as a placeholder test first...
i might switch it to use .split instead of a list as well
it wouldn't simplify the function at all but it would make writing the level data easier
yoooo i know your pfp
ngl i might go back to this
Hey! That worked!
Now I can refactor more of this populator idea, even better. Thanks!
does anyone know pygame?
Lots of people know pygame, do you have an actual question?
My new populate
No more ifs!
I'll need to rename it, since this one will only work with devices, but so good
I'll have a populate_items() and a populate_devices()
So awesome https://paste.pythondiscord.com/MEBA
Not that it works, but that it will work for all levels
And all items and all wires
Is Metal by Apple hard to learn?
All populated from the data. I had to make some conditions for some items, progress so far https://paste.pythondiscord.com/FEKA
@surreal furnace Thank you again for showing me how to instance objects from strings, that's so cool
Yes
Hello!
no problem!
you could probably make it use the devices package by default if you're mainly going to be using it for that
this town ain't big enough for the two of us
also
here's what I've been working on
it has a post process screen shader for (currently only) colour correction
the grass is really laggy though, if anyone has any suggestions on how to improve performance I'd love to hear them
class RotationSpring:
def __init__(self, rotation, target_rotation, strength=1.0, dampening=1.0):
self.rotation = rotation
self.target_rotation = target_rotation
self.angular_velocity = 0
self.strength = strength
self.dampening = dampening
def update(self):
self.angular_velocity += (self.target_rotation - self.rotation) * engine.delta() * self.strength
self.angular_velocity = engine.math.lerp(self.angular_velocity, 0, self.dampening * engine.delta())
self.rotation += self.angular_velocity
class GrassPatch(engine.TickableEntity):
def __init__(self, pos, width):
self.pos = Vector2(pos)
self.width = width
self.interval = 3 if engine.settings.getConfig().getboolean("graphics", "fancy_grass") else 4
self.grass = []
def generateGrass(self):
self.grass = [Grass(self.pos + (x * self.interval, 0)) for x in range(int(self.width / self.interval))]
random.shuffle(self.grass)
def serialize(self):
self.grass = []
def update(self, *args):
if engine.settings.getConfig().getboolean("graphics", "grass"):
if not self.grass:
self.generateGrass()
for g in self.grass:
g.update(*args)
class Grass(engine.TickableEntity):
def __init__(self, pos):
self.pos = Vector2(pos)
self.pos.x += random.randint(-1, 1)
self.influence = Vector2(
random.uniform(0.05, 0.09),
random.uniform(0.1, 0.3)
)
self.wind_strength = random.randint(7, 12)
self.width = random.randint(1, 2)
self.height = random.randint(5, 20)
self.trigger_rect = pygame.Rect(0, 0, self.width, self.height)
self.trigger_rect.midbottom = self.pos
self.damp = random.uniform(0.7, 1.5)
self.strength = random.uniform(0.7, 1.5)
self.rot_spring = RotationSpring(0, 0, self.strength, self.damp)
self.colour = random.choice((
(25, 60, 62),
(38, 92, 66),
(62, 137, 72)
))
I'm actually using it for robots and items now too, and loving it
glad I could help!
It's changed slightly from what it was a couple of hours ago, as some objects need different args, but conditions for them is easy
yeah I just have the args as a list usually
you could probably do smth to make them a dict if you wanna have default values though
All of this stufff is being added using a couple of methods
And that blue robot is wired with an 8-pin chip loaded and connected to its thrusters/bumpers
nice!
So easy to add more
my game doesn't use tiles it uses sized platforms
so it's a bit of a pain to add things manually
(rects)
I was thinking the same thing, level editor
But in my case, I'd pretty much just need to make the tile editor and add a item menu to exissting code
Cause my game is already an editor
Just doesn't have a menu to choose items to add, it does have one for devices though
Items are everything in the game, keys, robots, gates, everything. Devices are a subclass of Item and is everything that has a port to which wires can be connected and logic to carry electricity (signals) to other devices. Robots are subclasses of items and have special devices inside
I should have thought about a level editor before I hardcoded 2d grids layouts for 400+ room, lol
I have this item/device adding to levels so far abstracted now so that part of adding items and things is no longer a pain in the ass
entities work how my stuff does now but the tiles system would probably use indexing
I'm only using tiles for the walls
mine's abstracted and still a pain in the ass 😭
Everything else is just a plain old sprite
this is the first level
oh what
why did it put that at the beginning
oh well
lovely sfx
thank you!
god why is batching such a pain
I'm trying to switch to a tile system and make tiles merge into rects where possible and I'm slowly going insane
nice ^^
I dont know if it's much of a suggestion as I personally don't understand a thing that's happening in this vid (that im linking, not yours) and on top of that it's not even python. However I think it explains the concept pretty well. Maybe it's useful to you. if not, interesting watch in any case 🙂
https://www.youtube.com/watch?v=5zlfJW2VGLM&ab_channel=Vercidium
The source code and demos are available here: https://patreon.com/vercidium
I spent the past 6 years creating a game engine, and I've been shocked at the things that can make or break performance.
I put together 3 simple optimisations that you can use to make your game run up to 10 times quicker.
Music is Orbit, Saturation, Abberations and Ch...
It is an good idea if i make an IA for the left paddle for an ping pong game?
thank you! I'll check it out
IA?
Pretty much all interactive items/devices in one room
The red rect being drawn on that blue robot is just debug showing the robot's portal rect, that which collides with walls and enables/disables robot entry
its a bit glitched but yeah.... :T
ohhh i didn't realise you'd misspelt AI
Oh my bad sorry
Well look at the player lives
it reached 0 but i can still playing lol
i didn't add an gameover screen for now
ahhhh ok
are you lerping the ai position?
I've found that makes it more natural looking when I implemented it
No for now i made so the ai paddle just follow the ball
Thank you i appreciate it :')
ehm, i tried to make so if the ball goes fast it have fire particles, heres the result :(
that's quite a lot of particles
I'd personally be worried about visual clarity
maybe try rendering the ball in front of the particles and keeping it white?
or at least a distinct colour
I know, its not supposed to happend
It should only show small particles smaller than the ball
but for some reasons there all that
can I see your code?
hmm
that is odd
it seems to me in the picture actually that the particles are the right size
and its just the ball that's been set to the particle colour
No the ball being yellow its normal, its to show the ball the is on fire
I don't quite understand what the problem is then tbh
just try to play the game, you will understand, i don't want the particles to be that much
Another quick and easy refactor, 14 ifs replaced by a couple of lines
I can keep going too
lol
This is the toolbox selection method
Nice keep going, your doing great work 
oh you've made a logic gate playground?
Yeah
cool
A game full of logic puzzles using robots to solve them
ah, very cool
The robots have thrusters, bumpers, antenna, and grabbers. each with ports where one can connect wires to logic gates to have them perform tasks
beep boop
Yip
would you happen to know how to make a square and then move it around the screen in pygame?
I've tried and the square shrinks and grows with the movement
What do you mean by move it around the screen, like with the keyboard, the mouse, or by itself, like a ball bouncing around?
with the keyboard
Here's a quickie https://paste.pythondiscord.com/AGGQ Could be made better using pygame.key.get_pressed() though
And some bounds checking
aight
But just make a sprite, give it an event handler to handle the keyboard input, and adjust the sprite's rect per the keys
alright
For a little more fun, you can do anything you want https://paste.pythondiscord.com/YZCA
That was quick demo for someone else a few weeks ago, how to do a sprite and a group, adding simple movement with the keys or whatever is easy enough
oh I meant more the phrasing before the link
pygame.Sprite() is awesome, jus sayin, I love those things
And vectors, learning how to use those opened a whole new world of game motion mechanics for me
oh same
it took me ages to figure out that .elementwise() existed though and I thought I was going insane 😭
Delta time, inheritance, vectors, all things I've learned over the past couple of years that I wish I'd learned waaaaaay sooner
Make one DirectionalSensor and subclass the different types from it https://paste.pythondiscord.com/DLVA
I just redid those last night, much nicer than they were
ooh very nice
anyone got any ideas on how I could combine rects vertically?
they're initially tiles on a grid and then they get batched horizontally
but I havent been able to batch vertically as well
(the bottom platform does have a collider you just can't see it because the grass is covering it (which I should probably fix) )
Combine vertically? I'm not sure I know what that means
You mean those on the left and right become one large rect?
yep
so the wide one at the top was also initially a bunch of tiles
def unpack_level_layout(level):
batches = []
for y, row in enumerate(level):
temp_batches = [Batch(None, (0, 0), (0, 0))]
for x, tile in enumerate(row):
tile_type = LEVEL_IDS[tile]
if temp_batches[-1].type != tile_type:
temp_batches.append(Batch(tile_type, (x, y), (1, 1)))
else:
temp_batches[-1].size.x += 1
for batch in temp_batches:
if batch.type is None:
continue
batches.append(batch)
objects = {}
for i, batch in enumerate(batches):
objects[f"batch_{i}"] = batch.convert()
return objects
I'm using this at the moment
I can only think of the probably naive approach, iterate them, checking for collisions and compiling a new rect from the results
class Batch:
def __init__(self, batch_type, pos, size):
self.type = batch_type
self.pos = Vector2(pos)
self.size = Vector2(size)
def __str__(self):
return f"type: {self.type.__name__}, pos: {self.pos}, size:{self.size}"
def convert(self):
result = self.type(self.pos.elementwise() * TILE_SIZE, self.size.elementwise() * TILE_SIZE)
return result
the thing is then it might not be rectangular
hold on
this is what im worried about
If they're all the same size, you could use rect.centery as a condition for those vertically, you probably know this already
that's a good idea
however
it generates the levels when the player enters them from a json file
and I'm worried about stuttering or flickering when that happens
atm the function takes < 1ms but idk if checking for that many collisions would be an issue
also I'd rather keep it all in the first function
its not worth trying to merge them both ways
why is that?
I could implement a chunk system for it but it would require changing quite a lot of the framework I already have
aslong as you are only checking collisions with tiles on the screen, only merging them on one axis gives you more than enough performance
in alot of cases merging both ways wont reduce the rect count
im unable to illustrate why because im on 1 bar of signal 💀, but unless the level is very boxy i personally wouldnt try to merge both ways (e.g. you have floating squares of land instead of trying to make them in interesting shapes)
https://paste.pythondiscord.com/GRXA
Ig this is kinda game development
Think of it like this
Lets say you have a 1 pixel big rect on every pixel on a 1080p display
To check collisions for all of them, youd have to check over 2 million collisions
Combine them horizontally, and you just turned 2,073,600 checks into 1,080 checks
I made a simple GUI Using python which represents a gorilla tag mod menu lol
yeah but in this example if I batch vertically as well then it's 1 check
Yup
But look at the difference
2,073,600 -> 1080 is a vastly bigger improvement from 1080 -> 1
By merging them along one axis you've already gotten the majority of what you will get
And assuming you have irregular terrain it becomes even less impressive
👋 all ! I'm getting started using Arcade but not Python. I am a backend software engineer and I've been using Python for 6+ years.
I would like to start working on a side open source game and I would like to not go at it alone. I would love to find one or more people that would like to help me out and try to build a nice little game.
What is the game I'd like to make ? Well a ski resort tycoon of course ⛷️ ! Tis' but the season of course ! My goal would be to have the game be 3D but let's start small and have 2D start 😉
If you'd like to know more, or are interested, hit me up ! I'd love to chat !
@latent mauve, maybe you should go on Panda3D for 2D/3D easy transition
I'll look into it!
also, as a general rule, open blind invitations for other people to work on a game fall flat. Most people want to work with people they know
and it's also seen in some circles as begging for labor
if you start by building something on your own, even if it's very small, that sends a signal that you know how to do the work. And that provides a base upon which other people can start helping out, should they feel inclined
Yeah that makes sense
I am working on it
I just have nothing to show for it yet 🙂
in programming of any kind, having work to show is how you establish your intentions.
if you say "I have this great idea, I just need other people to help me build it" people will be like "why not just build the parts of it you can first, and then talk to us?"
Yes ofc
Pretty much everything that describes a 31-room level in a single dict of strings, ints, lists and dicts https://paste.pythondiscord.com/JA6A in two uploads https://paste.pythondiscord.com/G32A
What's cool is that I can eventually parse all the items in a level into a similar dict, write that dict, then load it as a loaded game
No other levels will have pre-wired devices in them, only level 1 starts with them wired to accomplish that level's puzzles, but each room will have a wire_dict for saving wires
Hello Guys, can anyone help me with this issue ? The ball has this strange behavior when hit a pad corner
The code is this one:
if left_pad.colliderect(ball_rect) and left_pad.right > ball_rect.left or right_pad.colliderect(ball_rect) and right_pad.left > ball_rect.left:
print("COLLISION !")
ball_speed_x = -ball_speed_x
score = update_score(score, +1)
You need some collision response. When you flip the ball_speed_x, also try ball_rect.left = left_pad.right This way you move the ball out of collision
And the opposite on the other side, for the right_pad
@limber veldt, thank you for reply ! I tried in this way, but the issue occurred again
ball_speed_x = -ball_speed_x
ball_rect.left = left_pad.right
score = update_score(score, +1)
I just tested something....I made my level2_data.py, it's just one big dict describing the level like I posted above, then I assigned that as a variable in a class then pickled the class. Then, instead of importing the data and sending it to the level, I loaded it from the pickled object, assigned it to a variable and passed it, it worked!
The level2_data.py is 75kb, the level2_data.lvl (the pickled object) is 1kb
Ball and paddle collisions are done well in this, separating the x and y axes https://www.youtube.com/watch?v=4tVC1vhxiao
Hmm, maybe it didn't work...issues
working on vines
the springs I'm using for the water and vines are causing quite a bit of lag though
I've managed to optimise them a little (about +20fps from first implementation) but they're still quite unperformant
I was considering rendering them in a shader instead of using pygame's draw features but the main problem is actually (and surprisingly) the spring calculations rather than the rendering
Nice, that's quite a lot of them, would just a few be any easier on the fps?
I got my save data working. I pickled the attribute itself instead of the class having it
So I'm considering how the level gets this data. Perhaps it should load each level's data at level start. Like, player hits a portal, it loads the data, sends it to the level constructor and spawns the player after construction
I was importing the data into each level's class, now loading it from a pickle and sending it as an arg to the constructor
Testing this with level 2, this is it now, and the populate_level2() method will be moved to BaseLevel() soon, basically just a couple of attributes and a call to populate https://paste.pythondiscord.com/AE7Q
The data has the Train and, unless I make a special condition for it in the item parsing, it ends up in the room_items (the group that is drawn and interactive) when it shouldn't be until the button to call it is pressed
So I just remove it after the populator
And in the button to call it touched_by_item() method, it iterates the items to find it, so no reference needs to be sent to the button
And I have two groups that each item goes into, level_items, and room_items. level_items is basically just a reference to every item in a level, room_items are drawn and interative
oh definitely. I put the vines into a set rather than a list though (after that) and made a few other optimisations and that gained me about another 20 and stabilised the fps quite a lot
Good idea, using a set
that's what I'm doing
it works pretty well
level loading shouldn't take very long tbh
Sort of on-the-fly data loading?
for me interpreting and loading the json file takes usually <1 ms
yep
Yeah, it seems plenty fast, any SSD should load it in milliseconds
foliage is "buffered" so generating it doesn't have any significant issues when the level is first loaded
I'll get a video of the level switching hold on
the flickering near the end is a hotkey for level reloading
the only reason it's flickering is because the foliage is buffered
which it has to be to appear in front of everything else
So I wonder...A few versions ago, I was just importing all the levels at game init and instancing them as necessary. Then I moved to importing the levels at level transitions, thinking there was no reason to have all levels imported and in memory all the time, and just reassigning the self.level attribute after importing. But that doesn't sever all references to old levels and they remain in sys.modules. Is it even worth any effort to 'unload' levels?
probably not, but I personally wouldn't be defining levels in python at all
using json files will keep it much more compact
Yeah, for sure, and python would just be used to create the json?
or to load it yeah
I cna do that now that I have a parser that can parse an entire dict of a level
here's one of my levels
the file name is NOT 😠 a face it's the level coordinates
yep
I have 4 lists actually
1 for normal objects and 1 for physics objects
and then a variant of them both for objects that need to be loaded after the player is
here's a shorter one so you can actually see the end of it
So I'll just need to complete the conversion of all my level datas into jsonable dicts, just one orr two levels are done so far
I wonder if one should make those json files read-only?
wdym?
just open them in read only mode
this seems very real
Yes
Well, for this game, it will be able to save levels and I would want to prevent the default levels being written over
Does anyone need it?
I save levels in a different folder as pickle classes
excellent
I made a v3.0 of that non-working mod menu lol
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
oh btw the thing that says "currently has 118 mods" is wrong lol
Five levels dumped to json so far, this is all going to be changed, but so far it's working https://paste.pythondiscord.com/JCHQ
I should probably add a try/except condition to them, just in case they can't find the files
And that method is just a debug method, not a feature
Just taking all the data that's in variables and dict-ifying it, time consuming but worth it, really like the json idea
If I implemented the save_game() method how I want to, I could just start a level and save it, it would do the json conversion for me
why are you using a different class for each level?
I'm not too sure yet
Once I get all the levels aligned, that will be changing too
With json, that is, and the new parser
But the game's levels are totally not related, there's no reason to have them all in one class
Or in one file even
The only thing common between the levels is anything the player carries with them to the next level
So just an inventory transfer
And when the levels were 1200 lines of data and logic, it made total sense to have them each in their own class...that is changing though as I redo these things
but they're all defined in the same way aren't they?
wouldn't it be better to have a more abstract level class
Most are, yes, but many have slight differences
Of the seven or so levels I've turned into json so far, only one of them has totally default setup
Like level 1 has a couple of items it randomizes on init, level 5 has a one-way room link setup after the normal links are made, and so on
In level 2, I go ahead and add the Train() object in the json but remove it from the room right after populate_level()
Another way to manage it would be to make a dummy room to store it in, then shift it from one room to another when triggered
I did that in level 4, there's a button that only appears periodically, during the time that it's gone, it's actually been moved to an inaccessible room
It's the easiest way to take something out of a room so the player can't interact with it, move it to another room...or even off screen
Level isn't really the right name for them, as they were always more like level populators, defining all the objects within a level. I do have a more abstract level, BaseLevel(), where all the methods to deal with levels lives. populate_level() now lives there, link_rooms in a few versions is there, parsing the 2d arrays into tiles is there
I have 173 total instances of 51 various tiles, still not sure how I want to better handle those
And that's just tiles with behaviors, plain colored tiles are all base tiles
Hey everyone, coming from Rust, WGPU was a big deal. Does wgpu-py get a lot of usage in the python community?
I haven't touched it yet - I mostly work with things that wrap OpenGL, like Pyglet
Dang
Love being able to instance from strings https://paste.pythondiscord.com/Z2IQ
They just do this
Just working out the data and method for parsing items with internal rooms inside other items with internal rooms
That was from a dict of portal items
I made my magnum opus between the hours of 12:30 and 2am last night
I want to know start up of gaming
Can anybody send me code for starting a new gaming app means as a idea
If you mean a game with gaming app, then you probably would be able find a lot of examples online with things like Ursina, Pygame-ce and Pyglet
who wants to learn me everysingle line of code in existiance (python ofc)
or try
pls dm me
I have game saving to pickle kinda working, progress
Hi! I would like to create a little educational game... The idea is simple: there should be a geoboard (something like this: https://www.visnos.com/demos/polygon-explorer) where the user can create it's polygon and on the bottom I'd like to show the area and the perimeter of that polygon. I know it's a really dull game, but I can't put my mind up on how to actually create the board! Could anybody give me some ideas or link some similar projects? Thank you in advance
I've done similar with mouse draggable points using pygame and python to draw bezier curves
Drawing a polygon using the points would be rudimentary
Here's a version of that with fewer points (just one curve) https://paste.pythondiscord.com/LIIA
I want to learn python for Game Development for free?
Youtube tutorials are free
Anyone who can guide me to which sites or tutorials to use
Bro there are million of Tutorials on Youtube. How to know which one to choose
Clear Code, Russ, Nick, among the best pygame youtubers
Can you guide me
Ok Thanks for Guiding me out
Helping someone learn programming is no small undertaking. One must know how to find and implement information and ideas, especially for free
thank you very much
I'd like to ask you one last thing
I don't know if it's much use to anyone, but just an idea of how I made mousable points. That file was for making assets for another game, so really not a game idea, but maybe one can learn a little from it
For the background, (I'd like to build something like this: https://apps.mathlearningcenter.org/geoboard/) would you suggest using an image with the dots (and saving their positions) or to create them as objects on a plain background?
I would probably make a 2d grid and put dot sprites at each intersection
Well, it has many of the key features I was looking for... so don't worry!
Got it, thank you again!
I don't know which is heavier, blitting a large image with dots on it or blitting a few thousand dots
True that
I think blitting thousands of dots is wayyy worse, because you would be calling a function in Python...
I think there has to be a point of diminishing returns, probably relative to image size and number of dots
https://paste.pythondiscord.com/X2JA A basic grid of grey dots
well i have a problem in my game
i have a problem with placing of blocks
the only way how i can place a block is this
but it must be like this
If i try to place blocks like this then it doesn´t work
but if i put a block like this then it works but that is not the intention how it should be
I hope someone can help me fix my code https://paste.pythondiscord.com/HYPA
yours really ?
yes
but me and my friend are working together
i hope there is way to fix this
Uh. Well not a pro, but I've used it before.
I'm not really following with the problem, what's happening?
How well does python fare when being embedded into e.g. Rust for game dev?
Hey send me code of that game of block 🥺
if you want to embed python scripting to a game engine, cpython is a bit too much, but https://pocketpy.dev can do the job. But if you have a lot of strings to handle you may want rustpython https://rustpython.github.io instead to avoid conversion
wow, pocketpy is interesting
hey guys i wanna develop an adventure game with graphics but idk how to start
What kinds of things are you thinking of? (examples of other games like what you want to make)
maybe something like the og gta
or a texted based adventure game with some graphics
so it doesnt look plain with you just playing in terminal
I'm mucking about with creating a roguelike adventure, which is relatively easy
the graphics are simple, so it's less of a hurdle to implement them, and you don't have to worry about FPS because it's turn-based
cheers
sample screenshot (the graphics are all placeholders - this isn't for release yet; when that happens they'll be replaced with proper assets)
nice bro
the focus right now is on game mechanics, the underlying state mgmt
want me to send you my game once i finish quite a bit?
you can start with "canned" graphics
stuff from itch.io's free asset section, for instance - use those to get started
you can use Pygame or a number of other frameworks (I'm using Pyglet)
whats the best in your opinion
Pygame has the broadest use and may be the easiest to get up to speed with for starters
@round obsidian I wish I could come up with a game idea and make something. I could definitely code it. Trying to look for people that want a programmer.
the way I'm getting started is by just cloning any existing mechanic that I know of to figure out how things work. Once I get that down, then I'll see about making it original. Understanding how things like this come together at all is a first step
Recoded it due to performance issues, but I made the evasion system better
it now considers multiple vectors
I am going to add obsticale vector evasion also so it avoids trapping itself
My sprites did not work as you can see
hey i have a problem. so im using a tutorial to do a platformer game, and wanted to use another sprite. but when i imported the sprite and played it. the animation looks weird. could anyone help?
dutch comments 😆
how do i make games with pygame
Find a tutorial or a blog about pygame, there are different ways
okay then
yo guys i got a game idea who wanna make it with me
@stuck remnant what is the idea?
GAME IDEA:
You're a citizen in the UK in the year 2042 and the UK has been invaded by India and now you must fight with your neighbours and soliders to end the invasion the game will have similar mechanics to GTA 1 GTA 2 and GTA London but you can buy weapons of mass destruction or craft them on your own once youve reached a high enough status and theres not one single entire match instead theres levels set in each majour UK city/town the games also in multiplayer
This video demonstrates how to complete three so called "impossible" Kill Frenzies in a safe and fast way. What you need to do for preparation is:
- crush a B-Type at the Zaibatsu car crusher to get invisibility
- park a fast (parking) car next to the place where you collect the power-up
- get another B-Type, so you can get invisibility for th...
I'm not interested sorry.
Isometria Devlog 39 - New Minimap, Map Generation, Discord, Next Fest! https://youtu.be/VTwaFfYhC1o
Wishlist and play the Isometria demo here: https://store.steampowered.com/app/2596940/Isometria
https://bigwhoopgames.itch.io/isometria-demo
In this week's dev log I will show you the brand new minimap which is much more performant than the old one. I also discuss biome and map generation improvements, the new discord I've setup, and Isometria...
it is pygame-ce
whats pygame-ce
that pygame https://github.com/pygame-community/
The GitHub organization of "Pygame Community" - a community run by fans and devs of pygame: https://github.com/pygame-community/pygame-ce - Pygame Community
cool
( works on web too )
you don't have to change much your code to run as a html5 game
and it still runs on desktop and android if done well
Yes all in pygame-ce
mostly just caching is important
can you link me to any tutorials?
like if you rotate an image, save the rotation insetad of rerotating it
there are a few on my youtube
cool
want me to share you my game idea?
GAME IDEA:
You're a citizen in the UK in the year 2042 and the UK has been invaded by India and now you must fight with your neighbours and soliders to end the invasion the game will have similar mechanics to GTA 1 GTA 2 and GTA London but you can buy weapons of mass destruction or craft them on your own once youve reached a high enough status and theres not one single entire match instead theres levels set in each majour UK city/town the games also in multiplayer
doable with pygame if you used pixel art
you should consider spritestacking, would look cool for a gta1/2 type game
thanks
I'm an open book if you have questions
you should join the pygame discord as well if you need help
cheers
could the game be doable for me to code even with my little experiance
like the only thing ive actually coded in python is a text based adventure game
so my recommendation is start small
do one thing at a time
like make a map with a player that can walk around
then slowly add things like a car or a building
multiplayer might be tough at first
dafluffypotato has some great videos on youtube which you could follow as well
thanks
btw im having a slight problem installing pygame
its not letting me install pygame for some reason
Read the error
It's not letting you install user
There's not supposed to be a space between -- and user
Also I think that has to go before the name of the package
👍
make sure you're installing pygame into the same instance of Python you're using to run your code. If you're using PyCharm, PyCharm does funny things with venvs in projects, so you have to use their own way to install libraries
(this is one of the reasons we as a community don't always recommend PyCharm to beginners, because it means they have trouble following tutorials due to issues like this)
read the rest of what I wrote. are you using PyCharm?
what editor/IDE are you using?
thonny
@stuck remnant https://github.com/thonny/thonny/wiki/InstallingPackages
thx
Thonny also has its own package management stuff
yeah i just use thonny cause its easy for me to use and it is the one we use in computing science
i much prefer it over visual studio code
that was terrible to use
it's much simpler, yes
VS Code is a more general editor that can be turned into an IDE for many languages
I use VS Code because I do work in a lot of different things, not just Python
I've used pycharm and vscode, both work fine, they seem pretty similar
Seems you need to compare the original source image to the new one, are they the same size? If using a sheet, are they the same position in the image?
Your animated player image might be a sheet, in that case, you'll need to make a new sheet with the appropriate images, or edit the code to work with a different sized image
yeah, the original image is a sheet. ive already adjusted the code the match the different height
but the animation is weird like that
its like slowly transitioning to the next image
instead of directly going to it
and how do i solve this error??
its not even part of my code
You must have passed in something wrong to the pygame.sprite.collide_mask function
oh thank u i fixed it
I got my shape objects and sensors and editors working really well
Idk I have the same problem with macbook
Idk why the pygame is installed but the VSCode cant find it even though its right there
Same issue
Got some Spritesheets and Animations for those SpriteSheets running in my game engine
Made my first game and used aesprite to help implement sprites into my game. If anyone wants the repo link theres a release
I experienced an interesting bug/feature today:
if you execute pygame.display.set_caption millions of times per second, it will most likely cause Windows WM to hang and the system to become unresponsive
I basically had pygame.display.set_caption in a tight loop and it was causing Windows to hang
it was not fun to debug :)
@pine plinth what game are you making?
not a game, just pygame visualization
@pine plinth visualizing algorithms?
Anyone here have a game idea they want to try out?
Hey folks, I am taking Harvard's CS50 Python rn and for the final project wanted to make something like original mario bros. Which would be the best library to use?
probably pygame+pytmx+pyscroll
@vagrant saddle thanks
if you want help material get on pygame discord this one does not allow for dropping tmx and stuff, which seems a bit weird for a game dev channel
https://pygame-web.github.io/showroom/pygame-scripts/spritefusion.html source code in page
how would I make a basic player following ai in pygame?
@woven glacier what kind of game.
just an "avoid the enemies" game
2d 3d platformer what?
It requires a bit of math.
You have the players position and the enemies position.
You'd get the difference in x and difference in y from the enemy to the player.
alright
So if you had a triangle the components would be the differences.
what do you mean by "components"?
The x and y difference between your play and enemy.
ah
This pair of numbers can be called a vector.
So we have the right direction
Now we need the right magnitude.
Basically the speed which your enemy moves.
If you divide each component of the vector by the length of the vector you will get a vector with a length of one pointing in the same direction.
Are you following?
maybe
one sec
like so?
epdiffX = []
epdiffY = []
def diffupdate():
global epdiff
epdiff.clear()
for i in range(enemies):
epdX = playerX - enemyX[i]
epdiffX.append(epdX)
epdY = playerY - enemyY[i]
epdiffY.append(epdY)
The steps are get the x and y difference between your two entities. Calculate the distance between them. Divide each component by the distance. Then multiply each component by a speed value.
I'm not sure I get the "divide each component by the distance" part
Like how or why
how
You know how to get the distance between two points?
It's very similar to Pythagoras theorem.
ah
One more level to convert to json, phew, what a grind
In short, and both positions need to be Vector2()
Or look up seek behaviors
They can get much more complex
While I suggest working through the long way to understand how it works, the short way is using pygame's Vector2() methods
The Coding Train on youtube has a series, The Nature of Code, recommended even if it's not python
Also Freya Holmer goes deep
is this your game? I love it !!
yes it is, written entirely in python and pygame-ce
Hello everyone I am new here and I am still beginning to use python. I was hoping to get some thoughts from all of you on what simple projects should I start if my end game is to create a game using pygame? Thank you
Game saved, closed, reopened, saved files parsed and portals added to main level leading to saved game
And saving as pickles, too, awesome
I can change that 'Nothing yet' to 'Saved games'
Cool. What info do you save?
Everything
The room layouts, the texts, the objects, rotations, positions, wires in every room, everything
Yeah
I'm sstill working out the methods but pretty much just building a dict of lists and dicts for every item in the game and saving it
This is an example o flevel data as python, it's just one dict. My save_game() method builds a similar dict and saves it as a pickle, the that loaded data is sent to the level init instead of the default data when the game is loaded https://paste.pythondiscord.com/HJBA
Dicts and lists are python types, array kind of objects
Get started on some tutorials, just takes practice
Everything worth doing is kinda hard
That's why you have to keep practicing
It's fine if you don't keep practicing, it gets pretty hard, but you still have to keep trying, looking for better tutorials or whatever
I'm certainly no pro but we all gotta start somewhere
Hello, I just wanted to share a new project that I've been working on this month. It's a Python library for OpenGL context/window management. The purpose of this is to be a lightweight yet a high-level wrapper for GLFW, and hopefully be used in game dev. It's currently in development, but I think I can finish it this weekend.
@unreal river have you made anything in opengl.
yes
@unreal river cool. I made something that allows you to attach shader by name.
It uses gperf.
I'm interested in making games with opengl but I think it's a dead end path because most use a game engine.
yeah, but I found it fun to create games from scratch without using game engines
Currently implementing bindings to GLFW functions in C++
I can show you the code I wrote a lil bit later. I think it's pretty neat.
sure
Filenames parsed to portals, mostly copies of the same file, but it works!
Now I can take Load out of the file menu
Cause all loading will be through those portals
It's cool how level selection are just game objects which you can save and load.
Thanks, I'm really satisfied with how this is coming together, so much effort
17 levels altogether and only 5 of them are default setups, the rest need some setup after populating all the objects, rooms, everything else
So that's why they need to be separate objects, working out the logic to initialize each level otherwise would be a pain
It has six game levels and eleven tutorial levels
So this is a logic gate puzzle game?
Yeah, you have robots with bumpers, thrusters, antenna, and grabbers, and use them to solve puzzles by building circuits inside them using logic gates connected their various devices
Neat
You've fallen into the underground city of Robotropolis and encounter about 30 puzzles of increasing difficulty through six levels
On your way out
It's a remake of an original game named Robot Odyssey from The Learning Company in about 1985
I enjoyed playing human resource machine. Got very close to beating it but it's basically assembly.
Each of the first five levels has a secret which, if all gathered, and clues followed, will lead to the super secret sixth level, previewed in that short vid
I love sercrets
I'll be publishing to github eventually. I don't know how well I've written it or how well it will run on others' machines (mine is just an i5 laptop with a 1650)
And it's not scalable, so those playing with scaled desktops will need to set it to 1080 100%
Well I imagine it will do pretty well. It's a 2d game in python.
I'll be interested in playing it when it's posted.
I have the clock set to 60 fps, it's not a fast action game, but I never see dt go above the 16.7ms it should be
Only the room being shown is being drawn, so nothing is drawn in the background
So it runs pretty tight
Things in other rooms can be animating though, that doesn't draw them
Yeah, the evalutation tick rate is on a timer
So it can be controlled with that slider in the menubar
I use dt but things move based on that timer
It would be cool if you can program a robot and a controller to control it remotely.
Like so
Yeah, you can, using the robot antennas, they can talk to each other
And given the complexity of circuits one can make using those gates, they can me made to do just about anything
The robots of level 1 come pre-wired to complete the tasks of level 1, in the subsequent levels, you're on your own
The chip inside that blue robot was burned in the lab, it consists of about 12 other chips nested inside it, each with circuits in them
The wallhugger chip
I even made a special device for listening to robot antennas, makes it so the antenna only 'hears' the robot that matches its color, so robots can have private conversations
or public
The room shown with all the objects at the start of that video shows all the logic devices and sensors
The test level, the one with everything https://paste.pythondiscord.com/MQ7A
Well, the dict of all the datas
So, if you start a level from the previous level, it will be loading the level data from a json file of a similar dict, but if you start one from a saved game portal, it will load pickle data and start the level with that instead of the json data
This way original levels can't be overwritten by saved levels, they're different filetypes
My brother had a great idea for a puzzle game.
He is really good at scratch. Gonna try and convince him to switch to python or C.
@limber veldt we are going to be making a puzzle game as well
It will have lazers.
Many other things. Just don't want to give it away.
Everyone wants lasers, be sure to share your progress
Tour of the main hub level, the portals to levels 2-6 won't be in the final, only there for debug atm (they work)
I'm thinking if one beats all six levels, it'll expose those portals
There are also a few other little cheats I can implements
Like quick room navigation using shift + arrow keys
Instantly move the player from one room to the next
Spy cam for all levels, one can just view the rooms without moving to them
It's actually a feature of level 4. There is a library computer into which you can drop a disk that grants access to the level's security cameras, necessary for some of that level's puzzles
It also has a pathfinder, so if one wants to, they can just double click on a portal and the player will automove to it (or anywhere on screen, for that matter)
Good morning, playing the gama
can i make games on python
So, I had a few conditions for saving device references, But since all these devices are subclasses of Device(), I gave it a write_ref() method where it writes the default params for itself (name, position, rotation). Then for the devices that need more than those params saved, I gave them an override write_ref() where they call super().write_ref() then append their params to it an return it
No more condition for devices, they take care of themselves
And that's bound to be refactored too, since all devices are subclasses of Item(). So the base write_ref() will likely end up there with overrides in devices
Devices are a subclass of Item() and only devices can be rotated, so base item will just do name and position, device will add rotation and specific devices will append their specific attributes
Is there a particular name for an override method that calls super(), cause it's not really an override, is it?
No reason you can't. If you try and do some massive scale graphically intensive FPS or such you may eventually run into issues, but theres plenty to learn in Python for game dev.
Nifty concept Any way to follow your progress with deving it?
Thanks and not really, other than my frequent ramblings here
So I guess it'd be an extended method?
ET the extra terrestrial?
does this channel care about the language?
?
i was making a joke cause the teleportation system from room to room you have kind of reminds me of the atari 2600 game
Oh yeah, I guess you're right, I should make a little distorted fade effect
btw are you good with pixel art?
im wanting to find someone who wants to make a game with me and is good at pixel art
I suppose you'd need to pitch your game idea to any potential artist, some might be alright with some subjects, others maybe not
So, I don't know what channel would be the right one, if it would be in a help channel or not, but I am trying to make a text adventure game, I figured it would be a great way to learn python. I've been stuck on some of the functions for like 2 weeks. Or at least actually calling to functions is where I'm struggling
What's the issue, you send arguments to functions or methods and they return something...usually
So, basically what I'm trying to do is make a series of menus and then call them as needed to the game, i.e. I want to have the start menu that would ask if the player wants to begin and then have different menus based off of where they are and so on, I know how to make the menus but then I don't know how to actually use them. I am making them with the def function. I apologize for not really understanding it, I am still learning python and have only been working with it for a couple months total
I'm not sure how I'd handle that kind of thing, never thought about making a text adventure game, surely others here have some ideas though
My original one worked really good but as I started learning new functions the old ones kind of got pushed out of my head so now I'm just trying to get back to the basics because it made alot more sense then
Maybe I'd make a bunch of objects that link together and have attributes for the prompt and valid responses, just thinking a little though, still not sure
I guess more of what my problem is that I have one that I had followed and made successfully but now I don't know how to take what I have and make another one but with an entirely different type of content
Or understanding what I made and utilizing it
why not look at https://pypi.org/project/transitions or other computer course about finite state machines first before rushing into making any interface
Thank you so much, I will check it out now!
can i get help with someone familiar with buildozer
@pastel current i don't know exactly how roles work on this discord, but is there somehow a way to announce / assign people recently enlisted as experts for python-emscripten community support ( and remind at the same time that Pygame-ce/Panda3D do web publishing baed on that support 🙂 )
( experimental web publishing of course)
They have this channel as well? Oh!
uhh i’m not too active in this server to know, @light nest should be able to help you with that
Hey, i would love to find someone to start a python game project using pygame. I dont have any ideas of what kind of game it will be so we can plan everything
XD, not this time
I am making puzzle game with lasers.
are you like inviting me to do it with you maybe ooor?
also did a bot just react to my message?!
Sorry no. It's just me and my brother.
ah okay, yeah no problem
Tryna decide if I want to change from 2d lists defining my room grids to some kind of data objects with .x, .y, .image attributes, maybe more, like pytmx
The parsing would be a lot easier with objects
Maybe I implement it in a test level and see what happens
Just as a test, I did this, both methods essentially do the same thing (except the top one doesn't handle the Switch() at all) https://paste.pythondiscord.com/GSJQ
Also, the top method doesn't populate the .room_array or .layout, both referenced in collision and some animations. So making that work for everything is probably not worth the hassle
In the populate_room() method, I if val == all the values in the 2d list and instance tiles based on those conditions. If that method was to work for all tiles in all levels, it would need maybe 150 conditions
So I'm just exploring other ideas for handling populate_room()
Is there a library or a game engine to develop 3d games in python?!?
try Panda3D or Ursina
Ive tried ursina
Where do we get models and their texture packs
I suck at blender
you can create them or download online... I don't really use ursina but there are great tutorials out there
So u use panda3d?
I use neither tbh, I am not into 3D games
Okayy thankss
panda3d or ursina and then use pygame for controle a vector couldbe like that....i never try 3d becouse i dont understand a render using. and its so complicate to me, i just start doing on 2d righ now
Okayy thankss
yea , hope your project going well
you mean a game ? what is soft aim for ?
ohk so you was design it, iam not suggest you to using 3D becouse it will alot understanding. but if you like 3d you can going with 3d game engine, there was new option like UPBGE, it was 3d game engine.
i never try discord game bot, but it good option for
create game based for newbie
yea sure u can...
just follow on, simple tutorial game for pygame
Follow the basic Ursina tutorials / samples: https://www.ursinaengine.org/entity_basics.html
Panda3D also has great documentation: https://docs.panda3d.org/1.10/python/introduction/tutorial/index
Okayyy
Hey, just a quick update regarding the Python library I've been working on. I have refined the purpose to be a library incorporating OpenGL, OpenAL, GLAD, and GLFW with some other features typically for game development
Gj
Now integrate FusionGL 💀💀💀
Any cubers here? I love the feel of the F perm, it just flows so smoothly
@limber veldt cubers? F perm?
Rubik's, and one of the algorithms
Anything related to developing games
Nahhh, the beginner method is the goat.
Yup
Been working on a chip 8 emulator and debugger. It got added to the official showcase of DearPyGui as well. It is still a work in progress, gonna add few more features to help it stand out from countless other chip 8 emulators
J perm it is for me
but M + U moves from roux or algs like H or Z feels super satisfying too
I tried practicing Ja as an inverted Jb, doesn't quite feel as good, at least to me, but you right, Jb and T feel really smooth too
On game updates, I'm working out a new data format for my game that will better handle items with internal rooms, it's slow going but I think it'll work better
Instead of defining those internal rooms separately from 'regular' rooms, I'm parsing all items into a list and saving indices into that list if an item has an internal room
So all rooms will be handled the same
Internal or not
me
but not a speedcuber
I like solving different cubes rather than speed
The floor is yours, mini mod...oh wait, you have nothing game related to add...sorry
so what is panda3d like 3d rendering engine or what
i am but not that good
it's a game engine for 3D games, simulations, etc. anything 3D
also usefull for applying shaders to 2D games but a bit overkill for just doing that of course, sidenote can export to web like pygame-ce
What is the good way to make game in kivy? Is using standard game loop (init, update)? which seems like not goes well in kivy.
Is KivEnt still use for game dev?
Managing Multiple Scenes in Pygame
I have just published a new video on YouTube that shows a solution to a common problem facing pygame developers. I often see questions here about how to implement a program with multiple scenes (where the layout and user interface is very different from any other).
The video shows how to use a package that I've built called "pyghelpers" to do this. The basic idea is that the package contains a "Scene Manager" that runs the standard pygame main loop, and each scene that you want to have has to be built as a class (OOP). Each scene must have a few methods with predefined names that the Scene Manager calls each time through the main loop - but you can make your scenes as simple or complicated as you wish. Switching scenes is done with a single line of code.
The video shows how to install the pyghelpers package. The code of the pyghelpers package (and my pygwidgets package) are freely downloadable from GitHub. The description below the video has links to the sample code used in the video and more.
The video can be found here: https://youtu.be/Z_Y1aBwbmrY
I hope you find it helpful.
This is a video on how you can use object-oriented programming
to build a Python program with multiple scenes in pygame.
Links to relevent material mentioned in the video:
How to install pyghelpers and pygwidgets:
>python3 -m pip install -U pip --user
>python3 -m pip install -U pyghelpers --user
>python3 -m pip install -U pygh...
interesting..
interesting..
Isometria Devlog 40 - Beach Biome, World Gen, New Items, Better Load Times! https://youtu.be/9ORi6miB_wY Written in python using pygame-ce
Wishlist and play the Isometria demo here: https://store.steampowered.com/app/2596940/Isometria
https://bigwhoopgames.itch.io/isometria-demo
In this week's dev log I give you the first look at the beach biome. I will also discuss the current iteration of world generation. The new clay grenade is introduced. Game load times have also been reduc...
wow that looks amazing
Should i use panda3d for a 3d game or another library? I'm planning on creating a game for my project at school.
if you want to go 3D I would probably recommend godot, I have not used 3D in python so I'm not the person to ask
godot has python implementation right?
check on youtube for 3D python stuff, you'll get a better understanding of what you should look into
thanks you too
Godot is really close to python, but not quite the same
Amazing, waiting for the tutorial, lol
which tutorial did you want?
Just how to do that whole game
Clear has another tut on the way, looking forward to it
the whole game? It would take me months to put that together
I would consider doing a "long form" tutorial but probably not the whole game
Yeah, I was just teasing, been watching your devlogs all along, it's massive
I will consider doing an isometric long form devlog in the future
but it would take some time to make and I have to concentrate on completing the game first
Godot uses its own scripting language. You can use c and therefore any language but most documentation is in Godot scripting language.
looks good
Playing with pathfinder
which algorithm do you use?
I doesn't look like a djisktra one
okk
Less random grid
What are you using for the GUI here? Pygame?
is there a reason why the animations dont work?https://paste.pythondiscord.com/QC4A
it only renders one animation frame from the 4 i have
yes
More density
This is a fantastic article, btw https://www.redblobgames.com/pathfinding/a-star/introduction.html
Is python a good language for game development
I heard that python is not the right language for making games
I have this question too
good enough for small games
you wouldnt use it in industry i dont think
unity or unreal are much more extensive and responsive
if you google it apparently some games are “in python” whatever that means - they could be referring to backend but who knows
my guess is its good enough for 90% of the small games a singular dev would make - maybe nps though
Python has been used quite a bit in the industry. Usually as a scripting language. Even pygame is only a python layer of course.
You would leave the heavy work to C/C++
Disney used it for the Panda3D engine, there is the Ren'Py engine for visual novels, Eve Online used stackless python for a lot of the game code
Games encompass a lot of things. For some of them using a python framework makes sense.
Others can benefit from it as a glue or scripting language and then there are projects where it's actually the wrong choice.
Anyone have a good idea for a game to make with just python text (no python graphics). Also pip install doesn't work for my device (if that matters)
Yeah it's fine. Look at DaFluffyPotato's works for example
You could make Higher or Lower. How does pip fail to install packages?
They look clean.. Is he using Pygame?
Yep and maybe Godot for a few
This dev is more comfortable using PyGame than anything since he started with it
I'd say the biggest limitation in python game dev is the dev's skill, next is the speed but that can be worked around too
Amazing.
Yep, python might be slow but you can * boost * sometimes with threading/etc.
Look at BigWhoop, ClearCode, Fluffy, among others, they all get awesome results
Speaking of Clear, he just dropped another loooong tutorial, I've already started watching it
And of course, I don't mean the next CoD kind of games, AAA games are well beyond the skill levels of most anyway, but pygame and a few other libraries are plenty capable of making good games
If one wishes to start game development, is it the most privileged choice in their range to start on Python or C languages?
A further question of mine I present, could the art of game development be entangled with software development? Could I learn one and master the other with just additional in-sights?
If one wishes to start game development, is it the most privileged choice in their range to start on Python or C languages?
Neither Python nor C are common in game development - common choices are C# and C++. There's a long road from learning programming to being able to make games, though, and Python is a good first language.
A further question of mine I present, could the art of game development be entangled with software development? Could I learn one and master the other with just additional in-sights?
I don't think so. You can make good games without knowing anything about software development (e.g. board games are a thing, after all), or be a professional software engineer and yet know nothing about how to design games.