Interested in Game Dev?

It looks like PyGame wraps around SDL and works across platforms. There’s also PyInstaller if we want to create one-click binaries to release (for Windows and Linux).

I think we have a winner.

Any objections to using PyGame? (Other than mine – it’s fairly low-level.)

I’ve used pygame before. It’s not complicated if you watch out for the right python and pygame versions.

  1. Choose a python version (2 or 3)
  2. Download and install the appropriate pygame. On Windows, I remember dragging and dropping the library in some folder and that was it. On Linux I installed with a package manager from a repo.

It might’ve been just my code but I found it really slow.

@Wulf since you’re neglecting our (my and your) joint project anyway, would you have time to do a quick download + test and see if it’s as slow as you remember?

1 Like

C/C++ isn’t so bad.

Behold!

_Bool dma_serial(char ID,char SR, char *buff, char length) //Set up & Service DMA requests. Returns void, reschedules self if fails.
{
struct USART_struct uart; //Struct for addressing UART control registries
struct DMA_Channel_struct DMAcha; //Struct for addressing DMA control registries
DMAcha = (struct DMA_Channel_struct
)DMAmem[ID][SR]; //Retrive DMA channel structure from LUT using ID and Direction as index
if (DMAcha->CSPR&0xC0){ //Dump function if channel is busy, make note for scheduler to re-attempt later
DMA_add(ID,SR,buff,length); //Add DMA request to list of pending transfers
event[0]=1; //Flag DMA for attention of main scheduler.
return 0;
} //Else: Channel is free, configure for transfer session
DMAcha->CCR &= ~(0x01); //Disable DMA during configuration
DMAcha->CCR = 0x00;
if(SR){DMAcha->CCR = 0x22;} //SR: 0-Send 1-Recive
else {DMAcha->CCR = 0x2A;} //CCR setting DMA configuration, bit3 = Direction
DMAcha->CSPR &= ~(0x38);
DMAcha->CSPR |= 0x10;
DMAcha->CNBTR = 24;
DMAcha->CPARH = (uint8_t)(DMAmem[ID][2] >> (uint8_t)8); //Point DMA to Peripheral memory address using pre-filled LUT
DMAcha->CPARL = (uint8_t)(DMAmem[ID][2]+1); //ID indexes peripheral channels
if (DMAcha == DMA1_Channel3)
{
DMAcha->CM0EAR = (uint8_t)((int16_t)&serialbuff[ID][SR][0]>> (uint8_t)16);
}
DMAcha->CM0ARH = (uint8_t)((int16_t)buff >> (uint8_t)8); //Point DMA to buffer memory address using pre-filled LUT
DMAcha->CM0ARL = (uint8_t)((int16_t)buff&0xFF);
if(ID==3){ //DMA called for SPI transfer, configure SPI control registers
if(SR){SPI1->CR3|=0x01;}
else{SPI1->CR3|=0x02;}
SPI1->CR1 |= 0x40;
}
else{ //DMA is called for USART transfer, configure USART control registers
uart=(struct USART_struct
)DMAmem[ID][2]; //Specific USART registers pointed to by LUT using channel ID as index.
uart->CR5&=~(0xC0); //Clear old USART DMA directional enables.
uart->CR2|=0x08;
uart->CR5 = (0x80>>SR); //Enable USART for DMA transfer depending on SR
uart->CR1 &=~(0x20); //Enable USART Tx line.
}
DMAcha->CCR |= 0x01; //Re-enable DMA for transfer
return 1;

}

1 Like

I’ll give it a shot :slight_smile:

Hey penguins @AbrarSyed @Severok @asad3ainjalout can you guys confirm what version(s) of Python you have installed?

On Ubuntu 14.04, I get:

  • Python2: 2.7.5
  • Python3: 3.4.3

These are pre-installed for free (didn’t have to download or build from source).

Hehe, “for free”

I can’t test it today ashes. I’m pretty sure it was a really horrible algorithm I had for path finding though. Still, I’d say anything else ewould’v handled the algorithm just fine.

on Arch we get…

  • python 3.5.1-2
  • python2 2.7.11-3

of course, being Arch, you gotta install everything yourself

behold the magic fenced code… that is done like so:

```java
public static void main(String[] args) { return 0; }
```

or

[code]public static void main(String[] args) { return 0; }[/code]

##output:

public static void main(String[] args) { return 0; }
1 Like

I can’t test it today ashes. I’m pretty sure it was a really horrible algorithm I had for path finding though. Still, I’d say anything else ewould’v handled the algorithm just fine.

@Wulf it sounds like you’re making a point that PyGame/Python has poor performance. I’m skeptical (especially because CPython tends to compile things). Let’s hope we have enough “coder power” to overcome these issues if/when they come up in our projects.

Are you okay with that? Or do you really think PyGame+Python is just woefully underpowered?

I had some discussions with Abrar, who had some discussions with Wulf. This is hard to explain clearly, so let me just say it directly.

Who owns this game prototype that we’re working on? Who’s responsibility is it to carry this on their back until it’s finished?

I assumed it would be part of Deen Games (and live on the Deen Games Prototyping team). But, it can also be a Muslim Gamer production (and go on the MG site).

The answer to this question really changes only two practical things:

  • Who’s responsible to drive this project to completion? (Is it me, or one of you?)
  • When we finish (ship) this and post it on the MG website, can we also post it on the DG website?

Abrar suggested a poll, so, here you go.

Who Owns and is Responsible For this Project?

  • It’s born and bred on MG and MG owns it
  • It’s pushed by ashes999 so DG owns it
  • It’s a joint collaboration and we both co-own it
  • It really doesn’t matter.

0 voters

@ashes999

Under Arch:
python-3.5.1-2
python2-2.7.11-3

Both were installed via the package manager pacman with very little effort ‘pacman -S python python2’

My impression has always been that Python is best suited for programs involving string manipulation (Particularly for things like Regex) but is somewhat inefficient for maths based processing in which case C++ is far more powerful. @Wulf 's assertion that his algorithum under python being reletively slow does sound reasonable to me.

Python is very easy to use, excellent with text based applications and automation. This would be my goto for rapid prototyping simple programs and applications where processing time and system resources are not key.

C++ is difficult to use (by comparison), excellent with more intensive and math based processing.
I would go C++ for more serious projects where performance is worth the investment of time and effort dealing with the additional complexity.

I have not used Java, so feel free to call me out if I am off mark. My impression is that it is more middle ground. Possibly not as strong as C++ but better if you have a multi-platform application.

@Severok does this asauge your fears?: Facts About PyGame

IIRC PyGame works pretty well and Python itself is used widely in the scientific computing community (see Numpy and other packages). We’re talking about hardcore calculations (eg. modelling how two organic molecules interact at the nanosecond/microsecond scale, atom by atom).

I’m willing to take a risk on poor performance in favour of high-language ability (read: the ability to code fast). In my personal experience, every performance bottleneck was my fault; never a limitation of the underlying program. You can always optimize and tweak if you get stuck.

Java and C# fall into the same camp, and perhaps Haxe to: they compile down to machine language, so performance is pretty comparable to C++, give or take.

ADMIN EDIT: that link… FTFY… or not…discourse hates me…

Python is fine with me. My opinion is something like 90% what I remember from my software engineering classes where they compared and contrasted python against C.

From the website you provided:

Uses optimized C, and Assembly code for core functions.
C code is often 10-20 times faster than python code, and assembly code
can easily be 100x or more times faster than python code.

So apparently the library abstracts C code allowing it to be placed in python? That would seemingly side-step the argument all together.

The real take away from that of course, is that we should be programming in Assembly.

Hahaha. No. Seriously, no.

30 days is barely enough time to do anything. We need to be as high-level as we can. For you, I think the challenge will be moving up to that top level of programming. Maintainability and readability are key; performance is usually “fix as necessary,” and it’s usually not necessary.

My challenge will be to battle my annoyance and try to spend more time writing game logic than wrappers around PyGame to make it more usable “next time.” That’s the scourge of being an API developer.

Any other objections to Python? @Wulf? @asad3ainjalout?

1 Like

No objections here; I was just sharing past experience :slight_smile:

Have we had any thoughts about the logistics and timeline for this project?

We are officially starting this project in Mid-July correct? and it seems like we want to have the language and genre selected by then.

Would it be reasonable for us to plan a set of 4 deliverable milestones for this project, 1/week for the duration? I am thinking something like:

Week 1: Brainstorming & Setup. Deliverable:
Design document including game genre, setting, mechanics, etc detailing games core mechanics, required functionality and desired functionality.

Having every member of the team set up with access to the projects file repository and a working IDE or required software for their role properly configured for development

Week 2: Core game prototype: A week setting up the engine and building something that "Works"
Deliverables:
A compiled and playable game with the bare minimum mechanics and assets for it to be called a game (The save point mentioned in that article a while back).

Week 3: Desired game prototype: A week spent expanding the core prototype adding in as many of the desired mechanics and assets as feasible
Deliverables:
An enhanced version of the previous deliverable closer to the game detailed in the design document.

Week 4: Play testing, Asset polishing and bug hunting.
A week where no more assets/mechanics are developed, but instead the work done in week 3 is properly tested, balanced and polished.
Deliverables: Final product.

Also: Of course I was not serious about using assembly. Do we need to use sarcasm tags here?

Pokemon Dungeon + Genetics

(Disclaimer: I haven’t really played Pokemon Dungeon.) I imagine a roguelike (eg. 25 floors of a randomly generated dungeon, you get to the bottom) where you’re cast as a pokemon-like creature. Your attacks actually have a range (eg. flame breath may damage a triangular-shaped area in front of you) and possibly affect the terrain (eg. set grass on fire).

You level up and gain new powers, and have the usual Pokemon-like dilemma of “which powers do I keep and which do I discard?” as you customize your beast.

You can also capture many enemies as playable creatures for future rounds.

Genetics: between games (after you die, before you start a new game), or perhaps in-game, you can use the DNA of any current or past creature you played to clone a new one. You can also use genetic modification (gene splicing specifically) to try and change their attributes.

Part of the game is genome mapping (capture enough eg. charmanders of different types and analyze them so you understand what each and every gene does).

Gene splicing is also based on real biological principles; one example is “certain genes travel together” (eg. maybe a super strength gene comes with a strength-nerfing gene), you either get both or have to isolate/separate them. Gene splicing can also cause unintended side-effects.

I really wanted to make this game for a long time, but never had a chance.

Your joke about assembly may not be a joke per-se, because 1) you are an experienced assembly programmer, and 2) PyGame told us assembly is up to 100x faster. I wouldn’t be totally surprised if we had you running through PyGame code and aseembly-fying a bottleneck that we find in our game :slight_smile:

TLDR: we iterate constantly and pull in features + polish as much as we have time for. We try to push all the prep work (IDE setup, etc.) to before we actually start.


Long version:

I believe the belief of my teachers (MITx edX courses on game design and educational game development), and the industry as a whole, seems to be “design documents don’t work,” because it’s hard to really understand the experience you’re building until you play it. Instead of that, we substitute in iterations of design and testing.

I haven’t pulled out my shiny project manager badge, but here’s what I’m sort of pushing for (sorry if it’s too pushy – Abrar already told me as much):

  • Preparation (up to Eid): foundation and validation. Pick the language (seems like Python is the current people’s choice), build a tiny “hello world” app (eg. show an image on screen, that’s it) and validate that it works for all of us. That is:
    • Try to get all coders to set up their build environments
    • Make sure we can generate executables for all platforms (eg. Flash/JS, or Windows+Linux)
    • In this case, create a single EXE and give it to a non-coder to make sure they can run it without issues or installing anything
  • Ideation (up to Eid + 2 weeks): pick the core idea. Discuss it, explore it, and see what seems like a fun concept or two. Agree on it. We know what we’re building roughly.
  • Week 1: build it really really really fast and cheap (eg. grey/red boxes for everything, no images or audio) and validate that it’s fun.
  • Week 1-2: Prove it’s fun even without graphics/audio. Keep iterating. If something doesn’t work, tweak it or dump it, and try something else. It has to be fun.
  • Week 2-3: Brainstorm/iterate extended feature set. Prioritize, and start implementing and iterating best-first until we run out of time.
  • Week 3-4: Polish what we have. If there’s time, pick another feature, implement it, polish it. Rinse and repeat.

At the end of week 4, we grind to a halt and say “we’re done.” We share it (post it on MG? Give it to friends/family?) and see what people think. We celebrate actually finishing something.

Does that sound okay to you guys?

BTW, I assume my role will be (sadly) mostly managing workload, keeping a backlog of well-defined tasks, balancing everyone’s opinions, focusing everyone on the goal, etc. and not as much coding :frowning: That’s how collaboration projects worked out for me in the past.

Hopefully, we have enough people to split among different roles, eg. one person per feature, or one person polishing, or one person bug-fixing, or something (and not stepping on each others virtual toes).

TLDR #2: Please install PyGame if you’re a coder. sudo apt-get install python-pygame works on Ubuntu, albeit just for Python 2.

This looks interesting: http://pythonhosted.org/sge-pygame/sge.html (high-level engine on top of PyGame). Myabe something we want to investigate.

Also, if you want to test PyGame, here’s a repository you can clone: https://github.com/ashes999/pygame-test

Run it with python main.py. It just draws an image to-screen. You should be able to run it with Python 2. (Let’s have that Python 2 vs. Python 3 discussion later.)