#game-development

1 messages · Page 20 of 1

limber veldt
#

Oh dang, had to add another condition to check if player is not carrying the item. There was a bug where I entered the object while carrying it, resulting in stuck inside object

#

I already have overlap conditions for entering internal rooms. Each internal room object has a collision rect constrained to its rect.center, if this rect overlaps any wall tiles, the object cannot be entered

#

Since exiting the object places player at object rect.center, if that portion of the object is overlapping tiles, it can dump player into a completely surrounded collision

#

So I needed a check for it

#

So I'll need to get both of those working together, need another condition

#

Time to put the overlap code into its own method, so it can be called from that moveUP() method

limber veldt
#

There we go

#

Just for completeness

limber veldt
#

I suppose I could actually break that iteration when assigning True to overlapping

round obsidian
#

Had an incident worth documenting:
with Pyglet, when you let objects go out of scope in a game loop, make sure they are entirely deleted from texture memory so they don't get accidentally GCed during the draw process, or the draw process will crash.

#

This turned out to be a side effect of some bad object management on my part.

unkempt wren
#

Falalalala, yes. Is this a ban speedrun?

#

Okay, what administrative need to you have pertaining to game development?

limber veldt
#

I changed all my gates to use the wider stems and ports too, I like it

limber veldt
#

If I do end up using them again, I'll refactor the narrow stems creation

#

I'll likely never use them again, the wider images are easier on the eyes

#

Time to ctrl cv the code folder and delete them

limber veldt
limber veldt
#

I have so this is as close to the corner that robot can be and still allow entry

#

No way one could use a robot to 'tunnel' through a wall or even into one

#

Also, robots won't move if any more than their bumpers are touching a wall

#

So that robot, even if he thrusts, won't move

honest heron
#

how do change my file directory to Desktop

#

im actuallly going insane

limber veldt
#

Is the project a folder with a few files? Use VSCode's File menu > Open Folder, browse to and select that folder instead of opening the files within the folder, this will open all files in the folder and set the working directory to that folder

#

Or work out the ../ path name and load it from where ever it is

#

I usually have a file structure as such, with Assets next to the code folder which contains all the .py files and open the code folder is VSCode. From there, I can get my assets with ../ like so...

limber veldt
#

But only because I open the code folder in VSCode instead of a file

#

Btw, for anyone interested in those functions, one must from os import walk to get walk

sterile nest
limber veldt
#

Right on, I always ctrl cv my code folder periodically, so end up with sometimes dozens of backups

#

The Droidquest project has loads of files and stuff, it's huge by my standards

#

I haven't counted total lines but gotta be near 25k

#

So keeping a clean file structure is important, and avoiding circular imports

#

I usually have one file in my folder, this one called lame.py, just to test whatever things I need....to test

#

Over 200 occurrences of 'class ' in Droidquest

#

And tons of inheritance

#

Almost everything has Item(pygame.sprite.Sprite) first in the mro

sterile nest
#

Yeah , once I make my tower game, I'm gonna use like atleast a Gig of storage for backups lol

#

25k lines os crazy

#

biggest program I made was like 3k lines across 3 files for a networking IRC server

sterile nest
#

just so you know

limber veldt
#

Nice to know, will probably avoid tha

#

t

sterile nest
#

im not sure why tho

#
def collide_circle(left, right):
    """detect collision between two sprites using circles

    pygame.sprite.collide_circle(left, right): return bool

    Tests for collision between two sprites by testing whether two circles
    centered on the sprites overlap. If the sprites have a "radius" attribute,
    then that radius is used to create the circle; otherwise, a circle is
    created that is big enough to completely enclose the sprite's rect as
    given by the "rect" attribute. This function is intended to be passed as
    a collided callback function to the *collide functions. Sprites must have a
    "rect" and an optional "radius" attribute.

    New in pygame 1.8.0

    """

    xdistance = left.rect.centerx - right.rect.centerx
    ydistance = left.rect.centery - right.rect.centery
    distancesquared = xdistance**2 + ydistance**2

    try:
        leftradius = left.radius
    except AttributeError:
        leftrect = left.rect
        # approximating the radius of a square by using half of the diagonal,
        # might give false positives (especially if its a long small rect)
        leftradius = 0.5 * ((leftrect.width**2 + leftrect.height**2) ** 0.5)
        # store the radius on the sprite for next time
        left.radius = leftradius

    try:
        rightradius = right.radius
    except AttributeError:
        rightrect = right.rect
        # approximating the radius of a square by using half of the diagonal
        # might give false positives (especially if its a long small rect)
        rightradius = 0.5 * ((rightrect.width**2 + rightrect.height**2) ** 0.5)
        # store the radius on the sprite for next time
        right.radius = rightradius
    return distancesquared <= (leftradius + rightradius) ** 2
#

It seems fast

#

this is game dev, but you need to delete line 4-7. And then assign a+b

limber veldt
#

I guess that makes sense because rects don't need any distance checks

sterile nest
#

Maybe I should push some code

#

I want to see if they will improve it

sterile nest
#
[0.45833669998683035, 0.4615948999999091, 0.4721016000257805, 0.4676309999777004, 0.46541229996364564]
[0.06254219997208565, 0.06156130007002503, 0.0633681999752298, 0.06414100003894418, 0.06397799996193498]
``` Mines faster ☠️
#

All because I do an intial check

#
if pygame.sprite.collide_rect(sprite_1, sprite_2):
brisk yew
#

btw, you're not supposed to use that function like this, but whatever ig

#

also sprite_1.rect.colliderect(sprite_2)

sterile nest
#

@limber veldt would you mind running some code real fast for me and seeing if you get the same speed difference?

limber veldt
#

Not at all, I'm just running a decent laptop, let's see

sterile nest
#

ah its like slightly too big..1 sec

#

the bottom is faster by like a factor of 7 lol

#

I feel like im doing something wrong

limber veldt
#

My values [0.40089050005190074, 0.38983520003966987, 0.40523919998668134, 0.4458810999058187, 0.41937420004978776] [0.05229899985715747, 0.050902700051665306, 0.05090170004405081, 0.04992869985289872, 0.051856900099664927]

sterile nest
#

yeah same

#

or close

#

to the same ratios

#

all thats different is a tiny check

if not left.collide_rect(right):
   return False
#

idk. Im not seeing how the performance tanks so bad by not having this

#

its averaging at a 9.5x decrease in time

sterile nest
#

just pushed a pull request

sterile nest
#

Added a little debug menu thing. Not really a "menu" since the buttons are hardcoded. But its good for now

hexed hound
#

hey,
I have been trying to make a game where I want to display some texts
but the thing is that I want it in such a manner that when the player presse spacebar the next text/message should come
I have created a list with all the texts in it
can anyone help me how to achieve that thing

limber veldt
limber veldt
#

For me using pygame, I would probably pre-create a list of font.render() surfaces using my list of strings (the texts) and display those according to the index, avoiding creating a bunch of surfaces during the main loop

burnt dawn
#

hello, anyone here know about wave function collapse? I don't get this picture on how it was propagated, at first I thought it was easy but I didn't know there's also a thing called entropy, is there more that I'm missing? or its only the entropy?

west escarp
#

Each gridspace has an associated probability distribution for the possible tiles based on neighbours,
And probability distributions have associated entropies you can calculate

#

@burnt dawn

#

Not sure if that fully answers your question or if I've misunderstood

burnt dawn
#

oh thanks, that helps

west escarp
#

It's actually super simple to calculate for a discrete distribution like this: sum the probability * log probability of each tile

burnt dawn
#

oh nicee, but idk math soooo 💀, I don't even know what this means

#

wait are u telling me I need to know the math about wave function to be able to implement it?

brisk yew
west escarp
sterile nest
# burnt dawn oh nicee, but idk math soooo 💀, I don't even know what this means

https://youtu.be/rI_y2GAlQFM?si=Jt54cndpFZtqSFds

The coding train has a full tutorial in Javascript.
At 8 mins, he explains thr concept and the math related

Straight out of quantum mechanics, Wave Function Collapse is an algorithm for procedural generation of images. In this video (recorded over 3 live streams) I attempt the tiled model and explore a variety of solutions to the algorithm in JavaScript with p5.js. Also, check out WFC's predecessor: Model Synthesis (more info below). Code: https://the...

▶ Play video
limber veldt
#

Inside my blue robot compared to the 'original'

#

Just finished refactoring all my objects that were using the old port stem objects to use the new ones

#

That got rid of 400+ lines of code between a few objects

#

Now everything with a port and a stem is using instances of the same object

#

Just different types

#

With the old stems, I was creating sprites for them, adding to a group and drawing the group. The new ones are being blitted directly on the device's image

#

Easier to deal with the objects now. Like I don't have to move their port and stem objects between rooms when player carries them into different rooms, they're self contained objects

sterile nest
#

Ah I see you also made a slider and a button for speed and Remote

limber veldt
#

Yeah, the original just used keys to change the settings with no indicators

sterile nest
#

wait, why are there 2 screens

limber veldt
#

Cept the antenna appearing over player head when remote is on

#

Running my game and the original game on top of it, then screenshot

sterile nest
#

ah nice

limber veldt
#

My rooms have more resolution in the grid size, the og had 20x12 tile rooms, mine has 24x15

#

This grid defines my robot rooms

#

Then of course, the items are added to it, the bumpers and thrusters and things

limber veldt
#

I, not too long ago, updated my python from 3.9.5 to latest, really enjoying the match/case statements. But I wonder if there is any substantial speed difference

#

I did some stylized tiles in some early versions, eventually changed to just plain colored tiles

limber veldt
#

I wonder if nesting a thousand of them would throw a max recursion error

sinful field
#

hi guys i wanna make a game in pygame, but i need to know what protocol should i use for tha lan multiplayer ?

#

anyone to help me

honest heron
#

@limber veldt idk I gave up

#

Imm take a break from coding idk who the hell made vs studio code but they sure make it hard to change a simple directory

#

might just delete vs studio code and restart on a different one

#

ill probably actually juse use the standard python idle

limber veldt
#

That's unfortunate

#

Check out this handle and train object, both of them are instances of Player and actually change the levels current player to themselves

#

So like the player doesn't necessarily pull the handle, the handle becomes the player and picks up the actual player then moves

#

Nevermind my purple background flipflop, makes it easier to debug the image and ports

limber veldt
#

I just did a renaming and bit of refactoring session that feels soooo good

#

I had too many uses of the word 'Port', sometimes as Port2, ExternalPort, Portal, whatever, that gets confusing when one of my files has 300+ occurrences of the word

#

My stem objects are now called Stem and referenced as .stems, not to be confused with the port objects referenced as .ports

honest heron
#

thats nice

#

@limber veldt I fixed my issue

limber veldt
#

Wonderful, what was the problem?

honest heron
#

I was able to get my player animated which was actually very hard becuase I using opp to do it and I honestly have never used object orientated programming

limber veldt
#

So many advantages to using a proper IDE

honest heron
#

it was the fire directory but instead of using > I used :

#

file*

#

now I don't know how to bring my player down to floor level in a class

limber veldt
#

You need him to be down with those bushes

honest heron
#

yea

#

I just don't know how to implement it with opp I tried just bringing him down but it just gave me a error

#

there has to be a way to do it I just suck and don't really understand computer logic well

limber veldt
#

If you'd like to share the part of code where you're placing the player, go ahead, maybe someone can see something to fix it

honest heron
#

I closed my ide but tomorrow i'll be sure to do that

limber veldt
#

Ok, that's fine, good enough for now

#

A lot of really small steps to learning a lot of this stuff, just takes time and practice, practice, practice

honest heron
#

ty

limber veldt
#

np

simple relic
#

I made something

wicked sail
limber veldt
#

No, but will eventually post to github

wicked sail
#

awesome, it looks fun to play :D

limber veldt
#

It's such an ambitious project for me, I really feel like I should get it a little better than it is before sharing, but I'm making good progress lately

wicked sail
#

is it based on a game you used to play?

limber veldt
#

Yes

#

Robot Odyssey, originally released by The Learning Company in like 1985. Then rereleased as Droidquest in 1999 or so, ported to Java

#

He did great at it

#

My python version is basically that ported to python and pygame

#

I have built from that source, but I'm not sure it will build with recent SDKs

wicked sail
#

Cool! do you plan to add multiplayer, or do you want to keep it as faithful as possible to the original?

limber veldt
#

No, I don't plan to, but it might be a cool feature

#

My version vastly improves the interface with modern controls

limber gazelle
#

considering the distinction between camera and world in openGL

#

would it make sense to think of it as: the camera doesn't move, the world moves around the camera?

limber veldt
#

My level objects inherit so the levels themselves have only the init() methods to define the rooms, all other methods are from BaseLevel()

#

One or two out of the 17 or so levels, has an extra override or two

#

The antenna objects, those which send and receive signals from other antennas inside other robots, share a common channel. If one is broadcasting, they all receive the signal. I'm thinking give them a channel selector so they can talk in private

#

It'd be easy to implement since they all 'broadcast' True values to the same list in the main.py and at the same index each time, like the blue robot only sets list[2] to True and so on

#

The other robots are currently using any() on that list but that's not a problem to change

#

I'd probably just give the antennas additional ports, one input and output for each channel

#

One could come up with some really smart puzzles with that functionality

winged kettle
#

Is python game dev just pygame or is there something more

limber veldt
#

There are many python game libs, pygame, pyglet, Ursina, Panda3d, Arcade, to name just a few

#

Some, like Godot, use a very similar to python language

limber veldt
#

Maybe I make a new object, an antenna transceiver with a button that can cycle all four robot colors and whatever color it's set to is the color of the robot it hears or talks to

#

Oh well, that's features, I have one more level of content to populate, about 20 more rooms

#

Another tutorial level 'Circuits'

celest canopy
limber veldt
#

And I finished populating the last level, now I can play with features

#

Cleaning up the imports. When I first started writing these levels, I just imported everything into all of them, they don't need everything

#

So they a little better now, one of levels

limber veldt
#

And I see why * imports are generally bad

#

One, because you get everything that module imports too

#

And two, they're unreadable

brisk yew
limber veldt
#

Okay

#

And both imports from settings should be one line

#

I'm still fairly new to all this inheritance stuff, so still learning, and I love it

#

My last few projects have quite a bit of it

#

It's all about categorizing my objects. all enemies should have a BaseEnemy, all devices a BaseDevice and things like this. That way they can all share functionality from the Bases

limber veldt
brisk yew
#

yep, I'd say it's def easier to read, some more structure to it
now, if speaking PEP 8, I'd do

json
random
tkinter

pygame

the
rest
of
them

but yk, not forcing it or anything, lol

#

(as if I could)

pine plinth
#

i follow this order:

  1. __future__
  2. typing, collections.abc
  3. sys, builtins, os and other low-level stuff
  4. rest of stdlib
  5. 3rd party
  6. my modiles
proper peak
#

I just let isort order them, and it follows pep8 (3 groups (builins, third-party, modules within package itself) and alphabetical within a group).

brisk yew
#

in rare cases have to be careful if import order matters for functionality with that though

#

nonetheless a very cool tool

limber veldt
limber veldt
woven scaffold
#

damn how many imports XD

limber veldt
#

Well, there's 200+ items, from rooms, to levels, to devices, to robots, tryna keep them organized

#

In about 35-40 files

fallow finch
# limber veldt Is something like this better, somewhat organized?

i always do :

import <stdlib module>
import <stdlib module>
from <stdlib module> import <stdlib thing>

import <third party module>
import <third party module>
from <third party module> import <third party thing>

from <file of my project> import <thing of my project>
from <file of my project> import <thing of my project>
from <file of my project> import <thing of my project>
limber veldt
limber veldt
fallow finch
#

wdym

#

yes i don't use import x, y, z, w

limber veldt
#

Okay, gotcha

fallow finch
#

but the important point is the newlines

#

i make 3 blocks

limber veldt
#

Makes sense

fallow finch
limber veldt
#

Sure, let's see how you would have them

fallow finch
#

can you give text version

limber veldt
#

One sec...

fallow finch
#

powertoys is mid

limber veldt
fallow finch
#

Levels is a folder i guess

limber veldt
#

I'm going to change to importing the levels during the method to set the level instead of importing all of them

#

Yeah

fallow finch
#

you made a folder thats named like a class yert

#

why

limber veldt
fallow finch
#

just use snake case

#

or one word

#
> levels
> chip_stuff
limber veldt
#

So the Levels folder should be lowercased?

fallow finch
#

yes

limber veldt
#

Okay

fallow finch
#

don't uppercase folder names

limber veldt
#

And ChipStuff folder as chip_stuff instead?

fallow finch
#

yes

#

and path_finder

limber veldt
#

Right on, thanks

#

Easy to change

#

Especially now that I've cleaned up most of the import sections

#

It is a work in progress and I really appreciate the input

fallow finch
#
import json
from os import walk
import pickle
from random import random, choice, randint
import sys

import pygame
from pygame import Vector2 as vec2
from tkinter import Tk
from tkinter.filedialog import asksaveasfilename, askopenfilename

from devices import ANDGate, NewPen, NewSwitch2, XORGate, NOTGate, ORGate, NANDGate, NORGate, XNORGate, BUFFERGate, FLIPFLOP, NODE2
from items import EvalButton, PaintBrush
from robots import NewBlueRobot, OrangeRobot, WhiteRobot, RedRobot
from settings import EDITOR_DATA, Colors
from support import Timer
# Newline maybe
from ChipStuff.stems import Stem
# Newline maybe
from Levels.level_lab import LevelLab
from Levels.level1 import Level1
from Levels.level2 import Level2
from Levels.level3 import Level3
from Levels.level4 import Level4
from Levels.level5 import Level5
from Levels.level6 import Level6
from Levels.level_robots import LevelRobots
from Levels.level_wiring import LevelWiring
from Levels.level_sensors import LevelSensors
from Levels.level_toolkit import LevelToolKit
from Levels.level_circuits import LevelCircuits
from Levels.level_teamwork import LevelTeamWork
from Levels.level_design import LevelDesign
from Levels.level_endgame import LevelEndGame
from Levels.level_main import LevelMain
from Levels.level_test import LevelTest
# Newline maybe
from PathFinder.pathfinder import PathFinder, DiagonalMovement
#

you really have a lot of imports from your files

#

so separating them a bit could be a thing (at least the things from different folders)

limber veldt
#

Yeah, the Level2() object, for instance, all of them really, are just room definitions and item population for Level() to run and DQ.py to set

fallow finch
#

is everything initialized at once like this too

potent elk
#

Uhhh can u guys help me

limber veldt
#

So I think all those level imports can be in the set_level() method

fallow finch
#

like initializing all levels at once is probably not required

limber veldt
#

Right

fallow finch
potent elk
#

Pls

fallow finch
#

WAIT

fallow finch
# limber veldt Right

you don't have to load all objects at once too
just load whats required for the level

#

maybe its a small game but for a larger game you can't load everything

limber veldt
#

I do for that particular file because it handles the toolbox, from which the devices are added

#

But yeah, I know what you mean. I still have some cleanup for these imports

potent elk
fallow finch
#

no

#

just write your problem here

potent elk
#

Ok

fallow finch
#

don't tell HELP ME and don't dm

limber veldt
#

I did get a pygame oom error earlier, too many Surface()

fallow finch
#

how much exactly

#

and and all the level stuff creating surfaces and stuff

limber veldt
#

I dunno how many, but I do know pygame has a limit

#

Right

fallow finch
#

you can't just load everything

limber veldt
#

I know

fallow finch
#

imagine if GTA had to load all assets

#

all the time

limber veldt
#

And it's the levels that are eating it up

fallow finch
#

because just one level needs to be loaded at once

#

you need to code something to unload them as well

limber veldt
#

They create, in some cases, more than 100 font.render() surfs

fallow finch
#

100 surfs is nothing tho

limber veldt
#

But for that many levels, and some even close to 200 surfs, it adds up

potent elk
#

Wait

fallow finch
#

you can have thousands of them

limber veldt
#

I changed my Text2() object to not use .convert_alpha()

potent elk
#

it gives me a error

fallow finch
#

tell error bruh

potent elk
#

import os

os.chdir(r'')

for f in os.listdir():
    f_name, f_ext = os.path.splitext(f)

    f_title, f_num = f_name.split("-")

    print('{}-{}{}'.format(f_num, f_title, f_ext))```
#

i have the path

limber veldt
#

So yeah, that will probably be my next bit of refactoring, loading levels on-the-fly so to speak

fallow finch
#

first don't use any absolute path like this

potent elk
fallow finch
#

no

#

the error isnt provided

#

python tells you an error message

#

about what's not working

potent elk
#

ValueError: not enough values to unpack (expected 2, got 1)

fallow finch
#

which line

#

the splitext or the split

potent elk
#

8

fallow finch
#

its the split

potent elk
#

so how do i fix it

fallow finch
#

if there's no - in the string you can't expect 2 values

#

your code isnt correct

potent elk
#

how

fallow finch
#

because there's not always a - in the string

potent elk
#

than

#

??

fallow finch
#

f_title, f_num = f_name.split("-")
if f_name is "banana" the split will just have one value which is "banana"

#

and you CAN'T put it in 2 variables

potent elk
#

bro how do i fix it

fallow finch
#

if your string is "ban-ana" you'll have "ban" in f_title and "ana" in f_num

#

but if value count isnt 2 then your code isnt valid

#

if the string is always intended to have a - then you're getting the wrong string

#

print it to see

potent elk
#

example: I have C #3

fallow finch
#

print f_name

#

to debug

potent elk
#

i want the #3 C

fallow finch
#

idk what this means

potent elk
#

u want me to print f_name?

fallow finch
#

print it in the loop

#

to see its value

#

because the problem comes from here

#

you're expecting a string with a - in it

#

if you don't understand this that means you don't understand your own code

limber veldt
#

That worked.

#

Commented the global import and just imported on a keypress

fallow finch
#

overusing this can lead to mid code tho

limber veldt
#

I wanna do it just for those levels

fallow finch
#

also is your code as simple as this

#

like the thing is straight up in the event.key

limber veldt
#

No, there are also portals that lead to that level

fallow finch
#

i mean is your program one file

#

and you're doing everything in the pygame event if statement

limber veldt
#

No

fallow finch
#

i make a class to abstract pygame events
that i use in classes representing my game states

limber veldt
#

That code is from the handle_set_level() method

#

No, wrong...

fallow finch
#

i use a class like this for states

#

with simple accessors for each part of the "engine"

limber veldt
#

Changed in set_level()

fallow finch
#

also its not a very good way to handle levels ngl

limber veldt
#

How else?

fallow finch
#

instead of hardcoding classes for levels you should have something like a json file

limber veldt
#

It's a great way to handle portals

fallow finch
#

to load as much levels as you want

limber veldt
#

Becase in the portal object, I can define the .next_level and read that in main

fallow finch
#

a level should be a json or pickle or something else file

#

not a code file

#

the level can have an id and you can use it from the code

limber veldt
#

That's an idea but pickle can't pickle surfaces

fallow finch
#

you can serialize surfaces btw

#

using pg.image.tostring

limber veldt
#

to_string()?

fallow finch
#

but just use image name

limber veldt
#

Right

fallow finch
#

don't do this anyway

#

the asset loading part is relative to your code

limber veldt
#

Something I haven't yet exploried

fallow finch
#

you use the image and sound NAMES in the level files

#

not the data itself

limber veldt
#

I'm also drawing with pygame primitives many of my images

fallow finch
limber veldt
#

So there isn't a lot of image loading, but still some

fallow finch
#

asset loading is a different thing anyway

#

i'm talking of making level files

limber veldt
#

Right

fallow finch
#

levels don't contain assets they use them

limber veldt
#

In my case, Level() uses them and levels define them

fallow finch
#

even assets like string could be elsewhere and loaded by the asset manager (so you can easily handle locales for example)

#

i'm saying most serious games nowadays dont have a Level1() class or a Level2() class

potent elk
#

yo

limber veldt
#

My level objects are just __init__() methods

potent elk
#

so what i need to do?

fallow finch
#

i told you

#

print f_name to see what it contains

#

because the issue comes from there

#

but looks like you don't understand your own code ngl

#

is it written by you

limber veldt
#

Always print things, man

potent elk
#

ye but not all

limber veldt
#

First thing to do when something goes wrong, print your values

fallow finch
#

do you know what unpacking is too

potent elk
#

uhhh to unpack the things

fallow finch
#

you dont cat_shrug

potent elk
#

bro cant help than just say u cant

limber veldt
#

So should I do a del current_level before instancing the new level?

fallow finch
#

i totally understand what your code does

#

but you don't understand it

potent elk
#

dont gotta make fun of a new coder

fallow finch
#

i don't make fun bruh

#

but as an experienced coder i can definitely see its not your code

#

or maybe you made it 6 moths ago

potent elk
#

than can u just help

fallow finch
#

yes i can

#

i told you twice

#

print

#

the

#

variable

potent elk
#

at the end??

fallow finch
#

before the split

#

so you know whats inside it

potent elk
#

ok

fallow finch
#

ngl you should work on something easier

potent elk
#

i did print it

limber veldt
#

Making json out of all the room layout defs in the levels would be a good start, I think

potent elk
#

it says C #3 which is a txt in my file

fallow finch
potent elk
#

ye

#

so what i di

#

do*

fallow finch
#

thats not possible

#

splitext is for file name and extension

#

a file name CAN'T be "C #3"

limber veldt
#

Here's one layout, as you can see by the index, it's room[62]. So that level has 63 of those defs in it. Importing those from json would be awesome

fallow finch
#

BRUH

#

pickle is maybe better

potent elk
#

bro what???

fallow finch
#

json is manually editable but pickle is made for python and supports all objects

limber veldt
#

Oh you know what, I think you're right

fallow finch
potent elk
#

ong

fallow finch
#

a file name can't be C #3

potent elk
#

bro

fallow finch
#

ngl you should check a python tutorial and do easier things first

potent elk
#

can i just ss?

limber veldt
#

I am already trying to implement pickle for saving a level, it's kinda working so far but still much work to do on it

fallow finch
#

because you're completely lost

potent elk
#

screen share

fallow finch
#

no sorry

fallow finch
limber veldt
#

But I think you are right, pickling these levels is a great idea

fallow finch
#

i generaly use a base dict

#

and a lot of things in it

#

like values

limber veldt
#

Now that I have them all defined, even moreso

fallow finch
#

this can be whats in a level

limber veldt
#

Right, that's a good idea too

#

I'm just not confident that these levels will pickle

#

I'll try it right quick...

fallow finch
#

if you use object types like lists and dicts it will always be pickle-able

#

most pygame objects can be serialized too

limber veldt
#

It worked!

fallow finch
#

bruh

#

of course it works

limber veldt
#

I haven't unpickled it yet but I did get a saved file of a pickled Level() object

fallow finch
#

why are you worried about pickling cat_shrug

limber veldt
#

Because previous experience tryna pickle sprites

fallow finch
#

you can serialize surfaces using tostring() but its a dumb idea

#

firstly because assets and levels arent the same thing

#

secondly you'll have the same images in the objects more than once

#

thirdly because serialized surfaces are big like BMP (while formats like png are compressed)

#

4thly because big pickle objects will be slower to load

limber veldt
#

Very interesting

fallow finch
#

i'm average pickle enjoyer

limber veldt
#

So can pickle the Level() objects, but not yet the sprites...eventually I'm working out saving current level

fallow finch
#

just use the image/sprite names in the pickle

#

and your asset loading will handle loading the images

limber veldt
#

And all the items/locations/wires/states

fallow finch
#

you can make dicts for them too (in the dict itself)

#

like each item with the location and the type for example

#

in a dict

limber veldt
#

Right, then parse that into the level on load

fallow finch
#

yes

#

but you load a python object

#

no need to parse a txt or binary yourself

#

to extract the info

limber veldt
#

I'm excited to see progress on my save_game()

#

And load

fallow finch
#

what is save_game() doing

#

saving what

limber veldt
#

That's the last main thing I really need to get woking

fallow finch
#

is this the game save file handler

limber veldt
#

Saving the state of all items/locations/wires within the current level

fallow finch
#

uh

#

but its a progress right

#

so its like a game save file

fallow finch
limber veldt
#

Yes, and they will be specific to each level

fallow finch
#

uh cat_shrug

#

alright

#

but game saves and levels are different things

limber veldt
#

Right, I get what you mean there

fallow finch
#

first thing is the game save files should be in appdata

#

but otherwise it can be a pickled dict too

limber veldt
#

Eventually

fallow finch
#

just don't put a modified level in it

limber veldt
#

But I gotta get them first

fallow finch
#

to get appdata you use pygame.system.get_pref_path()

#

pygame.system.get_pref_path("My Company Name", "My Game")

#

returns smth like "C:\Users\...\AppData\Roaming\My Company Name\My Game"

limber veldt
#

I just printed the pickle.load() object and, sure enough, it is what it's supposed to be

#

Happens to be the level I pickled....mind you. I only pickled the Level() object, that which defines a level, nothing to do with game saving here

fallow finch
#

if you make a serious game you need something to create the levels

limber veldt
#

That's what Level() actually does

fallow finch
#

to create them i mean

#

level design

#

you can use tiled and convert the tiled file to a dict of your format and pickle it

#

or make your own editor

limber veldt
#

But something to specifically create and another thing to specifically run, yes

fallow finch
#

you can't edit a pickle file by hand

limber veldt
#

Don't want to

fallow finch
#

and even if it was a json file it would not be a good thing to create levels

limber veldt
#

I thought about using tiled

fallow finch
#

it exports a xml thingy

limber veldt
#

And just importing the tmx

fallow finch
#

there's a module called pytmx that creates surfaces and stuff directly from the tmx

#

its widely used by beginners

limber veldt
#

Yeah, I don't really need it here, I think

fallow finch
#

i'm pretty sure tiled wasnt created for that purpose tho

limber veldt
#

I mean, it could make some things better, but as I have all these things already coded and parsing into objects in levels, I probably won't

fallow finch
#

yes its better to code your own thing

#

i don't think tmx files are intended to be game files

#

they're tiled projects

#

just like .ase

#

huh matt

limber veldt
#

Perhaps I'll move forward with this loading levels on the fly thing using pickled objects

brisk yew
#

I personally export Tiled to json and parse it myself

fallow finch
#

thats close to what we're talking about

#

i export tiled to my own format thats not pickle (but i could use pickle too)

limber veldt
#

As for the moment, I'm having a smoke break and a drink or two

fallow finch
#

wait you mean tiled can export to json natively

brisk yew
#

yep

limber veldt
#

This worked

#

Mind you, these are just shortcut keys for me to navigate the levels, not part of the game

#

So I can choose levels on keypresses for testing things

#

So for the set_level() method, I'll have a dict of relative paths from which to find the pickled levels...maybe

#

Because we don't need to get_path() for just teleporting to a new level

#

Testing passed, implementation next

#

I kinda really wanna lay the ground work for some kind of asset management

fallow finch
#

what type of assets do you have

limber veldt
#

Just images, really

#

And I'm just loading those with a couple of functions to load them into dicts or lists

fallow finch
#

you can make a global dict ngl

limber veldt
#

So they're already in dicts

fallow finch
#

just be sure to define the images to load or unload

limber veldt
#

Some make sense for me to have in a list for the objects that they go to but an overall dicts of them is a good idea

fallow finch
#

a dict can use strings as keys

limber veldt
#

Right

fallow finch
#

so you can use the keys in the levels for example

limber veldt
#

Ease of use

fallow finch
#

and flexibility

#

you can easily add or remove images

limber veldt
#

Yeah, I do that often

fallow finch
#

you probably need more types of assets btw

limber veldt
#

Don't have to change any args or params, just send the dict

fallow finch
#

such as :

  • fonts
  • strings
  • sounds
  • music
  • shaders
  • videos
  • ...
#

all assets arent handled the same way

limber veldt
fallow finch
#

asset handling is also about how you handle the asset files

limber veldt
#

This is populating my player image dict

fallow finch
#

the images can be defined in a json

#

thats what i do at least

#

but having it in the code is fine too

#

(i use a .pak file that contains all files including the jsons to define asset dicts)

limber veldt
#

And I have similar code for other assets

fallow finch
#

i was talking aboiut a global images dict

#

not related to player or smth like that

#

they're not related to the game logic

limber veldt
#

By global, what do you mean there?

fallow finch
#

all images of the app in a dict

#

they can be loaded or not

#

i have a global dict for each type of asset in my asset class

limber veldt
#

I mean, I know what global is, but as these assets are all part of main, they are kind of global in that they are being sent where they need to go

fallow finch
#

the game logic just use the names

#

the the names are defined in a json file

#

there's no pathes in the game code

limber veldt
#

i don't understand

#

How do do load an image without a path

fallow finch
#

i load it from my asset manager class

#

and i use a name for it in the images dict

limber veldt
#

I mean, there has to be something populating a global dict by loading assets into it

fallow finch
#

then the game logic just use the image name

fallow finch
#

the assets manager class

#

but the keys and pathes are defined in a json file

limber veldt
#

Well yeah, that's what I do, I never load images during game logic

#

Only load them in main init() and send them

#

By lists or dicts

fallow finch
#

any game is doing this

#

what i mean is a more specific thing tho

#

i use a dict for all images of the app
and the keys can be loaded and unloaded

limber veldt
#

And how do your instances get them?

#

By sending the values of keys?

fallow finch
#

wdym

#

when i load some assets the asset manager reads the json files and loads the assets

#

and then the game logic uses keys like "player_up" or "box"

#

not surface objects or smth like that

limber veldt
#

I'm trying to get what you mean by global dict of assets

fallow finch
#

a single dict for all images of the game

#

and a single dict for all sounds too

#

and same for all types of assets

limber veldt
#

Well that's just packing and unpacking into a dict, I don't see the advantage of having everything in the same dict though

#

Maybe to send the entire dict to other objects?

fallow finch
#

the advantage is
keys can contain None or the actual asset

#

because i don't just load

#

i also unload

#

to not keep everything in memory at once

#

and i can also use simple strings (keys) in the game logic

#

instead of using variables contaning surfaces or stuff like that

#

i make my own high-level handlers for the things too (like canvas for drawing stuff or mixer to play sound or music)

limber veldt
#

I'm kind of doing that with the various images for 'hot': [NESW], 'cold': [NESW] for individual object images

#

Then when I decorate() them

#

Just use the dict

fallow finch
#

whats this class

limber veldt
#

Parent class for all devices, those things with ports and get evaluated

fallow finch
#

idk what a device is

limber veldt
#

Many of those objects override that though

#

AND gates, NOR gates, these are devices

#

They have ports to which wires are connected

fallow finch
#

but so its a game logic object

limber veldt
#

All things which have ports are devices

#

Yeah

fallow finch
#

my images dict is in the asset manager

#

not in game object classes

limber veldt
#

Totally not making sense

fallow finch
limber veldt
#

I create the image dict when I instance the object

fallow finch
#

its not a dict like i use

#

i was talking of a dict for whole app

#

you're talking of a dict related to a game logic object

limber veldt
#

Oh I know

#

But I'm just saying this is what I'm doing so far

fallow finch
#

what you're doing is the usual way to load assets in a simple way in pygame

#

but your code doesnt really unload the assets right

#

and if you load different objects that means the same surfaces can be present more than once in ram

#

making the right classes and stuff is not that easy

limber veldt
fallow finch
#

alright

#

you want to hear something

#

the game objects shouldnt know they're rendered

limber veldt
#

Only in that they objects get kill()ed

fallow finch
#

thats right
a good game should be able to run without the rendering part

#

what you're doing doesnt respect that

limber veldt
#

What do you mean?

fallow finch
#

you have draw calls and images directly in your game objects

limber veldt
#

It's only drawing on its image, not to screen

fallow finch
#

oh

limber veldt
#

You see no reference to screen there

fallow finch
#

i thought there was

#

but well i can't achieve to say what i want to say

limber veldt
#

All of these objects are being drawn in main when it draws the groups they belong to

#

Device is an Item and Item is a Sprite

#

The mro

#

As for using images for every state of every object, just no way

#

Like my stems have to be drawn on the object in the state they're in, I can't have an dict with every image for every state in it

#

Item has all the moving and selecting and all handling of all items, including robots, keys, sensors, everything the player can interact with, devices are those things which get evaluated in the simulation

#

Images in objects, I don't get that. All pygame sprites must have an image

#

But there may be something I'm missing here. Is there to be a method in the objects for assigning the image from main or an asset manager?

#

Like, I could, and in fact, have had them being sent to the objects, just all that drawing on the image not in the object itself and instead being sent

#

Because the stems aren't part of the device image, they just get drawn on it

#

This is a class for a different game, it defines a bunch of paths in a dict and has this method for getting them. Perhaps this kind of idea for all these images

#

That's not a terrible idea. Would give me that global dict, so to speak

#

I'm always mixed between drawing and loading images. For things like my player, I have to load them but for simple things like my gates, I'd rather just draw them

#

But I'm going to draw them in a new object

fallow finch
#

i don't use pygame.sprite on my own

#

some of my images are sheets and i create a json file for sprite positions

limber veldt
#

I always send (pos) to sprites, sometimes convert to vector (if the object is animated, as in, going to move)

limber veldt
#

I did this kind of thing so far, not sure if it will stay this way

#

So I'm drawing the images, storing in a dict, instancing the object with the dict and getting the images from it

#

And sending them to the AND gate

#

Where it is using them instead of drawing them itself

#

Problem with that though...I gotta make sure to use image.copy()

#

Because drawing on one would otherwise draw on all and gates

#

Hmm, just tested and I could be wrong there but I'm not sure why

#

Oh, I get it, my Device.generate_images() is using copies of what it is sent

limber veldt
#

Slight change to that Images() object

fallow finch
#

i don't see a __init__ there

limber veldt
#

Well, it's not quite an object

fallow finch
#

its a behaviour-less class

limber veldt
#

But in the sense that everything in python is an object, it's an object

fallow finch
#

an object is an instance of a class

fallow finch
#

bru

#

a behaviour-less class is basically functions and variables using a namespace

limber veldt
#

I see no need to instance it and make it an actual object, I can reference it as Images.get_images('')

#

Which is what I'm doing now

fallow finch
#

that feels very incorrect

limber veldt
#

It's just a dict in a class

#

And a getter to get values of keys

fallow finch
#

getters arent even pythonic

#

idk whats your level in python oop but if you want to make unusual classes you should learn stuff like getattr/setattr

#

do you know properties at least

limber veldt
#

Yeah, lol, have used them a few times

#

But don't totally understand them

fallow finch
#

you mean properties

limber veldt
#

Yeah

fallow finch
#

they're the pythonic version of getters and setters

#

what do you not understand in them

#

getattr and setattr is also a cool way to make a dict-like class i use it sometimes

limber veldt
#

Just looking over some older code for an implementation I once did...didn't find it. But I don't understand the advantages of using properties over attributes...yet

fallow finch
#

properties call a function

#

if x is a property doing
my_object.x = something
can do way more than changing a value of an attribute

#

properties arent a replacement for attributes they're a replacement for getters and setters

#

well they use getters and setters to make something easier to use

#

no need to add useless comments to the getters and setters like in java

limber veldt
#

I'm going to try implementing some of this in another class...

#

Time to get our hands dirty

#

hah

fallow finch
#

show class

limber veldt
#

I will when I get something working

#

Nearly midnight here, happy NYE

pine plinth
#

🎉

limber veldt
limber veldt
#

This works

#

Just a test

fallow finch
limber veldt
#

No?

fallow finch
#

are all your classes actually behaviour-less

limber veldt
#

I don't know what that means

fallow finch
#

well this one isnt behavour-less

limber veldt
#

I mean, they all have methods

fallow finch
#

but are the methods just functions with a namespace (like in the Images one)

#

or do you have a real oop structure for your app

limber veldt
#

I still don't know what you mean

#

I showed you one of my objects

fallow finch
#

a class isnt an object

#

an object is an instance of a class

fallow finch
limber veldt
#

Yeah, and I instanced it

#

It's basically just a class with a bunch of methods like this one

fallow finch
#

i meant the structure of your program

#

what classes do you have

#

how do you handle the states of the app too

limber veldt
#

This is the main loop

fallow finch
#

i was more interested in seeing all the classes and methods rather than whats in the methods

limber veldt
#

So far, I mean, it can always and often does change

fallow finch
#

how are states handled

limber veldt
#

There are no 'states'

fallow finch
#

i don't see anything state-related in the main loop

#

huh

#

do you have other states aside game

limber veldt
#

It runs levels, that's all it does

fallow finch
#

states is the first thing i implement when making an oop app

limber veldt
#

I use states often, perhaps a different implementation that you're used to

fallow finch
#

well i didnt see everything

#

but looks like your codebase uses oop but absolutely doesnt benefit of using it

limber veldt
#

I like the structure of that project

#

It's part of Galaga

fallow finch
#

where is game instanced

#

and why so much parameters thocc

#

oh they're all images

limber veldt
#

Yeah, pretty much

fallow finch
#

i never use any parameter in main class

limber veldt
fallow finch
#

neat

limber veldt
#

It runs the whole attract mode

#

Another work in progress for me

fallow finch
#

i wasnt expecting seeing a game of that complexity

limber veldt
#

But to the point, i like that structure

fallow finch
#

be sure to learn about new stuff instead of just using what you already know

#

in general

#

you'll not regret it

limber veldt
#

You're already helping me with that

#

Yeah, I just started learning oop a year and a half or so ago, and I have much more spare time these days than I did back then, so ya know, learning, practicing

fallow finch
#

you can learn everything about oop in python in one month or two

limber veldt
#

We try

#

haha

#

So would you consider that a state machine?

fallow finch
#

thats not what i think about when i hear state machine

limber veldt
#

And some of that code is not even implemted, like the change player, it's there and I had used it before not anymore, maybe again in the future I implement two-player mode

fallow finch
#

state machine is one state -> one class for me

#

and i keep my main class minimal

#

(creating the high-level accessors classes for the states code and defining pygame event stuff)

limber veldt
#

That game is completely different setup, one of my own making from the ground up

#

Galaga kicks ass so far

fallow finch
#

what if you have a lot of states tho

#

like menus loading screen splash screen ...

#

or different game states

limber veldt
#

I have used the same idea on NPCs or any object for that matter

#

In a lot of ways, it makes things easier, as each state has its own logic

fallow finch
#

i don't see how hacing so much methods is clearer than just using a .update() method

#

my states just have .draw()/.display() .set() and .update()

#

other methods are just used in the class itself

limber veldt
#

I shared the short video..lemme look for the one that actually changes states...

fallow finch
#

i know the thing works yea

#

i'm talking of codebase rn not how it looks

#

but how would you handle a stack of ingame menus like in geometry dash for example

#

you see a level you check the creator

#

then you check something else in the creator menu

#

...

#

and it has to revert all the way to level

limber veldt
fallow finch
#

your game is good

#

but i was talking of code

#

how would you handle a stack of ingame windows for example

limber veldt
#

I would create a class for each of them, instance it, update() and draw() it

fallow finch
#

but where's the stack

limber veldt
#

What do you mean stack?

fallow finch
#

you click on something in the red window

#

it creates the green one

#

when you leave the green one you have to get back on the previous state (with the red one)

limber veldt
#

Right, not sure how I'd do that

fallow finch
#

with a classic state machine this is extremely simple

limber veldt
#

And close the green one?

fallow finch
#

when you close the green one you get back on previous state

#

you cant touch the red one when the green one is active

#

like you generaly add a dark overlay to the screen before putting the green window

#

ui stuff you know

limber veldt
#

Right, okay, so I'd create them, add them to a list or dict or object or something and only update the last one while those under it don't get updated

fallow finch
#

when you use a classic state machine you .update() one state

#

its pretty trivial to understand

limber veldt
#

The current state

#

But the state can always change to another state, depends on what triggers a state change

fallow finch
#

thats not what everyone uses btw

limber veldt
#

To where?

fallow finch
#

its used in the main class

#

and at next iteration of the loop it will be the new state

#

the update() methods from the states i mean

limber veldt
#

That's what I use that set_game_state() method for you see it's sent to all of the objects, so they can callback a state change

#

I'm always interested in learning more state machine implementations. In fact, that was one of my first questions in this channel a couple of months ago

#

I suppose it would be trivial to return something from an update() method and use that to set the next state

fallow finch
#

yes its straight forward

limber veldt
#

Done right, I wouldn't have to send that method to the objects

fallow finch
#

i do this so i can change the state directly in the state code

limber veldt
#

Makes sense

#

Then you can have one place to handle states

fallow finch
#

the main file is really minimal

#

i make the state machine and then all the code is inside state classes

swift solar
#

You got a GitHub repo?

fallow finch
#

the state machine contains the stack too

fallow finch
swift solar
#

U

limber veldt
#

Pretty minimal

fallow finch
#

also not a repo yert

fallow finch
limber veldt
#

It's basically just a launcher

fallow finch
#

yes lol

#

but i have things to say about some parts still

#

replace this

#

by os.path.join(path, image)

#

you can replace this

#

by os.path.splitext(image)[0]

#

splitext also works with full path

#

you may also not agree with this since a lot of people do it but "importing a folder" is a bad thing

#

any file that's added in the folder will break the game

swift solar
fallow finch
swift solar
#

What's Galaga? And where is

Game

Defined?

limber veldt
#

Well, I mean, imprting a folder of images and not finding an image will certainly break something

fallow finch
#

and adding any other file will too

#

open one of the images with HxD and you'll get a .bak file

#

the user can break the game by just opening the files

limber veldt
#

Well yeah, this is python

fallow finch
#

no lol

#

its not a python problem

limber veldt
#

One can open the file and type, broken game

fallow finch
#

just don't load whats in a whole folder lmao

#

serious games don't do this

#

its absolutely not related to python

#

for my games i use a single .pak file that contains all the assets but that's more complex to setup

limber veldt
#

I want that whole folder of images, it is a game folder, inside the game's file structure

swift solar
fallow finch
#

one or more archive files

#

and if they use folders they don't ask windows to check whats in the folder and then trying to load everything as images

limber veldt
#

So load one image at a time by name?

#

No

fallow finch
#

make a dict with the images to load

#

just define it yourself

#

instead of checking the folder

limber veldt
#

Load the entire folder into a list or dict and be done with it. If someone goes in there playing around with files, they deserve to break it

fallow finch
#

you just don't want to remove your function

#

because you like it

swift solar
#

Or you could just check the file extension to see if it is a type of image and then load it or not

limber veldt
#

I learned it from reputable sources and yes, I do like it

fallow finch
#

and adds more loading time too

#

why would you load additional images

#

a game isnt made to be modified this way

fallow finch
limber veldt
#

No

fallow finch
#

well most games you'll see don't use a folder for their assets anyway

#

@swift solar dont laugh lol

limber veldt
#

That's why I'm drawing some of my surfs instead of loading, eventually only loading player images...maybe

fallow finch
#

i like dafluffypotato's games but how he's loading files is MEH

swift solar
#

It's a funny name, I kinda want it now

fallow finch
#

bruh

limber veldt
#

I haven't watched him hardly at all

fallow finch
#

wait

#

apotato

#

fluffypotato

limber veldt
#

Most games have their images as?

#

bytestreams?

fallow finch
#

archive files

#

all files into one single file

fallow finch
#

but some can use encryption/compression

#

you can also have more than one if game is large

fallow finch
#

but zip adds unnecessary loading times

#

especially if your asset formats (like png or jpg images) are already compressed

limber veldt
#

I have no need to compress my images

fallow finch
#

i mean you can use it to have one single file for assets

#

not for the compression part

limber veldt
#

Or obfuscate them or the codes

fallow finch
#

an archive file is a container like a zip

#

with images/sounds/... in it

#

games generaly use this to handle the assets

swift solar
#

Ah

limber veldt
#

And to obfuscate them so regular Joe can't go in there poking around

swift solar
#

Wait like a .rar

fallow finch
#

.pak extension is the most common one

#

but .wad is more historic i guess

#

its the format used by doom

fallow finch
# swift solar Wait like a .rar

rar is a compressed folder like zip tho
the point of these archive files is just to have everything in one not to compress (and obfuscate too generaly)

limber veldt
#

Like every project I go look at github has a folder of images, seems the norm for python at least, to include images in the package

fallow finch
#

game distributions are what they are

#

games are generaly not open source btw

limber veldt
#

RIght, mine are

fallow finch
limber veldt
#

Like I don't care once I'm done with it what someone else does

fallow finch
#

unlike java with gradle which is very strict

fallow finch
#

but a game distribution isnt code files

limber veldt
#

Yeah, I'm a long time hobbyist

swift solar
#

I prefer maven

limber veldt
#

Hmm, I've been pygaming for about four years now, more heavily lately, as I said, more spare time

#

I worked through all of Coding Train's NOC series and that taught me a lot on making things move

swift solar
#

Coding train?

limber veldt
#

He's a youtuber

swift solar
#

I thought he taught JavaScript?

limber veldt
#

Writes Java and js though, not python

swift solar
#

Oh

#

Ok

#

I do a little of all 3

limber veldt
#

I can do a little, too, but he's so good at explaining that the language really doesn't matter

#

I know python and pygame well enough to transfer his logic into my codes

limber veldt
#

I tell ya, it is kinda nice having all this drawing in one place. I'm not sure it will stay this way but even if it doesn't, I have all the drawing in one place and easy to implement any way I choose

#

The end result will be a dict with all the images in it, I can then use that anywhere or just keep pulling them from the class

upper dove
#

how do you make an actual game with Python, like an accurate, fun, and addictive game

pine plinth
#

it has nothing to do with python

brisk yew
#

tbf, snake is/was a fun and addictive game
Python is a snake
see the correlation?

limber veldt
#

Makes perfect sense to me

normal silo
honest heron
#

does anybody know any good begginer projects

#

im tryna go back to the basics and develop a stronger base. I realized that im moving to fast I haven't even been 2 weeks in and i've moved past some subjects I would like to go back to and start from scratch . skipped to many projects and wasted time I shouldnt have

swift solar
honest heron
#

ive worked on a few games but they never rlly completed nad its been from alot of source code and tutorials I can read and edit the code and add some parts but im missing alot of logic I feel that I skipped over

#

@swift solar just how everything connects

swift solar
#

Ah I did something similar when I first started, you should choose a simple game like snake, tictactoe, or flappy bird (my favorite) and build it from beginning to end all by yourself self using past code and the Internet to help you when you get stuck instead of online tutorials

cinder spire
#

I'm working on making a game with pygame

#

How would I check to see if ESC was pressed?

fallow finch
#

be sure to check the docs

cinder spire
grizzled river
#

So python is mainly for creating web pages? 🤔

unreal river
toxic marlin
#

Does anyone have experience with integrating LlamaV2/other LLMs with Unity, whether through Sentis or otherwise? LlamaV2 can be serialized to .onnx yea?

brisk yew
brisk yew
limber veldt
round obsidian
#

Ark-annoyed :D

#

"what if Breakout, but also BULLET HELL"

limber veldt
#

Nice, but it has a USB connection lost sound, thought I lost a device, lol

#

So, how are you doing image assets? Drawing them in code, importing images?

round obsidian
#

I had problems capturing audio at first. Your pain is my pain

#

@limber veldt I dumped them from the source ROM

#

they're just loaded as PNGs

limber veldt
#

Yeah, so you're drawing them in code

#

Oh ok

round obsidian
#

there's only a one-time import cost anyway, so it's just easy enough to turn them into an asset pack and load that at game start.

limber veldt
#

How many enemies do you have so far?

round obsidian
#

just enough for waves 1-4. Brains come next 🧠

#

then tanks , and then I just have to set up the wave counts

#

and write the attract mode stuff

#

and do some high score keeping

limber veldt
#

Right on, it's looking really good

round obsidian
#

I wrote a custom shader to do the color cycling effects

limber veldt
#

I need to write shaders

round obsidian
#

it was quite the crash course

#

the 'beamdown' effects I didn't do with shaders last time, so I may just keep the old technique

#

oh, and I have been able to use another utility I wrote to deliver the game as a standalone package

upper dove
#

anyone goT a good game they could show me?

upper dove
round obsidian
#

you'd be surprised how complex even a "simple" game is, and how much you have to do just to make that game's mechanics workable

upper dove
#

what about c++ is it easier?

round obsidian
#

It's not about the choice of language