Author Topic: My currently unnamed project  (Read 5345 times)

0 Members and 1 Guest are viewing this topic.

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
My currently unnamed project
« on: June 26, 2011, 11:30:05 pm »
This is the project I have been quasi working on for a few weeks. It is to be a nearly completely user made game. what I will be making is the framework and a 10 level level pack to demonstrate what it can do.

This game will have two parts to its release version
The game engine that takes the levelpack files and lets you play the game.

utilities for making your own fully customized levelpacks

The Goals for the game engine part in order of importance:
Do not limit the player and developer too much from possible games
Provide interesting ways to play
Protect from crashes
have easter eggs(this very bottom level)

The Goals For utilities in oder of importance:
Easy interface
allows easy customization of levels, weapons, enemies, obstacles, characters
creates safe levels
almost no limits on what it can make
ability to compile into a not too large level pack

This game will have you be able to create custom weapons, and obstacles. You can assign those weapons to players and enemies. The obstacles can then be utilized in levels. All of these are then compiled into a level pack file. they will all be written in hexadecimal code.
The point of each level will be to move from a predetermined starting point to a 'flag'(you choose the image for this in the level customization. There can be enemies with very simple events set for their appearance(you picking up a nearby weapon, you getting to a certain point, or with a timer). These enemies can have either predetermined weapons or a weapon from a random selection of weapons you said are possible for it to use(the possible weapons are set while customizing the enemy the when/where they pop out and what weapons they have is set in the level file). there can be obstacles with set images/fill color/transparency that you set if htey do damage and/or impede movement if so by what percent. You make players saying what weapons they can use, whether they can double jump, whether they can crouch, with how much speed they jump and how much health they start with out of 100%. YOu put all of these things together into a level, you decide what player is used on that level, what obstacles and where they will be(this will be on  a grid I don't want it to be pixel by pixel), when and where enemies pop out(from that same grid), what the power of gravity is, where the flag and starting points are and images for those places

Now I've told about the game(more information later) what do you guys think the name should be?


Here is like the bare frame of the games code
Code: [Select]
#import neeeded modules
import pygame
import math
import sys
import random
import binhex
from pygame.locals import *

gravity=0

#check to make sure pygame is working
if not pygame.font:
    print 'Warning, fonts disabled'
if not pygame.mixer:
    print 'Warning, sound disabled'

#functions to create our resources
def load_image(name, colorkey=None):
    fullname = os.path.join('data', name)
    try:
        image = pygame.image.load(fullname)
    except pygame.error, message:
        print 'Cannot load image:', fullname
        raise SystemExit, message
    image = image.convert()
    if colorkey is not None:
        if colorkey is -1:
            colorkey = image.get_at((0,0))
        image.set_colorkey(colorkey, RLEACCEL)
    return image, image.get_rect()

def load_sound(name):
    class NoneSound:
        def play(self): pass
    if not pygame.mixer or not pygame.mixer.get_init():
        return NoneSound()
    fullname = os.path.join('data', name)
    try:
        sound = pygame.mixer.Sound(fullname)
    except pygame.error, message:
        print 'Cannot load sound:', fullname
        raise SystemExit, message
    return sound

#functions to get the stats for ingame objects
def getEnemyStats(ID):
    return {}

def getObstacleStats(ID):
    return {}

def getPlayerStats(ID):
    return {}

def getWeaponStats(ID):
    return {}

#function to get all the level data
def getLevel(ID):
    return {}

#function to get the constants for the game
def getConstants(levelpack):
    return {}

#class for enemies
class Enemy(pygame.sprite.Sprite):
   
    def __init__(self, name, ID):
        stats=getEnemyStats(ID)#get this enemies stats
        #define needed variables
        self.name=name
        self.ID=ID
        self.danger=0
        self.jump=0
        self.gravity=0
        self.xvel=0
        self.yvel=0
        self.area.bottom=599
        self.area.right=599
   
    def update(self):
        if not self.danger or self.jump:#check to see if there is a special situation
            if stats[speed]:#see if this is a moving enemy and at what speed it would move
                newpos=self.rect.move((speed,self.gravity))
            else:
                newpos=self.rect.move((0, self.gravity))           
        elif self.danger:#see if the enemy is in danger
            self.evade()
            return 0
        elif self.jump:#see if the enemy is jumping
            newpos=((self.xvel,self.yvel-self.gravity))
        self.rect=newpos#move the enemy to its new position
   
    #implement the force of gravity
    def gravity(self):
        #need a collision detector here
        if self.rect.bottom>=self.area.bottom:
            self.downforce=0
            self.jump=0
            self.change=0
            self.rect.bottom=599
        else:
            self.downforce+=1/constants[gravity]
   
    #evade danger
    def evade():
        return 0

def engine():
    return 1

def playGame(run):
    #start set_up
    while run:

        clock.tick(constant[speed])

        #run game engine
        engine()

        for event in pygame.event.get():
            if event.type == QUIT:
                pygame.quit()
                return
            elif event.type == KEYDOWN and event.key == K_ESCAPE:
                pygame.quit()
                return
            if event.type == MOUSEBUTTONDOWN:
                sets=pygame.mouse.get_pressed()
                if sets[0]==1:
                    pass
            elif event.type == KEYDOWN and event.key == K_LEFT:
                player.left()
            elif event.type == KEYDOWN and event.key == K_RIGHT:
                player.right()
            else:
                player.still()

        allsprites.update()

    #Draw Everything
        screen.blit(background, (0, 0))
        allsprites.draw(screen)
        pygame.display.flip()

def collidedetect(defense,offense):
    if offense.rect.left<defense.rect.right:
        if offense.rect.left>defense.rect.left:
            if offense.rect.top<defense.rect.bottom:
                if offense.rect.top>defense.rect.top:
                    return 1
            elif offense.rect.bottom<defense.rect.bottom:
                if offense.rect.bottom>defense.rect.top:
                    return 1
    elif offense.rect.right>defense.rect.left:
        if offense.rect.right<defense.rect.right:
            if offense.rect.top<defense.rect.bottom:
                if offense.rect.top>defense.rect.top:
                    return 3
            elif offense.rect.bottom<defense.rect.botom:
                if offense.rect.bottom>defense.rect.top:
                    return 3
    elif offense.rect.top<defense.rect.bottom:
        if offense.rect.top>defense.rect.top:
            if offense.rect.left>defense.rect.left:
                if offense.rect.left<defense.rect.right:
                    return 2
            elif offense.rect.right<defense.rect.right:
                if offense.rect.right>defense.rect.left:
                    return 2
    elif offense.rect.bottom<defense.rect.bottom:
        if offense.rect.bottom>defense.rect.top:
            if offense.rect.left>defense.rect.left:
                if offense.rect.left<defense.rect.right:
                    return 0
            elif offense.rect.right<defense.rect.right:
                if offense.rect.right>defense.rect.left:
                    return 0
    else:
        return 5

def main():
    run=1
    playGame()
    return 1

if __name__ == '__main__':
    try:
        levelpack=sys.argv[1]#get the levelpacks name
    except IndexError:
        print "need a valid levelpack file or folder"
        exit(1)
    constants=getConstants(levelpack)#find out the needed constants
    main()
I have lots of work to do
« Last Edit: June 27, 2011, 01:04:20 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline AGVolnutt

  • LV3 Member (Next: 100)
  • ***
  • Posts: 58
  • Rating: +4/-0
    • View Profile
Re: My currently unnamed project
« Reply #1 on: June 26, 2011, 11:39:28 pm »
10LvLZRUMGD

Ten Level Zero-Rudimentary User-Made Game Developer

Is it a 2d engine or 3d?

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: My currently unnamed project
« Reply #2 on: June 26, 2011, 11:40:33 pm »
2d for now. this is the kind of game I've always wanted so eventually it will be 3d but I only know 2d for now so...

I like the name just I'd like it to be a little catchier...
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline AGVolnutt

  • LV3 Member (Next: 100)
  • ***
  • Posts: 58
  • Rating: +4/-0
    • View Profile
Re: My currently unnamed project
« Reply #3 on: June 26, 2011, 11:46:42 pm »
10LvLRUNG Engine

Ten Level Real Unique New Game

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: My currently unnamed project
« Reply #4 on: June 26, 2011, 11:49:49 pm »
I'd prefer it if the name didn't say 10 level. the 10 levels I'll include will just be demos really. there won't be any limit on the levels a levelpack(I have some interesting Ideas you could do with this

EDIT:If you made the change between levels instantaneous with no transition and make an RPG like game with scenes as levels. You'd have to go in a certain order though and couldn't go backwards between scenes
« Last Edit: June 26, 2011, 11:51:18 pm by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: My currently unnamed project
« Reply #5 on: June 27, 2011, 12:53:43 am »
Is this like a platformer or like an fps?  That might have some influence toward the name...
« Last Edit: June 27, 2011, 12:54:00 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: My currently unnamed project
« Reply #6 on: June 27, 2011, 08:34:55 am »
Its more of a platformer. I'll go update the description a little to try and make it clearer.

EDIT:update have most of the unit creator working. It currently puts the data into a text file
test enemy killer file. I added comments to say what each line is
Code: [Select]
/str /Killer /2011-06-27 /enemy /ruler501 /FFBC /end#header with name of enemy date creators name, ID code(random 2 byte integer in hexadecimal)
0#class number
Killer#img folder
95#health(% of 100)
3#jump speed in px/s
50#transparency 0-255
4#walking speed running speed is just 2x this
1#boolean can crouch
5#AI level 1 would be perfect evasion if possible
I should have more up tomorrow. This was whipped together after much thought on how files should be set up. I should have  a rudimentary level editor by Thursday
« Last Edit: June 28, 2011, 12:29:01 am by ruler501 »
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: My currently unnamed project
« Reply #7 on: June 30, 2011, 10:33:11 am »
UPDATE:
I haven't done much with the engine yet, but I have a well working script for generating the objects like weapons/players/enemies/obstacles levels are almost done and must be postponed till I'm done 'deserting' you guys. I should be able to have a beta of this out a week after I get back from Northern Tier

My code for the utility
Code: [Select]
import os
import random
import datetime

name=raw_input("What is your name?")
curdate=str(datetime.date.today())

def base10toN(num,n):
    """Change a  to a base-n number.
    Up to base-36 is supported without special notation."""
    num_rep={10:'A',
         11:'B',
         12:'C',
         13:'D',
         14:'E',
         15:'F',
         16:'G',
         17:'h',
         18:'i',
         19:'j',
         20:'k',
         21:'l',
         22:'m',
         23:'n',
         24:'o',
         25:'p',
         26:'q',
         27:'r',
         28:'s',
         29:'t',
         30:'u',
         31:'v',
         32:'w',
         33:'x',
         34:'y',
         35:'z'}
    new_num_string=''
    current=num
    while current!=0:
        remainder=current%n
        if 36>remainder>9:
            remainder_string=num_rep[remainder]
        elif remainder>=36:
            remainder_string='('+str(remainder)+')'
        else:
            remainder_string=str(remainder)
        new_num_string=remainder_string+new_num_string
        current=current/n
    return new_num_string

type=int(raw_input("""what type of file are you making
1)weapon
2)obstacle
3)player
4)enemy
5)level
6)levelpack\n"""))
if type==1:
    wname=raw_input("What is this weapons name? It is a max of 10 characters long\n")
    if len(name)>10:
        print "please try doing this again correctly"
        exit(1)
    ID=str(base10toN(random.randint(0,65535),16))
    header='/str /'+wname+' /'+curdate+' /weapon /'+name+' /'+ID+' /end'
    wclass=raw_input("What is the class number for this weeapon?0-255\n")
    folder=raw_input("What is the image folder for this weapon?\n")
    strength=raw_input("How much damage does this weapon do?\n")
    type=raw_input("Is this a projectile or beem weapon?p or b\n")
    if type=='p':
        projectile=raw_input("What is the folder for the projectiles image?\n")
        speed=raw_input("how fast does this projectile move?\n")
        transparency=raw_input("How transparent is the projectile? 0-255\n")
        ammo='p '+projectile+' '+speed+' '+transparency
    elif type=="b":
        width=raw_input("How wide is this beam?\n")
        speed=raw_input("How fast does the beam move? put 0 for instantaneous movement\n")
        color=raw_input("What is the hex value of the color of this beam?\n")
        transparency=raw_input("How transparent is the beam? 0-255\n")
        ammo='b '+color+' '+width+' '+speed+' '+transparency
    else:
        print "Please do this correctly next time"
        exit(1)
    aimab=raw_input("How amaible is this weapon? 1-360\n")
    transparency=raw_input("How transparent is the weapon? 0-255\n")
    clip=raw_input("How many shots do you have between reloads?\n")
    time=raw_input("how many frames are there between shots?\n")
    reload=raw_input("How long does it take to reload(in frames)?\n")
    usablen=int(raw_input("How many classes is this usable by?\n"))
    usable=''
    for i in xrange(0,usablen):
        usable=usable+' '+raw_input("What is a class this weapon is usable by?\n")
    file=open('w'+wname, 'w')
    file.write(header)
    file.write('\n')
    file.write(wclass)
    file.write('\n')
    file.write(folder)
    file.write('\n')
    file.write(strength)
    file.write('\n')
    file.write(ammo)
    file.write('\n')
    file.write(aimab)
    file.write('\n')
    file.write(transparency)
    file.write('\n')
    file.write(clip)
    file.write('\n')
    file.write(time)
    file.write('\n')
    file.write(reload)
    file.write('\n')
    file.write(usable)
    file.close()
elif type==2:
    oname=raw_input("What is this obstacles name? It is a max of 10 characters long\n")
    if len(name)>10:
        print "please try doing this again correctly"
        exit(1)
    ID=str(base10toN(random.randint(0,65535),16))
    header='/str /'+oname+' /'+curdate+' /enemy /'+name+' /'+ID+' /end'
    imgType=int(raw_input("""Is this obstacle a solid fill or a img file:
1)solid fill
2)img file\n"""))
    if imgType==1:
        hex=raw_input("what is the hex value of the fill color?\n")
        img="hex "+hex
    elif imgType==2:
        folder=raw_input("What is the name of the folder with the image(s)?\n")
        img="img "+folder
    else:
        print "Try putting in a valid number 1 or 2 next time"
        exit(1)
    transparency=raw_input("How transparent is this obstacle? 0-255\n")
    damage=raw_input("How much damage does this obstacle do? 0 if it doesn't do damage\n")
    slow=raw_input("By what percentage does this slow a player/enemy? 100 if you can't pass through it\n")
    destroyable=int(raw_input("Can this obstacle be destroyed? 0 or 1\n"))
    if destroyable==1:
        health=raw_input("Out of 100% how much damgae can this obstacle take?\n")
        destruction="1 "+health
    elif destroyable==0:
        destruction="0"
    else:
        print "Please try to put in a value number 1 or 0 next time"
        exit(1)
    gravity=raw_input("Is this obstacle affected by gravity?0 or 1\n")
    file=open('o'+oname, 'w')
    file.write(header)
    file.write('\n')
    file.write(img)
    file.write('\n')
    file.write(transparency)
    file.write('\n')
    file.write(damage)
    file.write('\n')
    file.write(slow)
    file.write('\n')
    file.write(destruction)
    file.write('\n')
    file.write(gravity)
    file.close()
elif type==3:
    pname=raw_input("What is the name for this player? It is a max of 10 characters long\n")
    if len(pname)>10:
        print "please try doing this again correctly"
        exit(1)
    ID=str(base10toN(random.randint(0,65535),16))
    while len(ID)<4:
        hold='0'+ID
        ID=hold
    header='/str /'+pname+' /'+curdate+' /player /'+name+' /'+ID+' /end'
    pclass=raw_input("What is the class number of this player? from 0-255\n")
    folder=raw_input("What folder has the images for this player?\n")
    health=raw_input("How much health does this player have? Out of 100\n")
    jump=raw_input("How quickly does this player jump?\n")
    transparency=raw_input("How transparent is this player? 0-255\n")
    speed=raw_input("How fast is this player?\n")
    walljump=raw_input("HCan this player walljump? 0 or 1\n")
    crouch=raw_input("Can this player crouch? 0 or 1\n")
    file=open('p'+pname, 'w')
    file.write(header)
    file.write('\n')
    file.write(pclass)
    file.write('\n')
    file.write(folder)
    file.write('\n')
    file.write(health)
    file.write('\n')
    file.write(jump)
    file.write('\n')
    file.write(transparency)
    file.write('\n')
    file.write(speed)
    file.write('\n')
    file.write(walljump)
    file.write('\n')
    file.write(crouch)
    file.close()
elif type==4:
    ename=raw_input("What is the name for this enemy? It is a max of 10 characters long\n")
    if len(ename)>10:
        print "please try doing this again correctly"
        exit(1)
    ID=str(base10toN(random.randint(0,65535),16))
    while len(ID)<4:
        hold='0'+ID
        ID=hold
    header='/str /'+ename+' /'+curdate+' /enemy /'+name+' /'+ID+' /end'
    eclass=raw_input("What is the class number of this enemy? from 0-255\n")
    folder=raw_input("What is the name of the folder with the images?\n")
    health=raw_input("How much health does this enemy have out of 100?\n")
    jump=raw_input("How fast does this enemy jump(px/s) put zero if he can't jump?\n")
    transparency=raw_input("How transparent is this enemy? 0-255\n")
    speed=raw_input("How fast does this enemy move(px/f)?\n")
    crouch=raw_input("Can this unit crouch? 0/1\n")
    AIlvl=raw_input("how good is this enemies AI? 1=perfect\n")
    file=open('e'+ename, 'w')
    file.write(header)
    file.write('\n')
    file.write(eclass)
    file.write('\n')
    file.write(folder)
    file.write('\n')
    file.write(health)
    file.write('\n')
    file.write(jump)
    file.write('\n')
    file.write(transparency)
    file.write('\n')
    file.write(speed)
    file.write('\n')
    file.write(crouch)
    file.write('\n')
    file.write(AIlvl)
    file.close()
elif type==5:
    lname=raw_input("What is the name for this enemy? It is a max of 10 characters long\n")
    if len(lname)>10:
        print "please try doing this again correctly"
        exit(1)
    ID=str(base10toN(random.randint(0,65535),16))
    while len(ID)<4:
        hold='0'+ID
        ID=hold
    header='/str /'+lname+' /'+curdate+' /level /'+name+' /'+ID+' /end'
    startx=raw_input("What is the x value of the starting positions top left?\n")
    starty=raw_input("What is the y value for the starting positions(higher=lower) top left?\n")
    start=x+','+y
    endx=raw_input("What is the x value of the ending positions top left?\n")
    endy=raw_input("What is the y value of the ending positions(higher=lower) top left?\n")
    endimage=raw_input("what is the name of the image for the ending position?\n")
    endtransparency=raw_input("What is the transparency for the ending? 0-255\n")
    endtime=raw_input("How long do you have to stay on the ending position to win?\n")
    end= endx+','+endy+' '+endimage+' '+endtransparency+' '+endtime
    enemyamount=int(raw_input("How many enemies will you need to make?\n"))
    enemies=''
    for i in xrange(0,enemyamount):
        ename=raw_input('What is this enemies name?\n')
        ex=raw_input("What is the x value of the top left of where this enemy appears?\n")
        ey=raw_input("What is the y value(higher=lower) of the top left of where this enemy appears?\n")
        eweapon=raw_input("What is the name of its default weapon?\n")
        ewclips=raw_input("How many clips does it start with?\n")
        entrance=int(raw_input("""Does this enemy come in
        1)on time
        2)randomly
        3)by player position\n"""))
        if entrance==1:
            etiming=raw_input("HOw many frames into the game should this enemy appear?\n")
            entry='t '+etiming
        elif entrance==2:
            repeat=raw_input("Does this unit appear more than once? 1 or 0\n")
            entry='r '+repeat
        elif entrance==3:
            px=raw_input("When the player gets to what x value does this enemy appear?\n")
            py=raw_input("When the player gets to what y value does this enemy appear?\n")
            entry='p '+px+','+py
        else:
            print "Please do this correctly next time"
            exit(1)
        enemies+=ename+' '+ex+','+ey+' '+eweapon+' '+ewclips+' '+entry+' /'
    obstacleamount=int(raw_input("How many enemies will you need to make?\n"))
    obstacle=''
    for i in xrange(0,obstacleamount):
        oname=raw_input('What is this obstacles name?\n')
        ox=raw_input("What is the x value of the top left of where this obstacle appears?\n")
        oy=raw_input("What is the y value(higher=lower) of the top left of where this obstacle appears?\n")
        ogravity=raw_input("Is this obstacle affected by gravity?0 or 1\n")
        randomness=raw_input("Does this obstacle randomly appear throughout the level?\n")
        obstacle+=oname+' '+ox+','oy+' '+gravity+' '+randomness
    gravity=raw_input("What is the force of gravity in px's(lower=higher force)?\n")
    pweapon=raw_input("What is the default weapons name?\n")
    pwclips=raw_input("How many clips does the default weapon come with?\n")
    weapon=pweapon+' '+pwclips
   
elif type==6:
    pass
else:
    print "Try again with a valid number 1-6"
    exit(1)
The level part of it doesn't work yet. Once I've released this I will make it into a graphical editor, but until then I'll leave it as purely text
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y