#game-development
1 messages Β· Page 81 of 1
is this drawing it in the terminal or on some sort of 2d drawing surface?
terminal drawing
hm
when you said "it doesn't work like that", do you mean that it doesn't draw pixel images in color?
every line is a +1 on the y axis
i thought you said i was giving it coordinates to drawing lines like a polygon
well
you said there were hitboxes that have arbitrary polygon boundaries, right?
and you want to use tiles as the basis of collision detection?
me:
so i want 2 separate worlds
the rendering one
and the collision one
every object got its side on each world
sprites for the rendering one (visuals)
and a collision range for the other one
ascii drawings
but it's drawing ASCII for the pixels
when you say collisions, are you imagining hitboxes like this but polygons?
yes
so you want to use the overlap of the polygons to determine collision, not how the tiles are drawn?
ye
ok, then you want a different algorithm than calculating each point along a line
exactly
you can simplify the issue by not allowing concave polygons
but
there's no solution that's both flexible, simple, and efficient.
you have to choose two of the three
what do you mean
as you saw in my drawing, i only did points for the edges, not the inside
this is what i want
.
are you actually trying to ask about edges, or are you trying to find ways of answering the question of whether two shapes made of arbitrary polygons overlap?
this
.
i think it might be easier to break each shape into a bunch of triangles
this
that'd be my approach
i am confused
look at that page
the idea is that you can break any polygon into a bunch of triangles
i dont want to do that
oh my god i lost it
if you only check if the edges intersect, then you might end up with a situation where a fast moving object clips through stuff
and ends up inside another poly
that's bad
i have a solution
what is it?
for every edge, get the edge that is past another one like:
edge1 edge2 edge3
edge1 with edge3
and we do this so that we can make a sort of X
and this will only happen to 4 edges
im not sure i understand. are you treating the center as another point to make triangles with?
but i think the algorithms i mentioned, and the general category of shape intersection algorithms, will be of help to you
hi
so i said
we start from the first point, and get the other one
the other one will be: skip the second point and get the third
make a line between it
and now we start with the second point
but i just need
a sort of code
to get positions in between points
the positions between points
there are two things i'm confused about, but this one is the most important
if you are only looking at integer positions between points, then you are effectively drawing pixels
i am drawing characters instead of pixels
no, you don't understand
if you generate a list of integer points between (1,1) and (1,5)
exactly how the coordinates are
[x, y]
then trying to intersect the set of points from (1,1) to (1,5) and the set of points from (1,3) to (5,3) is the same as checking if two bitmaps with lines drawn on them overlap
and at the resolution you're working at, it's like checking if the sprites overlap
unless you have two different resolutions for sprite drawing and the collision bitmap masks
the user will give the resolution he wants to...
do you have any experience with binary logical operators?
like ANDing two numbers, one that's 0b11100 with 0b10100
or whatever their hex / decimal version is
i don't mean image size btw, i mean relative resolutions of images
you know how the shadows in games on low are jagged and pixelated?
but then the texture of the object the shadow is projected onto is much higher resolution?
yes...
that's the same sort of difference I mean
where unless the collision mask is generated with a higher resolution like the object receiving shadow relative to the shadow projection, there is no difference between checking for overlap between the sprites themselves
so, you are telling me that getting points between start / end points is a pain?
i would just like to know how
i have a solution
for if the polygon is inside
I'm saying it makes no sense because you might end up with a situation like this, (0,0) in the upper left:
where red and green are the lines of two different polygons
as sets, green would be the set of integer points from (0,0) to (5,5)
red would be the set of integer points from (0,5) to (5,0)
and i will get, that There is a collision
there isn't
oh i gave them six instead of 5 but
each square represents and integer point
there is no tile that is both red and green
so if you only look at the integer points in between the vertices of polygons, there will be cases where the lines of the polygons do not intersect when rendered to tiles
uh
im not using python to do it
im drawing it in a js pixel editor
here's a very minimal example
green is the line from (0,1) to (1,0)
k
red is the line from (0,0) to (1,1)
green: (0,1) (1,0)
red: (0,0), (1,1)
now do you see why only looking at the integer points between places will fail sometimes?
it will work a lot of the time, yes
but sometimes you'll have weird situations where shapes going fast enough will fly through one another and end up stuck inside each other like a bethesda game going wrong
One message removed from a suspended account.
x)
the bigger point I'm making is that there are actually multiple kinds of collision detection used in games
so i can simply check the corners like left by 1 pixel and right by one pixel
hmm
maybe
that will work for lower speed objects
but what if you have a very tiny object going fast at a larger line?
it happens on all engines
is going really fast to the right
i think
well
sort of
here's the thing
FPS engines actually sometimes have two kinds of collision detection
one for fast objects like bullets
and one for less fast objects
the point I'm making is that a game engine on its own can't be that general
or it will suck at stuff
you have to choose what sorts of problems you're going to solve
and to do that, it's a good idea to have an idea of what kind of game you want to make in the first place
Unreal and Source were written and optimized with FPS games in mind
you can do some other kinds of games with them
yep, you just described how bullet physics is done
only they use complicated math rather than integer spaces
but
with Beth games, usually you aren't supposed to drink 5000 bottles of skooma at once
that will work
it might!
wait
but doing it only on integer spaces might also be kind of inefficient to do on CPU
if you're limited to only what's on the size of the terminal, it'll be fine
but if you have an off-screen world, it might start getting ugly
I am exactly limited to this:
you know how minecraft water updates really slowly?
yes
yeah if you tried to make it go fast the simulation might have trouble working fast enough for the game to be playable
you could make a program that's a really good water simulation, but it would restrict the CPU and GPU time you have available to do stuff in the rest of the world
well
ok
you've made a choice
and a limitation
that's good
successful games development is really about choosing your limitations and assumptions
and then working with them
you played any source based games?
TF2, CS GO
to expand on that just a bit, the general search term for that is "continuous collision detection" (CCD)
yes, that might be helpful for him to google
ok, i'll send a video
my pc doesnt even have a gpu
hl2 will still run on integrated, it's from 2004 and ran on integrated ok back then
just turned down to really low lol
also, check out this beautiful thing
This is the interactive demos for the Rust-writter nphysics engine
https://www.youtube.com/watch?v=YBVdtXxrUyk you can watch videos about it later but in source, if there's a steep angle, you can fly along it if you approach it from the side
hi, this vid took me a long time so gimme feedback pls
btw i surf on resurfed servers
My Twitch Channel: https://www.twitch.tv/lakitooyt
My Twitter Account: https://twitter.com/Lakitoo_
My Steam Profile: https://steamcommunity.com/id/lakitoo
I use FlawHUD (https://huds.tf/forum/showthread.php?tid=252) but I've changed the background to this im...
you can look at how 3d and 2d simulations change with changing parameters, in real time, in your browser
people call it "surfing"
it's a glitch in the source engine's physics
valve didn't waste their time on fixing it because none of their levels had surfaces like that
to get the positions in between a starting and end point
well
just this
i told you, bresham will do that
k
BUT
yes?
the more complicated solutions people use for collision detection are used because they are reliable and efficient
now
what you can also do
is do a modified version of bresham where you draw the left and right bounds at each y position of a polygon
then fill each x position between the Y ones
that would let you use the set object in python
however, i think you could be more efficient than that
so this?
if this is what you're describing earlier, where you expand the number of points drawn by drawing all points within a radius of 1-3 (or really N) points from the line
that's pretty similar to drawing a line in photoshop with a pencil brush size of N rather than a size of 1
even if you're confused by all of this, what I want you to take away from this is that efficient collision detection in games is hard
and there's no perfect solution
you have to pick the weaknesses your solution has to suit the game you want to make
and also consider the pain because i wont use any libs
you're not using libs because you want to learn, right?
yes
ok, let me ask another question
are all parts of the environment able to move
or are there some shapes that will be unable to move
everything can move
https://www.redblobgames.com/grids/line-drawing.html this is a good interactive guide to bresham
or an algorithm like it
then the object would'nt have collisions
btw, red blob games is good to check for other topics
the author makes really good articles
the example code is in JS but it's still pretty clear
also lol they mention the diagonal non-intersection issue on that article
hmm
this might help your integer location collision mask approach work
ok, so if you want to try it
what you could do is one of the line drawing algorithms described, but instead of drawing, you take the current coordinate, and add it to a set in python
hmm, i have another easier approach
shape_intersection_boundaries = set()
# you probably won't have a function like this, but i wrotte it this way for clarity
if point_is_on_line(x,y):
shape_intersection_boundaries.add((x,y))
well, the easiest and most efficient approach is disallowing rotation and having only rectangular hitboxes
streetfighter 2 did that
but my approach is
add +1 and check. if not, add -1 and check
not sure what you mean rn and i should probably get back to work on some stuff, but I hope discussing this at length helped at least a little
as in expand the area added to the mask by 1 more?
ye and also substract by 1
i suspect you're still going to run into issues at some point
but if you set a hard upper limit on movement speed, you might be able to avoid the issue somewhat
k
My pygame ZERO code doesn't work.
def move_player():
if keyboard.w:
player.y -= 2
clock.schedule_interval(animate, 0.5)
if keyboard.s:
player.y += 2
clock.schedule_interval(animate, 0.5)
if keyboard.a:
player.x -= 2
clock.schedule_interval(animate, 0.5)
if keyboard.d:
player.x += 2
clock.schedule_interval(animate, 0.5)
else:
player.image = "player"
def animate():
global frame
curr_img = "player-walk" + str(frame)
player.image = curr_img
frame += 1
if frame > 2:
frame = 1
It is for animating an image
but for some reason, it is only animating when I do the "d" button
wait
problem solved!
nvm
i was thinking of recreating this game on pygame. do you think this might be too heavy for python?
https://www.youtube.com/watch?v=YIlTXTbd7FY
The game no one expected, but the one we all needed
Β» Subscribe - http://bit.ly/AntVenomSubscribe
Β» Uploads - http://bit.ly/AntVenomUploads
PLAY ACID BREAKOUT
http://wonderfl.net/c/tNGi/fullscreen
http://dagobah.net/flash/acidbreakout_hacked.swf
SOCIAL MEDIA
Β» Twitch - http://twitch.tv/AntVenom
Β» Instagram - http://instagram.com/TheAntVenom
...
its called pixel breakout
You could probably do it with numpy and moderngl (for vfx).
never heard of moderngl what is it?
like PyOpenGL, but nicer.
(specifically wraps opengl 3.3 core)
Another option is to write some cython code for the particles / collision.
https://janentikan.itch.io/eew made this game over the last week for 7drl with python/panda3d share the love
</shamelessselfpromotion>
Where would I start with a platformer game in PyGame
arcade has some pretty good examples https://arcade.academy/examples/index.html#platformers
ight thanks
I need help regarding the best ides for python and pygame and neat
Will be in #help-apple
any latest pygame 2.0.1 documentation(pdf)?
If I wanted to draw something, let's say a bullet, in the main loop, before I use screen.fill(), how would I do this. (I need to draw something in an event.) This is in PyGame obviously
Make the event set some state instead
Check that state in the beginning of the draw loop
I would avoid drawing in events completely
Alright
Wait so how would I draw something when the player fires the MOUSEBUTTONDOWN event? @potent ice
You might create the projectile, but it will still be drawn later
You might have a list of active projectiles for example
I have the rect ready for drawing
What do you mean by this?
There is only one rect?
I'm saying you can add a new rect to a list of active projectiles in the event (just an example)
The draw code will just that those rects
i hope i am not interrupting anyone but what is python i don't know anything about coding
Might be better and faster ways
Much better place to start if you are that new π
Are you able to delete rects?
you can remove from the list if needed
I would think sprites and sprite groups could work better for this?
Ok
hi all does anyone know the best way to position objects relative to each other in panda3d. for example suppose i want my characters feet to be resting on a the top surface of a cube but not inside the cube. im fairly new to panda3d
bruh
@short meteor
same
Except I'm using Ursina
does anyone know how to use Ursina? I'm more of a trying it out learner than just watching learner.
can someone show me how to do stuff in python by the user clicking a key
for example clearing a list by user clicking spacebar
ah
ok
@lament carbon you need to do a thread. Well Actaully that's what I did considering that was easy for me. But for you I would recomend using a while lloop
@lament carbon are you using pygame?
oh no I know how to do it in pygame
I was asking if something similar can be applied
to more everyday programming tasks
such as clearing a list etc
could I import pygame and use it to clear stuff or anything of the sort by asking the user to click a button?
@abstract light
I think so yeah
so you know how to make a key right
you just need help on cleaning the screen
is that right?
@lament carbon
ok
do I have to make a python game loop?]
well not really
are you asking the palyer to clear the screen?
if not and you just want them to screen
anytime
user_input = int(input("Enter a number to find out if it is alternating or not: "))
def split2(AN_input):
return [char for char in AN_input]
string_ver = str(user_input)
temp_list = split2(string_ver)
length = len(temp_list)
iteration = length
split2(string_ver)
print(temp_list)
print("")
increasing_num = 1
even_or_odd = []
orig_length = length
while iteration>0:
if temp_list[length-(length+increasing_num)] in ("0","2", "4", "6", "8"):
increasing_num = increasing_num + 1
even_or_odd.append("even")
else:
increasing_num = increasing_num + 1
even_or_odd.append("odd")
length = length - 1
iteration = iteration - 1
print(even_or_odd)
length_of_even_odd = len(even_or_odd)
print("")
break_or_not = "temp"
for x in range(len(even_or_odd)-1):
if even_or_odd[x] == even_or_odd[x+1]:
break_or_not = False
else:
place_holder = 0
if break_or_not == False:
print("This is not an alternating number!")
alt_num = False
else:
print("This is an alternating number!")
alt_num = True
alt_num_true = "This is an alternating number!"
alt_num_false = "This is not an alternating number!"
alternating_num_storage = open("alternating_numbers_storage.txt", "w")
alternating_num_storage.write(str(user_input))
alternating_num_storage.write(", ")
alternating_num_storage.write(str(even_or_odd))
alternating_num_storage.write(", ")
if alt_num == True:
alternating_num_storage.write(alt_num_true)
elif alt_num == False:
alternating_num_storage.write(alt_num_false)
it basically just takes user input as a number, finds whether it is an alternating number and then tells me whether it is or not. after that it appends it to a text file
ok so what I did was I made a input and told the player if you want to clear the screen press enter and if they did I would make screen clear using the os system
I also did a sleep system
hmm im on windows sorry
yeah that is ok
Os system is a module
oh import os?
ok
and you name the function clear if you want
and after the input you would do clear()
so like this:
import os
def clear():
os.system("clear")
account = input("What do you want to do? ").strip()
if account == '1':
sleep(2)
clear()
block()
wait
I'll show you my whole code
ok
btw mind using ```py
py def account():
from replit import db
import os
from time import sleep
from stdiomask import getpass
def clear():
os.system("clear")
def signup():
username = input("Username: ").strip()
password = getpass(prompt = "Password: ").strip()
confirm = getpass(prompt = "Confirm password: ").strip()
if password == confirm:
db[username] = {
'password': password,
}
else:
print("Invalid. Try again")
sleep(2)
clear()
signup()
def block():
print("Log in")
username = input("Username: ").strip()
password = getpass(prompt = "password: ").strip()
if username in db and db[username]['password'] == password:
print("User found")
else:
print("invalid")
clear()
block()
print("""
- log in
- sign up
""")
account = input("What do you want to do? ").strip()
if account == '1':
sleep(2)
clear()
block()
elif account == '2':
sleep(1)
clear()
signup()
print("Good made your account now log in")
sleep(2)
clear()
block()
that did not work
why cant I write it
write waht
`py
alternating_num_storage = open("alternating_numbers_storage.txt", "w")
alternating_num_storage.write(str(user_input))
alternating_num_storage.write(", ")
alternating_num_storage.write(str(even_or_odd))
alternating_num_storage.write(", ")
if alt_num == True:
alternating_num_storage.write(alt_num_true)
elif alt_num == False:
alternating_num_storage.write(alt_num_false)```you might be fine using this for now, but you're leaving yourself open to memory leaks + really slow code,
you can use `with` to open your file so that you don't have to worry about closing it + you can use fstrings so that you've only got 1/2 writes
```py
with open("alertnating...", "w") as f:
f.write(f"{user_input}, {even_or_odd}, {alt_num_true if alt_num else alt_num_false}")```
from replit import db
import os
from time import sleep
from stdiomask import getpass
def clear():
os.system("clear")
def signup():
username = input("Username: ").strip()
password = getpass(prompt = "Password: ").strip()
confirm = getpass(prompt = "Confirm password: ").strip()
if password == confirm:
db[username] = {
'password': password,
}
else:
print("Invalid. Try again")
sleep(2)
clear()
signup()
def block():
print("Log in")
username = input("Username: ").strip()
password = getpass(prompt = "password: ").strip()
if username in db and db[username]['password'] == password:
print("User found")
else:
print("invalid")
clear()
block()
print("""
1. log in
2. sign up
""")
account = input("What do you want to do? ").strip()
if account == '1':
sleep(2)
clear()
block()
elif account == '2':
sleep(1)
clear()
signup()
print("Good made your account now log in")
sleep(2)
clear()
block()
see I used clear
that would will work
alright thank you guys, I have to got soon but I will look over this. tysm
@last moon thank you too dude
or any game engine that is free
ok
I was just curious about this and it seems like something a game oriented person would know
@last moon do you know how to use any game engine that is free?
which ones aren't?
ya
Unity
how
there's just another payed version
i think it's only c++?
if you want a python engine, it really depends on what you want to do but arcade is a great one
it's not the same type of engine as unity/UE tho
actually im not 100% sure it's technically an engine?
ya they've got tones of tutorials n' stuff
wait you know how to use a game engine?
can you help me learn it? like seriously videos don't help me. I need to do stuff.
not really lol, I'm working on a arcade project rn but I've tinkered with ue
there's a bunch of how-to examples on the site
there's also a full on walkthrough (text) if it helps https://learn.arcade.academy/
@abstract light
do !close
wha sup , im doing a maze game with turtle . i dont want the turtle to go outside the maze how to do this?
like i want the turtle to have a limits
how?
like border
is there any way to create games with python without having ultimate optimizing skills
Today with some help form @mighty gale on my dice game i was able to follow a tutorial and made a snake py game thanks :)
brilliant - glad to hear it!
wha sup , im doing a maze game with turtle . i dont want the turtle to go outside the maze how to do this?
like i want the turtle to have a limits
how?
like border
@true dagger something like calling the method of a 'containsPoint' check...
like you say if the character is gerater than the width of screen then you block it
that's how I have done it
it's been sometime since I've use trutle but let me get some facts
yeah you need to run a check to make sure his current or projected co-ordinate is not going to cross a line...
@grim abyss do you use Python?
@abstract light I do, I also have a script that plots doom levels using the Turtle module..
?
cool, I've dabbled in some pygame...
I'm by NO MEANS a "professional". I'm intermediate as well....
I don't. I would like to but I'm not aware of any game engines that support scripting via Python. I'm sure there are some out there but.....
It's an area I'm interested in to be sure...
It's a shame all the cool stuff uses Lua
yeah, plus Unity...
I like it's C# scripting though
I'm interested in C#
I need to learn C++ first though....
@abstract light Why do say Unity is bad because of C++? Explain...
Unity is coded in c++ and c++ is FAST
the scripting is done via C# and something else as well.....
nope
I've seen it before
but
I'm not saying C++
is a bad tool.
It's amazing.
I just feel like people should learn C
c++ advocates would say that Python's type-system is used as a "crutch". Python's type system is Dynamic and C++ has a Static type system.
Before I learned Python and OO concepts and could of used C. Not now though....I can't tolerate a language that is purely procedural with no OO support..
Python has ruined me
I know right?
I was trying to learn C++ because I wanted to use many types of game engines
I can't tolerate any other VR game now because Half Life: Alyx was sooooo good
I suggest you play the new Jurassic World game
really?
it's not 'on rails' is it?
but the problem is that it costs money
what genre would you say it is?
do you have full 3d movement?
oh ok.
some times they won't let you go to specific places like in all games
you have to finish something
well I don't actually own a VR headset but I'll keep my eyes peeled
i'm ready for starfield!
the game?
yes
nice
what games do you currently play?
I'm not a super game person
so I won't know that much
There's no way they just were purchased by MS and StarField is bad. MS must of seem something about that game that really grabbed their attention...
currently? Total War: Warhammer 2
No Man's Sky
what about uh valorant or Rocket league
nah, not my cup of tea
XD
what is this?
it is what people call checking the coordiantes of the player
I think
I forgot terms
@true dagger Well If you are using a 2D geometry library like "Planar". Then you can have line objects and they have a 'contains point' method...
yeah
well wait
no never mind
3D games will be hard to do
unlike the 2d games where you only need to axis
you will need 3 axis
a Z axis, a Y axis, and a X axis
X and Y you already know
Z is the top to bottom axis
if you want to set a hegiht limit
wait
no
it;s like
a normal coordinate sheet of paper
but when you make it 3d the perspective changes
wtym?
you mean what do you mean?
@true dagger
I think when he says vector support
he means the axis
I'm not sure
@grim abyss
that might be alittle to much for him
useful abstraction
he is only a beginner right?
actaully i think he can do it
can we see your code?
we will not steal don't worry
@true dagger what's you Python skill level? How long have you been at it?
you mean turtle
@true dagger you have a firm grasp of classes and OO yes?
classes are so annoying
I think he nodded off
you must be an OG C programmer?
yeah right
use Linux/GNU ?
who are you even asking
beacuse there are some varaibel I would like to use
and then I have to make them global
and I forget to do that
yo gusy I need help on my game
@abstract light no you don't.
yeah you do
python
on the terminal?
no
you just said python
python only has terminal unless you use a module
can we see your code?
@finite jay
@abstract light I don't have a single global variable in that script I linked. If you need Globals your design is flawed....
classes provide the encapsulation
wait
this is python not C
I think we are talking different stuff
ohhh?
in pygame I make a player clas
and in that player class I make a varaible called coins
yes
and I have the player's movements
and then I have the computer see if they have gotten a coin
and add it to it
it has worked
trust me
yeah you lost me there
show a code snippet
i've been focused on def functions and using it in classes
yeah
I put the variables in a function called coins and use it class
I need to see if I have the code still
wait
I know how to do that
but I don't like to see so many selfs
wait
you want to make a project togethter?
just for fun
sure. what type of project
what's your experience level with python and 3rd party libs ?
I read about a guy developing a game called Lumberjack solo..so cool
@abstract light so you're back eh? You never answered my question...
the only about you being familiar with 3rd party python libraries. your python skill level?
@abstract light Regardless, I'm ready if you are!
which ones?
ursina, let's do something in that!
what ?
0.o ?
i'm french sorry i don't understand you @abstract light
@grim abyss you didn't see the picture?
@abstract light no, nothing popped up
as of yet
he deleted it
hahaha gone again, i saw it this time
yeah
boy I speak spanish also
le salng
so you better speak spanish
tu connais
@abstract light dm it to me please so I can actually see all the frames
what do you mean
oh he has it
yeah
lol
ta encore cru lol
got it
mdrr
why do they keep disappearing?
ptdr
there
privacy? i hope those aren't his children
BAM!
@abstract light I wanted to see the GIF one though...
ok man no problem
because the 16 april.....
nsfw,porn, etc
...
that question basically answers itself though..hahahaha
funny he even asked!
contexual awareness!
lol
how old are you ?
ooooooh
@warm apex and you?
wow
hahahhahhaha
ok
who understand me when i talk in French ?
not me
a french guy
XD
@abstract light how about something messing with requests ?
are you american or british ?
<--- american
cool
la par exemple personne me comprend en gros si j'essaye d'insulter vos mΓ¨re en dΓ©bitage vous Γͺtes HS lol
@abstract light like cards? Playing Cards?
@abstract light how about a networked spades game, through a browser...
@abstract light answer, he wait
LOL yeah, I'll wait a loooooong damn time....lol
@abstract light do what on your own?
oh that
ok, like?
there aer so many card games in the web alread
true
hahahaha, how old are YOU
ok you know something I'm tired of? http://news.google.com
old enough to live in this world and not be like a baby eating fluid food
the news?
yeah, they put links on there that are pay-waled
Hey @warm apex!
It looks like you tried to attach file type(s) that we do not allow (.bat). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
let's do a news aggregator
...
fuck off @frank field
you do realize we are in a game development channel
indeed
and you want to make something that old people like you do
ok a 2d side scroller
can you model?
you mean draw
create game assets?
i might can create some music/sounds....but other than that. I can only code systems.....
I am doing a project right now
LOL
I wanted to do another one also
in what project do you work, guys
no, seriously..... lol
the most I am familiar with is Pygame
@warm apex my project: https://github.com/InZane84/WADdle-Plot-CLI
cooooool
i wanna move it to something better than 'Turtle'
refactor the code and implement a GUI
what is your job, guys
my job is currently....unemployed.
oh !
thanks covid!
i'm a victim of the collateral damage unleashed by the destruction of the restaurant industry!
ah
fucking Covid, my father is dead
like what?
i begin
?
Python
so yes you are experienced or you are a beginner?
beginner sorry
ahh
I am making this tile frenzy game and I need help getting started1
ok thank
I am making this tile frenzy game and I need help getting started1
pygame?
what is the concept of your game ?
a beginner too in the parsing of the english language it seems! lol
pygame is not "python"
I am just making it for fun but its likes a aim trainer
oh a cheating script eh?
nah
which will be executing on which digital distribution platform? Steam?
why would I cheat I just need a headstart
what time is it, in America ?
432
You need a headstart, in coding an 'aim trainer'. A exploitation tool!
Cheater!
lol
what
i care not young grasshopper. carry on...
k buddy
tile frenzy?
Is there a way to run Pygame in a separate thread, and allow code from the main loop to effect the Pygame thread?
Hello, is ursina engine good for 3d game development?
@abstract light Great I'd like some help in doing that. I have a text based game in vanilla python that works entirely in the Prompt and I would like to use Pygame to display a separate screen for graphics for certain events
In Pygame, does it hurt or help to do a simple rectangle collision before doing a pixel mask collision?
Odd question, just pinging any pygame experts
@analog barn without knowing Pygame directly, I would say that is actually good to do - perform a coarse collision test first, then a fine test
the coarse test is faster
Alright, that makes sense to me. I am curious though... the way that Pygame detects mask collision is by simply comparing a 2d list of 0's and 1's, once the mask is created it should still be fast, just not as fast as rectangles.... I will time it later
Wait do you need help?
Not necessarily, just messing around learning masks
collision tests are always best if you do coarse first, then fine
Errr we go! gotta love Pygame for how easy it is```py
# get collisions using rectangles
collisions = pg.sprite.groupcollide(self.ship.bullets, self.alien_fleet,
False, False)
for bullet, hit_list in collisions.items():
for alien in hit_list:
# use pixel mask collision
if pg.sprite.collide_mask(bullet, alien):
self.scoreboard.player_score += alien.point_value
alien.blow_up()
What with pygame?
https://github.com/The1Divider/PythonGame/blob/main/renderer.py Im trying to figure out why my camera is 1: studdering towards the edges and 2: not unlocking the player when the edge is rendered
Should I write menu and game in same file or separate
imo separate files allow you do separate your logic out but it's really a personal preference
coming back from java, it's hard to not make a new file for every class instinctively π
Specify --help for usage, or press the help button on the CMake GUI.``` why am i getting this error
what are you doing to get it?
I know how to work only with turtle
How does arcade/pyglet/moderngl send processes to the gpu?
"send processes" means what?
Getting the gpu to run operations rather than sending them through the cpu?
It's fairly simple. Drawing/rendering operations requires primitives (points, lines, triangles) to reside in a buffer object in vram.
That buffer is processed by a shader and things appear on the screen
Maybe better to say a "gpu program".
The SpriteList in arcade is a good example. The user can change properties on each sprite such as position, rotation, texture
It keeps track of what data is changed internally and write that information to vram (a buffer)
Just think of the buffer as a numpy array or python array
It's expensive to keep data in system memory and vram in sync, but it's worth it when we batch draw everything.
The sprite list in arcade is drawn using a single render call
We maintain an [[x, y, rotation], [x, y, rotation], ...] list in system memory and write that to a buffer in vram when change is detected
(There are more properties of course)
Is that why quaternion math is used in 3d graphics?
I don't know how that is related
Wouldnβt you store [x, y, z, rotation]?
Ah nvm then Iβm still trying to work 3D out conceptually
The reason quaternion are used is simply that they are simpler to work with because you won't have to worry about gimbal lock.
But they are converted to matrixes in the end
So theyβre used to make sure the 3 axis remain completely independent from each other?
They express rotations in a way you dont need to worry about it to put it simple
There are some great explanations of gibal lock using a paper plane if you seach
You can definitly avoid it using matrices. Still the quaternion way is nicer to work with ar times
I would not worry too much about it in the beginning.
Start with simple matrices. It's much simpler.
I just canβt wrap my head around the whole 4d rotations in 3D space but Iβll dive into it more
I would put that on the shelf adding a mental note until you have the other topics sorted
It's much simpler to wrap your head around when you know 4 x 4 matrices well. Multiplication order etc.
For example the TRS rule (translation, rotation, scale)
vβ = T * R * S * v is important to understand
That sounds familiar
Isnβt v normalized too?
It's a vertex/position in space. so.. nope
Maybe Iβm thinking of rotation matrices
You'd rely on the matrix library you are using to keep things straight
Matrices / quats is a pretty huge topic. It's easy to get lost in the details. I would try to learn from a higher level first and actually use them in a simple project.
Unless you are extremely interested in math I would just jump into it and try some simple 3D with projection, and modelview matrix.
Play around with a simple solar system for example
Get a feel on how global / local rotations and translations works
Jokes on you Iβm just here for the math idc about the graphics
Iβm sure higher level examples would help but Iβm honestly a lot more interested in the low level concepts
ah π
The glm source is a nice reference : https://github.com/g-truc/glm
Should find matrix normalization, inverse etc
and quaternions are under ext
Itβd probably help if I understood cpp π
Or interfaces or headers
Iβll keep that pinned tho thanks
It's template based so it can be a bit confusing. Still a great reference when you find the implementation (ignore header files that are just template stuff)
So does this shader differ from shaders written in the program or do those shader overwrite it?
A common "program" has a vertex shader and fragment shader attached
The vertex shader just transforms each vertex. That's it
It takes in a vertex and all its additional info such as color (or whatnot) and transforms it using the supplied projection/modelview matrix
Based on what primitive mode you are rendering with (points, lines, tringles) all the transformed vertices will go to the primitive assembly stage.. clipping etc.
Then the fragment shader will run for each pixel on the screen that are part of the primitive.
You get all the information about the primitive as input in the fragment shader. Primitives are always rendered in the order they arrived
Hi my daughter has decided to take computer science as a school option.
I am trying to find ideas for simple but fun ideas that would engage her.
I pitched typical tic tac toe but these are met with just flat 'what ever' 'meh' all she does most days is trawl through reels. I thought about pulling in reels and say YouTube one into one but it seems Facebook api doesn't allow anything more than allowinf you to pull your own info.
I thought maybe we could make a meme caption game but with this idea it would require multiple players and I feel this might be a bit to much. Any ideas how this could be kept simple or any other ideas that might get a 13year old enthusiastic?
Many thanks
hmm. Very individual what is hit and miss. The most popular project I worked on with my 14 year old nephew was a game were the enemies was his fathers heads trying to reach the middle of the screen were the internet router was located. You had to "pick them up" with the mouse. If one enemy reached the router it was game over. "No more internet" π
My brother almost died of laughter when we showed the game. It was not my idea!
What do you want to create?
pls
just need to make some games