|
Post by ShadoWeaver on Sept 30, 2012 10:25:24 GMT -5
Ok,
I'm not trying to step on any of the admins toes here. I just want to get input on the site and how even tch says its a template of what not to do for a website.
The basic design of the site is actually strait forward and simple, as it should be really. I could recreate it in dreamweaver in a couple of hours with everything I got off of github. I do however have questions and would like to help restructure the site so it makes more sense and is easier to work with.
I do have minimal experience working with code from college and designing my own portfolio site for myself. The way I was always taught was keep your files neat and organized to keep modification of the site easy to do down the road. While looking through this sites code I was jumping from folder to folder trying to dis-earn how things were set up and where they were put. still haven't found everything i want to.
With the site it should be in its own area, with it being the actual site in the very first folder say when you download it from github and open the ninjawars folder the main sites foundation should be there. the index and the skills, self, ninja and so on pages that make up the site itself. then the folders beyond that contain all the other info needed like the php code images links and what have you.
Now since i'm new to php this set up might not work due to how the arrays function and such, but this was the question I wanted to ask and answered so i could understand and help out. does the site need to be in a diff set up so the code can be utilized properly? if not then could all the functions be set up into global arrays be put into their own folders which contain all the global arrays for the game and each file has all the specific functions in each array to call upon when needed i.e. global array folder-> item array code, skill array code, npc array code, attack player array code. each file contains each of the specific code needed to be called upon to be executed when used from other pages.
I'm hoping you understand what i'm talking about and can help tell me if i'm dead wrong and I need to STFU and learn php some more or if this will work as a basic hierarchic for the game to utilize
|
|
|
Post by Tchalvak on Oct 1, 2012 14:16:38 GMT -5
Well, much of the current structure of folders and such is a matter of time. Code was made and added to the site and needs to continue to work, so we haven't put forth the time to do that level of cleanup (especially since to do so, we'd need to
As I said on the chat, code is nested because sometimes it's complicated, function A may call function B which may call function C and they all might be in different locations. This isn't necessarily great for comprehension, but it's often just what happens when trying to do things with the same code in multiple places.
Indeed, ninjawars suffers more from the opposite problem, in that many scripts didn't need to be scripts, they should have shared code so that the doshin uses the same basic library as the dojo instead of being doshin_office.php and dojo.php but that decision was made long ago and no-one has felt ambitious enough to refactor that yet to consolidate code while still retaining the same functionality.
In general the solution is somewhat familiarity, and somewhat having a good code search tool (eclipse? coda 2? sublime text 2? Maybe a good ide could help here).
Overall, though, I wouldn't focus really on code cleanup to start, I'd focus on small changes, small additions or bugfixes, polishing the text and content of map areas, or html layout changes. Npcs, map locations, and html look & images are good places to start, and probably the kind of place you're most likely to be able to get your code vetted & included. *shrugs*
But... ...just ask if you have any more specific questions.
AIM:tchalvak email: ninjawarslivebythesword@gmail.com
|
|
|
Post by ShadoWeaver on Oct 2, 2012 10:51:55 GMT -5
ok,
I don't mind doing stuff like redoing npc's and small stuff since all the n[c's basically do the same thing.. i figure they are place holders till the actual script for them is done up. My question is then where are the npc stored at I figured it was on the village page since thats where they are in the game, but i'm not sure even after looking through all of those pages of code trying to disearn all of it.
i would also like to work on items and such. Personally I like scrolls for the ninja magic and right now all the items dont do much of anything. if a kuni did more dmg or added some sort of status effect it would be more usfull than a low lvl item that isnt much better than a shuriken at least make it so that the iteams take into consideration a players lvl and do more dmg as they lvl up. thats another thing i would like to look into.
|
|
|
Post by ShadoWeaver on Oct 5, 2012 18:12:38 GMT -5
Work-
Right now its set up for 1 turn = 30 gold speeds -> 1 turn gain 6 then after that gain 3 so lets say 3 turns. and speeds cost $225. which boils down to 75 gold a turn basically even if its 6 turns it boils down to 1 turn = 75, or 38 gold.
this means working will loose you money no matter what. its not worth spending your turns to get gold in the end unless you want to use 100 turns to get gold wait a day and keep doing that and that takes forever and the game isn't that interesting if your waiting a week just to lvl up to like maybe lvl 8 or 10.
to make things more helpful I thought of making it so lower lvls would gain more gold, but then you could make a new account and just work till you gain inventory stash and lvl up. making it based on a players strength or lvl makes the higher lvls out of balance.
I was thinking that the more you work the better it gets but make it cap out at a certain point to make it worth it at lower lvls partly. say like be able to get enough speeds to gain small amounts of speeds but would be more worth it to actually gain lvls and bounty hunt.
so I was thinking that the equation for this would be {turns*30+(lowleveladdition)/user's lvl} lowleveladdition would be something like add 50 gold for lvl 1, 40 gold for lvl 2 and so on till you hit lvl 5 or so and its 0 then you divide it by the lvl ensuring that the higher the lvl the more working is a waste.
|
|
|
Post by Tchalvak on Oct 6, 2012 14:37:53 GMT -5
Ok, so work: First off, I use "work", and I think others do too, simply because if you log in on a daily basis for a little bit, your turns are often fully regenerated, and it's more difficult to use all of those turns if you don't have a lot of time available. So you might as well use up turns that way if you're not going to use them all on a given day anyway. So it is used, though I think it's already used more by lower levels than by higher levels. Secondly, thematically, work is kind in theme with the idea that ninjas are a peasant warrior (unlike the samurai, who are the high-class nobility). Many of the weapons are supposed to reinforce this, the kunai being a digging too, the sickle, uh, others. So work is also kinda there to show that as a ninja, you also end up having to blend in with the peasant class (whether it accomplishes this goal well or not, I dunno). So I don't really think it'd be too interesting to mess with work, I'd prefer to provide ways to get more money by taking on more risk, via killing monsters and such. There's already some work in progress in this direction here: github.com/tchalvak/ninjawars/blob/master/deploy/lib/data/lib_npc.phpand here: github.com/tchalvak/ninjawars/blob/master/deploy/www/npc.phpOther places that I think would be easy to make changes are on the map, with the descriptions of places and the people in them, etc. Items are harder, for example, because each item has to have custom-coded functionality to actually -do- anything other than damage, which is already well represented.
|
|
|
Post by ShadoWeaver on Oct 7, 2012 10:10:31 GMT -5
after looking t the links and going over the code; i'm confused on where the nppc's in the array get the code for calculating how much gold, or items, to give away upon death/victory. the original npcs have it all set up inside their own functions on the second link, and the black viper has a section where gold =>30 gold. since the vipers give out 110 gold upon death that makes me a bit confused on what is going on in that instance.
i do see the section in the npc.php where it is calling from the lib_npc.php to find out the npc's attributes i.e. str, speed, ect. then under that is the 'reward the poor sap' section. saying to add item and gold but doen't seem to define anywhere how it pulls up how much to award or what item to give.
one another note. if and when i can start to edit the dmg and reward system for the npc's what type of things are you wanting for each npc to give away, other than gold, will i run into limitations on that? like if i want the monk to give you no money but drop a root, even if the root does nothing at all right now, or if i want the oni to drop a random amount of ice scrolls ranging from 1 to 2. also, limitations on things like freezing the attacker randomly upon striking sorto like the random oni that steals turns. hitodama i think would be a nice low lvl npc to have randomly freeze attacker while also randomly giving away a more valuble item like a fire scroll. nothing major like a dim i'll leave that to higher lvl npcs though having 1 or 2 more with a higher random drop than the oni would be nice to do too
with that there is the issue of statues effect as well. since statues effects other than being frozen do nothing. like posion does nothing that i've seen. i'm geussing its suppose to be a DOT, damage over time, but in reality is just there. same issue with poison touch. I figure these are issues that will be looked upon later but wanted to ask about anyways.
|
|
|
Post by Tchalvak on Oct 7, 2012 21:34:45 GMT -5
Yeah, there's a "difficulty" calculation that is calculating gold reward now, line 80 here: github.com/tchalvak/ninjawars/blob/master/deploy/www/npc.phpLImitations of what npcs can do: Essentially, the code can do the things that npcs can currently do. But it would take more work for npcs to do anything that any one npc can't do. And some of the npcs are custom still at this point, so only the samurai is able to do his power attack thingie, & etc. More later.
|
|
|
Post by ShadoWeaver on Oct 8, 2012 20:06:54 GMT -5
Ok, I got it now
So the npc's gold system is based off their difficulty and then the difficulty is basically based off their str. the more dmg they are able to do the more you get out of them sort of thing since its all based off of str. the higher the str the higher the gold when they die. so making the npc's actually do more than just 10 points of dmg or 50 is simple. you just have to change one or two numbers here and there and bam its all done. that part is simple and can be done for each one in a matter of like 5 minutes.
the issue then come when you want them to do custom things and drop items. like with the old npc's you have to code them out individually in their own string and not in the array they are set up in right now. so to do that you would have to take each of them out of the array code the item drop and whatever you want them to do special and put them into the npc.php file with the oni and others. the more unique they are the more code is involved and more work to actually get them to work correctly like that page of code for the samurai.
does this mean to do something as simple as ad an item drop at a random value i would have to code it oue for each indivisually or could i actually add in a section of code like you have for gold drop and just have values in the array for the npc's set up to say if value = 0 then additem = 'shuriken', else if value = 1 additem 'null' sort of idea. (i'd have to look at the code again to get the right set up for it but you get the idea right?)
just want to make sure i'm thinking correctly before going through all the trouble of trying to set up npc's in a different way
|
|
|
Post by ShadoWeaver on Oct 8, 2012 20:12:27 GMT -5
quick note, i see you have code in here for a thief group as well, i've never run into a thief group even when i attack npc's tons of times. does this mean some of this code is not yet deployed into the game? or is thief group something entirely?
|
|
|
Post by Tchalvak on Oct 10, 2012 14:10:49 GMT -5
Theif group should be live and working, (though random), if not, it's a bug. Edit: Nope, wasn't able to get it to trigger so it must be broken at the moment, though I did discover a few other problems along the way that may be related (randomly blank results page, Oni not telling you what it is that you discover in their ashes, etc).
|
|
|
Post by Tchalvak on Oct 10, 2012 14:31:31 GMT -5
Ok, I got it now So the npc's gold system is based off their difficulty and then the difficulty is basically based off their str. the more dmg they are able to do the more you get out of them sort of thing since its all based off of str. the higher the str the higher the gold when they die. so making the npc's actually do more than just 10 points of dmg or 50 is simple. you just have to change one or two numbers here and there and bam its all done. that part is simple and can be done for each one in a matter of like 5 minutes. the issue then come when you want them to do custom things and drop items. like with the old npc's you have to code them out individually in their own string and not in the array they are set up in right now. so to do that you would have to take each of them out of the array code the item drop and whatever you want them to do special and put them into the npc.php file with the oni and others. the more unique they are the more code is involved and more work to actually get them to work correctly like that page of code for the samurai. does this mean to do something as simple as ad an item drop at a random value i would have to code it oue for each indivisually or could i actually add in a section of code like you have for gold drop and just have values in the array for the npc's set up to say if value = 0 then additem = 'shuriken', else if value = 1 additem 'null' sort of idea. (i'd have to look at the code again to get the right set up for it but you get the idea right?) just want to make sure i'm thinking correctly before going through all the trouble of trying to set up npc's in a different way In general, that's the right idea, but just keep in mind that there's old npcs and new npcs, and the code is currently transitioning from the old to the new, but not there yet. My goal is to make it so that at a minimum, everything that the old npcs can do (item drops, weird abilities) is able to be done with the new npcs, and then I'll move the old npcs into the new system, at which point we'll be able to make new npcs just by adding another line to the array of new npcs, which will be nice.
|
|