December 2016 Game Dev: 2D PCG Shooter

Goal: Create a procedural, 2D, top-down shooter like Enter the Gungeon in December.
Team (listed alphabetically):

Guys, can we use this as our official communication channel? I know @roketfiq and I are on Discord often; I’ll try to update things here that we discuss/decide.

@severok you’re good with Pyglet too right?

Hehehe… Pyglet… the perfect language for a Muslim dev team.

Yep I am fine. My First impressions of pyglet is that it is more event driven than pygame. It still looks pretty easy to work with.

Given this is our first run as a team, let’s focus on getting a minimum viable product set up than worrying too much about the end product.

The good games can come when we have found our feet.

As I understand for this style of project, speed is they key, over optimisation is the root of All evil. Make your code pretty enough for others to work with but make sure it runs in a week rather than running well in a month.

1 Like

∀evil ∈ over-optimization

Nice so if I rob a store, it’s got something to do with over optimization.

1 Like

@Severok spot on. I couldn’t have said it better myself.

I’ll try to break it down into small pieces here. Please try to keep it up to date when something’s done (and pushed). I’ll do the same.

Let’s get a basic PCG shooter done first. With coloured squares (yes, really). Then we can figure out (and flesh out features) while @Roketfiq does art.

Sound good?

FYI,

I cloned your Repo and I am good to go.

Time is limited tonight, so it looks like I won’t have time to post updated code, but I have started work. Insha Allah this weekend has some good opertunities to get to work proper.

I am trying to lay some ground work for object spawning and management.
I have set up a class that references object configurations on spawning:
IE: Game_Object(Enemy1, X, Y) should create a new object with the parameters defined for ‘Enemy 1’ such as Image, size, behavior, at location X, Y.

On construction, information is referenced from a seperate file object.py to populate the relevent object variables.

On deconstruction, Is a place holder in case we want run code in event of removing object such as spawning explosion/loot or adding points.

As for managing objects from frame to frame, I am planning to add a simple “For object in object_list” statement vectored to update the objects position/action based on a variable assigned during construction representing a behaviour type.

For the moment I can report I have:
Cloned the Repo,
Confirmed pyglet is setup correctly.
Updated your splash test to report mouse cursor movement/positions in the background while rendering your image.

Tomorrow I hope to have basic object spawning / management.
Once I have at minimum an existing player object and maybe an enemy object, I will look at rendering a play field for the relevent sprite and simple input.

If you consider theft to be an optimal form of acquisition… then maybe?
It is certainly faster than working.

1 Like

Derp!

  1. Cloning is awesome, because you can push directly without a PR. Abrar sent you an invite yesterday to your GitHub account (severokST)

  2. I don’t know why you’re considering object spawning. I would’ve gone with “what’s the minimum I need to make the player appear? Draw a red square!” and gone with that. Object spawning can come later.

But hey, if you want to start with monster spawning, I’m down with that. In fact, should we restrict the game world to the screen only? That’ll make it easier (and more hectic/frantic)… I don’t think that’s a bad thing.

  1. Can you add some tasks to the MVP issue in GitHub, just so it’s clear what you’re working on?

Otherwise, that’s great! I’ll try to stay out of your way by working on the boring/sucky items from the list instead of actual codez.

Oh, let’s try branching. Here’s a quick, short read about why.

Sorry, I pushed some changes to master. I’ll work out of a branch next time. Feel free to do the same, to even push your branch, and merge to master when you feel it’s ready.

Sorry @ashes987 , I must admit I have little experience with Git.
The only collab work I have done in the past used SVN and I have cloned every git repo I have ever used.

I will check out the link you posted and supply my updated code.

Currently it appears exactly the same as yours did, displaying the splash screen but with some underlying code.

What happens now is that the code starts, calling a py file I wrote that handles object prototyping.
On starting, a function is called which reads in a text file that is used to build several protoype objects (Player, 3x enemy types and some misc objects including bullets and the splash screen).

A function is then called to spawn an object (your splash screen) which then grabs a copy of the prototype object and puts it in a list of active objects.

The active object lists are used to systematically process each active object in the game and render their relevent sprites.

This results in the object for your splash screen to be pushed into the active list and subsequently rendered to the screen.

@roketfiq I can assign different images to differnt objects, so if you have any art to replace the coloured squares I can insert them now.

Edit:
Spawn: Splash screen object.

Spawn: Player object (Blue square), 2x Enemy objects (type 1 and 2 - Currently identical red box)

Edit 2:
@ashes987 Sorry to sound like a fool, but I do belive I am doing this wrong.

I made a branch for my changes so I could upload my code without immediately overwriting your work. But when I try to push I am getting permission errors.

I tried;
git checkout -b severok #working with new branch: Severok
git add * #add new files to local repo
git commit -m “Severok: Object spawning” #Commit changes to the local repo
git push origin severok #Push branch to remote repo.

remote: Permission to MuslimGamer/pcg-shooter.git denied to severokST.
fatal: unable to access ‘https://github.com/MuslimGamer/pcg-shooter.git/’: The requested URL returned error: 403

Do I need to be added to the project as a contributor or is this because I cloned the repo instead of pulling it earlier?

I added a reply to the issues page in github outlining my next goals.

My plan is to next look into setting up a thread to handle processing the game objects from step to step (if you have not already done so).

I have also included an additional file ai.py in which I am planning to build several basic AI behaviors, referenced by a dictionary.

The objects classs includes a variable flagging behavior type. On calling an ai.update() function, a dictionary is referenced using the objects behavior variable to vector off to an apporiate function that is to decide that objects next move and update its condition accordingly.

I have attached a dummy ai type to the misc objects (Cosmetic sprites) that should cause them to despawn after a set period of time. Once implemented the splash screen should despawn after a few seconds.

I wish I could back out my changes. You’re miles ahead and I’m just slowing you down.

I didn’t realize that I have to assign a team to the repo. Done. You should have push access. 403 => access denied IIRC.

But, you should see a failure saying your version is out-of-date, because I stupidly pushed to main. When you “git pull,” you’ll probably get a merge conflict. You can resolve it by destroying my changes (I can redo them later) – my changes don’t make sense given the design/architecture of classes you have going.

To summarize, you need to:

  • git commit to commit everything thus far
  • git pull pulls latest, creates conflict
  • git checkout --ours . obliterate my changes`
  • git add -A . to re-add the merged files
  • git push to push

If you don’t need to do that, because you’re pushing to a branch, you can eventually merge to main:

  • git checkout -b main
  • git merge severok
  • (see steps above)

I’m working in a branch now. Since you have the code well in hand, I’ll focus on the distribution and other stuff we have to sort out.

@roketfiq I would wait to add images once we have something solid for gameplay that we’re not going to change/delete. But since time is of the essence, start thinking about the overall art style and maybe practicing.

@ashes987 I’m still getting 403’d when I attempt to push.

Is there anywhere on git hub where I need to apply to be a contributor to this project?

I made a small revision to the maincode so now after the spash screen is called the game pauses for 5 seconds before removing the splash, spawning the player and enemy objects and starting a timed callback function for processing input/game updates

@severok try this (I use SSH as well). You will need to set up a PGP public/private key pair for this. GitHub.com has a nice page that walks you through the process.

AFAIK there’s nothing you need to do on GitHub to apply as a contributer; you’re already a contributer to the team. To prove this, click Settings and see if there’s an option to delete the project.

As far as splash screens, I thought we’d do at least one class per screen to keep things separate/isolated. I planned to convert my current code into a “base class” screen of just helpers to quickly do things.

Sounds like you’re making excellent progress mashaAllah. I’ll try to get the one-click binary thing setup today inshaAllah, plus Windows testing.

I’m so sorry. I just noticed that the MG org has read-access on teams by default. I changed it to write. Please try again.

Sorry, I haven’t used GitHub teams before.

@AbrarSyed sorry can you poke around on GitHub and see if everything is set up correctly?

No worries.

I had to take my son to his swimming lesson so Insha Allah I can push my branch later.

I vaugly remember we planned for project 1 week 1 to be getting the development environments/repo working and making sure everyone knows their role.

I don’t know how much time we have. Looks like roketfiq is into art only, you’re doing the main coding, and I’m doing the other stuff.

Let’s see how that goes. I would like to contribute more, but I fear treading on your work and causing more issues than I help.

I am very happy to let you run game design and scripting. I get the impression that is where your strengths are from seeing your rpg work.

I like the technical stuff like object handling and collision detection, so I can work on all that.

I am looking to put most of my functions in additional py files that you can call through some sort of simple APi so you can more or less handle the main.py file and general Game scripting.

My objects can be assigned arbitrary images (just specify an image path in the object data file), so when Roket wants to add some of his art we should be able to add it in fairly quickly.

lol brilliant reply

I’m not sure what you mean by “scripting” in this context. I’m flattered that you think my strengths are game design and scripting.

I’m like you. I like the technical stuff. For me, it’s all about cutting to the minimal possible code and content to make this a workable game.

I’m happy to let you run with it until we have a working shell of a game (blue square shoots randomly-generated red squares, player can walk around, walls). Then I’ll have to poke your architecture and figure out what makes sense.

I’m very fond of having external constants in a JSON file, ideally dynamically reloaded, so non-coders can just tweak that and the game updates itself. This is usually possible by having some sort of Config class with get/set values that just always reads them off disk. A better version caches values in memory and reloads them if the file changed.

I’ve got an installer working. Could you please pull the ashes999 branch and then try:

./build.sh`
cd dist
cd main
./main

… and tell me if it works?

I can do the splash screen and title screen once I get mah hands on your codez. Especially your uber leet fading in/out code.

lol guys @ashes987 and @Severok - I am trying so hard to catch up but I have no idea what you guys are saying. All these things are flying over my head. Where do I even start? Am I just worrying about art? If so, am I making fancy squares to insert? lol