|
Post by Neon_Knight on Sept 1, 2014 23:22:34 GMT
I had this idea a long time ago in my head. You see, I like fighting games, though I suck a lot at them. :/ I was wondering, how well GKC would fare as a Fighting Game? After talking in the IRC with the guys, they convinced me to open this thread. Basically, the idea is to see how many people is interested in working into this game. We must also decide which game engine to use, who's going to do the graphics, who's going to do sounds, voice acting, GUI, etc. Of course, there's going to be a lot to discuss. So far, I've been saving my ideas in this document: docs.google.com/document/d/1F7j15S6USK8fC2XWfzxlS4HbOt0czaRK6kyGr2_-dSQ/editNot to mention my very first contribution to the awesome ISAO thread. What do you think?
|
|
|
Post by fwip on Sept 1, 2014 23:34:01 GMT
Alright, so I'm also from the IRC channel. I think I can do backgrounds and possibly some coding.
|
|
Thoth
Junior Member
Posts: 92
|
Post by Thoth on Sept 1, 2014 23:50:03 GMT
I can also help with programming.
|
|
|
Post by The Anarch on Sept 2, 2014 0:53:08 GMT
I can contribute to voice acting. And if there's gonna be a story mode, writing as well.
|
|
|
Post by Daedalus on Sept 2, 2014 3:56:10 GMT
I can contribute to voice acting. And if there's gonna be a story mode, writing as well. I as well, on both counts. If someone would teach me the programming, I would love to help with that (great skill to learn haha)* *I know programming, but probably not the language used here. It would be a text-based game to begin, I assume? Then move to the animation stage? Also, Neon_Knight, I'm very impressed by the work you put into that document
|
|
|
Post by Neon_Knight on Sept 2, 2014 13:44:05 GMT
Story mode could be comic-based (think of Le Bizarre Avventure di GioGio: Vento Aureo). (11:50 below) The main gameplay, on the other hand, is a straight FG. Think of Tatsunoko vs. Capcom. (I almost forgot about that game, it was the game I had in mind when I first had the idea) Something closer to what this game could be (bar the character designs, of course) artwork-wise is Skullgirls. (Potentially not safe for work)
|
|
|
Post by fwip on Sept 3, 2014 4:51:06 GMT
Story mode could be comic-based (think of Le Bizarre Avventure di GioGio: Vento Aureo). (11:50 below) The main gameplay, on the other hand, is a straight FG. Think of Tatsunoko vs. Capcom. (I almost forgot about that game, it was the game I had in mind when I first had the idea) Something closer to what this game could be (bar the character designs, of course) artwork-wise is Skullgirls. (Potentially not safe for work)
I think that with this small a community, if this game is completed it will be by necessity a hodgepodge. Here's a background. I don't know if it can be used - I originally drew it for a fanart then gave up on the characters because I don't draw characters very well. However, it is a good sample of what the backgrounds will end up looking like, if I do them.
|
|
|
Post by sleepcircle on Sept 3, 2014 15:31:15 GMT
i know its really exciting and cool to think that you could be part of a project to make a gunnerkrigg court fighting game, and in theory every bit of help counts, but I think people probably shouldn't offer to help unless they actually have the skills to make good on their offer. You'll just bog the work down otherwise and project tasks will get lost and misplaced as people who don't have the ability to complete them monopolize the work schedule. that said i am an artist with a couple years training in animation. if you can get a team and a plan of attack, i would be pretty interested in helping. here is my portfolio www.dropbox.com/s/9u5g04fh94os43b/John%20Fraser%20-%20Portfolio%202014.pdfi'm also a hobbyist musician and sound designer, but i'd be quite willing to yield the floor there to someone with more experience on the subject than me. EDIT: there's not much online that i can use to show my sound/music work besides this youtu.be/iCrzprLZ96obut but i did create the atmosphere/synth pads for this from scratch. OTHER EDIT: just one or two writers should be enough, and you probably shouldn't look into getting those until you actually have an engine and a means of staging story segments.
|
|
|
Post by Neon_Knight on Sept 3, 2014 15:57:58 GMT
Well, I told the guys I'm not a good team leader. While I wrote that document, I lack most of the other skills needed for team leading, such as graphics (the ISAO pics don't count :/), sounds, coding (still learning), and most of all how to properly drive a team. My only experience with game design was level design for a few FPS, and a bit of Blender. :/
So yeah, we need a team leader.
About the writing, there's not really much writing to do. Story mode can very well be a recreation of the actual comic, a la JJBA: All-Star Battle.
|
|
|
Post by The Anarch on Sept 3, 2014 17:26:09 GMT
Credentials, eh? I can lay out a few examples, I suppose. Voice Acting 1 - Coyote audition made for a thread here. Voice Acting 2 - Teaser for The Perjurer, coming soon I hope! Original Writing 1 - Agent, a short horror story. Original Writing 2 - Vigilante Shift: Double Docked, a prototype short story for a superhero webcomic idea I'm developing. Comic Writing 1 - A page of Role of the Die, a webcomic I used to make about RPG players. Comic Writing 2 - Another page of RotD. Comic Writing 3 - G for Genesis, a parody comic I was making based on people I knew on a forum a long while back. Unfinished because writing is easy for me but keeping up drawing is not. Fan Fiction Writing 1 - Go on Living, a short fanfic based on 90's MTV cartoon series Daria. Fan Fiction Writing 2 - Screams of Silence, a novel length fanfic crossover of Daria and Silent Hill.
|
|
|
Post by fwip on Sept 3, 2014 18:18:55 GMT
i know its really exciting and cool to think that you could be part of a project to make a gunnerkrigg court fighting game, and in theory every bit of help counts, but I think people probably shouldn't offer to help unless they actually have the skills to make good on their offer. You'll just bog the work down otherwise and project tasks will get lost and misplaced as people who don't have the ability to complete them monopolize the work schedule. I have definitely seen this happen. For some things (like standalone images like backgrounds) maybe the best way to do it is to simply post the completed project, like I did. At this stage, with so much to do, there isn't that much of a risk of two people inadvertently performing the same task. We have no one with either of these skills so far AFAIK, so you could potentially be a huge help. I'd also encourage everyone to drop by the IRC channel because it seems like most of the decisions are being made there, and a lot communication that goes on there never makes it to the forums. For instance, I understand Thoth has already started coding a prototype. Well, I told the guys I'm not a good team leader. While I wrote that document, I lack most of the other skills needed for team leading, such as graphics (the ISAO pics don't count :/), sounds, coding (still learning), and most of all how to properly drive a team. My only experience with game design was level design for a few FPS, and a bit of Blender. :/ So yeah, we need a team leader. About the writing, there's not really much writing to do. Story mode can very well be a recreation of the actual comic, a la JJBA: All-Star Battle. I am in favor of a mostly decentralized approach to organizing this project anyway.
|
|
|
Post by fwip on Sept 3, 2014 20:13:00 GMT
OK, can someone with some experience playing this sort of game give me some pointers as to what the backgrounds should look like? Presumably there would be a foreground and a background with a... ground in between at a right angle to the other two. What should the dimensions of each level be? What scale should I draw them at? etc, etc. Just give me some pointers and set me to work, and I'll have the next one done in a couple of weeks.
|
|
|
Post by sleepcircle on Sept 3, 2014 23:14:45 GMT
i don't mean to be a huge downer, but I think a decentralized approach is a very poor one, and unless someone is spearheading this thing i'm not totally sure the game will make it through to completion.
most successful, large-scale open-source endeavours that i can think of (linux, blender, openoffice, mozilla) have usually been successful because someone or a small group kept everyone else running on the same track and had a clear vision. even closed-source stuff tends to do better under a single hand than when its decisions are made by consensus.
i mean i wish you the best of luck! but i've been involved in one too many failed projects where the plan wasn't clear and nobody was really in charge, so i'm not going to jump on board and start like churning out miles of resources without a guarantee on paper that someone somewhere knows what i'm actually doing any of this for.
|
|
|
Post by Daedalus on Sept 3, 2014 23:35:23 GMT
sleepcircle: I agree that projects never get done unless there is a central group working on it, or unless there is a huge number of people working on it. I'd love for this to be done (also because I could learn more coding) but I doubt it ever will be completed. Prove me wrong, people
|
|
|
Post by fwip on Sept 3, 2014 23:35:41 GMT
i don't mean to be a huge downer, but I think a decentralized approach is a very poor one, and unless someone is spearheading this thing i'm not totally sure the game will make it through to completion. most successful, large-scale open-source endeavours that i can think of (linux, blender, openoffice, mozilla) have usually been successful because someone or a small group kept everyone else running on the same track and had a clear vision. even closed-source stuff tends to do better under a single hand than when its decisions are made by consensus. i mean i wish you the best of luck! but i've been involved in one too many failed projects where the plan wasn't clear and nobody was really in charge, so i'm not going to jump on board and start like churning out miles of resources without a guarantee on paper that someone somewhere knows what i'm actually doing any of this for. Fair enough. I suppose it's more of a certain style of leadership I object to (although that may be the same style I tend to practice myself. It's a moot point unless I end up being the leader.) I agree that a leader is necessary, but the leader's role should be more to organize us and answer questions then to lead us to a goal that belongs to him alone. As volunteers from a fairly small community, this game will belong to everyone who works on it, and everyone should have a say in design decisions. ("Designer" is a better term - the Designer is the originator of the vision and maintains the design document as well as answering questions, but realizes that individual skills will mean that the game will not end up identical to the original vision, instead evolving into something new and usually beautiful that could not be forseen. Disclaimer: see my current status. Edit: My approach to working on large projects, communal or private, is that the journey is as valuable as the goal. Keep on working on it as long as interest remains, but keep in mind that it may never reach completion. In addition, I may be able to contribute less and less as my homework load increases.
|
|
|
Post by sleepcircle on Sept 4, 2014 6:22:09 GMT
yes, a good leader knows how to let people do what they're good at. like—a leader knows how to let other people do their own thing; a leader doesn't do all the design himself, breathing over the designer's shoulder, nor does a leader micromanage the gameplay, or force the musician to do only the songs the leader specifies.
like—yes, a good leader lets everyone have a say and takes this into consideration. but people are always going to pull different directions, and when people can't agree, or the work is getting too spread out, someone is going to have to call everyone back in, or make the final decision, or prioritize. maybe not even one person, the leader could be plural—a small group to, as you said, organize people and answer questions—but they also should have a strong gestalt sense for what the game should be like or else when the project is starting to pull apart, or wander, a crowd of people focused on their own goals might not notice as quickly as one or two who have to keep track of all the individual elements and keep them in sync.
it's great if the game evolves into something new and beautiful but if the mutations are uncontrolled it might just as easily die of cancer.
i am not demanding a dictator, or even a benevolent monarch, i'm just saying that a prime minister or a small parliament would be a good idea.
also i have been part of too many forgotten and abandoned journeys i suppose; i would like to finish something as the result of joining a project. i guess that's why i do stuff in the first place. i write stories because they're stories i'd want to read. i work on animations because they are animations i'd want to watch. if i never get to read them or watch them, then i might as well have put all that time into something i COULD finish.
|
|
|
Post by fwip on Sept 4, 2014 14:16:00 GMT
Well, in this case the leader may do all the design himself. I get the impression that in a small project, having the leader and the designer be the same person isn't uncommon.
|
|
|
Post by csj on Sept 6, 2014 22:02:10 GMT
I feel like that genre's had its day by now. It might be relatively straightforward, but I would encourage making something a little different. A turn-based tactics game, perhaps?
Like X-COM, only fewer aliens.
And yeah, I would like to contribute to a successful GKC game, but that's the rub; I'm a little tired of making/assisting half-finished projects. I recently composed the soundtrack to a game which never left alpha, despite my 'part' being done. Investing time in something when members aren't committed is a recipe for a rather depressing failure.
You want this to happen, you'll need to be prepared to make it happen, especially if you want others to chip in.
|
|
|
Post by fwip on Sept 7, 2014 0:31:42 GMT
I feel like that genre's had its day by now. It might be relatively straightforward, but I would encourage making something a little different. A turn-based tactics game, perhaps? Like X-COM, only fewer aliens. And yeah, I would like to contribute to a successful GKC game, but that's the rub; I'm a little tired of making/assisting half-finished projects. I recently composed the soundtrack to a game which never left alpha, despite my 'part' being done. Investing time in something when members aren't committed is a recipe for a rather depressing failure. You want this to happen, you'll need to be prepared to make it happen, especially if you want others to chip in. I think it's a little late to think of something like this. I also do have faith that we will get to the point that this game is playable, with at least some content.
|
|
|
Post by Daedalus on Nov 6, 2014 16:32:42 GMT
Hey, did this ever go anywhere?
|
|
|
Post by Daedalus on Nov 25, 2014 22:16:21 GMT
I was bored so I wrote a simple python script for this. No visuals yet but the combat mechanics are almost there. I doubt it'll ever get finished but if anyone else is interested I can put it here.
|
|
|
Post by fwip on Dec 5, 2014 4:48:43 GMT
I was bored so I wrote a simple python script for this. No visuals yet but the combat mechanics are almost there. I doubt it'll ever get finished but if anyone else is interested I can put it here. Put it here so that if interest continues without you we can work on it. @thoth should do that for what he has too. Hell, we should have done that with the Minecraft server.
|
|
|
Post by Daedalus on Dec 5, 2014 7:13:24 GMT
fwip: tragically I cannot do so at the moment because my laptop (with the only copy) is missing I'll put it up here when/if I find it though!!
|
|
|
Post by fwip on Dec 5, 2014 7:13:45 GMT
oh yeah, that BS. Hope you find it soon!
|
|
|
Post by Daedalus on Dec 30, 2014 6:09:34 GMT
Hey y'all: I was bored, so I started coding a GKC game in Python. I followed Pokemon's approach a bit more (easier to code), but it's a very rough combat system model which could be adapted to a fighting game. Absolutely no animation so far, of course - just the simplest possible number crunching, items, players, etc. It's also in testing, so it might not even run currently - it did before, but I added some stuff without debugging so far. Oh, and if it gets in a loop, type "quit" or Python interpreter commands. I write odd and slightly obsfucated code, so don't hesitate to ask any questions if you need to. COMBAT SYSTEM V1.000001#TESTING TOOL DEFINITIONS def test(var): print(var) input() def panic(): raise SystemExit def customize(): while True: temp=input('Command: ') if temp.lower()=='quit': break else: try: exec(temp) except: print('command not recognized') #RELEVANT DEFINITIONS AND CLASSES class Player: global players, player_traits def __init__(self,name): self.name=name for i in range(len(player_traits)): exec('self.'+player_traits[i]+ '=player_stats[name]['+str(i)+']') class Item: global item_index def __init__(self,name): self.name=name self.effect=input('effect? ') self.modifiers=item_index[name][0] #UNIVERSAL CONSTANTS/SETUP crit_mod=1.5 import random, copy #har har har get it? skynet_cost=99999999 #DICTIONARIES OF CLASS TRAITS player_traits=['health','physical','special','items'] #first three stats are constants; fourth is a list of objects player_stats={'annie':[500,10,50,[]], 'eggers':[1000,40,15,[]], 'renard':[700,30,30,[]], 'coyote':[2000,50,200,[]], 'shadow':[300,0,50,[]]} #item format: {name:[[boosts],[def abil],[off abil]] item_index={'giggleblade':[[0,1000,0],[],[]]} #attack format: {name:[type,power,extra]} attacks={'blast':['special',50,'crit_chance+=40'], 'punch':['physical',30,''], 'boxbot_nuke':['special','PlayerD.health/PlayerA.special','print(\'helloooooo\')']} #unique format: {player:[type,power,extra,count]} 'unique_attacks=' #ability format: {name:[[modifies,ability],...]} off_abil={'annie':[['either','if crit_hit: damage*=2']], 'coyote':[['either','damage*=100']], 'eggers':[], 'renard':[], 'shadow':[]} def_abil={'annie':[], 'coyote':[], 'eggers':[], 'renard':[], 'shadow':[['physical','damage*=0'], ['special','damage*=2']]} #DECLARE PLAYER IDENTITIES Player1=Player(input('Player 1: ').lower()) Player2=Player(input('Player 2: ').lower()) #syntax: giving player 1 a giggleblade Player1.items.append(Item('giggleblade')) customize() #INITIAL ATTACKING/DEFENDING PLAYER PlayerA=Player1 PlayerD=Player2 while True: #BACK UP INITIAL PLAYER STATS PlayerA_=copy.deepcopy(PlayerA) PlayerD_=copy.deepcopy(PlayerD) #CHOOSE ATTACKING PLAYER'S ATTACK move=attacks[input(PlayerA.name+'\'s turn: ')] #DETERMINE THE MOVE'S POWER #declared early so moves can modify it crit_chance=50 crit_hit=False #calculate item stat bonuses item_bonus=0 for item in PlayerA.items: item_bonus+=item.modifiers[\ player_traits.index(move[0])] test(item_bonus) #initial dmg: move strength * (relevant stat + item bonus) damage=eval('move[1]*(PlayerA.{}+item_bonus)' .format(move[0])) #is it a critical hit? rand=random.randint(0,100) if rand>crit_chance-1: damage*=crit_mod crit_hit=True print('Critical hit!') #APPLY EXTRA ITEM EFFECTS #APPLY EXTRA MOVE EFFECTS exec(move[2]) #APPLY EXTRA ABILITY EFFECTS #total list of modifiers == defensive (U) offensive rel_abil=def_abil[PlayerD.name]+off_abil[PlayerA.name] for ability in rel_abil: #if ability matches move type if move[0] in ability: #perform move effect exec(ability[1]) elif 'either' in ability: exec(ability[1]) #DISPLAY ANIMATION (HAHA LOLNOPE)
#APPLY DAMAGE TO DEFENDING PLAYER print(PlayerD.health) #actually apply damage PlayerD.health-=damage print(PlayerD.health) #SWITCH ATTACKING/DEFENDING PLAYERS if PlayerA is Player1: PlayerA=Player2 PlayerD=Player1 else: PlayerA=Player1 PlayerD=Player2
The following lines in particular are Boxbot-approved: for i in range(len(player_traits)): exec('self.'+player_traits[i]+'=player_stats[name]['+str(i)+']')
damage=eval('eval(str(move[1]))*PlayerA.{}'.format(move[0]))
item_bonus+=PlayerA.items[0].modifiers[player_traits.index(move[0])] Have fun. EDIT: aaaaand I'm an idiot writing code too late at night. The eval('eval(str(move[1]))...) can be replaced with eval('move[1]...)
|
|
|
Post by Daedalus on Jan 6, 2015 7:39:30 GMT
I made some changes and started rewriting the beginning. It removes some of the ugliest code from before and clears up some issues. This is only the updated classes and definitions, and will not quite work with the main body given above - I still need to tinker a bit more. The code I wrote is also a bit more conducive to an RPG, which is also easier to code because it requires less threading. COMBAT SYSTEM V1.000002:
# TESTING TOOLS def test(var): print(var) input() def panic(): raise SystemExit def customize(): while True: temp=input('Command: ') if temp.lower()=='quit': break else: try: exec(temp) except: print('command not recognized')
# CLASSES AND DEFINITIONS #designed for syntax of exec(marker(number)) #to execute all effects at that time point def marker(num): global relevant_effects command='' for effect in relevant_effects: #effect syntax is [type, time, effect] #such that the effect is a string of code if effect[0]==num: command+=effect[2]+'; ' elif effect>num: break return command #player traits are stored in player_list dictionary #currently they are [hp, p_atk, s_atk, abilities, items] #abilities is a list containing lists of [type,time,effect] class Player: global player_list, player_traits def __init__(self,name): self.name=name #shortens repetitive self.hp=players[name][0] #and so on; it also allows further trait addition for i,trait in enumerate(player_traits): exec('self.{}=player_list[name][{}]'.format(trait,i)) #static items have continuous effects (itself a list) #they can be added or removed by inherent methods class Static_Item: global player, player_traits def __init__(self,name,effect,boosts): #boosts is a list of stat modifiers #effect is nude code in a string self.name=name self.effect=effect self.boosts=boosts def attach(self,player): for i,trait in enumerate(player_traits[:-2]): exec('player.{}+=self.boosts[i]'.format(trait)) self.owner=player player.items.append(self) def remove(self): player=self.owner for i,trait in enumerate(player_traits[:-2]): exec('player.{}-=self.boosts[i]'.format(trait)) player.items.remove(self) #active items can be used a fixed number of times #when they are used that many times they disappear class Active_Item: global player def __init__(self,name,effect,uses): self.name=name self.uses=uses self.effect=effect def attach(self,player): self.owner=player player.items.append(self) def remove(self): player=self.owner player.items.remove(self) def activate(self): #syntax: exec(Active_Item.activate()) self.uses-=1 if self.uses==0: self.remove() return self.effect player_traits=['health','physical','special','abilities','items'] #first three stats are constants; fourth is a list of objects
|
|
|
Post by Daedalus on Jan 27, 2015 7:42:55 GMT
COMBAT SYSTEM V2.000001:
# TESTING TOOLS def test(var): print(var) input() def panic(): raise SystemExit def customize(): while True: temp=input('Command: ') if temp.lower()=='quit': break else: try: exec(temp) except: print('command not recognized')
# CLASSES AND DEFINITIONS
#designed for syntax of exec(marker(number)) #to execute all effects at that time point def marker(num): global relevant_effects command='' for effect in relevant_effects: #effect syntax is [type, time, effect] #such that the effect is a string of code if effect[1]==num: command+=effect[2]+'; ' #chain it to the others being used relevant_effects.remove(effect) #delete the ability once it's used return command
#player traits are stored in player_list dictionary #currently they are [hp, p_atk, s_atk, abilities, items] #abilities is a list containing lists of [type,time,effect] class Player: global player_list, player_traits def __init__(self,name): self.name=name #shortens repetitive self.hp=players[name][0] etc #this also allows further trait addition later for i,trait in enumerate(player_traits): exec('self.{}=player_list[name][{}]'.format(trait,i))
#passive items have continuous effects (itself a list) #they can be added or removed by inherent methods class Passive_Item: global player, player_traits def __init__(self,name,effect,boosts): #boosts is a list of stat modifiers #which should be of length three #effect is nude code in a string self.name=name self.effect=effect self.boosts=boosts def attach(self,player): for i,trait in enumerate(player_traits[:-2]): exec('player.{}+=self.boosts[i]'.format(trait)) #when attached, the boosts modify permanently #this prevents it to have to check it every time self.owner=player player.items.append(self) def remove(self): player=self.owner for i,trait in enumerate(player_traits[:-2]): exec('player.{}-=self.boosts[i]'.format(trait)) #when removed it gets rid of previous boosts player.items.remove(self)
#active items can be used a fixed number of times #when used up they disappear automatically class Active_Item: global player def __init__(self,name,effect,uses): self.name=name self.uses=uses self.effect=effect def attach(self,player): self.owner=player player.items.append(self) def remove(self): #does not require owner to be named player=self.owner player.items.remove(self) def activate(self): #syntax: exec(Active_Item.activate()) self.uses-=1 #denote that it has been used once if self.uses==0: self.remove() #automatically removed when no activations remain return self.effect #STORAGE OF BACKGROUND INFO ON MOVES, PLAYERS, ETC player_traits=['health','physical','special','defense','abilities','items'] #first three stats are designed as simple integers #fourth is a list of lists; format [[type,time,string],...] #type is a string (atk, def, or both), string is code #fifth is a list of objects, initializes to empty player_list={'annie':[500,10,50,100,[['both',3,'print(\'hellooooo\')'],['atk',1,'print(\'blah blah blah\'']],[]], 'eggers':[1000,40,15,200,[],[]], 'renard':[700,30,30,500,[],[]], 'coyote':[2000,50,200,1000,[],[]], 'shadow':[300,0,50,1,[],[]]} '''off_abil={'annie':[['either','if crit_hit: damage*=2']], 'coyote':[['either','damage*=100']], 'eggers':[], 'renard':[], 'shadow':[]} def_abil={'annie':[], 'coyote':[], 'eggers':[], 'renard':[], 'shadow':[['physical','damage*=0'], ['special','damage*=2']]}''' #attack format: {'name':[type,power,extra effects],...} attacks={'blast':['special',50,'crit_chance+=40'], 'punch':['physical',30,''], 'boxbot_nuke':['special','PlayerD.health/PlayerA.special','print(\'helloooooo\')']} #these are modifiers that apply equally #to both players and universal constants import random global_effects=[] skynet_cost=99999999 crit_mod=1.5
#ASSIGN PLAYER IDENTITIES Player1=Player(input('Player 1? ').lower()) Player2=Player(input('Player 2? ').lower())
#DETERMINE ATTACKING/DEFENDING PLAYER PlayerA=Player1 PlayerD=Player2
#screwing around testing space Sword=Passive_Item('sword','print(\'this is my sword. there are many like it but this one is mine\')',[1.5,1.5,1.5,1.5]) Sword.attach(Player1) Torch=Active_Item('torch','print(\'torch\')',3)
#For as long as the program runs... while True: while True: #keep prompting attack name until something is legal try: #prompt attack's name move=attacks[input(PlayerA.name+'\'s turn: ')] #when legal answer is given, break loop break except: pass #gather all relevant effects into the eponymous var #an effect is relevant if it's defensive for PlayerD #or if it's offensive for PlayerA, or if it's for both relevant_effects=[] for ability in PlayerA.abilities: if ability[0]=='atk' or ability[0]=='both': relevant_effects.append(ability) for ability in PlayerD.abilities: if ability[0]=='def' or ability[0]=='both': relevant_effects.append(ability) #activate active items? if input('Activate items? ')[0].lower()=='y': name=input('Name: ') exec('exec('+name+'.activate())') #this is what I get for writing general cases #inside exec( yields the return from activate() #outside exec( executes this code in turn ugh print('Remaining uses: '+str(eval(name+'.uses'))) #this in turn is another abomination due to the fact #that the name of the object referenced is not known #DETERMINE MOVE POWER damage=eval('move[1]*PlayerA.{}'.format(move[0])) damage/=PlayerD.defense test(damage) #APPLY CRITICAL HITS crit_chance=50 #redefined each time so effects can modify it #determine if the hit is critical crit_hit=False rand=random.randint(0,100) if rand>crit_chance-1: damage*=crit_mod crit_hit=True print('Critical hit!') #APPLY DAMAGE TO DEFENDING PLAYER print(PlayerD.health) #actually apply damage PlayerD.health-=damage print(PlayerD.health) #SWITCH ATTACKING/DEFENDING PLAYERS if PlayerA is Player1: PlayerA=Player2 PlayerD=Player1 else: PlayerA=Player1 PlayerD=Player2
Essentially rewritten from scratch, and overall, the code is much cleaner and more accurate this time. It also has comments now. That might be helpful to others and myself. Anyone want to critique? And/or modify or ask questions about it?
|
|
|
Post by fwip on Jan 27, 2015 7:49:39 GMT
COMBAT SYSTEM V1.100001:
# TESTING TOOLS def test(var): print(var) input() def panic(): raise SystemExit def customize(): while True: temp=input('Command: ') if temp.lower()=='quit': break else: try: exec(temp) except: print('command not recognized')
# CLASSES AND DEFINITIONS
#designed for syntax of exec(marker(number)) #to execute all effects at that time point def marker(num): global relevant_effects command='' for effect in relevant_effects: #effect syntax is [type, time, effect] #such that the effect is a string of code if effect[1]==num: command+=effect[2]+'; ' #chain it to the others being used relevant_effects.remove(effect) #delete the ability once it's used return command
#player traits are stored in player_list dictionary #currently they are [hp, p_atk, s_atk, abilities, items] #abilities is a list containing lists of [type,time,effect] class Player: global player_list, player_traits def __init__(self,name): self.name=name #shortens repetitive self.hp=players[name][0] etc #this also allows further trait addition later for i,trait in enumerate(player_traits): exec('self.{}=player_list[name][{}]'.format(trait,i))
#passive items have continuous effects (itself a list) #they can be added or removed by inherent methods class Passive_Item: global player, player_traits def __init__(self,name,effect,boosts): #boosts is a list of stat modifiers #which should be of length three #effect is nude code in a string self.name=name self.effect=effect self.boosts=boosts def attach(self,player): for i,trait in enumerate(player_traits[:-2]): exec('player.{}+=self.boosts[i]'.format(trait)) #when attached, the boosts modify permanently #this prevents it to have to check it every time self.owner=player player.items.append(self) def remove(self): player=self.owner for i,trait in enumerate(player_traits[:-2]): exec('player.{}-=self.boosts[i]'.format(trait)) #when removed it gets rid of previous boosts player.items.remove(self)
#active items can be used a fixed number of times #when used up they disappear automatically class Active_Item: global player def __init__(self,name,effect,uses): self.name=name self.uses=uses self.effect=effect def attach(self,player): self.owner=player player.items.append(self) def remove(self): #does not require owner to be named player=self.owner player.items.remove(self) def activate(self): #syntax: exec(Active_Item.activate()) self.uses-=1 #denote that it has been used once if self.uses==0: self.remove() #automatically removed when no activations remain return self.effect #STORAGE OF BACKGROUND INFO ON MOVES, PLAYERS, ETC player_traits=['health','physical','special','defense','abilities','items'] #first three stats are designed as simple integers #fourth is a list of lists; format [[type,time,string],...] #type is a string (atk, def, or both), string is code #fifth is a list of objects, initializes to empty player_list={'annie':[500,10,50,100,[['both',3,'print(\'hellooooo\')'],['atk',1,'print(\'blah blah blah\'']],[]], 'eggers':[1000,40,15,200,[],[]], 'renard':[700,30,30,500,[],[]], 'coyote':[2000,50,200,1000,[],[]], 'shadow':[300,0,50,1,[],[]]} '''off_abil={'annie':[['either','if crit_hit: damage*=2']], 'coyote':[['either','damage*=100']], 'eggers':[], 'renard':[], 'shadow':[]} def_abil={'annie':[], 'coyote':[], 'eggers':[], 'renard':[], 'shadow':[['physical','damage*=0'], ['special','damage*=2']]}''' #attack format: {'name':[type,power,extra effects],...} attacks={'blast':['special',50,'crit_chance+=40'], 'punch':['physical',30,''], 'boxbot_nuke':['special','PlayerD.health/PlayerA.special','print(\'helloooooo\')']} #these are modifiers that apply equally #to both players and universal constants import random global_effects=[] skynet_cost=99999999 crit_mod=1.5
#ASSIGN PLAYER IDENTITIES Player1=Player(input('Player 1? ').lower()) Player2=Player(input('Player 2? ').lower())
#DETERMINE ATTACKING/DEFENDING PLAYER PlayerA=Player1 PlayerD=Player2
#screwing around testing space Sword=Passive_Item('sword','print(\'this is my sword. there are many like it but this one is mine\')',[1.5,1.5,1.5,1.5]) Sword.attach(Player1) Torch=Active_Item('torch','print(\'torch\')',3)
#For as long as the program runs... while True: while True: #keep prompting attack name until something is legal try: #prompt attack's name move=attacks[input(PlayerA.name+'\'s turn: ')] #when legal answer is given, break loop break except: pass #gather all relevant effects into the eponymous var #an effect is relevant if it's defensive for PlayerD #or if it's offensive for PlayerA, or if it's for both relevant_effects=[] for ability in PlayerA.abilities: if ability[0]=='atk' or ability[0]=='both': relevant_effects.append(ability) for ability in PlayerD.abilities: if ability[0]=='def' or ability[0]=='both': relevant_effects.append(ability) #activate active items? if input('Activate items? ')[0].lower()=='y': name=input('Name: ') exec('exec('+name+'.activate())') #this is what I get for writing general cases #inside exec( yields the return from activate() #outside exec( executes this code in turn ugh print('Remaining uses: '+str(eval(name+'.uses'))) #this in turn is another abomination due to the fact #that the name of the object referenced is not known #DETERMINE MOVE POWER damage=eval('move[1]*PlayerA.{}'.format(move[0])) damage/=PlayerD.defense test(damage) #APPLY CRITICAL HITS crit_chance=50 #redefined each time so effects can modify it #determine if the hit is critical crit_hit=False rand=random.randint(0,100) if rand>crit_chance-1: damage*=crit_mod crit_hit=True print('Critical hit!') #APPLY DAMAGE TO DEFENDING PLAYER print(PlayerD.health) #actually apply damage PlayerD.health-=damage print(PlayerD.health) #SWITCH ATTACKING/DEFENDING PLAYERS if PlayerA is Player1: PlayerA=Player2 PlayerD=Player1 else: PlayerA=Player1 PlayerD=Player2
Essentially rewritten from scratch, and overall, the code is much cleaner and more accurate this time. It also has comments now. That might be helpful to others and myself. Anyone want to critique? And/or modify or ask questions about it? I don't know much about python. I saved it as a .py and it executed. "Player 1?" "fwip" *closes* error message is too fast to read, how do you see it again?
|
|
|
Post by Daedalus on Jan 27, 2015 15:31:58 GMT
fwip, @thoth: Ah, sorry. Currently it only has five players that work: Annie, Coyote, Eggers, Shadow, and Renard - as in, the "player" is the character you want to be. There are also only a couple moves that work currently (blast, nuke, and boxbot_nuke, all case-sensitive). However, the format it is written in makes it ridiculously easy to add items, players, or moves (they just are typed into a specific line and they stay in its dictionary forever). What would be some cool moves to add? I feel like I could make a decent text-based game with a month of time, if I had a plot to work with ( The Anarch?). And I am learning Java currently, so perhaps I will port this and make it visual. Someday. For now it's just a project in my boredom
|
|
|
Post by The Anarch on Jan 27, 2015 21:00:30 GMT
I feel like I could make a decent text-based game with a month of time, if I had a plot to work with ( The Anarch?). Helloooooooooooo! I had an idea for a fanfic that I was trying to write some time back. It might actually work pretty well as an adventure game, be it textual or graphical. A single main character with various puzzles to solve, etc. I could drag it back out and see about making it game-ready once we know what kinda game it'll be. Or if you're still wanting to do a fighter, I might could come up with something for that right quick.
|
|