#game-development
1 messages Β· Page 50 of 1
I think whatever you start out using will teach you things that will translate to other libraries / languages / engines.
hey @potent ice, im running into a format error with this:
self.sphere.buffer(self.buffer1, '3f8/i 3f8/i 3f8/i 1f8/i', ['planet_pos', 'planet_velocity', 'planet_force', 'planet_mass'])```
i think i've got the format string wrong
you just need to pass in the position don't you?
yeah but i dont use any of the other ones so dont they get optimized away anyways?
this way if i ever want to use the force/velocity to do some coloring i can
Nah you got to map the attributes right. It only works for subsets if attributes, but they must exist
and I think the format string should end in /i only
what does this mean:
It only works for subsets if attributes
wait. I think you are right π
the error i get is:
moderngl.error.Error: content[1][1] is an invalid format
from the render call
self.sphere.render(self.render_program, instances=self.N)
'3f8 3f8 3f8 1f8/i'?
ah just at the end?
well atleast that part works now. bunch of other stuff doesnt!
hm
doesnt look like a sphere to me
#if defined VERTEX_SHADER
in vec3 in_position;
in dvec3 planet_pos;
uniform mat4 m_projection;
uniform mat4 m_camera;
void main(){
gl_Position = m_projection * m_camera * vec4(in_position + vec3(planet_pos), 1.);
}```
oh well. i have a class to go to! ill try fix it later
ah
for just one planet it works
two or more seems to break it haha
Probably wrong offset!
Made an example for particle emitting in moderngl (upcoming 5.6 release that is). Method 1 steams the full buffer from python into gpu mem every frame. Method 2 only streams a smaller emit buffer every frame. Method 3 is emitting particles on the gpu. Each method are orders or magnitude faster than the previous one. I can maintain a particle system with 10M particles at 100fps in 3440 x 1440 using the last method. Particles die when leaving the screen and are emitted from the mouse position. https://github.com/moderngl/moderngl/blob/master/examples/particle_system_emit.py
It's just a huge mush of pixels. A lot more interesting realtime.. but I think trying to make gif anim of that is not possible
Make a mp4
You can steal the convert_to_gif file from my github. It lets you convert a folder of images to a mp4/gif
I have been following this guy for months, he is working on a game and the result is very great, he worked - on his own - very hard on the mechanics and of course all other aspects of the game, it deserves attention, also if anyone has experience that might help him please comment on his videos.
https://youtu.be/HwcQ5QTyDQ0
Using python api in unreal engine?
hello
Hi there!
hmm @potent ice really dont know what i could be doing wrong here:
self.sphere = sphere(radius=.001)
self.sphere.buffer(self.buffer1, '3f8 3f8 3f8 1f8/i', ['planet_pos', 'planet_velocity', 'planet_force', 'planet_mass'])
...
self.sphere.render(self.render_program, instances=self.N)```
#version 430
#if defined VERTEX_SHADER
in vec3 in_position;
in dvec3 planet_pos;
uniform mat4 m_projection;
uniform mat4 m_camera;
void main(){
gl_Position = m_projection * m_camera * vec4(in_position + vec3(planet_pos), 1.);
}
#endif```
just doesnt work somehow hah
code in repo?
ok ive tried to add balls to my compute shader example and i also pushed the code
@potent ice its as simple as it gets but it doesnt work π¦
Looking at it. Might be a bug!
ok, so, i need help big time with how to make colision with lets say platforms
What libraries are you currently using?
pygame
Here is an example from pygame site : https://www.pygame.org/project-Rect+Collision+Response-1061-.html
thats not really helping me too much
well, then maybe ask a more specific questionΒ π
first i need to make a rect over a sprite i have, and make it so that when i jump up into it it pushes me away, and if i jump onto it it keeps me ontop of it
well, it's usually a bit more complex than that, as you'll have lateral collisions, as well, and sometime your sprite will only partially standing on the block, etc, in my game the solution was to have something like 8 collision points around the character (like a very low precision ellipse), and test them all against the various rectangles, and depending on which collided, i would push the character in the opposite direction until it didn't collide anymore, and motions were directed by vectors, one for gravity always applied in the direction of the ground, and user input would just add acceleration to the character, that would be then reduced by opposing forces like friction with the ground and air, etc
ok im having dificulty with that, i cant make my player fall at all, like im trying to make their y be y - vel and i have them defined but it keeps saying i cant do that
anyone here able to join a call and i can share what im trying to do rather than try and explain it
That is a lot to ask for. Try to break down the problem into smaller parts?
@thick niche you might want to watch videos #2 and #3 plus the physics video here:
https://m.youtube.com/playlist?list=PLX5fBCkxJmm1fPSqgn9gyR3qih8yYLvMj
Arcade 2.2.4 is out. Main improvement is a 20% efficiency improvement in the time to move, rotate, scale, color a sprite through the use of array.array instead of numpy.
Numpy may be removed as a dependency in the future.
what would replace it? inbuilt c implementation?
Arcade used/uses numpy to create a block of native values (like float, double, int) as a block of memory to send to the GPU. I updated the sprite code to use Python's array class and that sped things up.
I'm hoping I can speed up the non-sprite drawing commands too. Those are pretty slow.
Coincidently there is a real python article https://realpython.com/arcade-python-game-framework/
A pretty cool one
Agreed. Not only is the article well-written, I think their artwork is pretty cool as well.
It's also super-nice when someone other than the library creator makes guides π
No kidding.
Today I was able to speed drawing primitives 71%, except I have one unit test that throws an OpenGL error. Not when I run the unit test individually, but only when I run all the unit tests together. And only on Linux. That's going to be fun to chase down.
Not sure what you mean, but the dynamic ones I'm guessing. Specifically the if statement on line 445 will cache the shader so I only create one per program run, rather than each time I draw an item:
hmm. I am surprised that array.array() is twice as fast when building a list first compared to using a generator. It's even slightly faster than np.fromiter with a generator.
list 5.291297500000001
generator 11.442588
np.fromiter 6.746506999999998
and it's on par with struck.pack. Maybe even a tad faster.
@potent ice maybe you can explain why this is happening.
so i add this buffer to my sphere VAO:
self.ball.buffer(self.buffer1, '4f 4f 4f/i', ['ball_position', 'ball_velocity', 'ball_color'])
and then in the shader if i just set the color to a fixed color it bugs out
but if i set the color differently for every ball it works fine...
#version 430
#if defined VERTEX_SHADER
in vec3 in_position;
in vec4 ball_position;
in vec4 ball_velocity;
uniform mat4 m_projection;
uniform mat4 m_camera;
out vec4 color;
void main(){
color = vec4(1,0,0,1);
gl_Position = m_projection * m_camera * vec4(in_position + ball_position.xyz, 1.);
}
#elif defined FRAGMENT_SHADER
out vec4 fragColor;
in vec4 color;
void main() {
fragColor = color;
}
#endif
that breaks
It's a bug. My bug π¦
but if i add in vec4 ball_color;
and color = ball_color; it works
do you know what causes the bug?
Yeah it's a bug in the VAO wrapper not calculating the right padding and stride for the buffer.
If you use all the attributes it will work.
oh well. Pure luck then? π
ok awesome!
You can also build your own VertexArray manually to solve it. It's just the VAO that doesn't handle it well
The VAO is getting very complicated π
It definitely makes life easier. Might even move it into moderngl core soon
oooohh!
hm, im kind of suprised that i cant have 500k balls bouncing around the scene at 60 fps..
it goes down to 9fps
500k spheres instanced?
yeah
dont really know if the instanced rendering or the compute shader is tanking performance
How do you create the sphere?
self.ball = sphere(radius=.01)
ah probably dont need that a that high res sphere
probably like 8 sectors and 4 rings is enough
or 4 each
hahahah yup
60 fps π
yay π
1mil still 60 fps!
but now generating the arrays takes for ever..
wow 10mil at 16 fps!
but it took like 2 min to generate the initial conditions
Try specifying dtype when creating the np arrays instead of using astype() after
ok let me try that
i just tried to time my function to create the data
haha
pycharm has stopped responding
4GB or ram already hehe
Often it's actually faster to use generators and consume the data with np.fromiter.
I wrote something about this after profiling a couple of years ago in the project moderngl-window is based on : https://demosys-py.readthedocs.io/en/latest/user_guide/geometry.html#generating-custom-geometry
Very often method 3 in that article is faster than doing fancy stuff with numpy. It's even more readable for most people.
And you minimize the amount of memory allocated.
so should i use random.random in the generator?
so to generate 2 vec4 with random x,y,z values and 1 as the w value i would do this?
def gen(N):
for _ in range(N):
yield random.random()
yield random.random()
yield random.random()
yield 1.
yield random.random()
yield random.random()
yield random.random()
yield 1.```
its a lot slower
really?
Don't run in debug mode
hm?
You mean the random methods or generating the data?
generating the data
havent tested the random methods
my numpy solution:
%timeit generate_data(10_000_000) 2.15 s Β± 96 ms per loop (mean Β± std. dev. of 7 runs, 1 loop each)
using fromiter:
%timeit np.fromiter(gen(10_000_000), count=10_000_000 * 8, dtype=np.float32) 11.3 s Β± 304 ms per loop (mean Β± std. dev. of 7 runs, 1 loop each)
np.random just getting called once is 4.5x slower than random.random
%timeit np.random.random()
450 ns Β± 12.6 ns per loop (mean Β± std. dev. of 7 runs, 1000000 loops each)
%timeit random.random()
99 ns Β± 5.58 ns per loop (mean Β± std. dev. of 7 runs, 10000000 loops each)```
... but is the entire initialisation slower in practice using generators?
ok. I guess random is the the problem.
yeah
but numpy is slower for single calls so you cant just replace it with np
but it probably doesnt matter too much for smaller data sizes
You could pre-generate an np array with random values and yield those
doesnt cuda have something for generating random numbers?
You can use transform feedback to generate the initial buffer with a vertex shader
hmm good idea
ah slight problem
i moved the color to a different buffer
now it all breaks because im not using the velocity part
but i dont need the velocity, can i tell the compiler to not optimize it away?
Just pad it
how?
hmm. Do it with VertexArray.
ah ok
@fierce wraith Are you using the compute shader to move the balls?
yup π
and to bounce them off the walls of a box they are in
i would show you, but i just broke it haha
I'd love to see it when you un-break it.
@fierce wraith Quick example : https://github.com/moderngl/moderngl/blob/master/examples/transform_feedback_gen_buffer.py
thanks!!
I don't think it can be any simpler. There are plenty of resources out there doing gpu noise. Don't use the built in glsl noise functions. They are not implemented by most vendors.
yeah
Maybe not super-important to optimize the initialization, but playing with this technique is very useful
I haven't had time to play with empty vao-rendering. You can do a lot of amazing stuff like voxel rendering.
@frozen knoll un-broke!
Oooh, very cool. I've got to learn how to do that.
thats just 256 balls, but i can go up to 10mil at 60 fps π
but it looks kinda boring then:
Thats....a lot.
@potent ice turns out what I had broke, was switching from vec4 to vec3. Apparently they dont pad correctly either.... now its a bunch of floats haha
aha
You only need to pad between each struct entry (aligned with the biggest datatype in the struct), so it's not that horrible. Still when dealing with this much data.. packing it tight with floats is probably a good idea.
@fierce wraith did you push the changes?
NOPE π
Nope
At the doctor now
@potent ice its just two vec3
Thats it
Till breaks
Still
I wonder if 32 byte aligned vertex data is still a good thing to do, or if tighter packing is preferred now-a-days. I know AMD cards really liked 32byte aligned vertex data, but that advice was probably from before GCN. It might have even been advice for ATI cards =/
For vertex data I don't really know how it work today. I know some Intel and amd integrated don't like 3-component float32 textures. That's the only thing I've stumbled over.
I'm pretty sure alignment still matters to some degree, but considering how insanely powerful gpus are today.. I have never really needed to profile it.
Alignment can matter for buffer streaming. That's the only case I've looked at.
.. but the biggest bottlenecks when rendering with python is python itself π
(That applies to any higher level language)
Still, there are many clever tricks to render things with near C performance
@potent ice puuuuusssshhhheeeedd!
nice. You need to make a ball1 and ball2 to make it render smooth
Now it only updates every second frame
because buffer1 is only the target buffer every second frame.
and ball2 has buffer2?
y
I guess every frame end up with data in ball2, so that's the one you render
Swap around ball vaos in the end self.ball1, self.ball2 = self.ball2, self.ball1
yeah
hmm. how do i create a function that tells me how many rings/sectors the spheres should have based on their size?
are the balls big enough for that to matter?
yeah if i have N down below 500
You should add simple lighting to these spheres. Otherwise they might as well be points or quads rendered with frag shader.
nice hack in balls.glsl btw π
to use the velocity? yeah hahaah
Makes them look like balls ```glsl
#version 430
#if defined VERTEX_SHADER
in vec3 in_position;
in vec3 in_normal;
in vec3 ball_position;
in vec3 ball_velocity;
in vec4 ball_color;
uniform mat4 m_projection;
uniform mat4 m_camera;
out vec4 color;
out vec3 vel;
out vec3 pos;
out vec3 normal;
void main(){
color = ball_color;
vel = ball_velocity;
vec4 p = m_camera * vec4(in_position + ball_position, 1.);
gl_Position = m_projection * p;
pos = p.xyz;
normal = inverse(transpose(mat3(m_camera))) * in_normal;
}
#elif defined FRAGMENT_SHADER
out vec4 fragColor;
in vec4 color;
in vec3 vel;
in vec3 pos;
in vec3 normal;
void main() {
float l = dot(normalize(-pos), normalize(normal));
float _ = length(vel);
fragColor = color * _ / _ * l;
}
#endif
thanks!
Might be a bit more heavy, but you'll see
ok pushed the dynamic rescaling/resolution π
Nice. The new shader will work great when N is low
But not when N is high
fragColor = color * _ / _ * (l + 0.25) needed to add some ambient
oh wow those look nice!
i have quite a few constants now to play with, should i create a config file?
nah its fine
haha
yeah. python is the config file π
wow
im gonna push something real quick
just let it run for a few min
ok pushed
hm maybe its just a optical illusion or sniping tool makes too low res screenshots
you can kinda see it here
you can kinda see the border of the cube thru the cube
You have blending enabled for some reason
Is that is intended, at least add self.ctx.enable(moderngl.BLEND | moderngl.CULL_FACE)
wasnt really intended hah
so the gpu don't have to deal with back faces
self.ctx.enable(moderngl.DEPTH_TEST | moderngl.CULL_FACE) is probably even faster
oh wow that looks completely different
dont know what i like more haha
with blending enabled you could kinda see the density of the balls
whatever looks better. culling is a minimum
i have question about uploading to app store
so when i try to upload it says that i need to pay 25$
but my credit card uses another currency
will i still be able to make the transaction
Should be no problem with that as far as I know. There will probably be a currency conversion somewhere down the line.
thanks alot man
Ok, just found this problem before going to bed. While I'm updating the position of my sprites, I'm not updating the angle. A quick test:
hm ok?
Oh, nvm. Just had to post the question to find the answer.
Need to get a stuffed animal to explain the problem to first I guess.
Need some help related to Pygame, I am trying to place a sprite into our code but I am having trouble doing so, can anyone help? I'm using a template as well. Here's the code, and I will show what parts I want to try and replace with a sprite.
Heres my code:
And this is what prints out. I want to replace the rectangle with a sprite of my choice. How would I go about doing that?
hey @potent ice how would i go about reducing the python overhead?
like what are some easy to implement tricks
Discord has support for Markdown, which allows you to post code with full syntax highlighting. Please use these whenever you paste code, as this helps improve the legibility and makes it easier for us to help you.
To do this, use the following method:
```python
print('Hello world!')
```
Note:
β’ These are backticks, not quotes. Backticks can usually be found on the tilde key.
β’ You can also use py as the language instead of python
β’ The language must be on the first line next to the backticks with no space between them
This will result in the following:
print('Hello world!')
alrighty
That image is very hard to read! π
yeah sorry haha
And please state what library you are using etc.
import pygame
import random
import os
WIDTH = 360
HEIGHT = 480
FPS = 30
# define colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
# initialize pygame and create window
pygame.init()
pygame.mixer.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("My Game")
clock = pygame.time.Clock()
all_sprites = pygame.sprite.Group()
class Bullet(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.Surface((50, 50))
self.image.fill(GREEN)
self.rect = self.image.get_rect()
self.rect.center = (0, 0)
def update(self):
self.rect.x += 3
self.rect.y += 1
if self.rect.left > WIDTH:
self.rect.right = 0
if self.rect.top > HEIGHT:
self.rect.bottom = 0
for i in range(10):
first_bullet = Bullet()
all_sprites.add(first_bullet)
# Game loop
running = True
while running:
clock.tick(FPS)
# Process input (events)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
# Update
all_sprites.update()
# Draw / render
screen.fill(BLACK)
all_sprites.draw(screen)
# *after* drawing everything, flip the display
pygame.display.flip()
pygame.quit()```
yeah ill try
pygame?
Not completely understanding what the problem is
itβs not a problem really itβs just like
i explained above
I want to replace the rectangle there with like a sprite or image
ah
yeah
Pygame have a lot of resources. Examples in the git repo and lots of tutorials on their site
so you can always learn by looking around there
@fierce wraith That entirely depends on the code. I guess the normal culprit is memory allocations.
For the visualization stuff I don't there there are much to optimize
Other than using better algorithms on the cpu and gpu
i think the part taking up the most time is actually calling the render function in python
not the compute shader being executed
What code are you talking about?
@manic quartz I have a lot of PyGame examples with sprites here: http://programarcadegames.com/index.php?chapter=example_code
You are calculating the camera matrix every frame. You don't ever move the camera, so it can go in init
n body or compute shader?
compute
hm i rotate it
Other than that it should already be near C performance
oh ignore me there. What you have is already perfect
haha
ok, in the nbody sim i dont need to actually render the result every frame, i only need to execute the compute shader
can i somehow execute the compute shader a couple times without using python to loop?
You can make your compute shader do multiple steps?
not really, because i split it into too compute shaders
i have to once calculate all the updated forces and then apply them
yeah but i want moooore speeeeed! hah
it runs at like 2.5kfps
but i dont actually need to update the screen that many times, i just need to do the calculation
I don't know. Start with crack or something or optimize the shaders π
hahaa
Or do the same in python to compare speed.
haha yeah compared to python its waaayy faster
I'm sure you could study glsl optimzing as well. I knew that well 10 years ago, but times have changed. I don't think it's worth it unless you are REALLY interested or actually need the speed for some real world problems.
hm no dont really need speed that much
Better to focus on algorithms. Getting the good old quad tree working in compute shaders should be awesome for example.
I don't think it's that hard, but there might be easier methods as well
Most common pitfalls is using astype() and tobytes() on np arrays in render code
and doing way to much matrix math on the python side
uniform.write(matrix.astype('f4').tobytes()) is terrible π
If your np array is already an f4 you can pass it directly because it supports the buffer protocil. uniform.write(matrix) done
so instead of converting then using them, np has dtype parameter in create methods normally
Same with pyrr. ```python
Matrix44.identity(dtype='f4')
matrix44.create_identity(dtype='f4')
... etc
Also Matrix44 is 5x slower than matrix44
yikes
yeah
have you fixed the VAO bug with instanced rendering?
and can i pull that somewhere? hehe
Not yet. It needs some planning or that whole class will have a meltdown
Yeah use plain moderngl.VertexArray or make sure you use all the attributes I guess?
i really dont need any for the display, im only using them in the compute shader
but if i used a vertex array i would have to build the sphere myself right?
yeah
vao.get_buffer_by_name('in_position').buffer I think, because that method returns a BufferInfo object
Then slap that into the content parameter with format and attrib name(s)... then add your instanced buffer.
I have a laundry list if things to fix in that VAO class like support for replacing buffers. Then it would destroy all the internal vertex arrays so you start from scratch
And VAO.merge is also nice
Merge together lots of VAOs so you can batch render many objects
Works great for static things when you can't use instancing
well i got this far:
self.ball = self.ctx.vertex_array(self.render_program,
[
(my_sphere.get_buffer_by_name('in_position').buffer, '3f', 'in_position'),
(self.buffer1, '3f8 3f8 3f8 1f8/i', 'planet_pos', 'planet_velocity', 'planet_force', 'planet_mass'),
(self.color_buffer, '4f/i', 'in_color')
])
@potent ice what does this mean:
moderngl.error.Error: content[1][3] must be an attribute not NoneType?
its complaining about the color buffer part
i think
oh does a vertex_array not drop unused attr?
It does not
urgh
can i somehow bind the buffer containing position, velocity, force and mass to a shader even though im only using the pos
ah
something like 3x8 for a dvec3?
it works!
but i need to steal the index buffer from the vao aswell haha
@potent ice whats the buffer name for the index_buffer? is it just index_buffer?
yes, doesn't show up in auto complete? π
no, i mean the get_buffer_by_name thing
what name do i give it to steal the index buffer
oh. hmm yeah. _index_buffer should work.
returns none π¦
It's the sphere?
It doesn't have index buffer. Passing None is fine as well
sphere._index_buffer is a VAO, does it just have one buffer?
yes. only one index buffer
what is its name?
sphere._index_buffer
ah yeah ofc
It's not pretty, I know
but _index_buffer is a VAO not a buffer
sphere._index_buffer.index_buffer?
nvm pycharm is just messing with me
yaaay works!
Yeah it should be a moderngl.Buffer π
nice!
The shitty part with the basic VertexArray is that its tied to a program.
i wonder why pycharm thinks its a VAO..
dont you mean that it is tied to a program?
and thats fine for me, im only ever gonna use it with one program haha
hahah
I have one minor knitpick. Not all your entrypoints are called main.py.
yeah i tried to rename them to the folder names so i dont get confused as to what im executing
ahh
but i just havent done so with the newer projects haha. i always wait until everything is unreadable and then i go through and start reformatting...
well. If you run them from the root, it should be easy to separate them?
oh. lol
yeah I end up just rightclicking the file and selecting run because i forget what main (5) is haha
do i need to do some fancy uv unwrapping to fit a planet texture onto the sphere?
@potent ice whats the buffer that stores the uvs called? in_texcoord_0 or uv or in_uv?
You can pass in your own variant in geometry methods if needed
whats textcoord1?
for a second layer of textures. It's based on the gltf standard
You could have a in_texcoord_15 if you wanted I guess
haha
There you go. Make shaders unreadable π ```python
class MyAttrNames(AttributeNames):
POISTION = 'bob'
NORMAL = 'harry'
TEXCOORD_0 = 'lucy'
geometry.sphere(attr_names=MyAttrNames)
in vec3 bob; // position
in vec3 harry; // normal
in vec2 lucy; // uv
haha looks good to me!
There's of course a drawback with fixed standard attributes, but I think the benefits outweighs the disadvantages.
would you suggest a texture array to store the different planets textures? @potent ice
what are the drawbacks for fixed standard attributes?
yeah because you can't change texture binding during a render call
But you can use the gl_InstanceID to fetch from a different layer
That's how you draw different tiles in 2d tilemaps as well in one draw call
Each tile contains a material_id in the vertex data specifying what layer to fetch from.
Same with a minecraft type chunk of cubes
If you want to keep it simple just stack 9 256x256 planet textures vertically in a png and load it as a texture array
Not really game related, but I have a script that scans my files and produces a quick-index of available commands.
Kind of like it.
I wish there was a way to make something like this easier to read:
For new programmers, that is very hard to figure out. Heck, for me that's hard to figure out and I wrote it.
it would be easier of you somehow split it between lines and on each line added a comment about which does what?
I've written the Game of Life in Kivy. But updates are fairly slow (~1s per update) . My implementation of the logic is fairly slow, creating a new grid each time. Is the thing thats slowing it down likely to be my rubbish logic, the unnecessary setting of RGB values, or is Kivy just not gonna like updating 200x200 cells each update?
class Cell(Widget):
r, g, b, a = NumericProperty(1), NumericProperty(0), NumericProperty(0), NumericProperty(0)
class PongGame(Widget):
w, h = 200, 200
life = Life(w, h) # Where I implement GOL poorly
cells = []
def start(self):
for i in range(self.w):
r = []
self.cells.append(r)
for j in range(self.h):
w = Cell(pos=(i * 5, j * 5))
self.add_widget(w) # Don't know if this is the right way to add widgets, but I had a lot of problems trying to get it to work, so just went for this dumb double for loop way
r.append(w)
def render(self, _):
self.life.update()
for i in range(self.w):
for j in range(self.h):
# Setting this each time isn't necessary
# But I don't think it should affect performance
if self.life.current_state[i][j]:
self.cells[i][j].r = 1
else:
if self.life.has_been_alive[i][j]:
self.cells[i][j].r = 0.1
else:
self.cells[i][j].r = 0
class LifeApp(App):
def build(self):
game = PongGame()
game.start()
Clock.schedule_interval(game.render, 0.1 / 60.0)
return game
if __name__ == '__main__':
LifeApp().run()
Sorry if this isn't the right place to ask
I don't do Kivy, but recreating 200 x 200 = 40,000 each time is going to take a while.
If I were advising how to do it in Arcade, I'd generate 40,000 sprites. Then flip the color or texture on the sprites you want to change. Then you are just changing the color, and not resending to the graphics card all that data.
Someone did something similar not long ago. They posted it in #303934982764625920
I think what I am doing is just changing the colour based on the current state, rather than re rendering an entire widget - but I do it for every widget irregardless of whether the state has changed
and I'll check it out, thanks Einarf
Closest thing I can find is from salt-die doing it with numpy, and his version of the logic is probably infinitely faster than mine - I just want to understand where the slowness is coming from, whether bad graphics implementation, bad logic implementation, or just inherent slowness
Well, at the moment I'm generating and throwing away a 200x200 list each time, so I'd guess just switching to not doing that would be enough to give me a big speed up in terms of logic. I'll do that and see how much of a difference it makes
He's updating a texture instead
Just feeding it with new pixels every frame
Then using nearest interpolation to make sure it scales up pixelated
I think this example is still relevant.
Or go crazy and use gles2 shader π https://discordapp.com/channels/267624335836053506/303934982764625920/666709809021845514
Godammit, salt-die's stuff is so cool, and so far out of my league at the moment
Or reduce the resolution
although I think I can learn from his maze stuff at least
I only just noticed that I forgot to change the name of my app away from PongGame - hah
I was going through the same tutorial. Totally did not notice π
got basic shader working at least
Slime Wars
I've had students want to do space invaders before, but don't know how to get sprites to move in a group. Making an example show that, and how to do shields.
Oh, and get only the bottom row of enemies to fire bullets
@potent ice will compute shaders support uniform vars at some point? or is that a opengl problem not a moderngl issue
I don't know about ModernGL, but compute shaders are no different than other shaders with regards to uniform vars.
In Panda3D you can certainly have uniform vars with compute shaders.
@fierce wraith It should support uniforms like any other shader.
Uniforms and uniform blocks
and I guess even subroutines
oh even though it has its own class?
just wondering because i had to implement my own loader, so i thought it probably wouldnt have uniforms
iirc i didnt see anything about uniforms in the computeshader class, but i might have just missed it
Yup. They are merged in 6.0. The loader was just missing from moderngl-window, but it's in 2.1 (unreleased)
That's going to take a while. 5.6 will get a lot of new stuff.
I think 6 could possibly be next year. 5.x has a lot more to give.
Think if 5.6 as the first transition version towards 6
ah
5.6 will have most of the stuff in 6.0
The main difference in 6 is that we remove the python wrappers over the objects created in C++
That bypasses a function call per instruction
oh wow, wont that make it a lot faster?
It will be faster at least
ill take it haha
Main focus is brining 5.x up to speed moving to towards 6.0 and improve docs and tutorials
Especially the last part.
Yay for docs.
A new user shouldn't necessarily need to know opengl to start using moderngl.
Right now that is not really the case. moderngl makes opengl easier to reason with, but you still need to know some opengl to use it. That needs to change.
@fierce wraith If you have any input on doc improvements, please poke me and I will add to list
or anyone..
will do!
or make issue on github
Some intro like this is great for example : https://www.labri.fr/perso/nrougier/python-opengl/
An open-source book about Python and OpenGL for Scientific Visualization based on experience, practice and descriptive examples
Really well done.
except that they use the old attribute instead of in because they are using #version 120 shaders.
Question, I have this little alien ship that moves around in my Pygame window, and it only moves when I move the left and right arrow button, which is what it's supposed to do. For it to move, I have to move my mouse just slightly then all the movement takes place. It's like it's waiting for my mouse to move just a little for the movements to all take place. Is their some way around this because I have no idea why it's doing that.
How do you process the input events?
That's usually where the problem is
oh my god. wasted 30 minutes on kivy render example because my attribute names was strings, not bytes
I fixed it @potent ice , thanks for the help though!
@slow cloak Care to share when the problem was? π
I think it was input events, I just moved the if statements up, and that solved it.
Yep it processes all event from the same queue, so it's easy to mess up the conditions
Yah
I would recommend adding some prints if you get in trouble
Ok, thanks for the help!
No problem
Actually @potent ice while I have you here, do you know if it's possible to create multiple circles, and all have them falling? I made an Alien Ship and when he fires I can't get all of the circles to keep moving down at once, and I was curious if there was a way.
I know with rects you can do something like rect.center_y or something like that, but I don't know if it's possible with circles
No idea. I've just used pygame.draw.circle π
I'm not well versed on sprites and whatnot in pygame, but I do know the windowing and event system well
Hmnm ok
There could possibly be some examples out there. Pygame does have a lot
Need to learn more about that myself. Think I need to make a simple game soon
@potent ice are you working on getting kivy to run with moderngl?
or just kivy for fun
kivy for fun first
I think it would work, but only on win and linux
It all depend if it's a good idea π
Could do it for fun, but I don't know if it has any real world value. That is the big question.
You can already do pretty nice things with shaders in kivy
.. and it will work across platforms.
So in theory adding moderngl into the equation will break compatibility and hugely complicate distribution of the app
yeah fair enough
Would be a "for fun" thing I guess.
If bump to gles3 in the future.. then maybe. Not holding my breath for that π
I don't think that has a high pri, and it probably shouldn't
so.. when setting uniforms in kivy, make sure you send in the right datatype. ```
self.canvas['size'] = float(self.width), float(self.height)
works with
uniform vec2 size;
but setting the integers directly doesn't work self.width, self.height
what is the best video or website for learning pygame
Self promotion: http://programarcadegames.com/
Or instead learn Arcade: http://arcade.academy
@foggy python has a lot of more advanced tutorials PyGame out there too, if you've had some programming already.
@quaint fog this is pretty good:
http://inventwithpython.com/pygame/
ok thank u
but @foggy python i dont want to pay i just want a free tutorial
@foggy python i would like some of your tutorials
the one I linked was free:
http://inventwithpython.com/pygame/chapter1.html
if you want mine, you can google them
OK
they are very good videos btw
yo guys not sure if pygame has changed but isnt this how you get the code running
import pygame,sys
from pygame.locals import *
pygame.init()
WINDOW_SIZE = pygame.display.set_mode((250,250))
it alway give me this error
No module named 'pygame.locals'; 'pygame' is not a package
maybe ```py
pygame.locals
doesent exist anymore
discard the issue it works
ive tried learning python myself but i only know the very basics
message me if intrested
!rules 6
6. No spamming or unapproved advertising, including requests for paid work. Open-source projects can be showcased in #show-your-projects.
@blissful oar We do not allow for requests for paid work here.
ahh bummer, any idea where i should go to find what im looking for
Not clue, maybe fiverr?
@potent ice maybe it would be fine to allow gl3 on android now, and win/linux would certainly be fine, but not sure about ios/osx π¬
Gles2.0 is still 20% on android though, but i'm sure it wasn't more than 80% when we did the initial port, so⦠maybe
@quartz cedar And if you want to make a 3D game, I recommend
Panda3D
For simple videogames, although it's not the lib objective, as opposed to panda3d, arcade or pygame, kivy is fine, too
Can anyone help me install pygame? I keep on getting a missing dependencies error.
I'm afraid we can't help you unless you specify which error message you are getting. π
If you could paste the error message, that'd be great.
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using UNIX configuration...
Hunting dependencies...
SDL : found 1.2.15
FONT : not found
IMAGE : not found
MIXER : not found
PNG : found
JPEG : found
SCRAP : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 23.1.17
Missing dependencies
I am running Linux Manjaro
And Using Pycharm with the Python 3.8 interpreter
@blazing edge Isn't Manjaro based on ArchLinux? If so, I recommend installing pygame using sudo pacman -S python-pygame
Cool! I ran it and it seemed to work. Any advice installing it to pycharm?
@blazing edge I don't have experience with PyCharm, but I would assume that PyCharm simply uses your system Python installation, and if so, it should be able to pick up PyGame automatically.
You might also want to check out 2.0.0-dev6 of pygame based on sdl2. It's pretty stable now.
FYI: pyglet 1.4.10 is out. It's the last release in 1.4. Next release is 1.5, a pure python 3 version with mountains of old cruft removed. It will keep getting patches for a long time (including the experimental 2.0 version)
If it removes so much cruft and isn't a compatible upgrade, shouldn't 1.5 be numbered 2.0?
Hey, so I'm trying to make an interactive button in Pygame and I am having trouble changing the Y position so the button changes black when I hover over it. What it does currently is change black when I hover over the bottom area of it, which is what I don't want.
Here's my game code: ```print ("WARNING: PLEASE INSTALL SAN FRANCISCO FONT FROM DEVELOPER.APPLE.COM/FONTS BEFORE STARTING THIS GAME OR ELSE IT WILL NOT FUNCTION PROPERLY.")
import pygame
Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
GREEN = (0, 255, 0)
RED = (255, 0, 0)
pygame.init()
Set the width and height of the screen [width, height]
size = (700, 500)
screen = pygame.display.set_mode(size)
pygame.display.set_caption("My Game")
Loop until the user clicks the close button.
done = False
Used to manage how fast the screen updates
clock = pygame.time.Clock()
SanFran = pygame.font.SysFont('.SF Pro Display Light',28, True, False)
-------- Main Program Loop -----------
while not done:
# --- Main event loop
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
# --- Game logic should go here
# --- Screen-clearing code goes here
# Here, we clear the screen to white. Don't put other drawing commands
# above this, or they will be erased with this command.
# If you want a background image, replace this clear with blit'ing the
# background image.
screen.fill(WHITE)
# --- Drawing code should go here
wording = SanFran.render("our game haha", True, BLACK)
screen.blit(wording, [30, 130])
mouse = pygame.mouse.get_pos()
if 150+100 > mouse[0] > 150 and 90+300 > mouse[1] > 300:
pygame.draw.rect(screen, BLACK, (90, 170, 300, 100))
else:
pygame.draw.rect(screen, RED,(90,170,300,100))
wording = SanFran.render("play me", True, BLACK)
screen.blit(wording, [90, 170])
pygame.display.update()
clock.tick(15)
# --- Go ahead and update the screen with what we've drawn.
pygame.display.flip()
# --- Limit to 60 frames per second
clock.tick(60)
Close the window and quit.
pygame.quit()```
The code currently prints out this.
@olive parcel pyglet 2.x is gl 3.3 core. pyglet 1.x is GL 2.1 π
@potent ice do you know how to add coins in pygame
@potent ice I would've then suggested that 1.5 be 2.0, and 2.x be 3.x
Yeah but there's already a 2.0 released π
Ah.
Long side project..
@potent ice do you know how to add coins in pygame
coins?
There are tons of examples drawing textures rectangles and sprites
ok thanks
no problem. That should be much faster than searching for random videos π
In pygame (which is a package in python) can I just upload the gif itself and get it to show all the pics of the gif or do I need to take every one of the pics in the gif and upload them together (not as a gif)?
I mean I'm pretty sure the answer is no but I just wanna make sure
if therese no baked in support you might be able to cobble it together with pillow
chances are, someone has written a library for that
although yeah, it'd be pretty easy to do yourself
yeah not that hard to convert to separate images or a vertical/horizontal stack of frames
Worst case you learn more about Pillow.
i made game multiplayer game with python (pygame, sockets, threading) now i want to run them on other pc's, is it possible to just install the game to pc, or i need to install python on every pc and every libary, and then run the scripts to play the game
There are projects like pyinstaller that makes executables, but never played with it much
There are a couple of other projects as well. Not too familiar with what project works best
i've had decent experiences with pyinstaller, kind of a pain to declare the dependencies it misses, and then to make sure it works on a PC that didn't have all the things you have installed, so it bundles all the actual dependencies, but once you got that working, it works well on other people's desktop
i didn't use the onefile mode ever, it always seemed more troublesome than needed, i used the onedir mode, which produces a dir full of files, and you have to give all that, so i used innosetup to create a setup.exe from this directory, and give that to people
i didn't try cx_freeze because for years i though it was just an older thing than pyinstaller, but i've recently learned it's actively maintained and it could be a very decent alternative to pyinstaller
thanks for tips guys
+1 for PyInstaller
Boys im having some issues in my pygame with hit detection with a bullet and a player!
could you give more information, like the code you've tried?
the downside to cx_freeze is that it only works on Windows afaik
anyone know how to run a python script, from unity c#, on an android device?
iron python seems like it might be the way to go, but its not updated for python 3+ yet.
Hm, i don't know how unity interact with python, but you can package cpython for android using python for android.
@dawn quiver Some specifics on what is not working would be useful.
it says "No module pygame found" even though I downloaded it
I downloaded the 32 bit version and I have a 32 bit version of python
How did you download and install it? Do you have the right version of Python? Do you have multiple copies of Python on your system?
I used pip
pip instal pygame
I only have 1 version of python
3.8.1
@olive parcel
@dawn quiver It depends what platform you are on. Pygame 1.x has some issues. You can try the 2.0.0-dev6 version as well. It's pretty stable.
Or maybe you have issues with your virtualenv?
I can't get pygame 1.x to work properly on os x for example
I think there are more known issues with Pygame 2 than 1
idk what the state of Pygame's support for 3.8.x is
I've tried everything from 3.3.x to 3.7.x
@foggy python 2.0.0-dev6 supports python 3.8
But they also added py38 wheels for 1.9.6 in november
ah
When 2.0 is deemed stable pygame will be in good shape again I think. There are also things in sdl2 that provides speedups for certain operations.
@dawn quiver Does another pip-installed module work? I'm guessing this has more to do with PYTHONPATH or other environment stuff than pygame specifically.
(Pygame) I have a class named Bird and a method under it named draw_bird
but I cant get the bird to display on the screen :/
first time user of classes
The Bird bird thing shouldn't conflict
okay
Case matters in Python
So those are two different names in its eyes
!paste can you toss your code onto our hastebin? Will be easier to get an idea of what's going on with more context
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.pydis.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.
No worries
Did the error give you a line number?
Or any more detail than what you mentioned?
Ohhhhh oh ohoh oh
Oh
Hold on
So the screen itself isn't being updated or flipped
That's what's going on
No, it's an easy thing to overlook
Like I said, graphical stuff is a pain in the ass
Right, one sec
So from what I'm gathering, it's not seeing the bird object in the main function. global is a bit tricky like that
yes
And it should work with bird.update(). And you're sure you're saving it before running it when you change it to that?
I know I'm asking basic stuff, but I'm just trying to be thorough
It opens with a blank canvas
Okay, that's what we should expect
And this is because we're still not updating the screen itself to account for the object being tacked onto it
(I think)
updated code
still not working from what I can see
maybe I still did something wrong
Looking further into it on my end
It is probably something very simple that I am overlooking
I'll have to investigate in a moment. Currently dealing with a database issue at work
Sorry, with tax season looming, it's hectic here
np
Got it
@tired dune figured it out
You need to add global bird just under where you have global screen at the top of your code
I mean it crashed, but it at least drew the circle
@tired dune Toss your updated code here
Oh no you can't stack the globals together like that
Has to be:
global screen
global bird
It's just not how the syntax works for that particular keyword
Just how they implemented it
And honestly, if you can help it, limit using globals. They tend to get messy, and like you've seen, getting them to properly appear where you want them to can be a chore
!globals
!global
When adding functions or classes to a program, it can be tempting to reference inaccessible variables by declaring them as global. Doing this can result in code that is harder to read, debug and test. Instead of using globals, pass variables or objects as parameters and receive return values.
Instead of writing
def update_score():
global score, roll
score = score + roll
update_score()
do this instead
def update_score(score, roll):
return score + roll
score = update_score(score, roll)
For in-depth explanations on why global variables are bad news in a variety of situations, see this Stack Overflow answer.
There it is
it still isnt working for me
Looking at your current version now
k
So it shows the white screen with the yellow circle on my screen but then it hangs and crashes
I'm going back over the tutorials to remind myself about all this, see if I can track down where the issue is
so I got rid of the while loop
and that semmed to make the circle show up at least
but then it closes
Yep, since it does it once, sees it has no other commands to run, then closes
Yeah, I think I know why, but I'm trying to figure it out
Ah theeeeeere it is
The event loop part
So 2 things I added. First I added import sys to the top of the file
Then I changed the main() function to be this:
def main():
setup()
maxFPS = 60 # FPS of the screen
clock = p.time.Clock() # Ticks frames of the screen
bird = Bird(28, "Yellow", 150, 250)
running = True
while running:
for event in p.event.get():
if event.type == p.QUIT:
sys.exit()
screen.fill(p.Color("White"))
bird.update()
p.display.flip()
I knew there was something that was missing, I just couldn't put my finger on it
So pygame requires events in order to function
thats good to know
and also what does the sys library do?
It just adds some system functions. Like exiting the program and that kind of jazz
So every key press and anything else you could do in pygame is considered an event
Events are always happening in it. But since they were never checked, they were piling up and just crashing it
(That's my guess, at any rate)
No problem. I suggest (if you haven't) glancing through the old tutorials that they have on the pygame site. https://www.pygame.org/docs/
π
A lot of it is in Python 2, but the differences are minimal
print vs print() and what not
Not to mention it has a very helpful section on blitting, which is key for making pygame run smoothly
There's a lot of info on Pygame at http://programarcadegames.com as well. Including examples.
Snagged and bookmarked
nice, now make a 4d cube π
Nice. The good old way of drawing a cube. Lines and sin/cos rotations I guess.
Does anyone know where I can get a 2d character pics for my game? (I mean a web or something like this)
I want to make an animation
@urban cipher https://kenney.nl/
Thanks
Opengameart.org also has a lot of free assests
Just make sure you include attributions. I do that even if the license don't require it.
Kenney has 6 spritesheets that are awesome for creating character animations out of.
See here for an example of how I did it, if you are interested:
How did you go about 3D shapes with pygame
With commands drawing to surfaces?
I mean.. you can use pygame as a window for opengl as well
But I assume you mean software rendering with surfaces. You can start drawing some points and apply manual rotations to them
Good old sin/cos stuff
Do it without perspective division first, so drop the z axis (or drop it fully)
nice, now make a 4d cube π
@dawn quiver lmao spoken like an asian mother
lol
would emulator/interpreter dev also go here?
also @tired dune idk if 3d is really pygame's thing exactly
you might need to start using other libraries
you can certainly implement 3d operations in python yourself and you might learn a lot, but that'll run pretty slowly
it can make for some pretty interesting effects in a 2D context still (and it performs fine in that context)
as long as you aren't doing full 3D, it's fine
here's a recent example (it's in the background):
@grand imp You can createa an opengl window/context with pygame if needed. It's even even possible to mix pygame surfaces and opengl stuff. Lots of interesting things can be done.
@foggy python that looks epic
i feel dumb for asking this now, but should i quit trying to do a platformer type attack system and start a turn based one? i'm really struggling with the former
a lot of people have a hard time with combat from a game design perspective
in general, turn based is less work and easier conceptually
it just does it backeards when i try to do melee, no matter what direction i'm facing, even if the code is identical for each orientation, it does it backwards for that direction
so i tried to make a homing type projectile, and that's bugging like heck, and doesn't work properly. i also really hate the concept of it
hey @foggy python what was your website again?
homing projectiles take some trig to do nicely
@iron galleon https://dafluffypotato.com
thanks
can you help me figure out a melee combat system? i was basing it off the x and y of the images i'm using, since i don't know how to use hitboxes
@foggy python 
my tutorials cover hitboxes
google dafluffypotato
ok
the first few are rough audio-wise
got it
though i fear my code's messiness might be beyond that
i'll have a look ayway
mine is messy aswell
ok
do u only do platformers? cuz mine's not so i don't know if they would mesh well
i'll send u a clip of what i have so far
this is designed to annoy. and you can see the homing combat not working. so i'm not sure if it's meant to annoy other people or me
i'll take a look at your videos
are there any specific ones for my problem?
@foggy python 
it dissappers instantly.
oh, is the attack supposed to be homing?
it's also a really bad early game mechanic in my opinion, and 'hitting demons from beneath' is just to cover up an attack bug
if you have any ideafor how to make my game playable at any scale, the code is here: https://github.com/Nightarcher3677/JustAnotherAdventureGame/tree/test-levels
welcome to 700 lines of buggy nightmares, friend
why do you have like 50 global variables
i'd like to see if i can implement a melee attack, but since the x and y are in the top left corner, that makes it really hard
how
well
center_x = width / 2 + pos_x
just transform that formula to whatever you need and you can work by center
interesting
thank u! i'll be sure to bug you some more when i inevitably stuff it up
you really need to learn a bit more python before stepping into Pygame
idiot is my middle name
start by working out all those globals
how? if i don't have them there then the definition can't use them
you can return values you need back
and you can pass values into the function as a parameter
look up how functions work
can do
also, you may want to use a class for the fireball, not a function
or just don't use either
yeah, i made it a function cuz i stuffed up with class and i didn't know why. i just now figured out it was because i wrote python class atk(): code goes here instead of python class atk: bleh bleh
also, how do i find the width?
of what
an image?
.get_size()[0] or .get_width()
otherwise, you define it yourself
ok
still not working. here's what i'm using: ```python
class atk:
def melee(damage, x, y, ex, ey, width, attack):
global facing
center_ex = 30 / 2 + ex
center_ey = 30 / 2 + ey
center_x = 15 / 2 + x
center_y = 15 / 2 + y
if attack:
if facing == -1:
if center_ex < center_x and center_ex > center_x - 50:
#if center_ey < center_y + 15 and center_ey > center_y - 15:
print('damaged')
elif facing == 1:
d = 3 #placeholder to prevent errors
you need to look up Pygameβs Rect class
that's ok, i made it work from the center_x thingo
to annoy you, i willnow send you a clip of it working
i feel so proud
@surreal furnace You should really re-think the structure of that project π
what do you mean by that
uh
as in code or concept
code
like I mentioned before, the globals and the use of functions are the main offenders
Iβm no expert on code structure tho
says the youtuber that does coding tutorials
fair enough
I'd start by putting all the non-code stuff into a data or resources directory with subfolders organizing things
that too
ok. um did you see the first 35 lines
I forgot about that by the time I read the code itself
i'm honestly way too lazy at this point to do that. but i will later
also, i don't know how clean ~700 lines of code is supposed to be, ok
That game could easily be 300-350
maybe even less
also, by organization of files, we were talking about the files themselves
If you are planning to keep expanding it, you at least need to do something π
Not just how theyβre handled in the code
ok, but.. in my defense i only learnt python 4 - 5 days ago, so my optimisation skills are not the best
You probably shouldnβt have done Pygame so early
It's a perfect opportunity to learn actually
Step back and re-organize. Ask for help if needed
@foggy python impatience is my other middle name
Also, taking a look at how other people did it will help get you in better habits
Learning Pythonβs fundamentals will save you time
ok
A lot of time
Work for laziness in the future π
And btw
This is coming from someone who didnβt figure out why lists were useful until after around a year of using Python
Hard work pays off in the future. Laziness pays off now.
@foggy python i only think they're useful for animation (that's also the only thing i've used them for)
uh
Your events are a list
Your enemies are in a list I think too
Or wait
Maybe not
those are the sprites FOR the animation
Iβm on mobile so I canβt read the code atm
ah, ok
aren't dictionarys the thing you used to make a text map of the level in your video?
I used lists and dictionaries I think
Depends on the video
Iβm pretty sure I used dicts in the infinite worlds one
yeah, that's the one
@foggy python i'm going to try my hand at 'top down' infinite terrien gen (via your video, of course)
y'know what? i just realised that my game mechanics are WAY too far off from what is required for an infinite gen game, soooo i'll just make it levels
Oh baby, when i understood that all game code is in one file, i knew i'm in for a treat!
@potent ice thats still technically not using python to do the actual 3d operations, but hardware/software libs. It's still good to mention to @tired dune though
Arcade 2.2.8 is out:
http://arcade.academy/release_notes.html
Man you're working your tail off on that
anyone here, knows python and willing to work with me on a 3D game
@gray stump out of curiosity, what are you using for 3D in Python? Panda3D?
@ember glade I'm on sabbatical from teaching this semester, so finally getting to poor a lot of effort into it.
Please don't judge me but i wanna maka a voxel engine.
scifi game
@olive parcel
Wanna join?
No thanks.
@frozen knoll the release date of 2.2.0 and other in december are set in 2020
If i'm reading it right
Where, on the release notes?
Oooh, right. That's not right.
Well, doesn't make any more sense than what I just wrote in the line above. Thanks. I'll correct.
o7
@cyan geyser yes! another person with a green default icon! join my in my quest for domination!
@foggy python i remembered what you said about clutter in my code, and decided to make the rest of the game in another file, which i import with ```python
from gamefiles import Game
(it's a class)
@surreal furnace BTW, check out SOLID principles. While not all are applicable to python (like interface segregation), single responsibility principle will make the code much more readable
ok, thanks
I was considering making an indie game in Python, something a'la Cave Story
any tips on getting started with that?
other than getting more people than myself on the team, all I can handle by myself theoretically is code and soundtrack
Firstly, you should choose which library you want to use
I'd suggest Arcade, or you can build your own engine using almost any graphical library (we made a retro pixelated game for the code jam using kivy)
Oh yeah speaking of which, which should I use? PyGame? Kivy? Try them both and see which suits you better?
i have a preference for arcade because it's simple and fun to use, and the creator hangs out around here
try it out for like 2 screen of platformer/shooter
alrighty, I'll take a look and see what I can learn
I'm also happy to answer any Arcade questions you might have. Just ping me.
@frozen knoll so i've never used arcade, but ive been using a lot of moderngl recently. im trying to port a project of mine from moderngl to arcade, just because doing everything from scratch gets kind of annoying haha
like i had to do the text rendering from scratch etc
is something like the image i posted easy to do in arcade?
im gonna be using waaay larger grids than this too
For creating tiles, I used the Pillow library to put text on an image, and then used the image as a Sprite.
isnt that really slow?
No. I generate the image when the program starts.
ah fair enough